Interface SelectionModel.Multi<C extends Component,T>
- Type Parameters:
C- the component typeT- the type of the items to select
- All Superinterfaces:
SelectionModel<C,,T> Serializable
- All Known Subinterfaces:
GridMultiSelectionModel<T>
- All Known Implementing Classes:
AbstractGridMultiSelectionModel
- Enclosing interface:
SelectionModel<C extends Component,T>
-
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
Modifier and TypeMethodDescriptiondefault voidDeselects the given item.default voiddeselectItems(T... items) Removes the given items from the set of currently selected items.Get first selected data item.default voidAdds the given item to the set of currently selected items.voidSelects all available the items.default voidselectItems(T... items) Adds the given items to the set of currently selected items.voidupdateSelection(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 Details
-
select
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:
selectin interfaceSelectionModel<C extends Component,T> - Parameters:
item- the item to add to selection, notnull
-
selectItems
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
Description copied from interface:SelectionModelDeselects the given item. If the item is not currently selected, does nothing.- Specified by:
deselectin interfaceSelectionModel<C extends Component,T> - Parameters:
item- the item to deselect, not null
-
deselectItems
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
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, notnullremovedItems- the items to remove, notnull
-
getFirstSelectedItem
Description copied from interface:SelectionModelGet 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:
getFirstSelectedItemin interfaceSelectionModel<C extends Component,T> - Returns:
- the first selected item.
-
selectAll
void selectAll()Selects all available the items.
-