edu.princeton.swing
public abstract class AbstractAction2 extends javax.swing.AbstractAction
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTRA_INFO_KEY
The key used for storing a random object containing extraneous information.
|
static java.lang.String |
LONG_DESCRIPTION_KEY
The key used for storing a longer description for the action, could be used for
context-sensitive help.
|
static java.lang.String |
NAME_KEY
The key used for storing the name for the action, used for a menu or button.
|
static java.lang.String |
SHORT_DESCRIPTION_KEY
The key used for storing a short description for the action, used for tooltip text.
|
static java.lang.String |
SMALL_ICON_KEY
The key used for storing a small icon for the action, used for toolbar buttons.
|
Constructor and Description |
---|
AbstractAction2()
Creates a new AbstractAction2.
|
AbstractAction2(java.lang.String name)
Creates a new AbstractAction2.
|
AbstractAction2(java.lang.String name,
javax.swing.Icon icon)
Creates a new AbstractAction2.
|
Modifier and Type | Method and Description |
---|---|
javax.swing.JMenuItem |
createMenuItem()
Creates a new JMenuItem for this Action.
|
javax.swing.KeyStroke |
getAccelerator()
Gets the accelerator keystroke for this Action.
|
java.lang.String |
getActionCommand()
Gets the action command for this Action.
|
java.lang.Object |
getExtraInfo()
Gets the extra info for this Action.
|
java.lang.String |
getLongDescription()
Gets the long description for this Action.
|
int |
getMnemonic()
Gets the mnemonic key for this Action.
|
java.lang.String |
getName()
Gets the name of this Action.
|
java.lang.String |
getShortDescription()
Gets the short description for this Action.
|
javax.swing.Icon |
getSmallIcon()
Gets the small icon for this Action.
|
void |
setAccelerator(javax.swing.KeyStroke accelerator)
Sets the accelerator keystroke for this Action.
|
void |
setActionCommand(java.lang.String command)
Sets the action command for this Action.
|
void |
setExtraInfo(java.lang.Object extraInfo)
Sets the extra info for this Action.
|
void |
setLongDescription(java.lang.String description)
Sets the long description for this Action.
|
void |
setMnemonic(int mnemonic)
Sets the mnemonic key for this Action.
|
void |
setName(java.lang.String name)
Sets the name of this Action.
|
void |
setShortDescription(java.lang.String description)
Sets the short description for this Action.
|
void |
setSmallIcon(javax.swing.Icon icon)
Sets the small icon for this Action.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public static final java.lang.String NAME_KEY
public static final java.lang.String SMALL_ICON_KEY
public static final java.lang.String SHORT_DESCRIPTION_KEY
public static final java.lang.String LONG_DESCRIPTION_KEY
public static final java.lang.String EXTRA_INFO_KEY
public AbstractAction2()
public AbstractAction2(java.lang.String name)
public AbstractAction2(java.lang.String name, javax.swing.Icon icon)
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name of this Action.public javax.swing.Icon getSmallIcon()
public void setSmallIcon(javax.swing.Icon icon)
icon
- The small icon for this Action.public java.lang.String getShortDescription()
public void setShortDescription(java.lang.String description)
description
- The short description for this Action.public java.lang.String getLongDescription()
public void setLongDescription(java.lang.String description)
description
- The long description for this Action.public int getMnemonic()
public void setMnemonic(int mnemonic)
mnemonic
- The mnemonic for this action (This should be one of the KeyEvent.VK_x
constants).public javax.swing.KeyStroke getAccelerator()
public void setAccelerator(javax.swing.KeyStroke accelerator)
accelerator
- The accelerator for this Action.public java.lang.String getActionCommand()
public void setActionCommand(java.lang.String command)
command
- The action command for this Action.public java.lang.Object getExtraInfo()
public void setExtraInfo(java.lang.Object extraInfo)
extraInfo
- The extra info for this Action.public javax.swing.JMenuItem createMenuItem()