void apply() throws IOException {
    // unregister removed tools
    ToolManager toolManager = ToolManager.getInstance();

    toolManager.setTools(getGroupList());
    myIsModified = false;
  }
  private static List<Object> getComboBoxElements() {
    List<Object> result = new ArrayList<Object>();
    ToolManager manager = ToolManager.getInstance();
    result.add(new Object()); // for empty selection
    for (ToolsGroup group : manager.getGroups()) {
      result.add(group);
      Collections.addAll(result, manager.getTools(group.getName()));
    }

    return result;
  }
  void reset() {
    ToolsGroup[] groups = ToolManager.getInstance().getGroups();

    for (ToolsGroup group : groups) {
      insertNewGroup((ToolsGroup) group.copy());
    }

    if ((getTreeRoot()).getChildCount() > 0) {
      myTree.setSelectionInterval(0, 0);
    } else {
      myTree.getSelectionModel().clearSelection();
    }
    (getModel()).nodeStructureChanged(null);

    TreeUtil.expand(myTree, 5);

    myIsModified = false;

    update();
  }
Пример #4
0
 public final void registerManager(@Nonnull final ToolManager toolManager) {
   manager = toolManager;
   history = toolManager.getHistory();
 }