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
Modifier and TypeFieldDescriptionprotected final List<DataChangeListener>
protected final Consumer<CollectionContainer.CollectionChangeEvent>
protected final CollectionContainer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(DataChangeListener listener) Adds listener to the data provider events.void
Unsupported.void
addItems
(Collection<? extends DataItem> items) Unsupported.protected void
fireCollectionChangeListener
(DataChangeOperation operation, Collection changedItems) getItems()
void
Removes all items from the data provider.void
removeChangeListener
(DataChangeListener listener) Removes listener to data provider eventsvoid
removeItem
(DataItem item) Unsupported.void
updateItem
(DataItem item) Unsupported.
-
Field Details
-
dataContainer
-
collectionChangeListener
-
changeListeners
-
-
Constructor Details
-
ContainerDataProvider
-
-
Method Details
-
fireCollectionChangeListener
-
getItems
- Specified by:
getItems
in interfaceDataProvider
- Returns:
- list of all items.
-
getItem
- Specified by:
getItem
in 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:
addItem
in 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:
addItems
in 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:
updateItem
in 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:
removeItem
in 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:DataProvider
Removes all items from the data provider.- Specified by:
removeAll
in interfaceDataProvider
-
addChangeListener
Description copied from interface:DataProvider
Adds listener to the data provider events.- Specified by:
addChangeListener
in interfaceDataProvider
- Parameters:
listener
- listener to be added
-
removeChangeListener
Description copied from interface:DataProvider
Removes listener to data provider events- Specified by:
removeChangeListener
in interfaceDataProvider
- Parameters:
listener
- listener to be removed
-
getMetaClass
- Specified by:
getMetaClass
in interfaceHasMetaClass
- Returns:
- entity MetaClass
-
getCollectionContainer
- Returns:
- CollectionContainer instance
-