public interface Action extends ActionListener
| Modifier and Type | Field and Description |
|---|---|
static String |
ACCELERATOR_KEY
Key used for storing a
KeyStroke for the accelerator for the
action. |
static String |
ACTION_COMMAND_KEY |
static String |
HIDE_TOOLBAR_TEXT
Boolean value to specify if text should be shown when this
action is used to build components for an ActionBar |
static String |
IMAGE_PATH
Key for a
String value to specify the resource name for the
icon |
static String |
LONG_DESCRIPTION
Key for storing a long description for the action.
|
static String |
MNEMONIC_KEY
Key for storing an
Integer object to be used as the mnemonic
for the action. |
static String |
NAME
Key used for storing the action name
|
static String |
SHORT_DESCRIPTION
Key for a short description for the action, used for tooltip text.
|
static String |
SMALL_IMAGE_PATH
Key for a
String value to specify the resource name for the
small icon |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Add a
PropertyChangeListener that will be notified when
either a value changes or the enabled state changes |
String |
getName()
Return the name of the action.
|
Object |
getValue(String key)
Actions can have any number of attributes, each referenced by a key (a
string).
|
boolean |
isEnabled()
Get if the component(s) that were built from this action should be
enabled or not.
|
void |
putValue(String key,
Object value)
Actions can have any number of attributes, each referenced by a key (a
string).
|
void |
removePropertyChangeListener(PropertyChangeListener l)
Remove a
PropertyChangeListener from the list that will be
notified when either a value changes or the enabled state changes |
void |
setEnabled(boolean enabled)
Set if the component(s) that were built from this action should be
enabled or not.
|
actionPerformedstatic final String NAME
static final String SHORT_DESCRIPTION
static final String LONG_DESCRIPTION
static final String ACTION_COMMAND_KEY
static final String ACCELERATOR_KEY
KeyStroke for the accelerator for the
action.static final String MNEMONIC_KEY
Integer object to be used as the mnemonic
for the action.static final String SMALL_IMAGE_PATH
String value to specify the resource name for the
small iconstatic final String IMAGE_PATH
String value to specify the resource name for the
iconstatic final String HIDE_TOOLBAR_TEXT
Boolean value to specify if text should be shown when this
action is used to build components for an ActionBarObject getValue(String key)
null will be returned if no such attribute existskey - keyvoid putValue(String key, Object value)
key - keyvalue - valueString getName()
AppAction.getValue
using a key of AppAction.NAME.boolean isEnabled()
void setEnabled(boolean enabled)
enabled - action enaqbledvoid addPropertyChangeListener(PropertyChangeListener l)
PropertyChangeListener that will be notified when
either a value changes or the enabled state changesl - listener to addvoid removePropertyChangeListener(PropertyChangeListener l)
PropertyChangeListener from the list that will be
notified when either a value changes or the enabled state changesl - listener to removeCopyright © 2021. All rights reserved.