Class ContainerDataProvider<E>

java.lang.Object
com.vaadin.flow.data.provider.AbstractDataProvider<E,com.vaadin.flow.function.SerializablePredicate<E>>
io.jmix.flowui.data.items.ContainerDataProvider<E>
All Implemented Interfaces:
com.vaadin.flow.data.provider.ConfigurableFilterDataProvider<E,com.vaadin.flow.function.SerializablePredicate<E>,com.vaadin.flow.function.SerializablePredicate<E>>, com.vaadin.flow.data.provider.DataProvider<E,com.vaadin.flow.function.SerializablePredicate<E>>, com.vaadin.flow.data.provider.InMemoryDataProvider<E>, ContainerDataUnit<E>, DataUnit, EntityDataUnit, EntityItems<E>, Serializable

public class ContainerDataProvider<E> extends com.vaadin.flow.data.provider.AbstractDataProvider<E,com.vaadin.flow.function.SerializablePredicate<E>> implements com.vaadin.flow.data.provider.InMemoryDataProvider<E>, ContainerDataUnit<E>, EntityItems<E>
See Also:
  • Field Details

    • container

      protected CollectionContainer<E> container
    • loader

      protected DataLoader loader
    • deferredSelectedItem

      protected E deferredSelectedItem
    • sortOrder

      protected com.vaadin.flow.function.SerializableComparator<E> sortOrder
    • filter

      protected com.vaadin.flow.function.SerializablePredicate<E> filter
  • Constructor Details

  • Method Details

    • containerCollectionChanged

      protected void containerCollectionChanged(CollectionContainer.CollectionChangeEvent<E> e)
    • containerItemPropertyChanged

      protected void containerItemPropertyChanged(InstanceContainer.ItemPropertyChangeEvent<E> e)
    • getEntityMetaClass

      public MetaClass getEntityMetaClass()
      Specified by:
      getEntityMetaClass in interface EntityDataUnit
      Returns:
      MetaClass of an entity contained in the source
    • getContainer

      public CollectionContainer<E> getContainer()
      Specified by:
      getContainer in interface ContainerDataUnit<E>
    • setSelectedItem

      public void setSelectedItem(@Nullable E item)
      Description copied from interface: EntityItems
      Set current item in the source.
      Specified by:
      setSelectedItem in interface EntityItems<E>
      Parameters:
      item - the item to set
    • containsItem

      public boolean containsItem(@Nullable E item)
      Specified by:
      containsItem in interface EntityItems<E>
      Returns:
      true if the underlying collection contains an item with the specified ID
    • updateItem

      public void updateItem(E item)
      Description copied from interface: EntityItems
      Update an item in the collection if it is already there.
      Specified by:
      updateItem in interface EntityItems<E>
    • refresh

      public void refresh()
      Description copied from interface: EntityItems
      Refreshes the source moving it to the BindingState.ACTIVE state
      Specified by:
      refresh in interface EntityItems<E>
    • addItemsChangeListener

      public com.vaadin.flow.shared.Registration addItemsChangeListener(Consumer<EntityItems.ItemsChangeEvent<E>> listener)
      Description copied from interface: EntityItems
      Adds an items change listener. The listener is called when the item collection is changed.
      Specified by:
      addItemsChangeListener in interface EntityItems<E>
      Parameters:
      listener - a listener to register, not null
      Returns:
      a registration for the listener
    • size

      public int size(com.vaadin.flow.data.provider.Query<E,com.vaadin.flow.function.SerializablePredicate<E>> query)
      Specified by:
      size in interface com.vaadin.flow.data.provider.DataProvider<E,com.vaadin.flow.function.SerializablePredicate<E>>
    • fetch

      public Stream<E> fetch(com.vaadin.flow.data.provider.Query<E,com.vaadin.flow.function.SerializablePredicate<E>> query)
      Specified by:
      fetch in interface com.vaadin.flow.data.provider.DataProvider<E,com.vaadin.flow.function.SerializablePredicate<E>>
    • getFilteredItems

      protected Stream<E> getFilteredItems(com.vaadin.flow.data.provider.Query<E,com.vaadin.flow.function.SerializablePredicate<E>> query)
    • getItems

      protected Stream<E> getItems()
    • getFilter

      public com.vaadin.flow.function.SerializablePredicate<E> getFilter()
      Specified by:
      getFilter in interface com.vaadin.flow.data.provider.InMemoryDataProvider<E>
    • setFilter

      public void setFilter(com.vaadin.flow.function.SerializablePredicate<E> filter)
      Specified by:
      setFilter in interface com.vaadin.flow.data.provider.ConfigurableFilterDataProvider<E,com.vaadin.flow.function.SerializablePredicate<E>,com.vaadin.flow.function.SerializablePredicate<E>>
      Specified by:
      setFilter in interface com.vaadin.flow.data.provider.InMemoryDataProvider<E>
    • getSortComparator

      public com.vaadin.flow.function.SerializableComparator<E> getSortComparator()
      Specified by:
      getSortComparator in interface com.vaadin.flow.data.provider.InMemoryDataProvider<E>
    • setSortComparator

      public void setSortComparator(com.vaadin.flow.function.SerializableComparator<E> comparator)
      Specified by:
      setSortComparator in interface com.vaadin.flow.data.provider.InMemoryDataProvider<E>
    • getState

      public BindingState getState()
      Specified by:
      getState in interface DataUnit
      Returns:
      a state of this source
    • addStateChangeListener

      public com.vaadin.flow.shared.Registration addStateChangeListener(Consumer<DataUnit.StateChangeEvent> listener)
      Description copied from interface: DataUnit
      Registers a new state change listener.
      Specified by:
      addStateChangeListener in interface DataUnit
      Parameters:
      listener - the listener to be added
      Returns:
      a registration object for removing an event listener added to a source
    • getEventBus

      protected EventBus getEventBus()