Class AbstractGridSingleSelectionModel<T>
java.lang.Object
io.jmix.groupgridflowui.kit.vaadin.grid.Grid.AbstractGridExtension<T>
io.jmix.groupgridflowui.kit.vaadin.grid.AbstractGridSingleSelectionModel<T>
- Type Parameters:
T- the grid type
- All Implemented Interfaces:
com.vaadin.flow.data.provider.DataGenerator<T>,com.vaadin.flow.data.selection.SelectionModel<Grid<T>,,T> com.vaadin.flow.data.selection.SelectionModel.Single<Grid<T>,,T> GridSelectionModel<T>,GridSingleSelectionModel<T>,Serializable
public abstract class AbstractGridSingleSelectionModel<T>
extends Grid.AbstractGridExtension<T>
implements GridSingleSelectionModel<T>
Abstract implementation of a GridSingleSelectionModel.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.data.selection.SelectionModel
com.vaadin.flow.data.selection.SelectionModel.Multi<C extends com.vaadin.flow.component.Component,T extends Object>, com.vaadin.flow.data.selection.SelectionModel.Single<C extends com.vaadin.flow.component.Component, T extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for passing a reference of the grid to this implementation. -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddSelectionListener(com.vaadin.flow.data.selection.SelectionListener<Grid<T>, T> listener) com.vaadin.flow.shared.RegistrationaddSingleSelectionListener(com.vaadin.flow.data.selection.SingleSelectionListener<Grid<T>, T> listener) Adds a selection listener that will be called when the selection is changed either by the user or programmatically.Gets a wrapper to use this single selection model as a single select inBinder.voidvoiddeselectFromClient(T item) Handles the deselection of an item that originates from the client.protected abstract voidfireSelectionEvent(com.vaadin.flow.data.selection.SelectionEvent<Grid<T>, T> event) Method for handling the firing of selection events.voidgenerateData(T item, elemental.json.JsonObject jsonObject) booleanbooleanisSelected(T item) protected voidremove()Remove this extension from its target.voidvoidselectFromClient(T item) Handles the selection of an item that originates from the client.voidsetDeselectAllowed(boolean deselectAllowed) Methods inherited from class io.jmix.groupgridflowui.kit.vaadin.grid.Grid.AbstractGridExtension
extend, getGrid, refreshMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.data.provider.DataGenerator
destroyAllData, destroyData, refreshDataMethods inherited from interface com.vaadin.flow.data.selection.SelectionModel.Single
deselectAll, getFirstSelectedItem, getSelectedItems, setSelectedItem
-
Constructor Details
-
AbstractGridSingleSelectionModel
Constructor for passing a reference of the grid to this implementation.- Parameters:
grid- reference to the grid for which this selection model is created
-
-
Method Details
-
selectFromClient
Description copied from interface:GridSelectionModelHandles the selection of an item that originates from the client.- Specified by:
selectFromClientin interfaceGridSelectionModel<T>- Parameters:
item- the item being selected
-
select
-
deselectFromClient
Description copied from interface:GridSelectionModelHandles the deselection of an item that originates from the client.- Specified by:
deselectFromClientin interfaceGridSelectionModel<T>- Parameters:
item- the item being deselected
-
deselect
-
isSelected
-
getSelectedItem
-
setDeselectAllowed
public void setDeselectAllowed(boolean deselectAllowed) -
isDeselectAllowed
public boolean isDeselectAllowed() -
asSingleSelect
Description copied from interface:GridSingleSelectionModelGets a wrapper to use this single selection model as a single select inBinder.- Specified by:
asSingleSelectin interfaceGridSingleSelectionModel<T>- Returns:
- the single select wrapper
-
addSelectionListener
-
addSingleSelectionListener
public com.vaadin.flow.shared.Registration addSingleSelectionListener(com.vaadin.flow.data.selection.SingleSelectionListener<Grid<T>, T> listener) Description copied from interface:GridSingleSelectionModelAdds a selection listener that will be called when the selection is changed either by the user or programmatically.- Specified by:
addSingleSelectionListenerin interfaceGridSingleSelectionModel<T>- Parameters:
listener- the single selection listener, notnull- Returns:
- a registration for the listener
-
generateData
- Specified by:
generateDatain interfacecom.vaadin.flow.data.provider.DataGenerator<T>
-
remove
protected void remove()Description copied from class:Grid.AbstractGridExtensionRemove this extension from its target.- Overrides:
removein classGrid.AbstractGridExtension<T>
-
fireSelectionEvent
protected abstract void fireSelectionEvent(com.vaadin.flow.data.selection.SelectionEvent<Grid<T>, T> event) Method for handling the firing of selection events.- Parameters:
event- the selection event to fire
-