public abstract class UIAction extends Object implements Action
actionPerformed
.
A typical subclass will look like:
private static class Actions extends UIAction { Actions(String name) { super(name); } public void actionPerformed(ActionEvent ae) { if (getName() == "selectAll") { selectAll(); } else if (getName() == "cancelEditing") { cancelEditing(); } } }
Subclasses that wish to conditionalize the enabled state should override
isEnabled(Component)
, and be aware that the passed in
Component
may be null.
This is based on sun.swing.UIAction in J2SE 1.5
Action
Modifier and Type | Field and Description |
---|---|
private String |
name |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener) |
String |
getName() |
Object |
getValue(String key) |
boolean |
isEnabled()
Cover method for
isEnabled(null) . |
boolean |
isEnabled(Object sender)
Subclasses that need to conditionalize the enabled state should
override this.
|
void |
putValue(String key,
Object value) |
void |
removePropertyChangeListener(PropertyChangeListener listener) |
void |
setEnabled(boolean b) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
actionPerformed
public void setEnabled(boolean b)
setEnabled
in interface Action
public final boolean isEnabled()
isEnabled(null)
.public boolean isEnabled(Object sender)
sender
may be null.sender
- Widget enabled state is being asked for, may be null.public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface Action
public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface Action
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses