Package com.bc.ceres.swing.actions
Class AbstractSystemAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.bc.ceres.swing.actions.AbstractSystemAction
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
- Direct Known Subclasses:
AbstractSelectionAction
,AbstractUndoAction
public abstract class AbstractSystemAction extends AbstractAction
An abstract base class for generic actions which can is executed either whenactionPerformed(java.awt.event.ActionEvent)
is called from a Swing UI, or programmatically by invokingexecute()
.- Since:
- Ceres 0.10
- See Also:
actionPerformed(java.awt.event.ActionEvent)
, 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 Modifier Constructor Description protected
AbstractSystemAction(String name, KeyStroke acceleratorKey, String iconResource)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
Invoked when an action occurs.abstract void
execute()
abstract boolean
isExecutable()
protected ImageIcon
loadIcon(String resource)
void
updateState()
Invoked to update this action's state, usually in reponse to some application specific events.-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Method Detail
-
actionPerformed
public void actionPerformed(ActionEvent e)
Invoked when an action occurs. The method is implemented as follows:if (isExecutable()) { execute(); } updateState();
- Parameters:
e
- The action event.- See Also:
isExecutable()
,execute()
,updateState()
-
isExecutable
public abstract boolean isExecutable()
-
execute
public abstract void execute()
-
updateState
public void updateState()
Invoked to update this action's state, usually in reponse to some application specific events. The method is implemented as follows:boolean executable = isExecutable(); setEnabled(executable);
-
-