goog.events.EventHandler<SCOPE>
Provided By | |
---|---|
Extends | |
All Implemented Interfaces |
Super class for objects that want to easily manage a number of event listeners. It allows a short cut to listen and also provides a quick way to remove all events listeners belonging to this object.
new EventHandler<SCOPE>( opt_scope )
Parameters |
|
---|
Instance Methods
this.addOnDisposeCallback<T>( callback, opt_scope ) → void
void
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added. If a callback is added to an already disposed Disposable, it will be called immediately.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
this.dispose() → ?
?
Disposes of the object and its resources.
Overrides | ||
---|---|---|
Specified by | ||
Parameters | None. | |
Returns |
|
this.disposeInternal() → void
void
Disposes of this EventHandler and removes all listeners that it registered.
Overrides | |
---|---|
Parameters | None. |
this.getDisposed() → boolean
boolean
warning Deprecated | Use |
---|
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getListenerCount() → number
number
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.handleEvent( e ) → void
void
Default event handler
Overrides | |||||
---|---|---|---|---|---|
Parameters |
|
this.isDisposed() → boolean
boolean
Overrides | |||
---|---|---|---|
Specified by | |||
Parameters | None. | ||
Returns |
|
this.listen<EVENTOBJ, THIS>( src, type, opt_fn, opt_options ) → THIS
THIS
Listen to an event on a Listenable. If the function is omitted then the EventHandler's handleEvent method will be used.
Overrides | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||
Returns |
|
this.listenOnce<EVENTOBJ, THIS>( src, type, opt_fn, opt_options ) → THIS
THIS
Listen to an event on a Listenable. If the function is omitted, then the EventHandler's handleEvent method will be used. After the event has fired the event listener is removed from the target. If an array of event types is provided, each event type will be listened to once.
Overrides | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||
Returns |
|
this.listenOnceWithScope<T, EVENTOBJ, THIS>( src, type, fn, capture, scope ) → THIS
THIS
Listen to an event on a Listenable. If the function is omitted, then the EventHandler's handleEvent method will be used. After the event has fired the event listener is removed from the target. If an array of event types is provided, each event type will be listened to once.
Overrides | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||||||
Returns |
|
this.listenWithScope<T, EVENTOBJ, THIS>( src, type, fn, options, scope ) → THIS
THIS
Listen to an event on a Listenable. If the function is omitted then the EventHandler's handleEvent method will be used.
Overrides | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||||||
Returns |
|
this.listenWithWrapper<THIS>( src, wrapper, listener, opt_capt ) → THIS
THIS
Adds an event listener with a specific event wrapper on a DOM Node or an
object that has implemented goog.events.EventTarget
. A listener can
only be added once to an object.
Overrides | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||
Returns |
|
this.listenWithWrapperAndScope<T, THIS>( src, wrapper, listener, capture, scope ) → THIS
THIS
Adds an event listener with a specific event wrapper on a DOM Node or an
object that has implemented goog.events.EventTarget
. A listener can
only be added once to an object.
Overrides | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||||||
Returns |
|
this.registerDisposable( disposable ) → void
void
Associates a disposable object with this object so that they will be disposed together.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.removeAll() → void
void
this.unlisten<EVENTOBJ, THIS>( src, type, opt_fn, opt_options, opt_scope ) → THIS
THIS
Unlistens on an event.
Overrides | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||||||
Returns |
|
this.unlistenWithWrapper<THIS>( src, wrapper, listener, opt_capt, opt_scope ) → THIS
THIS
Removes an event listener which was added with listenWithWrapper().
Overrides | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||||||
Returns |
|
Instance Properties
this.creationStack → (string|undefined)
(string|undefined)
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
this.handler_ → (SCOPE|undefined)
(SCOPE|undefined)
No information.