class ToggleActionPropertyChangeListener extends Object implements PropertyChangeListener
It guarantees a maximum of 1 instance of ToggleActionPCL to be installed per button (PENDING JW: add test to verify). It removes all ToggleActionPCLs which are targeted to unreachable buttons from the action's listener list.
Modifier and Type | Field and Description |
---|---|
private WeakReference<AbstractButton> |
buttonRef |
Constructor and Description |
---|
ToggleActionPropertyChangeListener(Action action,
AbstractButton button) |
Modifier and Type | Method and Description |
---|---|
protected AbstractButton |
checkReferent(Action action)
Returns the target button to synchronize from the listener.
|
boolean |
isToggling(AbstractButton button)
Check if this is already synchronizing the given AbstractButton.
|
protected boolean |
isToggling(Action action,
AbstractButton button) |
void |
propertyChange(PropertyChangeEvent evt) |
protected void |
releasePCLs(Action action)
Removes all ToggleActionPCLs with unreachable target buttons from the
Action's PCL-listeners.
|
protected boolean |
shouldAddListener(Action action,
AbstractButton button) |
private WeakReference<AbstractButton> buttonRef
public ToggleActionPropertyChangeListener(Action action, AbstractButton button)
protected boolean shouldAddListener(Action action, AbstractButton button)
protected boolean isToggling(Action action, AbstractButton button)
protected void releasePCLs(Action action)
action
- to cleanup.public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
protected AbstractButton checkReferent(Action action)
action
- The action this is listening to.public boolean isToggling(AbstractButton button)
button
- must not be nullNullPointerException
- if the button is null.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses