Package ucar.ui.widget
Class BAMutil.ActionToggle
- java.lang.Object
-
- javax.swing.AbstractAction
-
- ucar.ui.widget.BAMutil.ActionToggle
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
- Enclosing class:
- BAMutil
public static class BAMutil.ActionToggle extends AbstractAction
This wraps a regular action and makes it into a "toggle action", and associates it with an AbstractButton. Fetch/set the toggle state on the original action using:Boolean state = (Boolean) act.getValue(BAMutil.STATE); act.putValue(BAMutil.STATE, new Boolean(state));
It will automatically change the button state if the action state changes.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
-
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
-
Constructor Summary
Constructors Constructor Description ActionToggle(Action oa, AbstractButton b)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
ActionToggle
public ActionToggle(Action oa, AbstractButton b)
-
-
Method Detail
-
actionPerformed
public void actionPerformed(ActionEvent e)
-
-