final ToolWindow toolWindow = ToolWindowManager.getInstance(
project).getToolWindow(CheckStyleConstants.ID_TOOLWINDOW);
final CheckStyleToolWindowPanel panel = (CheckStyleToolWindowPanel)
toolWindow.getContentManager().getContent(0).getComponent();
panel.collapseTree();
}
}