public interface TreeItems<T> extends DataUnit
Modifier and Type | Interface and Description |
---|---|
static class |
TreeItems.ItemSetChangeEvent<T>
An event that is fired when TreeItems item set is changed.
|
static class |
TreeItems.SelectedItemChangeEvent<T>
An event that is fired when TreeItems selected item is changed.
|
static class |
TreeItems.ValueChangeEvent<T>
An event that is fired when TreeItems value is changed.
|
DataUnit.StateChangeEvent
Modifier and Type | Method and Description |
---|---|
Subscription |
addItemSetChangeListener(java.util.function.Consumer<TreeItems.ItemSetChangeEvent<T>> listener)
Registers a new item set change listener.
|
Subscription |
addSelectedItemChangeListener(java.util.function.Consumer<TreeItems.SelectedItemChangeEvent<T>> listener)
Registers a new selected item change listener.
|
Subscription |
addValueChangeListener(java.util.function.Consumer<TreeItems.ValueChangeEvent<T>> listener)
Registers a new value change listener.
|
boolean |
containsItem(T item) |
int |
getChildCount(T parent) |
java.util.stream.Stream<T> |
getChildren(T item) |
java.lang.String |
getHierarchyPropertyName() |
T |
getItem(java.lang.Object itemId) |
java.lang.Object |
getItemId(T item) |
java.util.stream.Stream<T> |
getItems() |
T |
getParent(T item) |
boolean |
hasChildren(T item) |
int |
size() |
addStateChangeListener, getState
java.lang.Object getItemId(T item)
item
- the item for obtaining the idT getItem(@Nullable java.lang.Object itemId)
itemId
- the item idjava.util.stream.Stream<T> getItems()
boolean containsItem(T item)
item
- an item to checktrue
if the underlying collection contains an item, false
otherwiseint size()
int getChildCount(T parent)
parent
- the parent itemjava.util.stream.Stream<T> getChildren(T item)
item
- the item to obtain children or null
to get root itemsboolean hasChildren(T item)
item
- the item to checktrue
if the item has children, false
otherwise@Nullable T getParent(T item)
item
- the item to get parentnull
if no parentjava.lang.String getHierarchyPropertyName()
Subscription addValueChangeListener(java.util.function.Consumer<TreeItems.ValueChangeEvent<T>> listener)
listener
- the listener to be addedSubscription addItemSetChangeListener(java.util.function.Consumer<TreeItems.ItemSetChangeEvent<T>> listener)
listener
- the listener to be addedSubscription addSelectedItemChangeListener(java.util.function.Consumer<TreeItems.SelectedItemChangeEvent<T>> listener)
listener
- the listener to be added