private void doSelectModuleOrGroup(final Object toSelect, final boolean requestFocus) { ToolWindowManager windowManager = ToolWindowManager.getInstance(myProject); final Runnable runnable = new Runnable() { @Override public void run() { ProjectView projectView = ProjectView.getInstance(myProject); if (requestFocus) { projectView.changeView(getId(), getSubId()); } ((BaseProjectTreeBuilder) getTreeBuilder()) .selectInWidth( toSelect, requestFocus, new Condition<AbstractTreeNode>() { @Override public boolean value(final AbstractTreeNode node) { return node instanceof AbstractModuleNode || node instanceof ModuleGroupNode || node instanceof AbstractProjectNode; } }); } }; if (requestFocus) { windowManager.getToolWindow(ToolWindowId.PROJECT_VIEW).activate(runnable); } else { runnable.run(); } }
protected final void fireTreeChangeListener() { if (myTreeChangeListener != null) myTreeChangeListener.run(); }