TreePath (TreePath parentOrNeighbour) { final String newProfileName = Messages.showInputDialog( myProject, JavaCompilerBundle.message("dialog.message.profile.name"), JavaCompilerBundle.message("title.create.new.profile"), null, "", new InputValidatorEx() { @Override public boolean checkInput(String inputString) { if (StringUtil.isEmpty(inputString) || Objects.equals(inputString, myDefaultProfile.getName())) { return false; } for (ProcessorConfigProfile profile : myModuleProfiles) { if (Objects.equals(inputString, profile.getName())) { return false; } } return true; } @Override public boolean canClose(String inputString) { return checkInput(inputString); } @Override public String getErrorText(String inputString) { if (checkInput(inputString)) { return null; } return StringUtil.isEmpty(inputString) ? JavaCompilerBundle.message("text.empty.profile") : JavaCompilerBundle.message("text.profile.exists", inputString); } }); if (newProfileName != null) { final ProcessorConfigProfile profile = new ProcessorConfigProfileImpl(newProfileName); myModuleProfiles.add(profile); ((DataSynchronizable)getRoot()).sync(); final DefaultMutableTreeNode object = TreeUtil.findNodeWithObject((DefaultMutableTreeNode)getRoot(), profile); if (object != null) { TreeUtil.selectNode(myTree, object); } } return null; }