T
- data typepublic class GridListDataView<T> extends AbstractListDataView<T>
component, dataProviderSupplier, NULL_IDENTIFIER_ERROR_MESSAGE
Constructor and Description |
---|
GridListDataView(DataCommunicator<T> dataCommunicator,
Grid<T> grid,
SerializableBiConsumer<SerializablePredicate<T>,SerializableComparator<T>> filterOrSortingChangedCallback)
Creates a new instance of Grid in-memory data view and verifies the
passed data provider is compatible with this data view implementation.
|
Modifier and Type | Method and Description |
---|---|
int |
getItemCount()
Get the full item count with filters if any set.
|
Stream<T> |
getItems()
Get the full data available to the component.
|
void |
setIdentifierProvider(IdentifierProvider<T> identifierProvider)
Sets an identifier provider, which returns an identifier for the given
item.
|
addFilter, addItem, addItemAfter, addItemBefore, addItems, addItemsAfter, addItemsBefore, addSortComparator, addSortOrder, contains, getDataProvider, getItem, getNextItem, getPreviousItem, getSupportedDataProviderType, removeFilters, removeItem, removeItems, removeSorting, setFilter, setSortComparator, setSortOrder, validateItemIndex
addItemCountChangeListener, equals, getIdentifierProvider, refreshAll, refreshItem, verifyDataProviderType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addItemCountChangeListener, refreshAll, refreshItem
public GridListDataView(DataCommunicator<T> dataCommunicator, Grid<T> grid, SerializableBiConsumer<SerializablePredicate<T>,SerializableComparator<T>> filterOrSortingChangedCallback)
dataCommunicator
- the data communicator of the Grid, not null
grid
- the Grid component, not null
filterOrSortingChangedCallback
- callback, which is being invoked when the Grid's filtering or
sorting changes, not null
public Stream<T> getItems()
DataView
public int getItemCount()
ListDataView
DataView.addItemCountChangeListener(ComponentEventListener)
method
instead to get notified when the item count has changed.getItemCount
in interface ListDataView<T,AbstractListDataView<T>>
getItemCount
in class AbstractListDataView<T>
DataView.addItemCountChangeListener(ComponentEventListener)
public void setIdentifierProvider(IdentifierProvider<T> identifierProvider)
DataView
dataView.setIdentifiedProvider(Item::getId);
.setIdentifierProvider
in interface DataView<T>
setIdentifierProvider
in class AbstractDataView<T>
identifierProvider
- function that returns the non-null identifier for a given itemCopyright © 2021. All rights reserved.