GWT 2.0.3

com.google.gwt.event.shared
Class GwtEvent<H extends EventHandler>

java.lang.Object
  extended by com.google.gwt.event.shared.GwtEvent<H>
Type Parameters:
H - handler type
Direct Known Subclasses:
BeforeSelectionEvent, CloseEvent, DomEvent, Event.NativePreviewEvent, FormPanel.SubmitCompleteEvent, FormPanel.SubmitEvent, HighlightEvent, InitializeEvent, OpenEvent, ResizeEvent, SelectionEvent, ShowRangeEvent, ValueChangeEvent, Window.ClosingEvent, Window.ScrollEvent

public abstract class GwtEvent<H extends EventHandler>
extends java.lang.Object

Root of all GWT events. All GWT events are considered dead and should no longer be accessed once the HandlerManager which originally fired the event finishes with it. That is, don't hold on to event objects outside of your handler methods.


Nested Class Summary
static class GwtEvent.Type<H>
          Type class used to register events with the HandlerManager.
 
Constructor Summary
protected GwtEvent()
          Constructor.
 
Method Summary
protected  void assertLive()
          Asserts that the event still should be accessed.
protected abstract  void dispatch(H handler)
          Should only be called by HandlerManager.
abstract  GwtEvent.Type<H> getAssociatedType()
          Returns the type used to register this event.
 java.lang.Object getSource()
          Returns the source that last fired this event.
protected  boolean isLive()
          Is the event current live?
protected  void kill()
          Kill the event.
protected  void revive()
          Revives the event.
 java.lang.String toDebugString()
          This is a method used primarily for debugging.
 java.lang.String toString()
          The toString() for abstract event is overridden to avoid accidently including class literals in the the compiled output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GwtEvent

protected GwtEvent()
Constructor.

Method Detail

getAssociatedType

public abstract GwtEvent.Type<H> getAssociatedType()
Returns the type used to register this event. Used by handler manager to dispatch events to the correct handlers.

Returns:
the type

getSource

public java.lang.Object getSource()
Returns the source that last fired this event.

Returns:
object representing the source of this event

toDebugString

public java.lang.String toDebugString()
This is a method used primarily for debugging. It gives a string representation of the event details. This does not override the toString method because the compiler cannot always optimize toString out correctly. Event types should override as desired.

Returns:
a string representing the event's specifics.

toString

public java.lang.String toString()
The toString() for abstract event is overridden to avoid accidently including class literals in the the compiled output. Use GwtEvent #toDebugString to get more information about the event.

Overrides:
toString in class java.lang.Object

assertLive

protected void assertLive()
Asserts that the event still should be accessed. All events are considered to be "dead" after their original handler manager finishes firing them. An event can be revived by calling revive().


dispatch

protected abstract void dispatch(H handler)
Should only be called by HandlerManager. In other words, do not use or call.

Parameters:
handler - handler

isLive

protected final boolean isLive()
Is the event current live?

Returns:
whether the event is live

kill

protected void kill()
Kill the event. After the event has been killed, users cannot really on its values or functions being available.


revive

protected void revive()
Revives the event. Used when recycling event instances.


GWT 2.0.3