T
- the type of the items to selectC
- the component typepublic static interface SelectionModel.Multi<C extends Component,T> extends SelectionModel<C,T>
SelectionModel.Multi<C extends Component,T>, SelectionModel.Single<C extends Component,T>
Modifier and Type | Method and Description |
---|---|
default void |
deselect(T item)
Deselects the given item.
|
default void |
deselectItems(T... items)
Removes the given items from the set of currently selected items.
|
default Optional<T> |
getFirstSelectedItem()
Get first selected data item.
|
default void |
select(T item)
Adds the given item to the set of currently selected items.
|
void |
selectAll()
Selects all available the items.
|
default void |
selectItems(T... items)
Adds the given items to the set of currently selected items.
|
void |
updateSelection(Set<T> addedItems,
Set<T> removedItems)
Updates the selection by adding and removing the given items from it.
|
addSelectionListener, deselectAll, getSelectedItems, isSelected
default void select(T item)
By default this does not clear any previous selection. To do that,
use SelectionModel.deselectAll()
.
If the item was already selected, this is a NO-OP.
select
in interface SelectionModel<C extends Component,T>
item
- the item to add to selection, not null
default void selectItems(T... items)
By default this does not clear any previous selection. To do that,
use SelectionModel.deselectAll()
.
If the all the items were already selected, this is a NO-OP.
This is a short-hand for updateSelection(Set, Set)
with
nothing to deselect.
items
- to add to selection, not null
default void deselect(T item)
SelectionModel
deselect
in interface SelectionModel<C extends Component,T>
item
- the item to deselect, not nulldefault void deselectItems(T... items)
If the none of the items were selected, this is a NO-OP.
This is a short-hand for updateSelection(Set, Set)
with
nothing to select.
items
- to remove from selection, not null
void updateSelection(Set<T> addedItems, Set<T> removedItems)
If all the added items were already selected and the removed items were not selected, this is a NO-OP.
Duplicate items (in both add & remove sets) are ignored.
addedItems
- the items to add, not null
removedItems
- the items to remove, not null
default 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<C extends Component,T>
void selectAll()
Copyright © 2022. All rights reserved.