Package de.intarsys.tools.event
Class EventDispatcher
- java.lang.Object
-
- de.intarsys.tools.event.EventDispatcher
-
- All Implemented Interfaces:
INotificationListener
,INotificationSupport
,java.io.Serializable
,java.util.EventListener
public class EventDispatcher extends java.lang.Object implements INotificationSupport, INotificationListener, java.io.Serializable
Helper object for management and dispatching of events.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EventDispatcher(java.lang.Object pOwner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNotificationListener(EventType type, INotificationListener listener)
Addlistener
to the collection of objects to be informed when the receiver triggers an event of typename
.void
attach(INotificationSupport support)
void
clear()
void
detach(INotificationSupport support)
java.lang.Object
getOwner()
void
handleEvent(Event event)
Called when an event occurs.protected boolean
hasListener(EventType type, INotificationListener listener)
boolean
isEmpty()
void
removeNotificationListener(EventType type, INotificationListener listener)
Removelistener
from the collection of objects to be informed about events of typename
.void
triggerEvent(Event event)
void
triggerEventReverse(Event event)
-
-
-
Method Detail
-
addNotificationListener
public void addNotificationListener(EventType type, INotificationListener listener)
Description copied from interface:INotificationSupport
Addlistener
to the collection of objects to be informed when the receiver triggers an event of typename
.- Specified by:
addNotificationListener
in interfaceINotificationSupport
- Parameters:
type
- The event type we are interested in.listener
- The object to be informed about an event occurrence
-
attach
public void attach(INotificationSupport support)
-
clear
public void clear()
-
detach
public void detach(INotificationSupport support)
-
getOwner
public java.lang.Object getOwner()
-
handleEvent
public void handleEvent(Event event)
Description copied from interface:INotificationListener
Called when an event occurs.- Specified by:
handleEvent
in interfaceINotificationListener
- Parameters:
event
- The event object giving detail information about the context.
-
hasListener
protected boolean hasListener(EventType type, INotificationListener listener)
-
isEmpty
public boolean isEmpty()
-
removeNotificationListener
public void removeNotificationListener(EventType type, INotificationListener listener)
Description copied from interface:INotificationSupport
Removelistener
from the collection of objects to be informed about events of typename
.- Specified by:
removeNotificationListener
in interfaceINotificationSupport
- Parameters:
type
- The event type we are no longer interested in.listener
- The object registered for the event till now.
-
triggerEvent
public void triggerEvent(Event event)
-
triggerEventReverse
public void triggerEventReverse(Event event)
-
-