Package io.jmix.flowui.data.grid
Class ContainerTreeDataGridItems<E>
java.lang.Object
com.vaadin.flow.data.provider.AbstractDataProvider<T,Void>
io.jmix.flowui.data.grid.ContainerDataGridItems<E>
io.jmix.flowui.data.grid.ContainerTreeDataGridItems<E>
- Type Parameters:
E- the type of entity contained in the associatedCollectionContainer
- All Implemented Interfaces:
com.vaadin.flow.data.provider.DataProvider<E,,Void> com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<E,,Void> ContainerDataUnit<E>,DataUnit,EntityDataUnit,DataGridItems<E>,DataGridItems.Sortable<E>,EntityDataGridItems<E>,TreeDataGridItems<E>,HasType<E>,Serializable
public class ContainerTreeDataGridItems<E>
extends ContainerDataGridItems<E>
implements TreeDataGridItems<E>, com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<E,Void>
A specialized implementation of
ContainerDataGridItems designed to handle hierarchical data structures.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.flowui.data.grid.DataGridItems
DataGridItems.ItemSetChangeEvent<T>, DataGridItems.SelectedItemChangeEvent<T>, DataGridItems.Sortable<T>, DataGridItems.ValueChangeEvent<T>Nested classes/interfaces inherited from interface io.jmix.flowui.data.DataUnit
DataUnit.StateChangeEvent -
Field Summary
FieldsFields inherited from class io.jmix.flowui.data.grid.ContainerDataGridItems
container, suppressSorting -
Constructor Summary
ConstructorsConstructorDescriptionContainerTreeDataGridItems(CollectionContainer<E> container, String hierarchyProperty) ContainerTreeDataGridItems(CollectionContainer<E> container, String hierarchyProperty, boolean showOrphans) -
Method Summary
Modifier and TypeMethodDescriptionfetchChildren(com.vaadin.flow.data.provider.hierarchy.HierarchicalQuery<E, Void> query) intgetChildCount(com.vaadin.flow.data.provider.hierarchy.HierarchicalQuery<E, Void> query) getChildren(E item) Retrieves the children of the specified item in a hierarchical structure.intDetermines the hierarchical level of the given item within a tree structure.protected EbooleanhasChildren(E item) Methods inherited from class io.jmix.flowui.data.grid.ContainerDataGridItems
addItemSetChangeListener, addSelectedItemChangeListener, addStateChangeListener, addValueChangeListener, containerCollectionChanged, containerItemChanged, containerItemPropertyChanged, containsItem, createSort, enableSorting, fetch, getContainer, getEntityMetaClass, getEventBus, getItem, getItems, getItemValue, getSelectedItem, getState, getType, initContainer, isInMemory, resetSortOrder, setSelectedItem, size, sort, suppressSortingMethods inherited from class com.vaadin.flow.data.provider.AbstractDataProvider
addDataProviderListener, addListener, fireEvent, refreshAll, refreshItem, refreshItemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.flowui.data.grid.DataGridItems
addItemSetChangeListener, addSelectedItemChangeListener, addValueChangeListener, containsItem, getItem, getItems, getItemValue, getSelectedItem, setSelectedItemMethods inherited from interface com.vaadin.flow.data.provider.DataProvider
addDataProviderListener, getId, isInMemory, refreshAll, refreshItem, refreshItemMethods inherited from interface io.jmix.flowui.data.DataUnit
addStateChangeListener, getStateMethods inherited from interface com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider
fetch, size, withConfigurableFilter, withConfigurableFilter, withConvertedFilter
-
Field Details
-
hierarchyProperty
-
showOrphans
protected final boolean showOrphans
-
-
Constructor Details
-
ContainerTreeDataGridItems
-
ContainerTreeDataGridItems
public ContainerTreeDataGridItems(CollectionContainer<E> container, String hierarchyProperty, boolean showOrphans)
-
-
Method Details
-
getChildCount
-
fetchChildren
-
getChildren
Retrieves the children of the specified item in a hierarchical structure. If the provided item is null, it retrieves the root-level items. If the provided item is not null, it retrieves the direct children of the specified item.- Parameters:
item- the item whose children are to be retrieved, or null to retrieve root-level items- Returns:
- a stream of child items associated with the specified parent item or root items if null
-
hasChildren
-
getLevel
Determines the hierarchical level of the given item within a tree structure. The root level is represented as 0, with each subsequent level increasing by 1.- Parameters:
item- the item whose hierarchical level is to be determined- Returns:
- the level of the specified item, where 0 represents the root level
- Throws:
IllegalArgumentException- if the specified item is not contained within the data provider
-
getParent
-