/** * Returns an array of the keys defined in this <code>ActionMap</code> and * its parent. This method differs from <code>keys()</code> in that * this method includes the keys defined in the parent. * * @return all keys of this map and all parents. */ public Object[] allKeys() { if (this.parent == null) { return keys(); } final Object[] parentKeys = this.parent.allKeys(); final Object[] key = keys(); final Object[] retval = new Object[parentKeys.length + key.length]; System.arraycopy(key, 0, retval, 0, key.length); System.arraycopy(retval, 0, retval, key.length, retval.length); return retval; }
/** * Returns the binding for <code>key</code>, messaging the * parent <code>ActionMap</code> if the binding is not locally defined. * * @param key the key to be queried. * @return the action for this key, or null if there is no such action. */ public Action get(final Object key) { final Action retval = (Action) this.actionMap.get(key); if (retval != null) { return retval; } if (this.parent != null) { return this.parent.get(key); } return null; }
/** * Adds a binding for <code>key</code> to <code>action</code>. * If <code>action</code> is null, this removes the current binding * for <code>key</code>. * <p>In most instances, <code>key</code> will be * <code>action.getValue(NAME)</code>. * * @param key the key for the action. * @param action the action to be added. */ public void put(final Object key, final Action action) { if (action == null) { remove(key); } else { if (this.actionMap.containsKey(key)) { remove(key); } this.actionMap.put(key, action); this.actionList.add (key); } }
/** * Adds a binding for <code>key</code> to <code>action</code>. * If <code>action</code> is null, this removes the current binding * for <code>key</code>. * <p>In most instances, <code>key</code> will be * <code>action.getValue(NAME)</code>. * * @param key the key for the action. * @param action the action to be added. */ public void put(final Object key, final Action action) { if (action == null) { remove(key); } else { if (this.actionMap.containsKey(key)) { remove(key); } this.actionMap.put(key, action); this.actionList.add (key); } }
/** * Returns an array of the keys defined in this <code>ActionMap</code> and * its parent. This method differs from <code>keys()</code> in that * this method includes the keys defined in the parent. * * @return all keys of this map and all parents. */ public Object[] allKeys() { if (this.parent == null) { return keys(); } final Object[] parentKeys = this.parent.allKeys(); final Object[] key = keys(); final Object[] retval = new Object[parentKeys.length + key.length]; System.arraycopy(key, 0, retval, 0, key.length); System.arraycopy(retval, 0, retval, key.length, retval.length); return retval; }
/** * Returns the binding for <code>key</code>, messaging the * parent <code>ActionMap</code> if the binding is not locally defined. * * @param key the key to be queried. * @return the action for this key, or null if there is no such action. */ public Action get(final Object key) { final Action retval = (Action) this.actionMap.get(key); if (retval != null) { return retval; } if (this.parent != null) { return this.parent.get(key); } return null; }
/** * Adds a binding for <code>key</code> to <code>action</code>. * If <code>action</code> is null, this removes the current binding * for <code>key</code>. * <p>In most instances, <code>key</code> will be * <code>action.getValue(NAME)</code>. * * @param key the key for the action. * @param action the action to be added. */ public void put(final Object key, final Action action) { if (action == null) { remove(key); } else { if (this.actionMap.containsKey(key)) { remove(key); } this.actionMap.put(key, action); this.actionList.add (key); } }
/** * Returns an array of the keys defined in this <code>ActionMap</code> and * its parent. This method differs from <code>keys()</code> in that * this method includes the keys defined in the parent. * * @return all keys of this map and all parents. */ public Object[] allKeys() { if (this.parent == null) { return keys(); } final Object[] parentKeys = this.parent.allKeys(); final Object[] key = keys(); final Object[] retval = new Object[parentKeys.length + key.length]; System.arraycopy(key, 0, retval, 0, key.length); System.arraycopy(retval, 0, retval, key.length, retval.length); return retval; }
/** * Returns the binding for <code>key</code>, messaging the * parent <code>ActionMap</code> if the binding is not locally defined. * * @param key the key to be queried. * @return the action for this key, or null if there is no such action. */ public Action get(final Object key) { final Action retval = (Action) this.actionMap.get(key); if (retval != null) { return retval; } if (this.parent != null) { return this.parent.get(key); } return null; }