final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(getPluginInterface(project).getInternalToolWindowId());
registerEventListener(project);
// toggle value
final Content content = toolWindow.getContentManager().getContent(0);
if (content != null) {
final FindBugsPreferences preferences = getPluginInterface(project).getPreferences();
final String groupByProperty = preferences.getProperty(FindBugsPreferences.TOOLWINDOW_GROUP_BY, GroupBy.BugCategory.name());
final boolean equals = GroupBy.BugCategory.name().equals(groupByProperty);
final ToolWindowPanel panel = (ToolWindowPanel) content.getComponent();
final GroupBy[] sortOrderGroup = GroupBy.getSortOrderGroup(GroupBy.BugCategory);
if(equals && !Arrays.equals(panel.getBugTreePanel().getGroupBy(), sortOrderGroup)) {
panel.getBugTreePanel().setGroupBy(sortOrderGroup);
}
return equals;