org.apache.wicket.util.listener
Class ListenerSet<T extends IListener>

java.lang.Object
  extended by org.apache.wicket.util.listener.ListenerSet<T>
Type Parameters:
T -
Direct Known Subclasses:
ChangeListenerSet

public abstract class ListenerSet<T extends IListener>
extends java.lang.Object

Holds a set of listeners implementing the IListener tag interface. Subclasses can implement notification methods that cast the listener to the correct subinterface and invoke the appropriate listener method. Note that these classes are not meant to be serializable or for you to hold them in session (see WICKET-2697)

Author:
Jonathan Locke

Constructor Summary
ListenerSet()
           
 
Method Summary
 boolean add(T listener)
          Adds a listener to this set of listeners.
protected abstract  void notifyListener(T listener)
          Notifies a listener.
 void notifyListeners()
          Notifies each listener in this set by calling notifyListener.
 void remove(T listener)
          Removes a listener from this set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListenerSet

public ListenerSet()
Method Detail

add

public boolean add(T listener)
Adds a listener to this set of listeners.

Parameters:
listener - The listener to add
Returns:
true if the set did not already contain the specified listener.

notifyListeners

public void notifyListeners()
Notifies each listener in this set by calling notifyListener.


remove

public void remove(T listener)
Removes a listener from this set.

Parameters:
listener - The listener to remove

notifyListener

protected abstract void notifyListener(T listener)
Notifies a listener.

Parameters:
listener - The listener to notify


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.