com.vaadin.flow.data.selection.
Interface SelectionEvent<C extends Component,T>
-
Type Parameters:
T
- the data type of the selection modelC
- the component typeAll Superinterfaces:
All Known Implementing Classes:
public interface SelectionEvent<C extends Component,T> extends Serializable
A selection event that unifies the way to access to selection event for multi selection and single selection components (in case when only one selected item is required).
Since:
1.0
Author:
Vaadin Ltd
-
-
Method Summary
All Methods Modifier and Type Method Description Set<T>
getAllSelectedItems()
Gets all the currently selected items.
Optional<T>
getFirstSelectedItem()
Get first selected data item.
C
getSource()
The component on which the Event initially occurred.
boolean
isFromClient()
Checks if this event originated from the client side.
-
-
-
Method Detail
-
getFirstSelectedItem
Optional<T> getFirstSelectedItem()
Get first selected data item.
This is the same as
SingleSelectionEvent.getSelectedItem()
in case of single selection.Returns:
the first selected item.
-
getAllSelectedItems
Set<T> getAllSelectedItems()
Gets all the currently selected items.
This method applies more to multiselection - for single select it returns either an empty set or a set containing the only selected item.
Returns:
return all the selected items, if any, never
null
-
getSource
C getSource()
The component on which the Event initially occurred.
Returns:
The component on which the Event initially occurred.
-
isFromClient
boolean isFromClient()
Checks if this event originated from the client side.
Returns:
true
if the event originated from the client side,false
otherwise
-
-