final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(getPluginInterface(project).getInternalToolWindowId());
// toggle value
final Content content = toolWindow.getContentManager().getContent(0);
if (content != null) {
final ToolWindowPanel panel = (ToolWindowPanel) content.getComponent();
final FindBugsPreferences preferences = getPluginInterface(project).getPreferences();
final boolean isEnabled = panel.getBugTreePanel().isScrollToSource();
final boolean enabled = preferences.getBooleanProperty(FindBugsPreferences.TOOLWINDOW_SCROLL_TO_SOURCE, isEnabled);
if(enabled != isEnabled) {
panel.getBugTreePanel().setScrollToSource(enabled);
}
return enabled;
}
return false;