T
- the grid bean typepublic class GridNoneSelectionModel<T> extends Object implements GridSelectionModel<T>
SelectionModel.Multi<C extends Component,T>, SelectionModel.Single<C extends Component,T>
Constructor and Description |
---|
GridNoneSelectionModel() |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isSelected
public Set<T> getSelectedItems()
SelectionModel
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.
getSelectedItems
in interface SelectionModel<Grid<T>,T>
public Optional<T> getFirstSelectedItem()
SelectionModel
This is the same as SelectionModel.Single.getSelectedItem()
in case of single
selection and the first selected item from
SelectionModel.getSelectedItems()
in case of multiselection.
getFirstSelectedItem
in interface SelectionModel<Grid<T>,T>
public void select(T item)
SelectionModel
select
in interface SelectionModel<Grid<T>,T>
item
- the item to select, not nullpublic void deselect(T item)
SelectionModel
deselect
in interface SelectionModel<Grid<T>,T>
item
- the item to deselect, not nullpublic void deselectAll()
SelectionModel
deselectAll
in interface SelectionModel<Grid<T>,T>
public void selectFromClient(T item)
GridSelectionModel
selectFromClient
in interface GridSelectionModel<T>
item
- the item being selectedpublic void deselectFromClient(T item)
GridSelectionModel
deselectFromClient
in interface GridSelectionModel<T>
item
- the item being deselectedpublic Registration addSelectionListener(SelectionListener<Grid<T>,T> listener)
SelectionModel
addSelectionListener
in interface SelectionModel<Grid<T>,T>
listener
- the listener to add, not null
Copyright © 2023. All rights reserved.