2362N/A * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This class provides default implementations for the JFC <code>Action</code> 0N/A * interface. Standard behaviors like the get and set methods for 0N/A * <code>Action</code> object properties (icon, text, and enabled) are defined 0N/A * here. The developer need only subclass this abstract class and 0N/A * define the <code>actionPerformed</code> method. 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * @author Georges Saab 0N/A * Whether or not actions should reconfigure all properties on null. 0N/A * Specifies whether action is enabled; the default is true. 0N/A * Contains the array of key bindings. 0N/A * Whether or not to reconfigure all action properties from the 0N/A "swing.actions.reconfigureOnNull",
"false")));
0N/A * Sets the enabled state of a component from an Action. 0N/A * @param c the Component to set the enabled state on 0N/A * @param a the Action to set the enabled state from, may be null 0N/A * Sets the tooltip text of a component from an Action. 0N/A * @param c the Component to set the tooltip text on 0N/A * @param a the Action to set the tooltip text from, may be null 0N/A * Creates an {@code Action}. 0N/A * Creates an {@code Action} with the specified name. 0N/A * @param name the name ({@code Action.NAME}) for the action; a 0N/A * value of {@code null} is ignored 0N/A * Creates an {@code Action} with the specified name and small icon. 0N/A * @param name the name ({@code Action.NAME}) for the action; a 0N/A * value of {@code null} is ignored 0N/A * @param icon the small icon ({@code Action.SMALL_ICON}) for the action; a 0N/A * value of {@code null} is ignored 0N/A * Gets the <code>Object</code> associated with the specified key. 0N/A * @param key a string containing the specified <code>key</code> 0N/A * @return the binding <code>Object</code> stored with this key; if there 0N/A * are no keys, it will return <code>null</code> 0N/A * @see Action#getValue 0N/A * Sets the <code>Value</code> associated with the specified key. 0N/A * @param key the <code>String</code> that identifies the stored object 0N/A * @param newValue the <code>Object</code> to store using this key 0N/A * @see Action#putValue 0N/A // Treat putValue("enabled") the same way as a call to setEnabled. 0N/A // If we don't do this it means the two may get out of sync, and a 0N/A // bogus property change notification would be sent. 0N/A // To avoid dependencies between putValue & setEnabled this 0N/A // directly changes enabled. If we instead called setEnabled 0N/A // to change enabled, it would be possible for stack 0N/A // overflow in the case where a developer implemented setEnabled 0N/A // in terms of putValue. 0N/A // Remove the entry for key if newValue is null 0N/A // else put in the newValue for key. 0N/A * Returns true if the action is enabled. 0N/A * @return true if the action is enabled, false otherwise 0N/A * @see Action#isEnabled 0N/A * Sets whether the {@code Action} is enabled. The default is {@code true}. 0N/A * @param newValue {@code true} to enable the action, {@code false} to 0N/A * @see Action#setEnabled 0N/A * Returns an array of <code>Object</code>s which are keys for 0N/A * which values have been set for this <code>AbstractAction</code>, 0N/A * or <code>null</code> if no keys have values set. 0N/A * @return an array of key objects, or <code>null</code> if no 0N/A * keys have values set 0N/A * If any <code>PropertyChangeListeners</code> have been registered, the 0N/A * <code>changeSupport</code> field describes them. 0N/A * Supports reporting bound property changes. This method can be called 0N/A * when a bound property has changed and it will send the appropriate 0N/A * <code>PropertyChangeEvent</code> to any registered 0N/A * <code>PropertyChangeListeners</code>. 0N/A * Adds a <code>PropertyChangeListener</code> to the listener list. 0N/A * The listener is registered for all properties. 0N/A * A <code>PropertyChangeEvent</code> will get fired in response to setting 0N/A * a bound property, e.g. <code>setFont</code>, <code>setBackground</code>, 0N/A * or <code>setForeground</code>. 0N/A * Note that if the current component is inheriting its foreground, 0N/A * background, or font from its container, then no event will be 0N/A * fired in response to a change in the inherited property. 0N/A * @param listener The <code>PropertyChangeListener</code> to be added 0N/A * @see Action#addPropertyChangeListener 0N/A * Removes a <code>PropertyChangeListener</code> from the listener list. 0N/A * This removes a <code>PropertyChangeListener</code> that was registered 0N/A * for all properties. 0N/A * @param listener the <code>PropertyChangeListener</code> to be removed 0N/A * @see Action#removePropertyChangeListener 0N/A * Returns an array of all the <code>PropertyChangeListener</code>s added 0N/A * to this AbstractAction with addPropertyChangeListener(). 0N/A * @return all of the <code>PropertyChangeListener</code>s added or an empty 0N/A * array if no listeners have been added 0N/A * Clones the abstract action. This gives the clone 0N/A * which is not handled for you by <code>Object.clone()</code>. 0N/A synchronized(
this) {
0N/A // Store the default fields