Class DataGrid.SelectionEvent<E>

All Implemented Interfaces:
HasUserOriginated, Serializable
Enclosing interface:
DataGrid<E>

public static class DataGrid.SelectionEvent<E> extends DataGrid.AbstractDataGridEvent implements HasUserOriginated
Event sent when the selection changes. It specifies what in a selection has changed, and where the selection took place.
See Also:
  • Field Details

    • selected

      protected final Set<E> selected
    • oldSelection

      protected final Set<E> oldSelection
    • userOriginated

      protected final boolean userOriginated
  • Constructor Details

    • SelectionEvent

      public SelectionEvent(DataGrid<E> component, Set<E> oldSelection, boolean userOriginated)
      Constructor for a selection event.
      Parameters:
      component - the DataGrid from which this event originates
      oldSelection - the old set of selected items
      userOriginated - true if an event is a result of user interaction, false if from the API call
  • Method Details

    • getAdded

      public Set<E> getAdded()
      A Set of all the items that became selected. Note: this excludes all items that might have been previously selected.
      Returns:
      a set of the items that became selected
    • getRemoved

      public Set<E> getRemoved()
      A Set of all the items that became deselected. Note: this excludes all items that might have been previously deselected.
      Returns:
      a set of the items that became deselected
    • getSelected

      public Set<E> getSelected()
      A Set of all the items that are currently selected.
      Returns:
      a set of the items that are currently selected
    • getOldSelection

      public Set<E> getOldSelection()
      A Set of all the items that were selected before the selection was changed.
      Returns:
      a set of items selected before the selection was changed
    • isUserOriginated

      public boolean isUserOriginated()
      Description copied from interface: HasUserOriginated
      Returns whether this event was triggered by user interaction or programmatically.
      Specified by:
      isUserOriginated in interface HasUserOriginated
      Returns:
      true if this event originates by user interaction, false otherwise.