void (@NotNull Object toSelect, final boolean requestFocus) { ToolWindowManager windowManager=ToolWindowManager.getInstance(myProject); final Runnable runnable = () -> { if (requestFocus) { ProjectView projectView = ProjectView.getInstance(myProject); if (projectView != null) { projectView.changeView(getId(), getSubId()); } } BaseProjectTreeBuilder builder = (BaseProjectTreeBuilder)getTreeBuilder(); if (builder != null) { builder.selectInWidth(toSelect, requestFocus, node -> node instanceof AbstractModuleNode || node instanceof ModuleGroupNode || node instanceof AbstractProjectNode); } }; if (requestFocus) { windowManager.getToolWindow(ToolWindowId.PROJECT_VIEW).activate(runnable); } else { runnable.run(); } }