com.vaadin.flow.component.shared.
Class SelectionPreservationHandler<T>
All Implemented Interfaces:
Abstract class that handles selection when DataProvider.refreshAll()
is
called.
Uses SelectionPreservationMode
to switch between the selection
preservation modes.
Author:
Vaadin Ltd.
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSelectionPreservationHandler
(SelectionPreservationMode selectionPreservationMode) Constructor taking in the initial selection preservation mode.
-
Method Summary
Modifier and TypeMethodDescriptionGets the selection preservation mode.
final void
handleDataChange
(DataChangeEvent<T> dataChangeEvent) Handles data change based on the current selection preservation mode.
abstract void
onDiscard
(DataChangeEvent<T> dataChangeEvent) Clears selection when
DataProvider.refreshAll()
is called.abstract void
onPreserveAll
(DataChangeEvent<T> dataChangeEvent) Preserves all selected items when
DataProvider.refreshAll()
is called.abstract void
onPreserveExisting
(DataChangeEvent<T> dataChangeEvent) Preserves the selected items that still exist after
DataProvider.refreshAll()
is called.final void
setSelectionPreservationMode
(SelectionPreservationMode selectionPreservationMode) Sets the selection preservation mode.
-
Constructor Details
-
Method Details
-
getSelectionPreservationMode
Gets the selection preservation mode.
Returns:
the selection preservation mode
See Also:
-
handleDataChange
Handles data change based on the current selection preservation mode.
Parameters:
dataChangeEvent
- the data change eventSee Also:
-
onPreserveAll
Preserves all selected items when
DataProvider.refreshAll()
is called.Parameters:
dataChangeEvent
- the data change event -
onPreserveExisting
Preserves the selected items that still exist after
DataProvider.refreshAll()
is called.Parameters:
dataChangeEvent
- the data change event -
onDiscard
Clears selection when
DataProvider.refreshAll()
is called.Parameters:
dataChangeEvent
- the data change event