void (AnActionButton button) { ToolEditorDialog dlg = createToolEditorDialog(ToolsBundle.message("tools.add.title")); Tool tool = dlg.createTool(); tool.setUseConsole(true); tool.setFilesSynchronizedAfterRun(true); tool.setShownInMainMenu(true); tool.setShownInEditor(true); tool.setShownInProjectViews(true); tool.setShownInSearchResultsPopup(true); tool.setEnabled(true); dlg.setData(tool, getGroups()); if (dlg.showAndGet()) { insertNewTool(dlg.getData(), true); } IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(myTree, true)); }