< prev index next >
src/java.desktop/share/classes/javax/swing/AbstractAction.java
Print this page
@@ -36,23 +36,23 @@
import java.security.AccessController;
import javax.swing.event.SwingPropertyChangeSupport;
import sun.security.action.GetPropertyAction;
/**
- * This class provides default implementations for the JFC <code>Action</code>
+ * This class provides default implementations for the JFC {@code Action}
* interface. Standard behaviors like the get and set methods for
- * <code>Action</code> object properties (icon, text, and enabled) are defined
+ * {@code Action} object properties (icon, text, and enabled) are defined
* here. The developer need only subclass this abstract class and
- * define the <code>actionPerformed</code> method.
+ * define the {@code actionPerformed} method.
* <p>
* <strong>Warning:</strong>
* 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 JavaBeans™
- * has been added to the <code>java.beans</code> package.
+ * has been added to the {@code java.beans} package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author Georges Saab
* @see Action
* @since 1.2
@@ -153,15 +153,15 @@
this(name);
putValue(Action.SMALL_ICON, icon);
}
/**
- * Gets the <code>Object</code> associated with the specified key.
+ * Gets the {@code Object} associated with the specified key.
*
- * @param key a string containing the specified <code>key</code>
- * @return the binding <code>Object</code> stored with this key; if there
- * are no keys, it will return <code>null</code>
+ * @param key a string containing the specified {@code key}
+ * @return the binding {@code Object} stored with this key; if there
+ * are no keys, it will return {@code null}
* @see Action#getValue
*/
public Object getValue(String key) {
if (key == "enabled") {
return enabled;
@@ -171,14 +171,14 @@
}
return arrayTable.get(key);
}
/**
- * Sets the <code>Value</code> associated with the specified key.
+ * Sets the {@code Value} associated with the specified key.
*
- * @param key the <code>String</code> that identifies the stored object
- * @param newValue the <code>Object</code> to store using this key
+ * @param key the {@code String} that identifies the stored object
+ * @param newValue the {@code Object} to store using this key
* @see Action#putValue
*/
public void putValue(String key, Object newValue) {
Object oldValue = null;
if (key == "enabled") {
@@ -240,14 +240,14 @@
}
}
/**
- * Returns an array of <code>Object</code>s which are keys for
- * which values have been set for this <code>AbstractAction</code>,
- * or <code>null</code> if no keys have values set.
- * @return an array of key objects, or <code>null</code> if no
+ * Returns an array of {@code Object}s which are keys for
+ * which values have been set for this {@code AbstractAction},
+ * or {@code null} if no keys have values set.
+ * @return an array of key objects, or {@code null} if no
* keys have values set
* @since 1.3
*/
public Object[] getKeys() {
if (arrayTable == null) {
@@ -257,20 +257,20 @@
arrayTable.getKeys(keys);
return keys;
}
/**
- * If any <code>PropertyChangeListeners</code> have been registered, the
- * <code>changeSupport</code> field describes them.
+ * If any {@code PropertyChangeListeners} have been registered, the
+ * {@code changeSupport} field describes them.
*/
protected SwingPropertyChangeSupport changeSupport;
/**
* Supports reporting bound property changes. This method can be called
* when a bound property has changed and it will send the appropriate
- * <code>PropertyChangeEvent</code> to any registered
- * <code>PropertyChangeListeners</code>.
+ * {@code PropertyChangeEvent} to any registered
+ * {@code PropertyChangeListeners}.
*
* @param propertyName the name of the property that has changed
* @param oldValue the old value of the property
* @param newValue the new value of the property
*/
@@ -282,21 +282,21 @@
changeSupport.firePropertyChange(propertyName, oldValue, newValue);
}
/**
- * Adds a <code>PropertyChangeListener</code> to the listener list.
+ * Adds a {@code PropertyChangeListener} to the listener list.
* The listener is registered for all properties.
* <p>
- * A <code>PropertyChangeEvent</code> will get fired in response to setting
- * a bound property, e.g. <code>setFont</code>, <code>setBackground</code>,
- * or <code>setForeground</code>.
+ * A {@code PropertyChangeEvent} will get fired in response to setting
+ * a bound property, e.g. {@code setFont}, {@code setBackground},
+ * or {@code 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.
*
- * @param listener The <code>PropertyChangeListener</code> to be added
+ * @param listener The {@code PropertyChangeListener} to be added
*
* @see Action#addPropertyChangeListener
*/
public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
if (changeSupport == null) {
@@ -305,15 +305,15 @@
changeSupport.addPropertyChangeListener(listener);
}
/**
- * Removes a <code>PropertyChangeListener</code> from the listener list.
- * This removes a <code>PropertyChangeListener</code> that was registered
+ * Removes a {@code PropertyChangeListener} from the listener list.
+ * This removes a {@code PropertyChangeListener} that was registered
* for all properties.
*
- * @param listener the <code>PropertyChangeListener</code> to be removed
+ * @param listener the {@code PropertyChangeListener} to be removed
*
* @see Action#removePropertyChangeListener
*/
public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
if (changeSupport == null) {
@@ -322,14 +322,14 @@
changeSupport.removePropertyChangeListener(listener);
}
/**
- * Returns an array of all the <code>PropertyChangeListener</code>s added
+ * Returns an array of all the {@code PropertyChangeListener}s added
* to this AbstractAction with addPropertyChangeListener().
*
- * @return all of the <code>PropertyChangeListener</code>s added or an empty
+ * @return all of the {@code PropertyChangeListener}s added or an empty
* array if no listeners have been added
* @since 1.4
*/
public synchronized PropertyChangeListener[] getPropertyChangeListeners() {
if (changeSupport == null) {
@@ -340,11 +340,11 @@
/**
* Clones the abstract action. This gives the clone
* its own copy of the key/value list,
- * which is not handled for you by <code>Object.clone()</code>.
+ * which is not handled for you by {@code Object.clone()}.
**/
protected Object clone() throws CloneNotSupportedException {
AbstractAction newAction = (AbstractAction)super.clone();
synchronized(this) {
< prev index next >