Search in sources :

Example 1 with SeverityEditorDialog

use of com.intellij.codeInspection.ex.SeverityEditorDialog in project intellij-community by JetBrains.

the class LevelChooserAction method createPopupActionGroup.

@NotNull
@Override
public DefaultActionGroup createPopupActionGroup(final JComponent anchor) {
    final DefaultActionGroup group = new DefaultActionGroup();
    for (final HighlightSeverity severity : getSeverities(mySeverityRegistrar, myIncludeDoNotShow)) {
        final HighlightSeverityAction action = new HighlightSeverityAction(severity);
        if (myChosen == null) {
            setChosen(action.getSeverity());
        }
        group.add(action);
    }
    group.addSeparator();
    group.add(new DumbAwareAction("Edit severities...") {

        @Override
        public void actionPerformed(@NotNull final AnActionEvent e) {
            final SeverityEditorDialog dlg = new SeverityEditorDialog(anchor, myChosen, mySeverityRegistrar, true);
            if (dlg.showAndGet()) {
                final HighlightInfoType type = dlg.getSelectedType();
                if (type != null) {
                    final HighlightSeverity severity = type.getSeverity(null);
                    setChosen(severity);
                    onChosen(severity);
                }
            }
        }
    });
    return group;
}
Also used : HighlightSeverity(com.intellij.lang.annotation.HighlightSeverity) SeverityEditorDialog(com.intellij.codeInspection.ex.SeverityEditorDialog) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) DumbAwareAction(com.intellij.openapi.project.DumbAwareAction) HighlightInfoType(com.intellij.codeInsight.daemon.impl.HighlightInfoType) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

HighlightInfoType (com.intellij.codeInsight.daemon.impl.HighlightInfoType)1 SeverityEditorDialog (com.intellij.codeInspection.ex.SeverityEditorDialog)1 HighlightSeverity (com.intellij.lang.annotation.HighlightSeverity)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)1 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)1 NotNull (org.jetbrains.annotations.NotNull)1