jdk/src/share/classes/javax/swing/ActionMap.java
changeset 24983 f5a6e2ed8c7d
parent 23010 6dadb192ad81
equal deleted inserted replaced
24982:37fe99dfd9e9 24983:f5a6e2ed8c7d
    92      * Adds a binding for <code>key</code> to <code>action</code>.
    92      * Adds a binding for <code>key</code> to <code>action</code>.
    93      * If <code>action</code> is null, this removes the current binding
    93      * If <code>action</code> is null, this removes the current binding
    94      * for <code>key</code>.
    94      * for <code>key</code>.
    95      * <p>In most instances, <code>key</code> will be
    95      * <p>In most instances, <code>key</code> will be
    96      * <code>action.getValue(NAME)</code>.
    96      * <code>action.getValue(NAME)</code>.
       
    97      *
       
    98      * @param key a key
       
    99      * @param action a binding for {@code key}
    97      */
   100      */
    98     public void put(Object key, Action action) {
   101     public void put(Object key, Action action) {
    99         if (key == null) {
   102         if (key == null) {
   100             return;
   103             return;
   101         }
   104         }
   111     }
   114     }
   112 
   115 
   113     /**
   116     /**
   114      * Returns the binding for <code>key</code>, messaging the
   117      * Returns the binding for <code>key</code>, messaging the
   115      * parent <code>ActionMap</code> if the binding is not locally defined.
   118      * parent <code>ActionMap</code> if the binding is not locally defined.
       
   119      *
       
   120      * @param key a key
       
   121      * @return the binding for {@code key}
   116      */
   122      */
   117     public Action get(Object key) {
   123     public Action get(Object key) {
   118         Action value = (arrayTable == null) ? null :
   124         Action value = (arrayTable == null) ? null :
   119                        (Action)arrayTable.get(key);
   125                        (Action)arrayTable.get(key);
   120 
   126 
   128         return value;
   134         return value;
   129     }
   135     }
   130 
   136 
   131     /**
   137     /**
   132      * Removes the binding for <code>key</code> from this <code>ActionMap</code>.
   138      * Removes the binding for <code>key</code> from this <code>ActionMap</code>.
       
   139      *
       
   140      * @param key a key
   133      */
   141      */
   134     public void remove(Object key) {
   142     public void remove(Object key) {
   135         if (arrayTable != null) {
   143         if (arrayTable != null) {
   136             arrayTable.remove(key);
   144             arrayTable.remove(key);
   137         }
   145         }
   146         }
   154         }
   147     }
   155     }
   148 
   156 
   149     /**
   157     /**
   150      * Returns the <code>Action</code> names that are bound in this <code>ActionMap</code>.
   158      * Returns the <code>Action</code> names that are bound in this <code>ActionMap</code>.
       
   159      *
       
   160      * @return an array of the keys
   151      */
   161      */
   152     public Object[] keys() {
   162     public Object[] keys() {
   153         if (arrayTable == null) {
   163         if (arrayTable == null) {
   154             return null;
   164             return null;
   155         }
   165         }
   170 
   180 
   171     /**
   181     /**
   172      * Returns an array of the keys defined in this <code>ActionMap</code> and
   182      * Returns an array of the keys defined in this <code>ActionMap</code> and
   173      * its parent. This method differs from <code>keys()</code> in that
   183      * its parent. This method differs from <code>keys()</code> in that
   174      * this method includes the keys defined in the parent.
   184      * this method includes the keys defined in the parent.
       
   185      *
       
   186      * @return an array of the keys
   175      */
   187      */
   176     public Object[] allKeys() {
   188     public Object[] allKeys() {
   177         int           count = size();
   189         int           count = size();
   178         ActionMap     parent = getParent();
   190         ActionMap     parent = getParent();
   179 
   191