com.vaadin.flow.component.grid.
Class ClientItemToggleEvent<T>
Type Parameters:
T
- the grid bean type
All Implemented Interfaces:
Event fired when the user toggles the selection state of an item on the client-side.
This event follows MultiSelectionEvent
and provides details about the
item that was toggled, its new selection state, and whether the shift key was
pressed during the selection. This can be helpful for implementing features
like range selection.
Author:
Vaadin Ltd
See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionClientItemToggleEvent
(Grid<T> source, T item, boolean isSelected, boolean isShiftKey) Creates a new item toggle event.
-
Method Summary
Modifier and TypeMethodDescriptiongetItem()
Gets the item that was toggled.
boolean
Gets whether the item was selected.
boolean
Gets whether the shift key was pressed when the item was toggled.
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
Methods inherited from class java.util.EventObject
toString
-
Constructor Details
-
ClientItemToggleEvent
Creates a new item toggle event.
Parameters:
source
- the source componentitem
- the item that was toggledisSelected
-true
if the item was selected,false
otherwiseisShiftKey
-true
if the shift key was pressed when the item was toggled
-
-
Method Details
-
getItem
Gets the item that was toggled.
Returns:
the item that was toggled
-
isSelected
public boolean isSelected()Gets whether the item was selected.
Returns:
true
if the item was selected,false
if the item was deselected -
isShiftKey
public boolean isShiftKey()Gets whether the shift key was pressed when the item was toggled.
Returns:
true
if the shift key was pressed,false
otherwise
-