Interface TreeItems<T>

All Superinterfaces:
DataUnit
All Known Subinterfaces:
EntityTreeItems<E>
All Known Implementing Classes:
ContainerTreeItems

public interface TreeItems<T> extends DataUnit
  • Method Details

    • getItemId

      @Nullable Object getItemId(T item)
      Parameters:
      item - the item for obtaining the id
      Returns:
      the id on the given item
    • getItem

      @Nullable T getItem(@Nullable Object itemId)
      Parameters:
      itemId - the item id
      Returns:
      the item by the given id
    • getItems

      Stream<T> getItems()
      Returns:
      the stream of all items
    • containsItem

      boolean containsItem(T item)
      Parameters:
      item - an item to check
      Returns:
      true if the underlying collection contains an item, false otherwise
    • size

      int size()
      Returns:
      size of the underlying collection
    • getChildCount

      int getChildCount(T parent)
      Parameters:
      parent - the parent item
      Returns:
      child count of the given parent item
    • getChildren

      Stream<T> getChildren(@Nullable T item)
      Parameters:
      item - the item to obtain children or null to get root items
      Returns:
      children of the given item
    • hasChildren

      boolean hasChildren(T item)
      Parameters:
      item - the item to check
      Returns:
      true if the item has children, false otherwise
    • getParent

      @Nullable T getParent(T item)
      Parameters:
      item - the item to get parent
      Returns:
      the parent of given item or null if no parent
    • getHierarchyPropertyName

      String getHierarchyPropertyName()
      Returns:
      the name of the property which forms the hierarchy
    • addValueChangeListener

      Subscription addValueChangeListener(Consumer<TreeItems.ValueChangeEvent<T>> listener)
      Registers a new value change listener.
      Parameters:
      listener - the listener to be added
      Returns:
      a registration object for removing an event listener added to a source
    • addItemSetChangeListener

      Subscription addItemSetChangeListener(Consumer<TreeItems.ItemSetChangeEvent<T>> listener)
      Registers a new item set change listener.
      Parameters:
      listener - the listener to be added
      Returns:
      a registration object for removing an event listener added to a source
    • addSelectedItemChangeListener

      Subscription addSelectedItemChangeListener(Consumer<TreeItems.SelectedItemChangeEvent<T>> listener)
      Registers a new selected item change listener.
      Parameters:
      listener - the listener to be added
      Returns:
      a registration object for removing an event listener added to a source