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();
//return panel.isPreviewEnabled();
final FindBugsPreferences preferences = getPluginInterface(project).getPreferences();
final boolean enabled = preferences.getBooleanProperty(FindBugsPreferences.TOOLWINDOW_EDITOR_PREVIEW, panel.isPreviewEnabled());
if(enabled != panel.isPreviewEnabled()) {
panel.setPreviewEnabled(enabled);
}
return enabled;
}
return false;