public abstract class AbstractAction extends Object implements Action
Action.ACCELERATOR_KEY, ACTION_COMMAND_KEY, HIDE_TOOLBAR_TEXT, IMAGE_PATH, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_IMAGE_PATH| Constructor and Description |
|---|
AbstractAction(String name)
Construct a new action with a name.
|
| 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)
Get the value for an attribute.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactionPerformedpublic AbstractAction(String name)
name - public boolean isEnabled()
Actionpublic void setEnabled(boolean enabled)
ActionsetEnabled in interface Actionenabled - action enaqbledpublic String getName()
ActionAppAction.getValue
using a key of AppAction.NAME.public void putValue(String key, Object value)
Actionpublic Object getValue(String key)
null will be returned if no
such attribute can be found.public void addPropertyChangeListener(PropertyChangeListener l)
ActionPropertyChangeListener that will be notified when
either a value changes or the enabled state changesaddPropertyChangeListener in interface Actionl - listener to addpublic void removePropertyChangeListener(PropertyChangeListener l)
ActionPropertyChangeListener from the list that will be
notified when either a value changes or the enabled state changesremovePropertyChangeListener in interface Actionl - listener to removeCopyright © 2021. All rights reserved.