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 when actionPerformed(java.awt.event.ActionEvent) is called from a Swing UI, or programmatically by invoking execute().
Since:
Ceres 0.10
See Also:
  • Constructor Details

    • AbstractSystemAction

      protected AbstractSystemAction(String name, KeyStroke acceleratorKey, String iconResource)
  • Method Details

    • 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

      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);
       
    • loadIcon

      protected ImageIcon loadIcon(String resource)