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;
}
Aggregations