/** * Gets the ActionManager instance. If the ActionManager has not been explicitly * set then the default ActionManager instance will be used. * * @return the ActionManager used by the ActionContainerFactory. * @see #setActionManager */ public ActionMap getActionManager() { if (manager == null) { manager = ActionManager.getInstance(); } return manager; }
/** * Return the instance of the ActionManger. If this has not been explicity * set then it will be created. * * @return the ActionManager instance. * @see #setInstance */ public static ActionManager getInstance() { if (INSTANCE == null) { INSTANCE = new ActionManager(); } return INSTANCE; }
/** * Retrieves the action corresponding to an action id. * * @param id value of the action id * @return an Action or null if id */ public Action getAction(Object id) { return get(id); }
/** * Callback for composite actions. This method will redispatch the * ActionEvent to all the actions held in the list. */ public void actionPerformed(ActionEvent evt) { ActionManager manager = ActionManager.getInstance(); Iterator<String> iter = getActionIDs().iterator(); while (iter.hasNext()) { String id = iter.next(); Action action = manager.getAction(id); if (action != null) { action.actionPerformed(evt); } } }
public void run() { ActionManager manager = ActionManager.getInstance(); manager.setEnabled(ACTION_UNDO, undoManager.canUndo()); manager.setEnabled(ACTION_REDO, undoManager.canRedo()); } };
ActionManager manager = ActionManager.getInstance(); manager.setSelected("font-bold", StyleConstants.isBold(set)); manager.setSelected("font-italic", StyleConstants.isItalic(set)); manager.setSelected("font-underline", StyleConstants.isUnderline(set)); manager.setSelected("left-justify", true); break; manager.setSelected("center-justify", true); break; manager.setSelected("right-justify", true); break;
/** * Convenience method for returning the ServerAction * * @param id value of the action id * @return the TargetableAction referenced by the named id or null */ public ServerAction getServerAction(Object id) { Action a = getAction(id); if (a instanceof ServerAction) { return (ServerAction)a; } return null; }
/** * Test to determine if the action is a <code>BoundAction</code> */ public boolean isBoundAction(Object id) { return (getBoundAction(id) != null); }
/** * Test to determine if the action is a <code>BoundAction</code> */ public boolean isCompositeAction(Object id) { return (getCompositeAction(id) != null); }
/** * Test to determine if the action is a <code>ServerAction</code> */ public boolean isServerAction(Object id) { return (getServerAction(id) != null); } }
public Action addAction(Action action) { return addAction(action.getValue(Action.ACTION_COMMAND_KEY), action); }
/** * Callback for composite actions. This method will redispatch the * ActionEvent to all the actions held in the list. */ @Override public void actionPerformed(ActionEvent evt) { ActionManager manager = ActionManager.getInstance(); Iterator<String> iter = getActionIDs().iterator(); while (iter.hasNext()) { String id = iter.next(); Action action = manager.getAction(id); if (action != null) { action.actionPerformed(evt); } } }
@Override public void run() { ActionManager manager = ActionManager.getInstance(); manager.setEnabled(ACTION_UNDO, undoManager.canUndo()); manager.setEnabled(ACTION_REDO, undoManager.canRedo()); } };
ActionManager manager = ActionManager.getInstance(); manager.setSelected("font-bold", StyleConstants.isBold(set)); manager.setSelected("font-italic", StyleConstants.isItalic(set)); manager.setSelected("font-underline", StyleConstants.isUnderline(set)); manager.setSelected("left-justify", true); break; manager.setSelected("center-justify", true); break; manager.setSelected("right-justify", true); break;
/** * Convenience method for returning the BoundAction * * @param id value of the action id * @return the TargetableAction referenced by the named id or null */ public BoundAction getBoundAction(Object id) { Action a = getAction(id); if (a instanceof BoundAction) { return (BoundAction)a; } return null; }
/** * Test to determine if the action is a <code>BoundAction</code> */ public boolean isBoundAction(Object id) { return (getBoundAction(id) != null); }
/** * Test to determine if the action is a <code>BoundAction</code> */ public boolean isCompositeAction(Object id) { return (getCompositeAction(id) != null); }
/** * Test to determine if the action is a <code>ServerAction</code> */ public boolean isServerAction(Object id) { return (getServerAction(id) != null); } }
public Action addAction(Action action) { return addAction(action.getValue(Action.ACTION_COMMAND_KEY), action); }
/** * Callback for composite actions. This method will redispatch the * ActionEvent to all the actions held in the list. */ @Override public void actionPerformed(ActionEvent evt) { ActionManager manager = ActionManager.getInstance(); Iterator<String> iter = getActionIDs().iterator(); while (iter.hasNext()) { String id = iter.next(); Action action = manager.getAction(id); if (action != null) { action.actionPerformed(evt); } } }