com.vaadin.client.widget.grid.selection
Class SelectionEvent<T>

java.lang.Object
  extended by com.google.web.bindery.event.shared.Event<H>
      extended by com.google.gwt.event.shared.GwtEvent<SelectionHandler>
          extended by com.vaadin.client.widget.grid.selection.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

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.event.shared.GwtEvent
com.google.gwt.event.shared.GwtEvent.Type<H>
 
Constructor Summary
SelectionEvent(Grid<T> grid, java.util.Collection<T> added, java.util.Collection<T> removed, boolean batched)
          Creates an event where several rows have been added or removed.
SelectionEvent(Grid<T> grid, T added, T removed, boolean batched)
          Creates an event with a single added or removed row.
 
Method Summary
protected  void dispatch(SelectionHandler handler)
           
 java.util.Collection<T> getAdded()
          Gets all rows added to the selection since the last SelectionEvent .
 com.google.gwt.event.shared.GwtEvent.Type<SelectionHandler> getAssociatedType()
           
 java.util.Collection<T> getRemoved()
          Gets all rows removed from the selection since the last SelectionEvent.
 java.util.Collection<T> getSelected()
          Gets currently selected rows.
 Grid<T> getSource()
          Gets a reference to the Grid object that fired this event.
static com.google.gwt.event.shared.GwtEvent.Type<SelectionHandler> getType()
          Gets a type identifier for this event.
 boolean isBatchedSelection()
          Checks if this selection change event is fired during a batched selection/deselection operation.
 
Methods inherited from class com.google.gwt.event.shared.GwtEvent
assertLive, isLive, kill, revive
 
Methods inherited from class com.google.web.bindery.event.shared.Event
setSource, toDebugString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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,
                      java.util.Collection<T> added,
                      java.util.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.

Returns:
a grid reference

getAdded

public java.util.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 java.util.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 java.util.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 Type identifier.

getAssociatedType

public com.google.gwt.event.shared.GwtEvent.Type<SelectionHandler> getAssociatedType()
Overrides:
getAssociatedType in class com.google.gwt.event.shared.GwtEvent<SelectionHandler>

dispatch

protected void dispatch(SelectionHandler handler)
Specified by:
dispatch 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


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.