Class ListChartItems<T extends DataItem>

java.lang.Object
com.vaadin.flow.data.provider.AbstractDataProvider<T,Void>
io.jmix.chartsflowui.kit.data.chart.ListChartItems<T>
All Implemented Interfaces:
com.vaadin.flow.data.provider.DataProvider<T,Void>, ChartItems<T>, Serializable

public class ListChartItems<T extends DataItem> extends com.vaadin.flow.data.provider.AbstractDataProvider<T,Void> implements ChartItems<T>
Data provider for a Chart component in which all items are stored in List.
See Also:
  • Field Details

  • Constructor Details

    • ListChartItems

      public ListChartItems()
    • ListChartItems

      @SafeVarargs public ListChartItems(T... items)
    • ListChartItems

      public ListChartItems(Collection<T> items)
  • Method Details

    • getItems

      public List<T> getItems()
      Specified by:
      getItems in interface ChartItems<T extends DataItem>
      Returns:
      unmodifiable collection of items
    • getItem

      public T getItem(Object id)
      Specified by:
      getItem in interface ChartItems<T extends DataItem>
      Parameters:
      id - the item id
      Returns:
      the item by the given id
    • addItem

      public void addItem(T item)
    • addItems

      @SafeVarargs public final void addItems(T... items)
    • addItems

      public void addItems(Collection<T> items)
    • updateItem

      public void updateItem(T item)
      Update an item in the data provider if it is already there.
      Parameters:
      item - an item to be updated
      Throws:
      IllegalArgumentException - if no such element found
    • removeItem

      public void removeItem(T item)
    • removeAll

      public void removeAll()
    • fireChangedEvent

      protected void fireChangedEvent(ChartItems.DataChangeOperation operation, List<T> items)
    • addItemSetChangeListener

      public com.vaadin.flow.shared.Registration addItemSetChangeListener(Consumer<ChartItems.ItemSetChangeEvent<T>> listener)
      Description copied from interface: ChartItems
      Registers a new item set change listener.
      Specified by:
      addItemSetChangeListener in interface ChartItems<T extends DataItem>
      Parameters:
      listener - the listener to be added
      Returns:
      a registration object for removing an event listener added to a source
    • isInMemory

      public boolean isInMemory()
      Specified by:
      isInMemory in interface com.vaadin.flow.data.provider.DataProvider<T extends DataItem,Void>
    • size

      public int size(com.vaadin.flow.data.provider.Query<T,Void> query)
      Specified by:
      size in interface com.vaadin.flow.data.provider.DataProvider<T extends DataItem,Void>
    • fetch

      public Stream<T> fetch(com.vaadin.flow.data.provider.Query<T,Void> query)
      Specified by:
      fetch in interface com.vaadin.flow.data.provider.DataProvider<T extends DataItem,Void>
    • getEventBus

      protected EventBus getEventBus()