java.lang.Object | |
↳ | com.google.gwt.event.shared.HandlerManager |
Manager responsible for adding handlers to event sources and firing those
handlers on passed in events. Primitive ancestor of EventBus
, and
used at the core of {com.google.gwt.user.client.ui.Widget}.
While widget authors should continue to use
addDomHandler(EventHandler, com.google.gwt.event.dom.client.DomEvent.Type)
and
addHandler(EventHandler, Type)
,
application developers are strongly discouraged from using a HandlerManager
instance as a global event dispatch mechanism.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a handler manager with a source to be set on all events fired via
fireEvent(GwtEvent) . | |||||||||||
Creates a handler manager with the given source, specifying the order in
which handlers are fired.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a handler.
| |||||||||||
Fires the given event to the handlers listening to the event's type.
| |||||||||||
Gets the handler at the given index.
| |||||||||||
Gets the number of handlers listening to the event type.
| |||||||||||
Does this handler manager handle the given event type?
| |||||||||||
Removes the given handler from the specified event type.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface com.google.gwt.event.shared.HasHandlers |
Creates a handler manager with a source to be set on all events fired via
fireEvent(GwtEvent)
. Handlers will be fired in the order that they
are added.
source | the default event source |
---|
Creates a handler manager with the given source, specifying the order in which handlers are fired.
source | the event source |
---|---|
fireInReverseOrder | true to fire handlers in reverse order |
Adds a handler.
type | the event type associated with this handler |
---|---|
handler | the handler |
Fires the given event to the handlers listening to the event's type.
Any exceptions thrown by handlers will be bundled into a
UmbrellaException
and then re-thrown after all handlers have
completed. An exception thrown by a handler will not prevent other handlers
from executing.
Note, any subclass should be very careful about overriding this method, as adds/removes of handlers will not be safe except within this implementation.
event | the event |
---|
Gets the handler at the given index.
type | the handler's event type |
---|---|
index | the index |
Gets the number of handlers listening to the event type.
type | the event type |
---|
Does this handler manager handle the given event type?
e | the event type |
---|
Removes the given handler from the specified event type.
type | the event type |
---|---|
handler | the handler |