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.StateChangeEventNested 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
FieldsModifier and TypeFieldDescriptionprotected CollectionContainer<T>protected Subscriptionprotected Subscriptionprotected Subscriptionprotected EventBusprotected List<Consumer<GridDataItems.ItemSetChangeEvent<T>>>protected List<Consumer<GridDataItems.SelectedItemChangeEvent<T>>>protected BindingStateprotected List<Consumer<GridDataItems.ValueChangeEvent<T>>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationRegisters a new item set change listener.com.vaadin.flow.shared.RegistrationRegisters a new selected item change listener.com.vaadin.flow.shared.RegistrationRegisters a new state change listener.com.vaadin.flow.shared.RegistrationRegisters a new value change listener.voidbind()protected voidbooleancontainsItem(T item) getItemByIndex(int index) getItems()getItems(int startIndex, int numberOfItems) getItemValue(Object itemId, MetaPropertyPath propertyId) getState()getType()intindexOfItem(T item) booleanprotected voidonContainerCollectionChanged(CollectionContainer.CollectionChangeEvent<T> collectionChangeEvent) protected voidonContainerItemChanged(InstanceContainer.ItemChangeEvent<T> itemChangeEvent) voidsetSelectedItem(T item) Set current item in the source.protected voidsetState(BindingState state) intsize()intvoidunbind()Methods inherited from class com.vaadin.flow.data.provider.AbstractDataProvider
addDataProviderListener, addListener, fireEvent, refreshAll, refreshItem, refreshItemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
bindin interfaceJmixBinding
-
unbind
public void unbind()- Specified by:
unbindin interfaceJmixBinding
-
addItemSetChangeListener
public com.vaadin.flow.shared.Registration addItemSetChangeListener(Consumer<GridDataItems.ItemSetChangeEvent<T>> listener) Description copied from interface:GridDataItemsRegisters a new item set change listener.- Specified by:
addItemSetChangeListenerin 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:GridDataItemsRegisters a new value change listener.- Specified by:
addValueChangeListenerin 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:GridDataItemsRegisters a new selected item change listener.- Specified by:
addSelectedItemChangeListenerin 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:DataUnitRegisters a new state change listener.- Specified by:
addStateChangeListenerin interfaceDataUnit- Parameters:
listener- the listener to be added- Returns:
- a registration object for removing an event listener added to a source
-
getEntityMetaClass
- Specified by:
getEntityMetaClassin interfaceEntityDataUnit- Returns:
MetaClassof an entity contained in the source
-
getContainer
- Specified by:
getContainerin interfaceContainerDataUnit<T>
-
getItemId
- Specified by:
getItemIdin interfaceGridDataItems<T>- Parameters:
item- the item for obtaining the id- Returns:
- the id on the given item
-
getItem
- Specified by:
getItemin interfaceGridDataItems<T>- Parameters:
itemId- the item id- Returns:
- the item by the given id
-
getItemValue
- Specified by:
getItemValuein interfaceGridDataItems<T>- Parameters:
itemId- the item idpropertyId- the property id- Returns:
- the item value
-
indexOfItem
- Specified by:
indexOfItemin interfaceGridDataItems<T>- Parameters:
item- the item for obtaining the index- Returns:
- the index of the given item
-
getItemByIndex
- Specified by:
getItemByIndexin interfaceGridDataItems<T>- Parameters:
index- the item index- Returns:
- the item by the given index
-
getItems
- Specified by:
getItemsin interfaceGridDataItems<T>- Returns:
- the stream of all items
-
getItems
- Specified by:
getItemsin interfaceGridDataItems<T>- Parameters:
startIndex- the start indexnumberOfItems- the number of items- Returns:
- items from the
startIndexand size not exceeding the specified number
-
containsItem
- Specified by:
containsItemin interfaceGridDataItems<T>- Parameters:
item- an item to check- Returns:
trueif the underlying collection contains an item,falseotherwise
-
size
public int size()- Specified by:
sizein interfaceGridDataItems<T>- Returns:
- size of the underlying collection
-
getSelectedItem
- Specified by:
getSelectedItemin interfaceGridDataItems<T>- Returns:
- the current item contained in the source
-
setSelectedItem
Description copied from interface:GridDataItemsSet current item in the source.- Specified by:
setSelectedItemin interfaceGridDataItems<T>- Parameters:
item- the item to set
-
getType
-