Interface GridDataItems<T>

All Superinterfaces:
com.vaadin.flow.data.provider.DataProvider<T,Void>, DataUnit, HasType<T>, Serializable
All Known Subinterfaces:
EntityGridDataItems<E>, EntityTreeGridDataItems<T>, GridDataItems.Sortable<T>, TreeGridDataItems<T>
All Known Implementing Classes:
AbstractContainerGridDataProvider, JmixGridDataProvider, JmixTreeGridDataProvider

public interface GridDataItems<T> extends DataUnit, com.vaadin.flow.data.provider.DataProvider<T,Void>, HasType<T>
  • 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

      com.vaadin.flow.shared.Registration addValueChangeListener(Consumer<GridDataItems.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

      com.vaadin.flow.shared.Registration addItemSetChangeListener(Consumer<GridDataItems.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

      com.vaadin.flow.shared.Registration addSelectedItemChangeListener(Consumer<GridDataItems.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