T - Data typeF - Filter typepublic interface ItemListingDataProviderAdapter<T,F>
extends com.vaadin.flow.data.provider.DataProvider<T,F>
DataProvider adapter to be used in item listings.| Modifier and Type | Method and Description |
|---|---|
static <T,F> ItemListingDataProviderAdapter<T,F> |
adapt(com.vaadin.flow.data.provider.DataProvider<T,F> dataProvider)
Create a new
ItemListingDataProviderAdapter using given concrete dataProvider. |
void |
addAdditionalItem(T item)
Add an additional item to the data provider.
|
List<T> |
getAdditionalItems()
Get the current additional items, if any.
|
boolean |
isFrozen()
Get whether the data provider is frozen.
|
boolean |
removeAdditionalItem(T item)
Remove an additional item from the data provider.
|
void |
removeAdditionalItems()
Remove all the additional items from the data provider.
|
void |
setFrozen(boolean frozen)
Set whether the data provider is frozen.
|
boolean isFrozen()
When the data provider is frozen, it never returns any item (the
DataProvider.size(com.vaadin.flow.data.provider.Query) will always be 0).
void setFrozen(boolean frozen)
When the data provider is frozen, it never returns any item (the
DataProvider.size(com.vaadin.flow.data.provider.Query) will always be 0).
frozen - Whether the data provider is frozenList<T> getAdditionalItems()
Additional items are provided in addition to the ones returned by the concrete data provider, for example from a backend service. They are always provided before any other item, and do not take part in filters and sorts.
addAdditionalItem(Object)void addAdditionalItem(T item)
Additional items are provided in addition to the ones returned by the concrete data provider, for example from a backend service. They are always provided before any other item, and do not take part in filters and sorts.
The additional items should be used, for example, to edit item values before saving into the backend. Then they should be removed from the data provider.
NOTE: Additional items are identified in the same way than any other item, using the DataProvider.getId(Object)
method. So the id providing logic should be consistent with any other item.
item - The item to add (not null)removeAdditionalItem(Object)boolean removeAdditionalItem(T item)
item - The item to remove (not null)true if given item was an additional item and it's been removed, false
otherwiseaddAdditionalItem(Object),
removeAdditionalItems()void removeAdditionalItems()
addAdditionalItem(Object)static <T,F> ItemListingDataProviderAdapter<T,F> adapt(com.vaadin.flow.data.provider.DataProvider<T,F> dataProvider)
ItemListingDataProviderAdapter using given concrete dataProvider.T - Data typeF - Filter typedataProvider - The concrete data provider (not null)ItemListingDataProviderAdapterCopyright © 2019 The Holon Platform. All rights reserved.