|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
edu.princeton.swing.AbstractAction2
public abstract class AbstractAction2
AbstractAction2 extends action to provide convenient get/set methods as well as a method to create a JMenuItem from this action.
Field Summary | |
---|---|
static String |
EXTRA_INFO_KEY
The key used for storing a random object containing extraneous information. |
static String |
LONG_DESCRIPTION_KEY
The key used for storing a longer description for the action, could be used for context-sensitive help. |
static String |
NAME_KEY
The key used for storing the name for the action, used for a menu or button. |
static String |
SHORT_DESCRIPTION_KEY
The key used for storing a short description for the action, used for tooltip text. |
static String |
SMALL_ICON_KEY
The key used for storing a small icon for the action, used for toolbar buttons. |
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 | |
---|---|
AbstractAction2()
Creates a new AbstractAction2. |
|
AbstractAction2(String name)
Creates a new AbstractAction2. |
|
AbstractAction2(String name,
Icon icon)
Creates a new AbstractAction2. |
Method Summary | |
---|---|
JMenuItem |
createMenuItem()
Creates a new JMenuItem for this Action. |
KeyStroke |
getAccelerator()
Gets the accelerator keystroke for this Action. |
String |
getActionCommand()
Gets the action command for this Action. |
Object |
getExtraInfo()
Gets the extra info for this Action. |
String |
getLongDescription()
Gets the long description for this Action. |
int |
getMnemonic()
Gets the mnemonic key for this Action. |
String |
getName()
Gets the name of this Action. |
String |
getShortDescription()
Gets the short description for this Action. |
Icon |
getSmallIcon()
Gets the small icon for this Action. |
void |
setAccelerator(KeyStroke accelerator)
Sets the accelerator keystroke for this Action. |
void |
setActionCommand(String command)
Sets the action command for this Action. |
void |
setExtraInfo(Object extraInfo)
Sets the extra info for this Action. |
void |
setLongDescription(String description)
Sets the long description for this Action. |
void |
setMnemonic(int mnemonic)
Sets the mnemonic key for this Action. |
void |
setName(String name)
Sets the name of this Action. |
void |
setShortDescription(String description)
Sets the short description for this Action. |
void |
setSmallIcon(Icon icon)
Sets the small icon 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 |
Field Detail |
---|
public static final String NAME_KEY
public static final String SMALL_ICON_KEY
public static final String SHORT_DESCRIPTION_KEY
public static final String LONG_DESCRIPTION_KEY
public static final String EXTRA_INFO_KEY
Constructor Detail |
---|
public AbstractAction2()
public AbstractAction2(String name)
public AbstractAction2(String name, Icon icon)
Method Detail |
---|
public String getName()
public void setName(String name)
name
- The name of this Action.public Icon getSmallIcon()
public void setSmallIcon(Icon icon)
icon
- The small icon for this Action.public String getShortDescription()
public void setShortDescription(String description)
description
- The short description for this Action.public String getLongDescription()
public void setLongDescription(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 KeyStroke getAccelerator()
public void setAccelerator(KeyStroke accelerator)
accelerator
- The accelerator for this Action.public String getActionCommand()
public void setActionCommand(String command)
command
- The action command for this Action.public Object getExtraInfo()
public void setExtraInfo(Object extraInfo)
extraInfo
- The extra info for this Action.public JMenuItem createMenuItem()
A
- JMenuItem whose action is this action.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |