summaryrefslogtreecommitdiff
path: root/javax/swing/AbstractAction.java
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2006-03-05 11:38:08 +0000
committerMark Wielaard <mark@klomp.org>2006-03-05 11:38:08 +0000
commit151c7439c5d7ca440f17b408ea9e2b750cd42543 (patch)
treee6eb1ec4bfeaa33e1a3936edd8c9b5d2dd862dfd /javax/swing/AbstractAction.java
parentcb35a91377f1dc2d7b1b5bc4c70ab91cbb36506f (diff)
downloadclasspath-151c7439c5d7ca440f17b408ea9e2b750cd42543.tar.gz
* configure.ac (VERSION): Set to 0.90-pre-generics.
* Merge with CVS trunk from classpath-0_90-branch-point.
Diffstat (limited to 'javax/swing/AbstractAction.java')
-rw-r--r--javax/swing/AbstractAction.java91
1 files changed, 60 insertions, 31 deletions
diff --git a/javax/swing/AbstractAction.java b/javax/swing/AbstractAction.java
index 25db58ed0..4a2334570 100644
--- a/javax/swing/AbstractAction.java
+++ b/javax/swing/AbstractAction.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.swing;
+import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.io.ObjectInputStream;
@@ -82,8 +83,9 @@ public abstract class AbstractAction
}
/**
- * Creates a new action with the specified name. All other properties are
- * initialised to <code>null</code>.
+ * Creates a new action with the specified name. The name is stored as a
+ * property with the key {@link Action#NAME}, and no other properties are
+ * initialised.
*
* @param name the name (<code>null</code> permitted).
*/
@@ -93,8 +95,10 @@ public abstract class AbstractAction
}
/**
- * Creates a new action with the specified name and icon. All other
- * properties are initialised to <code>null</code>.
+ * Creates a new action with the specified name and icon. The name is stored
+ * as a property with the key {@link Action#NAME}, the icon is stored as a
+ * property with the key {@link Action#SMALL_ICON}, and no other properties
+ * are initialised.
*
* @param name the name (<code>null</code> permitted).
* @param icon the icon (<code>null</code> permitted).
@@ -132,11 +136,12 @@ public abstract class AbstractAction
}
/**
- * clone
+ * Returns a clone of the action.
*
- * @return Object
+ * @return A clone of the action.
*
- * @exception CloneNotSupportedException TODO
+ * @exception CloneNotSupportedException if there is a problem cloning the
+ * action.
*/
protected Object clone() throws CloneNotSupportedException
{
@@ -152,6 +157,8 @@ public abstract class AbstractAction
*
* @return The value associated with the specified key, or
* <code>null</code> if the key is not found.
+ *
+ * @see #putValue(String, Object)
*/
public Object getValue(String key)
{
@@ -161,11 +168,17 @@ public abstract class AbstractAction
/**
* Sets the value associated with the specified key and sends a
* {@link java.beans.PropertyChangeEvent} to all registered listeners.
- * The standard keys are: {@link #NAME}, {@link #SHORT_DESCRIPTION},
- * {@link #LONG_DESCRIPTION}, {@link #SMALL_ICON},
- * {@link #ACTION_COMMAND_KEY}, {@link #ACCELERATOR_KEY} and
- * {@link #MNEMONIC_KEY}. Any existing value associated with the key will be
- * overwritten.
+ * The standard keys are:
+ * <ul>
+ * <li>{@link #NAME}</li>
+ * <li>{@link #SHORT_DESCRIPTION}</li>
+ * <li>{@link #LONG_DESCRIPTION}</li>
+ * <li>{@link #SMALL_ICON}</li>
+ * <li>{@link #ACTION_COMMAND_KEY}</li>
+ * <li>{@link #ACCELERATOR_KEY}</li>
+ * <li>{@link #MNEMONIC_KEY}</li>
+ * </ul>
+ * Any existing value associated with the key will be overwritten.
*
* @param key the key (not <code>null</code>).
* @param value the value (<code>null</code> permitted).
@@ -184,6 +197,8 @@ public abstract class AbstractAction
* Returns the flag that indicates whether or not the action is enabled.
*
* @return The flag.
+ *
+ * @see #setEnabled(boolean)
*/
public boolean isEnabled()
{
@@ -193,9 +208,12 @@ public abstract class AbstractAction
/**
* 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.
+ * {@link java.beans.PropertyChangeEvent} to all registered listeners (using
+ * the property name 'enabled').
*
* @param enabled the new flag value.
+ *
+ * @see #isEnabled()
*/
public void setEnabled(boolean enabled)
{
@@ -207,8 +225,11 @@ public abstract class AbstractAction
}
/**
- * getKeys
- * @returns Object[]
+ * 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).
+ *
+ * @return An array of keys.
*/
public Object[] getKeys()
{
@@ -216,12 +237,12 @@ public abstract class AbstractAction
}
/**
- * This method fires a PropertyChangeEvent given the propertyName
- * and the old and new values.
+ * Sends a {@link PropertyChangeEvent} for the named property to all
+ * registered listeners.
*
- * @param propertyName The property that changed.
- * @param oldValue The old value of the property.
- * @param newValue The new value of the property.
+ * @param propertyName the property name.
+ * @param oldValue the old value of the property.
+ * @param newValue the new value of the property.
*/
protected void firePropertyChange(String propertyName, Object oldValue,
Object newValue)
@@ -230,22 +251,27 @@ public abstract class AbstractAction
}
/**
- * This convenience method fires a PropertyChangeEvent given
- * the propertyName and the old and new values.
+ * Sends a {@link PropertyChangeEvent} for the named property to all
+ * registered listeners. This private method is called by the
+ * {@link #setEnabled(boolean)} method.
*
- * @param propertyName The property that changed.
- * @param oldValue The old value of the property.
- * @param newValue The new value of the property.
+ * @param propertyName the property name.
+ * @param oldValue the old value of the property.
+ * @param newValue the new value of the property.
*/
- private void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
+ private void firePropertyChange(String propertyName, boolean oldValue,
+ boolean newValue)
{
changeSupport.firePropertyChange(propertyName, oldValue, newValue);
}
/**
- * addPropertyChangeListener
+ * Registers a listener to receive {@link PropertyChangeEvent} notifications
+ * from this action.
*
- * @param listener the listener to add
+ * @param listener the listener.
+ *
+ * @see #removePropertyChangeListener(PropertyChangeListener)
*/
public void addPropertyChangeListener(PropertyChangeListener listener)
{
@@ -253,9 +279,12 @@ public abstract class AbstractAction
}
/**
- * removePropertyChangeListener
+ * Deregisters a listener so that it no longer receives
+ * {@link PropertyChangeEvent} notifications from this action.
*
- * @param listener the listener to remove
+ * @param listener the listener.
+ *
+ * @see #addPropertyChangeListener(PropertyChangeListener)
*/
public void removePropertyChangeListener(PropertyChangeListener listener)
{
@@ -265,7 +294,7 @@ public abstract class AbstractAction
/**
* Returns all registered listeners.
*
- * @return array of listeners.
+ * @return An array of listeners.
*
* @since 1.4
*/