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.ActionACCELERATOR_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, waitactionPerformedpublic UIAction(String name)
public final String getName()
public void setEnabled(boolean b)
setEnabled in interface Actionpublic 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 Actionpublic void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in interface ActionCopyright © 2017. All rights reserved.