org.openpermis.editor.policy.gui.event
Class EventSupport<T extends EventListener>

java.lang.Object
  extended by org.openpermis.editor.policy.gui.event.EventSupport<T>
Type Parameters:
T - the type of event listeners supported.

public class EventSupport<T extends EventListener>
extends Object

Support class to manage listeners and fire events.

Since:
0.1.0

Field Summary
private  List<T> listeners
          The listeners of this support class.
 
Constructor Summary
EventSupport()
          Creates a new, empty event support.
 
Method Summary
 void addListener(T listener)
          Adds a listener for events fired by this event support.
 void dispatchEvent(EventDispatcher<T> eventDispatcher)
          Dispatches an event to all registered listeners.
 void removeListener(T listener)
          Removes a listener from this event support.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

private final List<T extends EventListener> listeners
The listeners of this support class.

Since:
0.1.0
Constructor Detail

EventSupport

public EventSupport()
Creates a new, empty event support.

Since:
0.1.0
Method Detail

addListener

public void addListener(T listener)
Adds a listener for events fired by this event support.

The same listener object may be added more than once, and will be called as many times as it is added.

If the listener is null, no action is taken.

Parameters:
listener - the listener to add, may be null.
Since:
0.1.0

removeListener

public void removeListener(T listener)
Removes a listener from this event support.

If the same listener was added more than once, it will be notified one less time after being removed.

If the listener is null, or was never added, no action is taken.

Parameters:
listener - the listener to be removed, may be null.

dispatchEvent

public void dispatchEvent(EventDispatcher<T> eventDispatcher)
Dispatches an event to all registered listeners.

Parameters:
eventDispatcher - the dispatcher to use.
Since:
0.1.0


PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:48
Copyright (c) 2002-2007 Ergon Informatik AG