Class BeforeSelectionEvent<T>
- java.lang.Object
-
- com.google.web.bindery.event.shared.Event<H>
-
- com.google.gwt.event.shared.GwtEvent<BeforeSelectionHandler<T>>
-
- com.google.gwt.event.logical.shared.BeforeSelectionEvent<T>
-
- Type Parameters:
T- the type about to be selected
public class BeforeSelectionEvent<T> extends GwtEvent<BeforeSelectionHandler<T>>
Represents a before selection event.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gwt.event.shared.GwtEvent
GwtEvent.Type<H>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBeforeSelectionEvent()Creates a new before selection event.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Cancel the before selection event.protected voiddispatch(BeforeSelectionHandler<T> handler)Should only be called byHandlerManager.static <T> BeforeSelectionEvent<T>fire(HasBeforeSelectionHandlers<T> source, T item)Fires a before selection event on all registered handlers in the handler manager.GwtEvent.Type<BeforeSelectionHandler<T>>getAssociatedType()Returns theEvent.Typeused to register this event, allowing anEventBusto find handlers of the appropriate class.TgetItem()Gets the item.static GwtEvent.Type<BeforeSelectionHandler<?>>getType()Gets the type associated with this event.booleanisCanceled()Has the selection event already been canceled?protected voidsetItem(T item)Sets the item.-
Methods inherited from class com.google.gwt.event.shared.GwtEvent
assertLive, getSource, isLive, kill, revive
-
Methods inherited from class com.google.web.bindery.event.shared.Event
setSource, toDebugString, toString
-
-
-
-
Method Detail
-
fire
public static <T> BeforeSelectionEvent<T> fire(HasBeforeSelectionHandlers<T> source, T item)
Fires a before selection event on all registered handlers in the handler manager. If no such handlers exist, this method will do nothing.- Type Parameters:
T- the item type- Parameters:
source- the source of the handlersitem- the item- Returns:
- the event so that the caller can check if it was canceled, or null if no handlers of this event type have been registered
-
getType
public static GwtEvent.Type<BeforeSelectionHandler<?>> getType()
Gets the type associated with this event.- Returns:
- returns the handler type
-
cancel
public void cancel()
Cancel the before selection event. Classes overriding this method should still call super.cancel().
-
getAssociatedType
public final GwtEvent.Type<BeforeSelectionHandler<T>> getAssociatedType()
Description copied from class:EventReturns theEvent.Typeused to register this event, allowing anEventBusto find handlers of the appropriate class.- Specified by:
getAssociatedTypein classGwtEvent<BeforeSelectionHandler<T>>- Returns:
- the type
-
getItem
public T getItem()
Gets the item.- Returns:
- the item
-
isCanceled
public boolean isCanceled()
Has the selection event already been canceled?- Returns:
- is canceled
-
dispatch
protected void dispatch(BeforeSelectionHandler<T> handler)
Description copied from class:GwtEventShould only be called byHandlerManager. In other words, do not use or call.- Specified by:
dispatchin classGwtEvent<BeforeSelectionHandler<T>>- Parameters:
handler- handler- See Also:
EventBus.dispatchEvent(Event, Object)
-
setItem
protected final void setItem(T item)
Sets the item.- Parameters:
item- the item
-
-