Beispiel #1
0
 public String getGroupByActionId(String actionId) {
   for (Tool tool : getTools()) {
     if (Comparing.equal(actionId, tool.getActionId())) {
       return tool.getGroup();
     }
   }
   return null;
 }
 private static Tool findTool(String actionId, DataContext context) {
   MacroManager.getInstance().cacheMacrosPreview(context);
   for (Tool tool : getAllTools()) {
     if (actionId.equals(tool.getActionId())) {
       return tool;
     }
   }
   return null;
 }
Beispiel #3
0
  void registerActions() {
    unregisterActions();

    // register
    HashSet registeredIds =
        new HashSet(); // to prevent exception if 2 or more targets have the same name

    Tool[] tools = getTools();
    for (int i = 0; i < tools.length; i++) {
      Tool tool = tools[i];
      String actionId = tool.getActionId();

      if (!registeredIds.contains(actionId)) {
        registeredIds.add(actionId);
        myActionManager.registerAction(actionId, new ToolAction(tool));
      }
    }
  }
 public ToolAction(Tool tool) {
   myActionId = tool.getActionId();
   getTemplatePresentation().setText(tool.getName(), false);
   getTemplatePresentation().setDescription(tool.getDescription());
 }