org.fife.ui.app
Class StandardAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.fife.ui.app.StandardAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable
Direct Known Subclasses:
CapsLockAction, CheckForUpdatesAction, GoToMemberAction, GUIApplication.AboutAction, GUIApplication.ExitAction, GUIApplication.HelpAction, GUIApplication.ToggleStatusBarAction, GUIApplication.ToggleToolBarAction, NextDocumentAction, RunMacroAction, StopAction, StopAction, ViewTasksAction

public abstract class StandardAction
extends javax.swing.AbstractAction

The action type used by all instances of GUIApplication. This is merely an action with many ease-of-use methods.

Version:
0.6
Author:
Robert Futrell
See Also:
GUIApplication, 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
StandardAction(GUIApplication app, java.util.ResourceBundle msg, java.lang.String key)
          Creates an action, initializing its properties from a resource bundle.
StandardAction(GUIApplication app, java.lang.String name)
          Constructor.
StandardAction(GUIApplication app, java.lang.String name, javax.swing.Icon icon)
          Constructor.
StandardAction(GUIApplication app, java.lang.String name, javax.swing.Icon icon, java.lang.String desc, int mnemonic, javax.swing.KeyStroke accelerator)
          Constructor.
 
Method Summary
 javax.swing.KeyStroke getAccelerator()
          Returns the accelerator for this action.
 GUIApplication getApplication()
          Returns the application.
 javax.swing.Icon getIcon()
          Returns the icon for this action.
 int getMnemonic()
          Returns the mnemonic for this action.
 java.lang.String getName()
          Returns the name of this action.
 java.lang.String getShortDescription()
          Returns the short description for this action.
 void setAccelerator(javax.swing.KeyStroke accelerator)
          Sets the accelerator for this action.
 void setIcon(javax.swing.Icon icon)
          Sets the icon of this action.
 void setMnemonic(int mnemonic)
          Sets the mnemonic for this action.
 void setName(java.lang.String name)
          Sets the name of this action.
 void setShortDescription(java.lang.String desc)
          Sets the short description for this action.
 
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

StandardAction

public StandardAction(GUIApplication app,
                      java.util.ResourceBundle msg,
                      java.lang.String key)
Creates an action, initializing its properties from a resource bundle. The name of the action is found using the specified key. If keys exist with the names key + ".Mnemonic", key + ".Accelerator" or key + ".ShortDesc", then those properties are set as well.

Parameters:
app - The parent application.
msg - The bundle to localize from.
key - The key in the bundle for the name of this action.

StandardAction

public StandardAction(GUIApplication app,
                      java.lang.String name)
Constructor.

Parameters:
app - The parent application.
name - The name of the action.

StandardAction

public StandardAction(GUIApplication app,
                      java.lang.String name,
                      javax.swing.Icon icon)
Constructor.

Parameters:
app - The parent application.
name - The name of the action.
icon - The icon associated with the action.

StandardAction

public StandardAction(GUIApplication app,
                      java.lang.String name,
                      javax.swing.Icon icon,
                      java.lang.String desc,
                      int mnemonic,
                      javax.swing.KeyStroke accelerator)
Constructor.

Parameters:
app - The parent application.
name - The name of the action.
icon - The icon associated with the action.
desc - The description of the action.
mnemonic - The mnemonic for the action.
accelerator - The accelerator key for the action.
Method Detail

getAccelerator

public javax.swing.KeyStroke getAccelerator()
Returns the accelerator for this action.

Returns:
The accelerator.
See Also:
setAccelerator(KeyStroke)

getApplication

public GUIApplication getApplication()
Returns the application.

Returns:
The application.

getIcon

public javax.swing.Icon getIcon()
Returns the icon for this action.

Returns:
The icon.
See Also:
setIcon(Icon)

getMnemonic

public int getMnemonic()
Returns the mnemonic for this action.

Returns:
The mnemonic, or -1 if not defined.
See Also:
setMnemonic(int)

getName

public java.lang.String getName()
Returns the name of this action.

Returns:
The name of this action.
See Also:
setName(String)

getShortDescription

public java.lang.String getShortDescription()
Returns the short description for this action.

Returns:
The description.
See Also:
setShortDescription(String)

setAccelerator

public void setAccelerator(javax.swing.KeyStroke accelerator)
Sets the accelerator for this action.

Parameters:
accelerator - The new accelerator, or null for none.
See Also:
getAccelerator()

setIcon

public void setIcon(javax.swing.Icon icon)
Sets the icon of this action.

Parameters:
icon - The icon.
See Also:
getIcon()

setMnemonic

public void setMnemonic(int mnemonic)
Sets the mnemonic for this action.

Parameters:
mnemonic - The new mnemonic. A value of -1 means "no mnemonic."
See Also:
getMnemonic()

setName

public void setName(java.lang.String name)
Sets the name of this action.

Parameters:
name - The name of this action.
See Also:
getName()

setShortDescription

public void setShortDescription(java.lang.String desc)
Sets the short description for this action.

Parameters:
desc - The description.
See Also:
getShortDescription()