Package com.vaadin.flow.component.grid
Class AbstractGridSingleSelectionModel<T>
- java.lang.Object
-
- com.vaadin.flow.component.grid.Grid.AbstractGridExtension<T>
-
- com.vaadin.flow.component.grid.AbstractGridSingleSelectionModel<T>
-
- Type Parameters:
T- the grid type
- All Implemented Interfaces:
GridSelectionModel<T>,GridSingleSelectionModel<T>,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>,Serializable
public abstract class AbstractGridSingleSelectionModel<T> extends Grid.AbstractGridExtension<T> implements GridSingleSelectionModel<T>
Abstract implementation of a GridSingleSelectionModel.- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
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
Constructors Constructor Description AbstractGridSingleSelectionModel(Grid<T> grid)Constructor for passing a reference of the grid to this implementation.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description com.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.com.vaadin.flow.data.selection.SingleSelect<Grid<T>,T>asSingleSelect()Gets a wrapper to use this single selection model as a single select inBinder.voiddeselect(T item)voiddeselectFromClient(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)Optional<T>getSelectedItem()booleanisDeselectAllowed()booleanisSelected(T item)protected voidremove()Remove this extension from its target.voidselect(T item)voidselectFromClient(T item)Handles the selection of an item that originates from the client.voidsetDeselectAllowed(boolean deselectAllowed)-
Methods inherited from class com.vaadin.flow.component.grid.Grid.AbstractGridExtension
extend, getGrid, refresh
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
selectFromClient
public void selectFromClient(T item)
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
public void select(T item)
-
deselectFromClient
public void deselectFromClient(T item)
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
public void deselect(T item)
-
isSelected
public boolean isSelected(T item)
-
setDeselectAllowed
public void setDeselectAllowed(boolean deselectAllowed)
-
isDeselectAllowed
public boolean isDeselectAllowed()
-
asSingleSelect
public com.vaadin.flow.data.selection.SingleSelect<Grid<T>,T> 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
public com.vaadin.flow.shared.Registration addSelectionListener(com.vaadin.flow.data.selection.SelectionListener<Grid<T>,T> listener)
-
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
public void generateData(T item, elemental.json.JsonObject jsonObject)
- 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>
-
-