|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractAction org.fife.ui.app.StandardAction
public abstract class StandardAction
The action type used by all instances of GUIApplication
. This
is merely an action with many ease-of-use methods.
GUIApplication
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
DEFAULT_ACCELERATOR
A property specific to StandardActions (though other custom actions can certainly use it) that stores the default accelerator for the action. |
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 | |
---|---|
StandardAction(GUIApplication app)
Creates the action. |
|
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 key)
Creates an action, initializing its properties from the parent application's resource bundle. |
|
StandardAction(GUIApplication app,
java.lang.String key,
java.lang.String icon)
Creates an action, initializing its properties from the parent application's resource bundle. |
Method Summary | |
---|---|
javax.swing.KeyStroke |
getAccelerator()
Returns the accelerator for this action. |
GUIApplication |
getApplication()
Returns the application. |
javax.swing.KeyStroke |
getDefaultAccelerator()
Returns the default accelerator for this action. |
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 |
setDefaultAccelerator(javax.swing.KeyStroke accelerator)
Sets the default accelerator for this action. |
void |
setIcon(javax.swing.Icon icon)
Sets the icon of this action. |
void |
setIcon(java.lang.String res)
Sets the icon of this action. |
void |
setIcon(java.net.URL res)
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 |
Field Detail |
---|
public static final java.lang.String DEFAULT_ACCELERATOR
KeyStroke
s should be stored with this key.
Constructor Detail |
---|
public StandardAction(GUIApplication app)
setName(String)
, setIcon(String)
, or whatever other
methods are necessary to set this action up.
app
- The parent application.public StandardAction(GUIApplication app, java.lang.String key)
key + ".Mnemonic"
key + ".Accelerator"
key + ".ShortDesc"
app
- The parent application.key
- The key in the bundle for the name of this action.public StandardAction(GUIApplication app, java.lang.String key, java.lang.String icon)
key + ".Mnemonic"
key + ".Accelerator"
key + ".ShortDesc"
app
- The parent application.key
- The key in the bundle for the name of this action.icon
- The name of the icon resource for this action, or
null
for no icon.public StandardAction(GUIApplication app, java.util.ResourceBundle msg, java.lang.String key)
key + ".Mnemonic"
key + ".Accelerator"
key + ".ShortDesc"
app
- The parent application.msg
- The bundle to localize from. If this is null
,
then app.getResourceBundle()
is used.key
- The key in the bundle for the name of this action.Method Detail |
---|
public javax.swing.KeyStroke getAccelerator()
setAccelerator(KeyStroke)
public GUIApplication getApplication()
public javax.swing.KeyStroke getDefaultAccelerator()
setDefaultAccelerator(KeyStroke)
,
getAccelerator()
,
DEFAULT_ACCELERATOR
public javax.swing.Icon getIcon()
setIcon(Icon)
public int getMnemonic()
-1
if not defined.setMnemonic(int)
public java.lang.String getName()
setName(String)
public java.lang.String getShortDescription()
setShortDescription(String)
public void setAccelerator(javax.swing.KeyStroke accelerator)
accelerator
- The new accelerator, or null
for none.getAccelerator()
,
setDefaultAccelerator(KeyStroke)
public void setDefaultAccelerator(javax.swing.KeyStroke accelerator)
accelerator
- The new default accelerator, which may be
null
.getDefaultAccelerator()
,
setAccelerator(KeyStroke)
,
DEFAULT_ACCELERATOR
public void setIcon(javax.swing.Icon icon)
icon
- The icon.getIcon()
,
setIcon(String)
,
setIcon(URL)
public void setIcon(java.lang.String res)
setIcon(getClass().getResource(res)).
res
- The resource containing the icon.getIcon()
,
setIcon(URL)
,
setIcon(Icon)
public void setIcon(java.net.URL res)
res
- The resource containing the icon.getIcon()
,
setIcon(String)
,
setIcon(Icon)
public void setMnemonic(int mnemonic)
mnemonic
- The new mnemonic. A value of -1
means
"no mnemonic."getMnemonic()
public void setName(java.lang.String name)
name
- The name of this action.getName()
public void setShortDescription(java.lang.String desc)
desc
- The description.getShortDescription()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |