diff options
Diffstat (limited to 'javax/swing/AbstractAction.java')
-rw-r--r-- | javax/swing/AbstractAction.java | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/javax/swing/AbstractAction.java b/javax/swing/AbstractAction.java index c0ddf44ff..da65bdd1d 100644 --- a/javax/swing/AbstractAction.java +++ b/javax/swing/AbstractAction.java @@ -15,8 +15,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and @@ -48,9 +48,9 @@ import java.util.HashMap; import javax.swing.event.SwingPropertyChangeSupport; /** - * AbstractAction - * @author Andrew Selkirk - * @version 1.0 + * A base class for implementing the {@link Action} interface. + * + * @author Andrew Selkirk */ public abstract class AbstractAction implements Action, Cloneable, Serializable @@ -58,12 +58,12 @@ public abstract class AbstractAction private static final long serialVersionUID = -6803159439231523484L; /** - * enabled + * A flag that indicates whether or not the action is enabled. */ protected boolean enabled = true; /** - * changeSupport + * Provides support for property change event notification. */ protected SwingPropertyChangeSupport changeSupport = new SwingPropertyChangeSupport(this); @@ -74,7 +74,8 @@ public abstract class AbstractAction private transient HashMap store = new HashMap(); /** - * Constructor AbstractAction + * Creates a new action with an empty string for the name. All other + * properties are initialised to <code>null</code> */ public AbstractAction() { @@ -82,9 +83,10 @@ public abstract class AbstractAction } /** - * Constructor AbstractAction + * Creates a new action with the specified name. All other properties are + * initialised to <code>null</code>. * - * @param name TODO + * @param name the name (<code>null</code> permitted). */ public AbstractAction(String name) { @@ -92,10 +94,11 @@ public abstract class AbstractAction } /** - * Constructor AbstractAction + * Creates a new action with the specified name and icon. All other + * properties are initialised to <code>null</code>. * - * @param name TODO - * @param icon TODO + * @param name the name (<code>null</code> permitted). + * @param icon the icon (<code>null</code> permitted). */ public AbstractAction(String name, Icon icon) { @@ -144,11 +147,12 @@ public abstract class AbstractAction } /** - * Returns a value for a given key from the built-in store. - * - * @param key the key to get the value for - * - * @return Object + * Returns the value associated with the specified key. + * + * @param key the key (not <code>null</code>). + * + * @return The value associated with the specified key, or + * <code>null</code> if the key is not found. */ public Object getValue(String key) { @@ -156,10 +160,16 @@ public abstract class AbstractAction } /** - * Puts a key/value pair into the built-in store. - * - * @param key the key - * @param value the value + * 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. + * + * @param key the key (not <code>null</code>). + * @param value the value (<code>null</code> permitted). */ public void putValue(String key, Object value) { @@ -172,9 +182,9 @@ public abstract class AbstractAction } /** - * isEnabled + * Returns the flag that indicates whether or not the action is enabled. * - * @return boolean + * @return The flag. */ public boolean isEnabled() { @@ -182,9 +192,11 @@ public abstract class AbstractAction } /** - * setEnabled + * 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. * - * @param enabled TODO + * @param enabled the new flag value. */ public void setEnabled(boolean enabled) { |