in src/main/java/org/jetbrains/plugins/spotbugs/actions/AbstractToggleAction.java [124:175]
abstract boolean isSelectedImpl(
@NotNull final AnActionEvent e,
@NotNull final Project project,
@Nullable final Module module,
@NotNull final ToolWindow toolWindow,
@NotNull final ToolWindowPanel panel,
@NotNull final FindBugsState state,
@NotNull final ProjectSettings projectSettings,
@NotNull final AbstractSettings settings
);
@Override
public final void setSelected(@NotNull AnActionEvent e, boolean select) {
final Project project = IdeaUtilImpl.getProject(e.getDataContext());
if (project == null || !project.isInitialized() || !project.isOpen()) {
e.getPresentation().setEnabled(false);
e.getPresentation().setVisible(false);
return;
}
final ToolWindow toolWindow = ToolWindowPanel.getWindow(project);
if (toolWindow == null || !toolWindow.isAvailable()) {
e.getPresentation().setEnabled(false);
e.getPresentation().setVisible(false);
return;
}
final ToolWindowPanel panel = ToolWindowPanel.getInstance(toolWindow);
if (panel == null) {
e.getPresentation().setEnabled(false);
e.getPresentation().setVisible(false);
return;
}
final Module module = IdeaUtilImpl.getModule(e.getDataContext(), project);
final ProjectSettings projectSettings = ProjectSettings.getInstance(project);
AbstractSettings settings = projectSettings;
if (module != null) {
final ModuleSettings moduleSettings = ModuleSettings.getInstance(module);
if (moduleSettings.overrideProjectSettings) {
settings = moduleSettings;
}
}
setSelectedImpl(
e,
project,
module,
toolWindow,
panel,
FindBugsState.get(project),
projectSettings,
settings,
select
);
}