Package io.jmix.ui.data.impl
Class ContainerDataProvider
java.lang.Object
io.jmix.ui.data.impl.ContainerDataProvider
- All Implemented Interfaces:
DataProvider,HasMetaClass,Serializable
Data provider which contains
CollectionContainer with items.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<DataChangeListener>protected final Consumer<CollectionContainer.CollectionChangeEvent>protected final CollectionContainer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(DataChangeListener listener) Adds listener to the data provider events.voidUnsupported.voidaddItems(Collection<? extends DataItem> items) Unsupported.protected voidfireCollectionChangeListener(DataChangeOperation operation, Collection changedItems) getItems()voidRemoves all items from the data provider.voidremoveChangeListener(DataChangeListener listener) Removes listener to data provider eventsvoidremoveItem(DataItem item) Unsupported.voidupdateItem(DataItem item) Unsupported.
-
Field Details
-
dataContainer
-
collectionChangeListener
-
changeListeners
-
-
Constructor Details
-
ContainerDataProvider
-
-
Method Details
-
fireCollectionChangeListener
-
getItems
- Specified by:
getItemsin interfaceDataProvider- Returns:
- list of all items.
-
getItem
- Specified by:
getItemin interfaceDataProvider- Parameters:
id- id of data item- Returns:
- data item by id
-
addItem
Unsupported. Always throws anUnsupportedOperationException. Use CollectionContainer for changing data items of ContainerDataProvider- Specified by:
addItemin interfaceDataProvider- Parameters:
item- an item to be added- Throws:
UnsupportedOperationException- use CollectionContainer for changing data items of ContainerDataProvider
-
addItems
Unsupported. Always throws anUnsupportedOperationException. Use CollectionContainer for changing data items of ContainerDataProvider- Specified by:
addItemsin interfaceDataProvider- Parameters:
items- a collection of data items to be added- Throws:
UnsupportedOperationException- use CollectionContainer for changing data items of ContainerDataProvider
-
updateItem
Unsupported. Always throws anUnsupportedOperationException. Use CollectionContainer for changing data items of ContainerDataProvider- Specified by:
updateItemin interfaceDataProvider- Parameters:
item- an item to be updated- Throws:
UnsupportedOperationException- use CollectionContainer for changing data items of ContainerDataProvider
-
removeItem
Unsupported. Always throws anUnsupportedOperationException. Use CollectionContainer for changing data items of ContainerDataProvider- Specified by:
removeItemin interfaceDataProvider- Parameters:
item- an item to be removed- Throws:
UnsupportedOperationException- use CollectionContainer for changing data items of ContainerDataProvider
-
removeAll
public void removeAll()Description copied from interface:DataProviderRemoves all items from the data provider.- Specified by:
removeAllin interfaceDataProvider
-
addChangeListener
Description copied from interface:DataProviderAdds listener to the data provider events.- Specified by:
addChangeListenerin interfaceDataProvider- Parameters:
listener- listener to be added
-
removeChangeListener
Description copied from interface:DataProviderRemoves listener to data provider events- Specified by:
removeChangeListenerin interfaceDataProvider- Parameters:
listener- listener to be removed
-
getMetaClass
- Specified by:
getMetaClassin interfaceHasMetaClass- Returns:
- entity MetaClass
-
getCollectionContainer
- Returns:
- CollectionContainer instance
-