|
Griffon 1.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
public interface EventRouter
An event handling helper.
Listeners may be of type
Some examples of eventHandler names are: onStartupStart, onMyCoolEvent. Event names must follow the camelCase naming convention.
Method Summary | |
---|---|
void
|
addEventListener(Object listener)
Adds an event listener. |
void
|
addEventListener(Map listener)
Adds a Map containing event listeners. |
void
|
addEventListener(String eventName, Closure listener)
Adds a Closure as an event listener. |
void
|
addEventListener(String eventName, RunnableWithArgs listener)
Adds a Runnable as an event listener. |
boolean
|
isEnabled()
Returns the current enabled state. |
void
|
publish(String eventName)
Publishes an event with optional arguments. |
void
|
publish(String eventName, List params)
Publishes an event with optional arguments. |
void
|
publishAsync(String eventName)
Publishes an event with optional arguments. |
void
|
publishAsync(String eventName, List params)
Publishes an event with optional arguments. |
void
|
publishOutsideUI(String eventName)
Publishes an event with optional arguments. |
void
|
publishOutsideUI(String eventName, List params)
Publishes an event with optional arguments. |
void
|
removeEventListener(Object listener)
Removes an event listener. |
void
|
removeEventListener(Map listener)
Removes a Map containing event listeners. |
void
|
removeEventListener(String eventName, Closure listener)
Removes a Closure as an event listener. |
void
|
removeEventListener(String eventName, RunnableWithArgs listener)
Removes a Runnable as an event listener. |
void
|
setEnabled(boolean enabled)
Sets the enabled state of this router. |
Method Detail |
---|
public void addEventListener(Object listener)
A listener may be a
Some examples of eventHandler names are: onStartupStart, onMyCoolEvent. Event names must follow the camelCase naming convention.
listener
- an event listener of type Script, Map or Object
public void addEventListener(Map listener)
An event listener may be a
Some examples of eventHandler names are: StartupStart, MyCoolEvent. Event names must follow the camelCase naming convention.
listener
- an event listener of type Script, Map or Object
public void addEventListener(String eventName, Closure listener)
Event names must follow the camelCase naming convention.
eventName
- the name of the eventlistener
- the event listener
public void addEventListener(String eventName, RunnableWithArgs listener)
Event names must follow the camelCase naming convention.
eventName
- the name of the eventlistener
- the event listener
public boolean isEnabled()
public void publish(String eventName)
eventName
- the name of the event
public void publish(String eventName, List params)
eventName
- the name of the eventparams
- the event's arguments
public void publishAsync(String eventName)
eventName
- the name of the event
public void publishAsync(String eventName, List params)
eventName
- the name of the eventparams
- the event's arguments
public void publishOutsideUI(String eventName)
eventName
- the name of the event
public void publishOutsideUI(String eventName, List params)
eventName
- the name of the eventparams
- the event's arguments
public void removeEventListener(Object listener)
A listener may be a
Some examples of eventHandler names are: onStartupStart, onMyCoolEvent. Event names must follow the camelCase naming convention.
listener
- an event listener of type Script, Map or Object
public void removeEventListener(Map listener)
An event listener may be a
Some examples of eventHandler names are: StartupStart, MyCoolEvent. Event names must follow the camelCase naming convention.
listener
- an event listener of type Script, Map or Object
public void removeEventListener(String eventName, Closure listener)
Event names must follow the camelCase naming convention.
eventName
- the name of the eventlistener
- the event listener
public void removeEventListener(String eventName, RunnableWithArgs listener)
Event names must follow the camelCase naming convention.
eventName
- the name of the eventlistener
- the event listener
public void setEnabled(boolean enabled)
enabled
- the value for the enabled state
Groovy Documentation