com.vaadin.flow.component.grid.
Class GridNoneSelectionModel<T>
- java.lang.Object
-
- com.vaadin.flow.component.grid.GridNoneSelectionModel<T>
-
Type Parameters:
T
- the grid bean typeAll Implemented Interfaces:
GridSelectionModel<T>, SelectionModel<Grid<T>,T>, Serializable
public class GridNoneSelectionModel<T> extends Object implements GridSelectionModel<T>
Selection model implementation for disabling selection in Grid.
See Also:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.flow.data.selection.SelectionModel
SelectionModel.Multi<C extends Component,T>, SelectionModel.Single<C extends Component,T>
-
-
Constructor Summary
Constructors Constructor and Description GridNoneSelectionModel()
-
Method Summary
All Methods Modifier and Type Method and Description Registration
addSelectionListener(SelectionListener<Grid<T>,T> listener)
Adds a generic listener to this selection model, accepting both single and multiselection events.
void
deselect(T item)
Deselects the given item.
void
deselectAll()
Deselects all currently selected items, if any.
void
deselectFromClient(T item)
Handles the deselection of an item that originates from the client.
Optional<T>
getFirstSelectedItem()
Get first selected data item.
Set<T>
getSelectedItems()
Returns an immutable set of the currently selected items.
void
select(T item)
Selects the given item.
void
selectFromClient(T item)
Handles the selection of an item that originates from the client.
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.data.selection.SelectionModel
isSelected
-
-
-
-
Method Detail
-
getSelectedItems
public Set<T> getSelectedItems()
Description copied from interface:
SelectionModel
Returns an immutable set of the currently selected items. It is safe to invoke other
SelectionModel
methods while iterating over the set.Implementation note: the iteration order of the items in the returned set should be well-defined and documented by the implementing class.
Specified by:
getSelectedItems
in interfaceSelectionModel<Grid<T>,T>
Returns:
the items in the current selection, not null
-
getFirstSelectedItem
public Optional<T> getFirstSelectedItem()
Description copied from interface:
SelectionModel
Get first selected data item.
This is the same as
SelectionModel.Single.getSelectedItem()
in case of single selection and the first selected item fromSelectionModel.getSelectedItems()
in case of multiselection.Specified by:
getFirstSelectedItem
in interfaceSelectionModel<Grid<T>,T>
Returns:
the first selected item.
-
select
public void select(T item)
Description copied from interface:
SelectionModel
Selects the given item. Depending on the implementation, may cause other items to be deselected. If the item is already selected, does nothing.
Specified by:
select
in interfaceSelectionModel<Grid<T>,T>
Parameters:
item
- the item to select, not null
-
deselect
public void deselect(T item)
Description copied from interface:
SelectionModel
Deselects the given item. If the item is not currently selected, does nothing.
Specified by:
deselect
in interfaceSelectionModel<Grid<T>,T>
Parameters:
item
- the item to deselect, not null
-
deselectAll
public void deselectAll()
Description copied from interface:
SelectionModel
Deselects all currently selected items, if any.
Specified by:
deselectAll
in interfaceSelectionModel<Grid<T>,T>
-
selectFromClient
public void selectFromClient(T item)
Description copied from interface:
GridSelectionModel
Handles the selection of an item that originates from the client.
Specified by:
selectFromClient
in interfaceGridSelectionModel<T>
Parameters:
item
- the item being selected
-
deselectFromClient
public void deselectFromClient(T item)
Description copied from interface:
GridSelectionModel
Handles the deselection of an item that originates from the client.
Specified by:
deselectFromClient
in interfaceGridSelectionModel<T>
Parameters:
item
- the item being deselected
-
addSelectionListener
public Registration addSelectionListener(SelectionListener<Grid<T>,T> listener)
Description copied from interface:
SelectionModel
Adds a generic listener to this selection model, accepting both single and multiselection events.
Specified by:
addSelectionListener
in interfaceSelectionModel<Grid<T>,T>
Parameters:
listener
- the listener to add, notnull
Returns:
a registration handle for removing the listener
-
-