Ejemplo n.º 1
0
 public String getGroupByActionId(String actionId) {
   for (Tool tool : getTools()) {
     if (Comparing.equal(actionId, tool.getActionId())) {
       return tool.getGroup();
     }
   }
   return null;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 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));
      }
    }
  }
Ejemplo n.º 4
0
 public ToolAction(Tool tool) {
   myActionId = tool.getActionId();
   getTemplatePresentation().setText(tool.getName(), false);
   getTemplatePresentation().setDescription(tool.getDescription());
 }