Package io.jmix.flowui.data.items
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.flowui.data.DataUnit
DataUnit.StateChangeEvent
Nested classes/interfaces inherited from interface io.jmix.flowui.data.EntityItems
EntityItems.ItemsChangeEvent<T>
-
Field Summary
Modifier and TypeFieldDescriptionprotected CollectionContainer<E>
protected E
protected DataLoader
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addItemsChangeListener
(Consumer<EntityItems.ItemsChangeEvent<E>> listener) Adds an items change listener.com.vaadin.flow.shared.Registration
Registers a new state change listener.protected void
protected void
boolean
containsItem
(E item) fetch
(com.vaadin.flow.data.provider.Query<E, com.vaadin.flow.function.SerializablePredicate<E>> query) protected EventBus
getFilteredItems
(com.vaadin.flow.data.provider.Query<E, com.vaadin.flow.function.SerializablePredicate<E>> query) getItems()
getState()
boolean
void
refresh()
Refreshes the source moving it to theBindingState.ACTIVE
statevoid
setSelectedItem
(E item) Set current item in the source.int
size
(com.vaadin.flow.data.provider.Query<E, com.vaadin.flow.function.SerializablePredicate<E>> query) void
updateItem
(E item) Update an item in the collection if it is already there.Methods inherited from class com.vaadin.flow.data.provider.AbstractDataProvider
addDataProviderListener, addListener, fireEvent, refreshAll, refreshItem, refreshItem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.data.provider.DataProvider
getId, withConfigurableFilter, withConfigurableFilter, withConvertedFilter
-
Field Details
-
container
-
loader
-
deferredSelectedItem
-
-
Constructor Details
-
ContainerDataProvider
-
-
Method Details
-
containerCollectionChanged
-
containerItemPropertyChanged
-
getEntityMetaClass
- Specified by:
getEntityMetaClass
in interfaceEntityDataUnit
- Returns:
MetaClass
of an entity contained in the source
-
getContainer
- Specified by:
getContainer
in interfaceContainerDataUnit<E>
-
setSelectedItem
Description copied from interface:EntityItems
Set current item in the source.- Specified by:
setSelectedItem
in interfaceEntityItems<E>
- Parameters:
item
- the item to set
-
containsItem
- Specified by:
containsItem
in interfaceEntityItems<E>
- Returns:
- true if the underlying collection contains an item with the specified ID
-
updateItem
Description copied from interface:EntityItems
Update an item in the collection if it is already there.- Specified by:
updateItem
in interfaceEntityItems<E>
-
refresh
public void refresh()Description copied from interface:EntityItems
Refreshes the source moving it to theBindingState.ACTIVE
state- Specified by:
refresh
in interfaceEntityItems<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 interfaceEntityItems<E>
- Parameters:
listener
- a listener to register, not null- Returns:
- a registration for the listener
-
isInMemory
public boolean isInMemory() -
size
-
fetch
-
getFilteredItems
-
getItems
-
getState
-
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 interfaceDataUnit
- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
getEventBus
-