Interface DataGridItems<T>

Type Parameters:
T - row item type
All Superinterfaces:
DataUnit
All Known Subinterfaces:
DataGridItems.Sortable<T>, EntityDataGridItems<E>, TreeDataGridItems<T>
All Known Implementing Classes:
ContainerDataGridItems, ContainerTreeDataGridItems, EmptyDataGridItems, EmptyTreeDataGridItems

public interface DataGridItems<T> extends DataUnit
A common interface for providing data for DataGrid component.
  • 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
    • getItemValue

      @Nullable Object getItemValue(Object itemId, MetaPropertyPath propertyId)
      Parameters:
      itemId - the item id
      propertyId - the property id
      Returns:
      the item value
    • indexOfItem

      int indexOfItem(T item)
      Parameters:
      item - the item for obtaining the index
      Returns:
      the index of the given item
    • getItemByIndex

      @Nullable T getItemByIndex(int index)
      Parameters:
      index - the item index
      Returns:
      the item by the given index
    • getItems

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

      List<T> getItems(int startIndex, int numberOfItems)
      Parameters:
      startIndex - the start index
      numberOfItems - the number of items
      Returns:
      items from the startIndex and size not exceeding the specified number
    • 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
    • getSelectedItem

      @Nullable T getSelectedItem()
      Returns:
      the current item contained in the source
    • setSelectedItem

      void setSelectedItem(@Nullable T item)
      Set current item in the source.
      Parameters:
      item - the item to set
    • addValueChangeListener

      Subscription addValueChangeListener(Consumer<DataGridItems.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<DataGridItems.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<DataGridItems.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