|
Griffon 0.9.5-rc2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
public interface EventPublisher
Base contract for classes that can publish events using their own event bus.
Method Summary | |
---|---|
void
|
addEventListener(Object listener)
Adds an event listener. |
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
|
isEventPublishingEnabled()
Returns whether events will be published by the event bus or not. |
void
|
publishEvent(String eventName)
Publishes an event. |
void
|
publishEvent(String eventName, List args)
Publishes an event. |
void
|
publishEventAsync(String eventName)
Publishes an event. |
void
|
publishEventAsync(String eventName, List args)
Publishes an event. |
void
|
publishEventOutside(String eventName)
Publishes an event. |
void
|
publishEventOutside(String eventName, List args)
Publishes an event. |
void
|
publishEventOutsideUI(String eventName)
Publishes an event. |
void
|
publishEventOutsideUI(String eventName, List args)
Publishes an event. |
void
|
removeEventListener(Object listener)
Removes an event listener. |
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
|
setEventPublishingEnabled(boolean enabled)
Sets the enabled state for event publishing. |
Method Detail |
---|
public void addEventListener(Object listener)
Accepted types are: Script, Map and Object.
listener
- an event listener
public void addEventListener(String eventName, Closure listener)
eventName
- the name of the eventlistener
- an event listener
public void addEventListener(String eventName, RunnableWithArgs listener)
eventName
- the name of the eventlistener
- an event listener
public boolean isEventPublishingEnabled()
public void publishEvent(String eventName)
Listeners will be notified in the same thread as the publisher.
eventName
- the name of the event
public void publishEvent(String eventName, List args)
Listeners will be notified in the same thread as the publisher.
eventName
- the name of the eventargs
- event arguments sent to listeners
public void publishEventAsync(String eventName)
Listeners will be notified in a different thread.
eventName
- the name of the event
public void publishEventAsync(String eventName, List args)
Listeners will be notified in a different thread.
eventName
- the name of the eventargs
- event arguments sent to listeners
@Deprecated public void publishEventOutside(String eventName)
Listeners will be notified outside of the UI thread.
eventName
- the name of the event
@Deprecated public void publishEventOutside(String eventName, List args)
Listeners will be notified outside of the UI thread.
eventName
- the name of the eventargs
- event arguments sent to listeners
public void publishEventOutsideUI(String eventName)
Listeners will be notified outside of the UI thread.
eventName
- the name of the event
public void publishEventOutsideUI(String eventName, List args)
Listeners will be notified outside of the UI thread.
eventName
- the name of the eventargs
- event arguments sent to listeners
public void removeEventListener(Object listener)
Accepted types are: Script, Map and Object.
listener
- an event listener
public void removeEventListener(String eventName, Closure listener)
eventName
- the name of the eventlistener
- an event listener
public void removeEventListener(String eventName, RunnableWithArgs listener)
eventName
- the name of the eventlistener
- an event listener
public void setEventPublishingEnabled(boolean enabled)
enabled
- the value fot the enabled state.
Groovy Documentation