PROPERTY - Item property typeITEM - Item typepublic interface ItemDataSourceContainer<ITEM,PROPERTY> extends ItemDataSource<ITEM,PROPERTY>, com.vaadin.data.Container.Indexed, com.vaadin.data.Buffered, com.vaadin.data.Container.Filterable, com.vaadin.data.Container.Sortable, com.vaadin.data.Container.ItemSetChangeNotifier, com.vaadin.data.Container.PropertySetChangeNotifier
Container using an ItemDataProvider to load items on demand.ItemDataSource.CommitHandler<ITEM>, ItemDataSource.Configuration<PROPERTY>, ItemDataSource.ItemAction, ItemDataSource.ItemSort<PROPERTY>, ItemDataSource.PropertySortGenerator<PROPERTY>| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BATCH_SIZE
Default batch (page) size for items loading using
ItemDataProvider |
| Modifier and Type | Method and Description |
|---|---|
default boolean |
addContainerProperty(PROPERTY propertyId,
Class<?> type,
boolean readOnly,
boolean sortable)
Adds an Item property to this container
|
<T> boolean |
addContainerProperty(PROPERTY propertyId,
Class<T> type,
boolean readOnly,
boolean sortable,
T defaultValue)
Adds an Item property to this container
|
Registration |
addQueryConfigurationProvider(com.holonplatform.core.query.QueryConfigurationProvider queryConfigurationProvider)
Add an external
QueryConfigurationProvider for additional query configuration |
void |
addQueryParameter(String name,
Object value)
Add a query parameter
|
static <PROPERTY,ITEM> |
builder()
Get a builder to create an
ItemDataSourceContainer. |
void |
refreshItem(Object itemId)
Refresh given the item identified by given
itemId in data source |
void |
removeQueryParameter(String name)
Remove a query parameter
|
void |
setAutoRefresh(boolean autoRefresh)
Set if auto-refresh is enabled for this container, i.e. items are loaded when one of the Container method which
involve operations on item set is called.
|
void |
setCommitHandler(ItemDataSource.CommitHandler<ITEM> commitHandler)
Handler to manage items and item set modifications.
|
void |
setDefaultSort(com.holonplatform.core.query.QuerySort sort)
Set query default sort.
|
void |
setFixedFilter(com.holonplatform.core.query.QueryFilter filter)
Set query fixed filter (always added to query predicates)
|
void |
setFixedSort(com.holonplatform.core.query.QuerySort sort)
Set query fixed sort (always added to query sorts)
|
void |
setMaxCacheSize(int maxCacheSize)
Set max items cache size
|
void |
setPropertyDefaultValue(PROPERTY propertyId,
Object defaultValue)
Set a default value to initialize the given
propertyId |
void |
setPropertyReadOnly(PROPERTY propertyId,
boolean readOnly)
Set whether the given
propertyId is read-only |
void |
setPropertySortable(PROPERTY propertyId,
boolean sortable)
Set whether the given
propertyId can partecipate in container sorting |
void |
setPropertySortGenerator(PROPERTY property,
ItemDataSource.PropertySortGenerator<PROPERTY> propertySortGenerator)
Set a
PropertySortGenerator to generate QuerySorts for given property |
add, clear, commit, discard, get, getConfiguration, getId, getItemIds, isBuffered, refresh, refresh, remove, size, sort, updateaddItemAt, addItemAt, getIdByIndex, getItemIds, indexOfIdcommit, discard, isBuffered, isModified, setBufferedaddContainerFilter, getContainerFilters, removeAllContainerFilters, removeContainerFiltergetSortableContainerPropertyIds, sortaddItemAfter, addItemAfter, firstItemId, isFirstId, isLastId, lastItemId, nextItemId, prevItemIdstatic final int DEFAULT_BATCH_SIZE
ItemDataProvidervoid setAutoRefresh(boolean autoRefresh)
If auto-refresh is not enabled, ItemDataSource.refresh() method must be called to load items before using this
Container.
autoRefresh - true to enable auto-refreshvoid setMaxCacheSize(int maxCacheSize)
maxCacheSize - Max cache size to set<T> boolean addContainerProperty(PROPERTY propertyId, Class<T> type, boolean readOnly, boolean sortable, T defaultValue)
T - Property typepropertyId - Property idtype - Property value typereadOnly - Whether property is read-onlysortable - Whether property is sortabledefaultValue - Property default valuetrue if property was successfully addeddefault boolean addContainerProperty(PROPERTY propertyId, Class<?> type, boolean readOnly, boolean sortable)
propertyId - Property idtype - Property value typereadOnly - Whether property is read-onlysortable - Whether property is sortabletrue if property was successfully addedvoid setPropertySortable(PROPERTY propertyId, boolean sortable)
propertyId can partecipate in container sortingpropertyId - Property idsortable - Whether the property is sortable or notvoid setPropertyReadOnly(PROPERTY propertyId, boolean readOnly)
propertyId is read-onlypropertyId - Property idreadOnly - Whether the property is read-onlyvoid setPropertyDefaultValue(PROPERTY propertyId, Object defaultValue)
propertyIdpropertyId - Property iddefaultValue - Property default valueRegistration addQueryConfigurationProvider(com.holonplatform.core.query.QueryConfigurationProvider queryConfigurationProvider)
QueryConfigurationProvider for additional query configurationqueryConfigurationProvider - QueryConfigurationProvider to addRegistrationvoid setFixedFilter(com.holonplatform.core.query.QueryFilter filter)
filter - Query fixed filter, or null for nonevoid setDefaultSort(com.holonplatform.core.query.QuerySort sort)
null and no other sort is available, this one will be usedsort - Default query sortvoid setFixedSort(com.holonplatform.core.query.QuerySort sort)
sort - Query fixed sort, or null for nonevoid addQueryParameter(String name, Object value)
name - Parameter namevalue - Parameter valuevoid removeQueryParameter(String name)
name - Parameter name to removevoid setPropertySortGenerator(PROPERTY property, ItemDataSource.PropertySortGenerator<PROPERTY> propertySortGenerator)
PropertySortGenerator to generate QuerySorts for given propertyproperty - Property (not null)propertySortGenerator - PropertySortGenerator (not null)void setCommitHandler(ItemDataSource.CommitHandler<ITEM> commitHandler)
commitHandler - Item set commit handlervoid refreshItem(Object itemId)
itemId in data sourceitemId - Id of the item to refresh (not null)UnsupportedOperationException - If the refresh operation is not supported by concrete data storestatic <PROPERTY,ITEM> ItemDataSourceContainerBuilder.BaseItemDataSourceContainerBuilder<PROPERTY,ITEM> builder()
ItemDataSourceContainer.PROPERTY - Item property typeITEM - Item typeItemDataSourceContainer builderCopyright © 2019 The Holon Platform. All rights reserved.