Package io.jmix.ui.data.impl
Class ListDataProvider
java.lang.Object
io.jmix.ui.data.impl.ListDataProvider
- All Implemented Interfaces:
DataProvider
,Serializable
Data provider in which all items are stored in
List
.- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionListDataProvider
(DataItem... items) ListDataProvider
(List<? extends DataItem> items) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(DataChangeListener listener) Adds listener to the data provider events.void
Adds an item to the data provider.void
addItems
(Collection<? extends DataItem> items) Adds a collection of data items to the data provider.protected void
fireDataChanged
(DataChangeOperation operation, List<DataItem> items) getItems()
void
Removes all items from the data provider.void
removeChangeListener
(DataChangeListener listener) Removes listener to data provider eventsvoid
removeItem
(DataItem item) Removes an item from the data provider.void
updateItem
(DataItem item) Update an item in the data provider if it is already there.
-
Field Details
-
items
-
changeListeners
-
-
Constructor Details
-
ListDataProvider
public ListDataProvider() -
ListDataProvider
-
ListDataProvider
-
-
Method Details
-
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
Description copied from interface:DataProvider
Adds an item to the data provider.- Specified by:
addItem
in interfaceDataProvider
- Parameters:
item
- an item to be added
-
addItems
Description copied from interface:DataProvider
Adds a collection of data items to the data provider.- Specified by:
addItems
in interfaceDataProvider
- Parameters:
items
- a collection of data items to be added
-
updateItem
Update an item in the data provider if it is already there.- Specified by:
updateItem
in interfaceDataProvider
- Parameters:
item
- an item to be updated- Throws:
IllegalArgumentException
- if no such element found
-
removeItem
Description copied from interface:DataProvider
Removes an item from the data provider.- Specified by:
removeItem
in interfaceDataProvider
- Parameters:
item
- an item to be removed
-
removeAll
public void removeAll()Description copied from interface:DataProvider
Removes all items from the data provider.- Specified by:
removeAll
in interfaceDataProvider
-
fireDataChanged
-
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
-