/[classpath]/classpath/javax/swing/AbstractAction.java
ViewVC logotype

Diff of /classpath/javax/swing/AbstractAction.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by mark, Sat Jul 2 20:32:46 2005 UTC revision 1.15 by trebligd, Tue Jul 5 14:57:21 2005 UTC
# Line 48  import java.util.HashMap; Line 48  import java.util.HashMap;
48  import javax.swing.event.SwingPropertyChangeSupport;  import javax.swing.event.SwingPropertyChangeSupport;
49    
50  /**  /**
51   * AbstractAction   * A base class for implementing the {@link Action} interface.
52     *
53   * @author      Andrew Selkirk   * @author      Andrew Selkirk
54   * @version     1.0   * @version     1.0
55   */   */
# Line 58  public abstract class AbstractAction Line 59  public abstract class AbstractAction
59    private static final long serialVersionUID = -6803159439231523484L;    private static final long serialVersionUID = -6803159439231523484L;
60    
61    /**    /**
62     * enabled     * A flag that indicates whether or not the action is enabled.
63     */     */
64    protected boolean enabled = true;    protected boolean enabled = true;
65        
66    /**    /**
67     * changeSupport     * Provides support for property change event notification.
68     */     */
69    protected SwingPropertyChangeSupport changeSupport =    protected SwingPropertyChangeSupport changeSupport =
70      new SwingPropertyChangeSupport(this);      new SwingPropertyChangeSupport(this);
# Line 74  public abstract class AbstractAction Line 75  public abstract class AbstractAction
75    private transient HashMap store = new HashMap();    private transient HashMap store = new HashMap();
76    
77    /**    /**
78     * Constructor AbstractAction     * Creates a new action with an empty string for the name.  All other
79       * properties are initialised to <code>null</code>
80     */     */
81    public AbstractAction()    public AbstractAction()
82    {    {
# Line 82  public abstract class AbstractAction Line 84  public abstract class AbstractAction
84    }    }
85    
86    /**    /**
87     * Constructor AbstractAction     * Creates a new action with the specified name.  All other properties are
88       * initialised to <code>null</code>.
89     *     *
90     * @param name TODO     * @param name  the name (<code>null</code> permitted).
91     */     */
92    public AbstractAction(String name)    public AbstractAction(String name)
93    {    {
# Line 92  public abstract class AbstractAction Line 95  public abstract class AbstractAction
95    }    }
96    
97    /**    /**
98     * Constructor AbstractAction     * Creates a new action with the specified name and icon.  All other
99       * properties are initialised to <code>null</code>.
100     *     *
101     * @param name TODO     * @param name  the name (<code>null</code> permitted).
102     * @param icon TODO     * @param icon  the icon (<code>null</code> permitted).
103     */     */
104    public AbstractAction(String name, Icon icon)    public AbstractAction(String name, Icon icon)
105    {    {
# Line 144  public abstract class AbstractAction Line 148  public abstract class AbstractAction
148    }    }
149    
150    /**    /**
151     * Returns a value for a given key from the built-in store.     * Returns the value associated with the specified key.
152     *     *
153     * @param key the key to get the value for     * @param key  the key (not <code>null</code>).
154     *     *
155     * @return Object     * @return The value associated with the specified key, or
156       *         <code>null</code> if the key is not found.
157     */     */
158    public Object getValue(String key)    public Object getValue(String key)
159    {    {
# Line 156  public abstract class AbstractAction Line 161  public abstract class AbstractAction
161    }    }
162    
163    /**    /**
164     * Puts a key/value pair into the built-in store.     * Sets the value associated with the specified key and sends a
165     *     * {@link java.beans.PropertyChangeEvent} to all registered listeners.  
166     * @param key the key     * The standard keys are: {@link #NAME}, {@link #SHORT_DESCRIPTION},
167     * @param value the value     * {@link #LONG_DESCRIPTION}, {@link #SMALL_ICON},
168       * {@link #ACTION_COMMAND_KEY}, {@link #ACCELERATOR_KEY} and
169       * {@link #MNEMONIC_KEY}. Any existing value associated with the key will be
170       * overwritten.
171       *
172       * @param key  the key (not <code>null</code>).
173       * @param value  the value (<code>null</code> permitted).
174     */     */
175    public void putValue(String key, Object value)    public void putValue(String key, Object value)
176    {    {
# Line 172  public abstract class AbstractAction Line 183  public abstract class AbstractAction
183    }    }
184    
185    /**    /**
186     * isEnabled     * Returns the flag that indicates whether or not the action is enabled.
187     *     *
188     * @return boolean     * @return The flag.
189     */     */
190    public boolean isEnabled()    public boolean isEnabled()
191    {    {
# Line 182  public abstract class AbstractAction Line 193  public abstract class AbstractAction
193    }    }
194    
195    /**    /**
196     * setEnabled     * Sets the flag that indicates whether or not the action is enabled and, if
197       * the value of the flag changed from the previous setting, sends a
198       * {@link java.beans.PropertyChangeEvent} to all registered listeners.
199     *     *
200     * @param enabled TODO     * @param enabled  the new flag value.
201     */     */
202    public void setEnabled(boolean enabled)    public void setEnabled(boolean enabled)
203    {    {

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26