DispatchableInterface
| Kind of class: | interface |
|---|---|
| Inherits from: | CoreInterface |
| Implemented by: | |
| Version: | 02/06/07 |
| Author: | Aaron Clinger |
| Classpath: | org.casalib.event.DispatchableInterface |
| File last modified: | Monday, 01 December 2008, 13:34:40 |
Event interface which all objects that use EventDispatcher should adhere to.
Summary
Instance methods
- dispatchEvent (eventName:String) : Boolean
- Reports event to all subscribed objects.
- addEventObserver (scope:Object, eventName:String, eventHandler:String) : Boolean
- Registers a function to receive notification when a event handler is invoked.
- removeEventObserver (scope:Object, eventName:String, eventHandler:String) : Boolean
- Removes specific observer for event.
- removeEventObserversForEvent (eventName:String) : Boolean
- Removes all observers for a specified event.
- removeEventObserversForScope (scope:Object) : Boolean
- Removes all observers in a specified scope.
- removeAllEventObservers : Boolean
- Removes all observers regardless of scope or event.
Instance methods inherited from CoreInterface
Instance methods
addEventObserver
function addEventObserver (
scope:Object,
eventName:String,
eventHandler:String) : Boolean
Registers a function to receive notification when a event handler is invoked.
Parameters:
scope :
The target or object in which to subscribe.
eventName :
Event name to subscribe to.
eventHandler:
[optional] Name of function to recieve the event. If undefined class assumes
eventHandler matches eventName.Returns:
- Returns
trueif the observer was established successfully; otherwisefalse.
dispatchEvent
function dispatchEvent (
eventName:String) : Boolean
Reports event to all subscribed objects.
Parameters:
eventName:
Event name.
param(s) :
[optional] Parameters passed to the function specified by "eventName". Multiple parameters are allowed and should be separated by commas: param1,param2, ...,paramN
Returns:
- Returns
trueif observer(s) listening to specifed event were found; otherwisefalse.
removeAllEventObservers
function removeAllEventObservers (
) : Boolean
Removes all observers regardless of scope or event.
Returns:
- Returns
trueif observers were successfully removed; otherwisefalse.
removeEventObserver
function removeEventObserver (
scope:Object,
eventName:String,
eventHandler:String) : Boolean
Removes specific observer for event.
Parameters:
scope :
The target or object in which subscribed.
eventName :
Event name to unsubscribe to.
eventHandler:
[optional] Name of function that recieved the event. If undefined class assumes
eventHandler matched eventName.Returns:
- Returns
trueif the observer was successfully found and removed; otherwisefalse.
removeEventObserversForEvent
function removeEventObserversForEvent (
eventName:String) : Boolean
Removes all observers for a specified event.
Parameters:
eventName:
Event name to unsubscribe to.
Returns:
- Returns
trueif observers were successfully found for specifiedeventNameand removed; otherwisefalse.
removeEventObserversForScope
function removeEventObserversForScope (
scope:Object) : Boolean
Removes all observers in a specified scope.
Parameters:
scope:
The target or object in which to unsubscribe.
Returns:
- Returns
trueif observers were successfully found inscopeand removed; otherwisefalse.