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.
javax.swing.Action
| Modifier and Type | Method and Description |
|---|---|
| public boolean | accept(Object
Widget enabled state is being asked for, may be null. sender)Overrides default javax. Subclasses that need to conditionalize the enabled state should override this. |
| public void | addPropertyChangeListener(PropertyChangeListener listener)
Implements javax. Adds a |
| public final String | |
| public Object | getValue(String key)
Implements javax. Gets one of this object's properties using the associated key. |
| public final boolean | |
| public void | putValue(String key, Object value)
Implements javax. Sets one of this object's properties using the associated key. |
| public void | removePropertyChangeListener(PropertyChangeListener listener)
Implements javax. Removes a |
| public void | setEnabled(boolean b)
Implements javax. Sets the enabled state of the |
| name | back to summary |
|---|---|
| private String name | |
| UIAction | back to summary |
|---|---|
| public UIAction(String name) | |
| accept | back to summary |
|---|---|
| public boolean accept(Object sender) Overrides default javax. Subclasses that need to conditionalize the enabled state should
override this. Be aware that | |
| addPropertyChangeListener | back to summary |
|---|---|
| public void addPropertyChangeListener(PropertyChangeListener listener) Implements javax. Doc from javax. Adds a | |
| getName | back to summary |
|---|---|
| public final String getName() | |
| getValue | back to summary |
|---|---|
| public Object getValue(String key) Implements javax. Doc from javax. Gets one of this object's properties using the associated key. | |
| isEnabled | back to summary |
|---|---|
| public final boolean isEnabled() Implements javax. Cover method for | |
| putValue | back to summary |
|---|---|
| public void putValue(String key, Object value) Implements javax. Doc from javax. Sets one of this object's properties
using the associated key. If the value has
changed, a | |
| removePropertyChangeListener | back to summary |
|---|---|
| public void removePropertyChangeListener(PropertyChangeListener listener) Implements javax. Doc from javax. Removes a | |
| setEnabled | back to summary |
|---|---|
| public void setEnabled(boolean b) Implements javax. Doc from javax. Sets the enabled state of the | |