public final class ChangeSupport extends Object
PropertyChangeSupport
for
ChangeListener
s. This class is not serializable.Constructor and Description |
---|
ChangeSupport(Object source)
Creates a new
ChangeSupport |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener listener)
Adds a
ChangeListener to the listener list. |
void |
fireChange()
Fires a change event to all registered listeners.
|
boolean |
hasListeners()
Checks if there are any listeners registered to this
ChangeSupport . |
void |
removeChangeListener(ChangeListener listener)
Removes a
ChangeListener from the listener list. |
public ChangeSupport(Object source)
ChangeSupport
source
- the instance to be given as the source for events.public void addChangeListener(ChangeListener listener)
ChangeListener
to the listener list. The same
listener object may be added more than once, and will be called
as many times as it is added. If listener
is null,
no exception is thrown and no action is taken.listener
- the ChangeListener
to be added.public void removeChangeListener(ChangeListener listener)
ChangeListener
from the listener list.
If listener
was added more than once,
it will be notified one less time after being removed.
If listener
is null, or was never added, no exception is
thrown and no action is taken.listener
- the ChangeListener
to be removed.public void fireChange()
public boolean hasListeners()
ChangeSupport
.