public class EventDispatcher
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
dispatchEvent(Component component,
java.lang.String eventName,
java.lang.Object... args)
Dispatches an event based on its name to any registered handlers.
|
static java.lang.String |
makeFullEventName(java.lang.String componentId,
java.lang.String eventName) |
static void |
registerEventForDelegation(HandlesEventDispatching dispatchDelegate,
java.lang.String componentId,
java.lang.String eventName)
Registers a dispatchDelegate for handling event dispatching for the event with the specified
component id and event name.
|
static void |
removeDispatchDelegate(HandlesEventDispatching dispatchDelegate)
Removes event handlers previously registered with the given
dispatchDelegate and clears all references to the dispatchDelegate in
this class.
|
static void |
unregisterAllEventsForDelegation()
Removes all event closures previously registered via
registerEventForDelegation(com.google.appinventor.components.runtime.HandlesEventDispatching, java.lang.String, java.lang.String). |
static void |
unregisterEventForDelegation(HandlesEventDispatching dispatchDelegate,
java.lang.String componentId,
java.lang.String eventName)
Unregisters a dispatchDelegate for handling event dispatching for the event with the specified
component id and event name.
|
public static void registerEventForDelegation(HandlesEventDispatching dispatchDelegate, java.lang.String componentId, java.lang.String eventName)
dispatchDelegate - object responsible for dispatching the eventcomponentId - id of component associated with event handlereventName - name of eventpublic static void unregisterEventForDelegation(HandlesEventDispatching dispatchDelegate, java.lang.String componentId, java.lang.String eventName)
dispatchDelegate - object responsible for dispatching the eventcomponentId - id of component associated with event handlereventName - name of eventpublic static void unregisterAllEventsForDelegation()
registerEventForDelegation(com.google.appinventor.components.runtime.HandlesEventDispatching, java.lang.String, java.lang.String).public static void removeDispatchDelegate(HandlesEventDispatching dispatchDelegate)
public static boolean dispatchEvent(Component component, java.lang.String eventName, java.lang.Object... args)
component - the component raising the eventeventName - name of event being raisedargs - arguments to the event handlerpublic static java.lang.String makeFullEventName(java.lang.String componentId,
java.lang.String eventName)