csheets.ui.ctrl
Class BaseAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by csheets.ui.ctrl.BaseAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
AboutAction, FocusOwnerAction, HelpAction, LicenseAction, NewAction, OpenAction, PreferencesAction, SaveAsAction

public abstract class BaseAction
extends AbstractAction

An base-class for actions.

Author:
Einar Pehrson
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, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
BaseAction()
          Creates a new base action.
 
Method Summary
protected  void defineProperties()
          Defines the action's properties.
protected abstract  String getName()
          Returns the action's name.
protected  boolean requiresFile()
          Returns whether the action requires the active workbook to be stored in a file in order to be enabled.
protected  boolean requiresModification()
          Returns whether the action requires the active workbook to be modified in order to be enabled.
protected  void showErrorDialog(Object message)
          Shows the user an error message.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Constructor Detail

BaseAction

public BaseAction()
Creates a new base action.

Method Detail

getName

protected abstract String getName()
Returns the action's name.

Returns:
the action's name, which is used as short description and action command

defineProperties

protected void defineProperties()
Defines the action's properties.


requiresModification

protected boolean requiresModification()
Returns whether the action requires the active workbook to be modified in order to be enabled. By default, the method returns false.

Returns:
whether the action should be enabled

requiresFile

protected boolean requiresFile()
Returns whether the action requires the active workbook to be stored in a file in order to be enabled. By default, the method returns false.

Returns:
whether the action should be enabled

showErrorDialog

protected void showErrorDialog(Object message)
Shows the user an error message.