public abstract class

GwtEvent

extends Object
java.lang.Object
   ↳ com.google.gwt.event.shared.GwtEvent<H extends com.google.gwt.event.shared.EventHandler>
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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.

Summary

Nested Classes
class GwtEvent.Type<H> Type class used to register events with the HandlerManager
Protected Constructors
GwtEvent()
Constructor.
Public Methods
abstract Type<H> getAssociatedType()
Returns the type used to register this event.
Object getSource()
Returns the source that last fired this event.
String toDebugString()
This is a method used primarily for debugging.
String toString()
The toString() for abstract event is overridden to avoid accidently including class literals in the the compiled output.
Protected Methods
void assertLive()
Asserts that the event still should be accessed.
abstract void dispatch(H handler)
Should only be called by HandlerManager.
final boolean isLive()
Is the event current live?
void kill()
Kill the event.
void revive()
Revives the event.
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected GwtEvent ()

Constructor.

Public Methods

public abstract 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

public Object getSource ()

Returns the source that last fired this event.

Returns
  • object representing the source of this event

public 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.

public 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.

Protected Methods

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().

protected abstract void dispatch (H handler)

Should only be called by HandlerManager. In other words, do not use or call.

Parameters
handler handler

protected final boolean isLive ()

Is the event current live?

Returns
  • whether the event is live

protected void kill ()

Kill the event. After the event has been killed, users cannot really on its values or functions being available.

protected void revive ()

Revives the event. Used when recycling event instances.