AnAction (final InspectionResultsView view) { return new InspectionResultsViewToggleAction( view, InspectionsBundle.message(ExperimentalUI.isNewUI() ? "inspection.action.group.by.severity.new" : "inspection.action.group.by.severity"), InspectionsBundle.message("inspection.action.group.by.severity.description"), AllIcons.Nodes.SortBySeverity) { @Override public boolean isSelected(@NotNull AnActionEvent e) { return GROUP_BY_SEVERITY; } @Override protected void setSelected(boolean state) { GROUP_BY_SEVERITY = state; } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.BGT; } }; }