AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.EventDispatcher Class Reference

Static Public Member Functions

static void registerEventForDelegation (HandlesEventDispatching dispatchDelegate, String componentId, String eventName)
 
static void unregisterEventForDelegation (HandlesEventDispatching dispatchDelegate, String componentId, String eventName)
 
static void unregisterAllEventsForDelegation ()
 
static void removeDispatchDelegate (HandlesEventDispatching dispatchDelegate)
 
static boolean dispatchEvent (Component component, String eventName, Object...args)
 
static String makeFullEventName (String componentId, String eventName)
 

Detailed Description

Dispatches events to component event handlers.

Author
markf.nosp@m.@goo.nosp@m.gle.c.nosp@m.om (Mark Friedman)
lizlo.nosp@m.oney.nosp@m.@goog.nosp@m.le.c.nosp@m.om (Liz Looney)

Definition at line 22 of file EventDispatcher.java.

Member Function Documentation

◆ dispatchEvent()

static boolean com.google.appinventor.components.runtime.EventDispatcher.dispatchEvent ( Component  component,
String  eventName,
Object...  args 
)
static

Dispatches an event based on its name to any registered handlers.

Parameters
componentthe component raising the event
eventNamename of event being raised
argsarguments to the event handler

Definition at line 188 of file EventDispatcher.java.

◆ makeFullEventName()

static String com.google.appinventor.components.runtime.EventDispatcher.makeFullEventName ( String  componentId,
String  eventName 
)
static

Definition at line 236 of file EventDispatcher.java.

◆ registerEventForDelegation()

static void com.google.appinventor.components.runtime.EventDispatcher.registerEventForDelegation ( HandlesEventDispatching  dispatchDelegate,
String  componentId,
String  eventName 
)
static

Registers a dispatchDelegate for handling event dispatching for the event with the specified component id and event name.

Parameters
dispatchDelegateobject responsible for dispatching the event
componentIdid of component associated with event handler
eventNamename of event

Definition at line 109 of file EventDispatcher.java.

◆ removeDispatchDelegate()

static void com.google.appinventor.components.runtime.EventDispatcher.removeDispatchDelegate ( HandlesEventDispatching  dispatchDelegate)
static

Removes event handlers previously registered with the given dispatchDelegate and clears all references to the dispatchDelegate in this class.

Called when a Form's onDestroy method is called.

Definition at line 174 of file EventDispatcher.java.

◆ unregisterAllEventsForDelegation()

static void com.google.appinventor.components.runtime.EventDispatcher.unregisterAllEventsForDelegation ( )
static

Removes all event closures previously registered via EventDispatcher#registerEventForDelegation.

Definition at line 161 of file EventDispatcher.java.

◆ unregisterEventForDelegation()

static void com.google.appinventor.components.runtime.EventDispatcher.unregisterEventForDelegation ( HandlesEventDispatching  dispatchDelegate,
String  componentId,
String  eventName 
)
static

Unregisters a dispatchDelegate for handling event dispatching for the event with the specified component id and event name.

Parameters
dispatchDelegateobject responsible for dispatching the event
componentIdid of component associated with event handler
eventNamename of event

Definition at line 134 of file EventDispatcher.java.


The documentation for this class was generated from the following file: