Class ClientItemToggleEvent<T>

java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<Grid<T>>
io.jmix.groupgridflowui.kit.vaadin.grid.ClientItemToggleEvent<T>
Type Parameters:
T - the grid bean type
All Implemented Interfaces:
Serializable

public class ClientItemToggleEvent<T> extends com.vaadin.flow.component.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.

See Also:
  • Field Summary

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    ClientItemToggleEvent(Grid<T> source, T item, boolean isSelected, boolean isShiftKey)
    Creates a new item toggle event.
  • Method Summary

    Modifier and Type
    Method
    Description
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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