com.vaadin.flow.data.selection.
Interface SelectionModel.Multi<C extends Component,T>
-
Type Parameters:
T
- the type of the items to selectC
- the component typeAll Superinterfaces:
SelectionModel<C,T>, Serializable
All Known Subinterfaces:
All Known Implementing Classes:
Enclosing interface:
SelectionModel<C extends Component,T>
public static interface SelectionModel.Multi<C extends Component,T> extends SelectionModel<C,T>
A selection model in which multiple items can be selected at the same time. Selecting an item adds it to the selection.
-
-
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>
-
-
Method Summary
All Methods 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.
-
Methods inherited from interface com.vaadin.flow.data.selection.SelectionModel
addSelectionListener, deselectAll, getSelectedItems, isSelected
-
-
-
-
Method Detail
-
select
default void select(T item)
Adds the given item to the set of currently selected items.
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.
Specified by:
select
in interfaceSelectionModel<C extends Component,T>
Parameters:
item
- the item to add to selection, notnull
-
selectItems
default void selectItems(T... items)
Adds the given items to the set of currently selected 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.Parameters:
items
- to add to selection, notnull
-
deselect
default 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<C extends Component,T>
Parameters:
item
- the item to deselect, not null
-
deselectItems
default void deselectItems(T... items)
Removes the given items from the set of currently selected 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.Parameters:
items
- to remove from selection, notnull
-
updateSelection
void updateSelection(Set<T> addedItems, Set<T> removedItems)
Updates the selection by adding and removing the given items from it.
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.
Parameters:
addedItems
- the items to add, notnull
removedItems
- the items to remove, notnull
-
getFirstSelectedItem
default 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<C extends Component,T>
Returns:
the first selected item.
-
selectAll
void selectAll()
Selects all available the items.
-
-