public class GenericListenerSupport<T> extends Object
GenericListener
interface
which allows to implement a type specific listener support similar to the
PropertyChangeSupport
one for virtually any custom or Java native listener.T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
Constructor and Description |
---|
GenericListenerSupport() |
Modifier and Type | Method and Description |
---|---|
boolean |
addListener(Reference<T> listener) |
boolean |
addListener(T listener) |
Object |
findListener(T listener) |
void |
fireEvent(GenericListener<T> gl,
EventObject event,
Object userObject)
Fire an event.
|
List<T> |
getListeners()
Get the list of all current listeners as direct references.
|
boolean |
pushListener(Reference<T> listener) |
boolean |
pushListener(T listener) |
void |
removeAllListeners() |
Object |
removeListener(T listener)
Remove a listener.
|
public boolean addListener(T listener)
public boolean pushListener(T listener)
public Object removeListener(T listener)
listener
- a listener of the given generic type.addListener(java.lang.Object)
)
or a reference to the argument (when it was added through
addListener(java.lang.ref.Reference)
).public List<T> getListeners()
public void fireEvent(GenericListener<T> gl, EventObject event, Object userObject)
gl
- an object that wishes to fire the event and knows how to do it
for the given listener type.event
- an event to fire.userObject
- a user object to be passed in the event.public void removeAllListeners()