EventPublisher (Griffon 0.9.5-rc2)
Date: 2012-03-09

Overview | Package | Class | Deprecated | Index | Help
| Griffon 0.9.5-rc2
| FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

## griffon.transform
[Java] Annotation Type EventPublisher

    java.lang.Object
      griffon.transform.EventPublisher

    @Retention(RetentionPolicy.SOURCE)
    @Target(ElementType.TYPE)
    @GroovyASTTransformationClass("org.codehaus.griffon.ast.EventPublisherASTTransformation")
    public @interface EventPublisher

Annotates a class.

When annotating a class it indicates that it will become an event publishing one. The class will have the ability to send arbitrary events to any listeners that may have been registered with it. These events are similar to the ones published by GriffonApplication.

The following methods will be added to classes annotated with @EventPublisher

- `public void addEventListener(java.lang.Object)`
  registers an event listener of type, Map, Script or bean
- `public void addEventListener(java.lang.String, groovy.lang.Closure)`
  registers a Closure as event listener
- `public void addEventListener(java.lang.String, griffon.util.RunnableWithArgs)`
  registers a Runnable as event listener
- `public void removeEventListener(java.lang.Object)`
  unregisters an event listener of type, Map, Script or bean
- `public void removeEventListener(java.lang.String, groovy.lang.Closure)`
  unregisters a Closure as event listener
- `public void removeEventListener(java.lang.String,griffon.util.RunnableWithArgs)`
  unregisters a Runnable as event listener
- `public void publishEvent(java.lang.String)`
  publishes an event in the current thread
- `public void publishEvent(java.lang.String, java.util.List)`
  publishes an event in the current thread
- `public void publishEventOutsideUI(java.lang.String)`
  publishes an event outside of the UI thread
- `public void publishEventOutsideUI(java.lang.String, java.util.List)`
  publishes an event outside of the UI thread
- `public void publishEventAsync(java.lang.String)`
  publishes an event outside of the publisher's thread
- `public void publishEventAsync(java.lang.String, java.util.List)`
  publishes an event outside of the publisher's thread
- `public boolean isEventPublishingEnabled()`
  if events will be published or not
- `public void setEventPublishingEnabled(boolean enabled)`
  if events will be published or not

Authors:
  Andres Almiray

See Also:
  org.codehaus.griffon.ast.EventPublisherASTTransformation

Method Summary

Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Groovy Documentation