DefaultActionGroup () { Shortcut shortcut = KeymapUtil.getPrimaryShortcut("GotoNextError"); String shortcutText = shortcut != null ? " (" + KeymapUtil.getShortcutText(shortcut) + ")" : ""; DefaultActionGroup gotoGroup = DefaultActionGroup.createPopupGroup(() -> CodeInsightBundle.message("popup.title.next.error.action.0.goes.through", shortcutText)); gotoGroup.add(new ToggleAction(EditorBundle.message("errors.panel.go.to.errors.first.radio")) { @Override public boolean isSelected(@NotNull AnActionEvent e) { return DaemonCodeAnalyzerSettings.getInstance().isNextErrorActionGoesToErrorsFirst(); } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.BGT; } @Override public void setSelected(@NotNull AnActionEvent e, boolean state) { DaemonCodeAnalyzerSettings.getInstance().setNextErrorActionGoesToErrorsFirst(state); } @Override public boolean isDumbAware() { return true; } } ); gotoGroup.add(new ToggleAction(EditorBundle.message("errors.panel.go.to.next.error.warning.radio")) { @Override public boolean isSelected(@NotNull AnActionEvent e) { return !DaemonCodeAnalyzerSettings.getInstance().isNextErrorActionGoesToErrorsFirst(); } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.BGT; } @Override public void setSelected(@NotNull AnActionEvent e, boolean state) { DaemonCodeAnalyzerSettings.getInstance().setNextErrorActionGoesToErrorsFirst(!state); } @Override public boolean isDumbAware() { return true; } } ); return gotoGroup; }