Package io.jmix.flowui.component.grid
Class AbstractContainerGridDataProvider<T>
java.lang.Object
com.vaadin.flow.data.provider.AbstractDataProvider<T,Void>
io.jmix.flowui.component.grid.AbstractContainerGridDataProvider<T>
- All Implemented Interfaces:
com.vaadin.flow.data.provider.DataProvider<T,
,Void> JmixBinding
,ContainerDataUnit<T>
,DataUnit
,EntityDataUnit
,EntityGridDataItems<T>
,GridDataItems<T>
,HasType<T>
,Serializable
- Direct Known Subclasses:
JmixGridDataProvider
public abstract class AbstractContainerGridDataProvider<T>
extends com.vaadin.flow.data.provider.AbstractDataProvider<T,Void>
implements ContainerDataUnit<T>, EntityGridDataItems<T>, JmixBinding
- 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.grid.GridDataItems
GridDataItems.ItemSetChangeEvent<T>, GridDataItems.SelectedItemChangeEvent<T>, GridDataItems.Sortable<T>, GridDataItems.ValueChangeEvent<T>
-
Field Summary
Modifier and TypeFieldDescriptionprotected CollectionContainer<T>
protected Subscription
protected Subscription
protected Subscription
protected EventBus
protected List<Consumer<GridDataItems.ItemSetChangeEvent<T>>>
protected List<Consumer<GridDataItems.SelectedItemChangeEvent<T>>>
protected BindingState
protected List<Consumer<GridDataItems.ValueChangeEvent<T>>>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
Registers a new item set change listener.com.vaadin.flow.shared.Registration
Registers a new selected item change listener.com.vaadin.flow.shared.Registration
Registers a new state change listener.com.vaadin.flow.shared.Registration
Registers a new value change listener.void
bind()
protected void
boolean
containsItem
(T item) getItemByIndex
(int index) getItems()
getItems
(int startIndex, int numberOfItems) getItemValue
(Object itemId, MetaPropertyPath propertyId) getState()
getType()
int
indexOfItem
(T item) boolean
protected void
onContainerCollectionChanged
(CollectionContainer.CollectionChangeEvent<T> collectionChangeEvent) protected void
onContainerItemChanged
(InstanceContainer.ItemChangeEvent<T> itemChangeEvent) void
setSelectedItem
(T item) Set current item in the source.protected void
setState
(BindingState state) int
size()
int
void
unbind()
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
addDataProviderListener, getId, refreshAll, refreshItem, refreshItem, withConfigurableFilter, withConfigurableFilter, withConvertedFilter
-
Field Details
-
container
-
containerItemChangeSubscription
-
containerItemPropertyChangeSubscription
-
containerCollectionChangeSubscription
-
selectedItemChangeListeners
-
valueChangeListeners
-
itemSetChangeListeners
-
eventBus
-
state
-
-
Constructor Details
-
AbstractContainerGridDataProvider
-
-
Method Details
-
onContainerItemChanged
-
onContainerCollectionChanged
protected void onContainerCollectionChanged(CollectionContainer.CollectionChangeEvent<T> collectionChangeEvent) -
containerItemPropertyChanged
-
bind
public void bind()- Specified by:
bind
in interfaceJmixBinding
-
unbind
public void unbind()- Specified by:
unbind
in interfaceJmixBinding
-
addItemSetChangeListener
public com.vaadin.flow.shared.Registration addItemSetChangeListener(Consumer<GridDataItems.ItemSetChangeEvent<T>> listener) Description copied from interface:GridDataItems
Registers a new item set change listener.- Specified by:
addItemSetChangeListener
in interfaceGridDataItems<T>
- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
addValueChangeListener
public com.vaadin.flow.shared.Registration addValueChangeListener(Consumer<GridDataItems.ValueChangeEvent<T>> listener) Description copied from interface:GridDataItems
Registers a new value change listener.- Specified by:
addValueChangeListener
in interfaceGridDataItems<T>
- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
addSelectedItemChangeListener
public com.vaadin.flow.shared.Registration addSelectedItemChangeListener(Consumer<GridDataItems.SelectedItemChangeEvent<T>> listener) Description copied from interface:GridDataItems
Registers a new selected item change listener.- Specified by:
addSelectedItemChangeListener
in interfaceGridDataItems<T>
- Parameters:
listener
- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
isInMemory
public boolean isInMemory() -
size
-
fetch
-
getState
-
setState
-
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
-
getEntityMetaClass
- Specified by:
getEntityMetaClass
in interfaceEntityDataUnit
- Returns:
MetaClass
of an entity contained in the source
-
getContainer
- Specified by:
getContainer
in interfaceContainerDataUnit<T>
-
getItemId
- Specified by:
getItemId
in interfaceGridDataItems<T>
- Parameters:
item
- the item for obtaining the id- Returns:
- the id on the given item
-
getItem
- Specified by:
getItem
in interfaceGridDataItems<T>
- Parameters:
itemId
- the item id- Returns:
- the item by the given id
-
getItemValue
- Specified by:
getItemValue
in interfaceGridDataItems<T>
- Parameters:
itemId
- the item idpropertyId
- the property id- Returns:
- the item value
-
indexOfItem
- Specified by:
indexOfItem
in interfaceGridDataItems<T>
- Parameters:
item
- the item for obtaining the index- Returns:
- the index of the given item
-
getItemByIndex
- Specified by:
getItemByIndex
in interfaceGridDataItems<T>
- Parameters:
index
- the item index- Returns:
- the item by the given index
-
getItems
- Specified by:
getItems
in interfaceGridDataItems<T>
- Returns:
- the stream of all items
-
getItems
- Specified by:
getItems
in interfaceGridDataItems<T>
- Parameters:
startIndex
- the start indexnumberOfItems
- the number of items- Returns:
- items from the
startIndex
and size not exceeding the specified number
-
containsItem
- Specified by:
containsItem
in interfaceGridDataItems<T>
- Parameters:
item
- an item to check- Returns:
true
if the underlying collection contains an item,false
otherwise
-
size
public int size()- Specified by:
size
in interfaceGridDataItems<T>
- Returns:
- size of the underlying collection
-
getSelectedItem
- Specified by:
getSelectedItem
in interfaceGridDataItems<T>
- Returns:
- the current item contained in the source
-
setSelectedItem
Description copied from interface:GridDataItems
Set current item in the source.- Specified by:
setSelectedItem
in interfaceGridDataItems<T>
- Parameters:
item
- the item to set
-
getType
-