org.zaval.util.event
Class ListenerSupport
java.lang.Object
|
+--org.zaval.util.event.ListenerSupport
- Direct Known Subclasses:
- LwActionSupport, LwComponentSupport, LwContainerSupport, LwFocusSupport, LwKeySupport, LwMouseMotionSupport, LwMouseSupport, LwWinSupport, TextListenerSupport
- public abstract class ListenerSupport
- extends java.lang.Object
This abstract, utility class can be inherited with a classes that implement:
-
Supporting list of listeners with a given type. Use
addListener
and removeListener
methods to control the list content.
-
Delivering events with a given type to the listeners. First of all, implement
perform(java.util.EventListener, java.util.EventObject)
method that
determines how the specified event should be delivered to the listener and
after that you can use perform(java.util.EventObject)
to delivery
the specified event to all listeners of the list.
Method Summary |
void |
addListener(java.util.EventListener l)
Adds the specified listener to the listeners list. |
void |
clear()
|
abstract void |
perform(java.util.EventListener l,
java.util.EventObject e)
The method knows how the specified event has to be delivered to an appropriate
method of the specified listener. |
void |
perform(java.util.EventObject e)
Fires the specified event to every member of the listeners list. |
void |
removeListener(java.util.EventListener l)
Removes the specified listener from the listeners list. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ListenerSupport
public ListenerSupport()
addListener
public void addListener(java.util.EventListener l)
- Adds the specified listener to the listeners list.
- Parameters:
l
- the specified listener.
removeListener
public void removeListener(java.util.EventListener l)
- Removes the specified listener from the listeners list.
- Parameters:
l
- the specified listener.
clear
public void clear()
perform
public void perform(java.util.EventObject e)
- Fires the specified event to every member of the listeners list.
The method uses
perform(java.util.EventListener, java.util.EventObject)
method to delivery the event to every listener.
- Parameters:
e
- the specified event.
perform
public abstract void perform(java.util.EventListener l,
java.util.EventObject e)
- The method knows how the specified event has to be delivered to an appropriate
method of the specified listener.
- Parameters:
l
- the specified listener.e
- the specified event.
Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org