Class SelectionEvent<T>


  • public class SelectionEvent<T>
    extends com.google.gwt.event.shared.GwtEvent<SelectionHandler>
    Event object describing a change in Grid row selection state.
    Since:
    7.4
    Author:
    Vaadin Ltd
    • Constructor Detail

      • SelectionEvent

        public SelectionEvent​(Grid<T> grid,
                              T added,
                              T removed,
                              boolean batched)
        Creates an event with a single added or removed row.
        Parameters:
        grid - grid reference, used for getSource
        added - the added row, or null if a row was not added
        removed - the removed row, or null if a row was not removed
        batched - whether or not this selection change event is triggered during a batched selection/deselection action
        See Also:
        SelectionModel.Multi.Batched
      • SelectionEvent

        public SelectionEvent​(Grid<T> grid,
                              Collection<T> added,
                              Collection<T> removed,
                              boolean batched)
        Creates an event where several rows have been added or removed.
        Parameters:
        grid - Grid reference, used for getSource
        added - a collection of added rows, or null if no rows were added
        removed - a collection of removed rows, or null if no rows were removed
        batched - whether or not this selection change event is triggered during a batched selection/deselection action
        See Also:
        SelectionModel.Multi.Batched
    • Method Detail

      • getSource

        public Grid<T> getSource()
        Gets a reference to the Grid object that fired this event.
        Overrides:
        getSource in class com.google.gwt.event.shared.GwtEvent<SelectionHandler>
        Returns:
        a grid reference
      • getAdded

        public Collection<T> getAdded()
        Gets all rows added to the selection since the last SelectionEvent .
        Returns:
        a collection of added rows. Empty collection if no rows were added.
      • getRemoved

        public Collection<T> getRemoved()
        Gets all rows removed from the selection since the last SelectionEvent.
        Returns:
        a collection of removed rows. Empty collection if no rows were removed.
      • getSelected

        public Collection<T> getSelected()
        Gets currently selected rows.
        Returns:
        a non-null collection containing all currently selected rows.
      • getType

        public static com.google.gwt.event.shared.GwtEvent.Type<SelectionHandler> getType()
        Gets a type identifier for this event.
        Returns:
        a GwtEvent.Type identifier.
      • getAssociatedType

        public com.google.gwt.event.shared.GwtEvent.Type<SelectionHandler> getAssociatedType()
        Specified by:
        getAssociatedType in class com.google.gwt.event.shared.GwtEvent<SelectionHandler>
      • isBatchedSelection

        public boolean isBatchedSelection()
        Checks if this selection change event is fired during a batched selection/deselection operation.
        Returns:
        true iff this event is fired during a batched selection/deselection operation