Package io.jmix.ui.component.data.tree
Class ContainerTreeItems<E>
java.lang.Object
io.jmix.ui.component.data.tree.ContainerTreeItems<E>
- All Implemented Interfaces:
DataUnit,ContainerDataUnit<E>,EntityDataUnit,EntityTreeItems<E>,TreeItems<E>
public class ContainerTreeItems<E>
extends Object
implements EntityTreeItems<E>, ContainerDataUnit<E>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.ui.component.data.DataUnit
DataUnit.StateChangeEventNested classes/interfaces inherited from interface io.jmix.ui.component.data.TreeItems
TreeItems.ItemSetChangeEvent<T>, TreeItems.SelectedItemChangeEvent<T>, TreeItems.ValueChangeEvent<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CollectionContainer<E>protected EventHubprotected final Stringprotected final boolean -
Constructor Summary
ConstructorsConstructorDescriptionContainerTreeItems(CollectionContainer<E> container, String hierarchyProperty) ContainerTreeItems(CollectionContainer<E> container, String hierarchyProperty, boolean showOrphans) -
Method Summary
Modifier and TypeMethodDescriptionRegisters a new item set change listener.Registers a new selected item change listener.Registers a new state change listener.addValueChangeListener(Consumer<TreeItems.ValueChangeEvent<E>> listener) Registers a new value change listener.protected voidprotected voidprotected voidbooleancontainsItem(E item) intgetChildCount(E parent) getChildren(E item) getItems()getState()booleanhasChildren(E item) voidsetSelectedItem(E item) Set current item in the source.intsize()
-
Field Details
-
container
-
hierarchyProperty
-
showOrphans
protected final boolean showOrphans -
events
-
-
Constructor Details
-
ContainerTreeItems
public ContainerTreeItems(CollectionContainer<E> container, String hierarchyProperty, boolean showOrphans) -
ContainerTreeItems
-
-
Method Details
-
containerItemChanged
-
containerCollectionChanged
-
containerItemPropertyChanged
-
getEntityMetaClass
- Specified by:
getEntityMetaClassin interfaceEntityDataUnit- Returns:
MetaClassof an entity contained in the source
-
getSelectedItem
- Specified by:
getSelectedItemin interfaceEntityTreeItems<E>- Returns:
- the current item contained in the source
-
setSelectedItem
Description copied from interface:EntityTreeItemsSet current item in the source.- Specified by:
setSelectedItemin interfaceEntityTreeItems<E>- Parameters:
item- the item to set
-
getState
-
getItemId
-
getItem
-
getItems
-
containsItem
- Specified by:
containsItemin interfaceTreeItems<E>- Parameters:
item- an item to check- Returns:
trueif the underlying collection contains an item,falseotherwise
-
size
public int size() -
getChildCount
- Specified by:
getChildCountin interfaceTreeItems<E>- Parameters:
parent- the parent item- Returns:
- child count of the given parent item
-
getChildren
- Specified by:
getChildrenin interfaceTreeItems<E>- Parameters:
item- the item to obtain children ornullto get root items- Returns:
- children of the given item
-
hasChildren
- Specified by:
hasChildrenin interfaceTreeItems<E>- Parameters:
item- the item to check- Returns:
trueif the item has children,falseotherwise
-
getParent
-
getHierarchyPropertyName
- Specified by:
getHierarchyPropertyNamein interfaceTreeItems<E>- Returns:
- the name of the property which forms the hierarchy
-
addStateChangeListener
Description copied from interface:DataUnitRegisters a new state change listener.- Specified by:
addStateChangeListenerin interfaceDataUnit- Parameters:
listener- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
addValueChangeListener
Description copied from interface:TreeItemsRegisters a new value change listener.- Specified by:
addValueChangeListenerin interfaceTreeItems<E>- Parameters:
listener- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
addItemSetChangeListener
Description copied from interface:TreeItemsRegisters a new item set change listener.- Specified by:
addItemSetChangeListenerin interfaceTreeItems<E>- Parameters:
listener- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
addSelectedItemChangeListener
public Subscription addSelectedItemChangeListener(Consumer<TreeItems.SelectedItemChangeEvent<E>> listener) Description copied from interface:TreeItemsRegisters a new selected item change listener.- Specified by:
addSelectedItemChangeListenerin interfaceTreeItems<E>- Parameters:
listener- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
getContainer
- Specified by:
getContainerin interfaceContainerDataUnit<E>
-