- All Implemented Interfaces:
- java.awt.event.ActionListener, java.util.EventListener
public abstract class SwitchableActionListener
extends java.lang.Object
implements java.awt.event.ActionListener
A custom action listener which can be turned off and on. Essentially, all
that has been added is a boolean variable which is meant to show whether or
not this listener is active (true by default). When supplying the method
actionPerformed(...) the option is then available to use this flag to define
conditions under which the performed action should or should not be executed.
The intention is to allow for an easy way for components to make changes to
other components in the UI without setting off their action listener, thus
starting an infinite loop. In practice it allows for easy differentiating on
the part of the code between user induced actions and model-induced actions.
- Author:
- ztosi