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.DataProvider<E,com.vaadin.flow.function.SerializablePredicate<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 ContainerDataUnit<E>, EntityItems<E>
See Also:
  • Field Details

  • 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
    • isInMemory

      public boolean isInMemory()
      Specified by:
      isInMemory in interface com.vaadin.flow.data.provider.DataProvider<E,com.vaadin.flow.function.SerializablePredicate<E>>
    • 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()
    • 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()