Package com.vaadin.flow.component.grid
Class ClientItemToggleEvent<T>
java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<Grid<T>>
com.vaadin.flow.component.grid.ClientItemToggleEvent<T>
- Type Parameters:
T- the grid bean type
- All Implemented Interfaces:
Serializable
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.booleanGets whether the item was selected.booleanGets whether the shift key was pressed when the item was toggled.Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListenerMethods 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-trueif the item was selected,falseotherwiseisShiftKey-trueif 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:
trueif the item was selected,falseif the item was deselected
-
isShiftKey
public boolean isShiftKey()Gets whether the shift key was pressed when the item was toggled.- Returns:
trueif the shift key was pressed,falseotherwise
-