| java.lang.Object | |
| ↳ | sun.swing.UIAction |
UIAction is the basis of all of basic's action classes that are used in
an ActionMap. Subclasses need to override 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.
Action|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
javax.swing.Action
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Adds a
PropertyChange listener. | |||||||||||
Gets one of this object's properties
using the associated key.
| |||||||||||
Subclasses that need to conditionalize the enabled state should
override this.
| |||||||||||
Cover method for
isEnabled(null). | |||||||||||
Sets one of this object's properties
using the associated key.
| |||||||||||
Removes a
PropertyChange listener. | |||||||||||
Sets the enabled state of the
Action. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.awt.event.ActionListener
| |||||||||||
From interface
javax.swing.Action
| |||||||||||
Adds a PropertyChange listener. Containers and attached
components use these methods to register interest in this
Action object. When its enabled state or other property
changes, the registered listeners are informed of the change.
| listener | a PropertyChangeListener object
|
|---|
Subclasses that need to conditionalize the enabled state should
override this. Be aware that sender may be null.
| sender | Widget enabled state is being asked for, may be null. |
|---|
Cover method for isEnabled(null).
Action is enabled
Sets one of this object's properties
using the associated key. If the value has
changed, a PropertyChangeEvent is sent
to listeners.
| key | a String containing the key |
|---|---|
| value | an Object value
|
Removes a PropertyChange listener.
| listener | a PropertyChangeListener object |
|---|
Sets the enabled state of the Action. When enabled,
any component associated with this object is active and
able to fire this object's actionPerformed method.
If the value has changed, a PropertyChangeEvent is sent
to listeners.
| b | true to enable this Action, false to disable it
|
|---|