| |
|
| java.lang.Object javax.swing.AbstractAction
All known Subclasses: javax.swing.text.TextAction,
AbstractAction | abstract public class AbstractAction implements Action,Cloneable,Serializable(Code) | | This class provides default implementations for the JFC Action
interface. Standard behaviors like the get and set methods for
Action object properties (icon, text, and enabled) are defined
here. The developer need only subclass this abstract class and
define the actionPerformed method.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans package.
Please see
java.beans.XMLEncoder .
version: 1.61 05/05/07 author: Georges Saab See Also: Action |
Field Summary | |
protected SwingPropertyChangeSupport | changeSupport If any PropertyChangeListeners have been registered, the
changeSupport field describes them. | protected boolean | enabled Specifies whether action is enabled; the default is true. |
changeSupport | protected SwingPropertyChangeSupport changeSupport(Code) | | If any PropertyChangeListeners have been registered, the
changeSupport field describes them.
|
enabled | protected boolean enabled(Code) | | Specifies whether action is enabled; the default is true.
|
AbstractAction | public AbstractAction()(Code) | | Creates an
Action .
|
AbstractAction | public AbstractAction(String name)(Code) | | Creates an
Action with the specified name.
Parameters: name - the name ( Action.NAME ) for the action; avalue of null is ignored |
AbstractAction | public AbstractAction(String name, Icon icon)(Code) | | Creates an
Action with the specified name and small icon.
Parameters: name - the name ( Action.NAME ) for the action; avalue of null is ignored Parameters: icon - the small icon ( Action.SMALL_ICON ) for the action; avalue of null is ignored |
addPropertyChangeListener | public synchronized void addPropertyChangeListener(PropertyChangeListener listener)(Code) | | Adds a PropertyChangeListener to the listener list.
The listener is registered for all properties.
A PropertyChangeEvent will get fired in response to setting
a bound property, e.g. setFont , setBackground ,
or setForeground .
Note that if the current component is inheriting its foreground,
background, or font from its container, then no event will be
fired in response to a change in the inherited property.
Parameters: listener - The PropertyChangeListener to be added See Also: Action.addPropertyChangeListener See Also: |
clone | protected Object clone() throws CloneNotSupportedException(Code) | | Clones the abstract action. This gives the clone
its own copy of the key/value list,
which is not handled for you by Object.clone() .
|
firePropertyChange | protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)(Code) | | Supports reporting bound property changes. This method can be called
when a bound property has changed and it will send the appropriate
PropertyChangeEvent to any registered
PropertyChangeListeners .
|
getKeys | public Object[] getKeys()(Code) | | Returns an array of Object s which are keys for
which values have been set for this AbstractAction ,
or null if no keys have values set.
an array of key objects, or null if nokeys have values set since: 1.3 |
getPropertyChangeListeners | public synchronized PropertyChangeListener[] getPropertyChangeListeners()(Code) | | Returns an array of all the PropertyChangeListener s added
to this AbstractAction with addPropertyChangeListener().
all of the PropertyChangeListener s added or an emptyarray if no listeners have been added since: 1.4 |
getValue | public Object getValue(String key)(Code) | | Gets the Object associated with the specified key.
Parameters: key - a string containing the specified key the binding Object stored with this key; if thereare no keys, it will return null See Also: Action.getValue |
isEnabled | public boolean isEnabled()(Code) | | Returns true if the action is enabled.
true if the action is enabled, false otherwise See Also: Action.isEnabled |
putValue | public void putValue(String key, Object newValue)(Code) | | Sets the Value associated with the specified key.
Parameters: key - the String that identifies the stored object Parameters: newValue - the Object to store using this key See Also: Action.putValue See Also: |
removePropertyChangeListener | public synchronized void removePropertyChangeListener(PropertyChangeListener listener)(Code) | | Removes a PropertyChangeListener from the listener list.
This removes a PropertyChangeListener that was registered
for all properties.
Parameters: listener - the PropertyChangeListener to be removed See Also: Action.removePropertyChangeListener See Also: |
setEnabled | public void setEnabled(boolean newValue)(Code) | | Sets whether the
Action is enabled. The default is
true .
Parameters: newValue - true to enable the action, false todisable it See Also: Action.setEnabled |
setEnabledFromAction | static void setEnabledFromAction(JComponent c, Action a)(Code) | | Sets the enabled state of a component from an Action.
Parameters: c - the Component to set the enabled state on Parameters: a - the Action to set the enabled state from, may be null |
setToolTipTextFromAction | static void setToolTipTextFromAction(JComponent c, Action a)(Code) | | Sets the tooltip text of a component from an Action.
Parameters: c - the Component to set the tooltip text on Parameters: a - the Action to set the tooltip text from, may be null |
shouldReconfigure | static boolean shouldReconfigure(PropertyChangeEvent e)(Code) | | Whether or not to reconfigure all action properties from the
specified event.
|
|
|
|