|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
gov.nasa.gsfc.drl.rtstps.library.XAction
public abstract class XAction
This class is an extension to AbstractAction
. It adds some
useful methods that are not in AbstractAction
, and I take
advantage of them when I make toolbars and menus.
AbstractAction
uses the technique of storing attributes
with text keys in a map, which always seemed silly to me when you have
a perfectly good convention of set/get method calls.
Field Summary | |
---|---|
private java.lang.String |
label
|
private static long |
serialVersionUID
|
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 | |
---|---|
protected |
XAction(java.lang.String label)
Define an Action object with the specified label and a default icon. |
protected |
XAction(java.lang.String label,
javax.swing.Icon icon)
Define an Action object with the specified label and icon. |
Method Summary | |
---|---|
abstract void |
actionPerformed(java.awt.event.ActionEvent e)
The action that is performed when the button is pressed or the menu item is selected. |
abstract javax.swing.KeyStroke |
getKeyStroke()
Get a hotkey combination that activates the action. |
abstract char |
getMnemonic()
Get the mnemonic character associated with the action label. |
java.lang.String |
getText()
Get the text associated with this action. |
abstract java.lang.String |
getToolTip()
Get the action's tooltip. |
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 |
Field Detail |
---|
private static final long serialVersionUID
private java.lang.String label
Constructor Detail |
---|
protected XAction(java.lang.String label, javax.swing.Icon icon)
protected XAction(java.lang.String label)
Method Detail |
---|
public final java.lang.String getText()
public abstract char getMnemonic()
public abstract java.lang.String getToolTip()
public abstract javax.swing.KeyStroke getKeyStroke()
public KeyStroke getKeyStroke() { return KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK); }
public abstract void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |