Class zwt.event.EventManager
Extends
zwt.Object.
This is the base class of all event manager. An event manager is used by an object to process events and dispatch them to the appropriate handlers.
Handlers are methods previously registered on the event manager to handle a specific type of event. A typical handler method has two input parameters: the object that triggered the event and the event.
Defined in: EventManager.js.
Constructor Attributes | Constructor Name and Description |
---|---|
zwt.event.EventManager(zwt_Object_object)
Construct an event manager and attach it to the specified object.
|
Method Attributes | Method Name and Description |
---|---|
addHandler(int_eventType, function_handler)
Add the specified handler function to the event manager associated to the specify event type.
|
|
addHandlers(object_handlers)
Add the specified handlers to the event manager.
|
|
onEvent(zwt_event_Event_event, zwt_Object_overrideObject, object_arg)
Dispatch the specified event to the appropriate handlers based on its type.
|
|
removeHandler(int_eventType, function_handler)
Remove the specified handler function from the event manager.
|
|
removeHandlers(object_handlers)
Remove the specified handlers from the event manager.
|
Class Detail
zwt.event.EventManager(zwt_Object_object)
Construct an event manager and attach it to the specified object.
Author: Jeremy KUHN.
Author: Jeremy KUHN.
- Parameters:
- {zwt.Object} zwt_Object_object
- The object to monitor
Method Detail
addHandler(int_eventType, function_handler)
Add the specified handler function to the event manager associated to the specify event type.
- Parameters:
- {Integer} int_eventType
- The event type
- {Function} function_handler
- The handler to add
addHandlers(object_handlers)
Add the specified handlers to the event manager.
- Parameters:
- {Object} object_handlers
- A map containing handler functions to add with event types as property names
onEvent(zwt_event_Event_event, zwt_Object_overrideObject, object_arg)
Dispatch the specified event to the appropriate handlers based on its type.
- Parameters:
- {zwt.event.Event} zwt_event_Event_event
- The event to dispatch
- {zwt.Object} zwt_Object_overrideObject
- If set it overrides the object passed to the handlers which is the object managed by the event manager by default
- {zwt.Object} object_arg
- An optional object to pass to the handler method
removeHandler(int_eventType, function_handler)
Remove the specified handler function from the event manager.
- Parameters:
- {Integer} int_eventType
- The event type
- {Function} function_handler
- The handler to add
removeHandlers(object_handlers)
Remove the specified handlers from the event manager.
- Parameters:
- {Object} object_handlers
- A map containing handler functions to add with event types as property names