javax.swing
public abstract class AbstractAction extends Object implements Action, Cloneable, Serializable
Field Summary | |
---|---|
protected SwingPropertyChangeSupport | changeSupport
Provides support for property change event notification. |
protected boolean | enabled
A flag that indicates whether or not the action is enabled. |
Constructor Summary | |
---|---|
AbstractAction()
Creates a new action with no properties set. | |
AbstractAction(String name)
Creates a new action with the specified name. | |
AbstractAction(String name, Icon icon)
Creates a new action with the specified name and icon. |
Method Summary | |
---|---|
void | addPropertyChangeListener(PropertyChangeListener listener)
Registers a listener to receive {@link PropertyChangeEvent} notifications
from this action.
|
protected Object | clone()
Returns a clone of the action.
|
protected void | firePropertyChange(String propertyName, Object oldValue, Object newValue)
Sends a {@link PropertyChangeEvent} for the named property to all
registered listeners.
|
Object[] | getKeys()
Returns an array of the keys for the property values that have been
defined via the {@link #putValue(String, Object)} method (or the class
constructor).
|
PropertyChangeListener[] | getPropertyChangeListeners()
Returns all registered listeners.
|
Object | getValue(String key)
Returns the value associated with the specified key.
|
boolean | isEnabled()
Returns the flag that indicates whether or not the action is enabled.
|
void | putValue(String key, Object value)
Sets the value associated with the specified key and sends a
{@link java.beans.PropertyChangeEvent} to all registered listeners.
|
void | removePropertyChangeListener(PropertyChangeListener listener)
Deregisters a listener so that it no longer receives
{@link PropertyChangeEvent} notifications from this action.
|
void | setEnabled(boolean enabled)
Sets the flag that indicates whether or not the action is enabled and, if
the value of the flag changed from the previous setting, sends a
{@link java.beans.PropertyChangeEvent} to all registered listeners (using
the property name 'enabled').
|
Parameters: name the name (null
permitted).
Parameters: name the name (null
permitted). icon the icon (null
permitted).
Parameters: listener the listener.
See Also: removePropertyChangeListener
Returns: A clone of the action.
Throws: CloneNotSupportedException if there is a problem cloning the action.
Parameters: propertyName the property name. oldValue the old value of the property. newValue the new value of the property.
Returns: An array of keys.
Returns: An array of listeners.
Since: 1.4
Parameters: key the key (not null
).
Returns: The value associated with the specified key, or
null
if the key is not found.
See Also: AbstractAction
Returns: The flag.
See Also: AbstractAction
Parameters: key the key (not null
). value the value (null
permitted).
Parameters: listener the listener.
See Also: addPropertyChangeListener
Parameters: enabled the new flag value.
See Also: isEnabled