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

public class ClientItemToggleEvent<T> extends ComponentEvent<Grid<T>>

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:

  • Constructor Details

    • ClientItemToggleEvent

      public ClientItemToggleEvent(Grid<T> source, T item, boolean isSelected, boolean isShiftKey)

      Creates a new item toggle event.

      Parameters:

      source - the source component

      item - the item that was toggled

      isSelected - true if the item was selected, false otherwise

      isShiftKey - true if the shift key was pressed when the item was toggled

  • Method Details

    • getItem

      public T 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