}
annotation.registerFix(new SuppressReportBugIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new SuppressReportBugForClassIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new ClearBugIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new ClearAndSuppressBugIntentionAction(problemDescriptor), textRange);
break;
case Detector.NORMAL_PRIORITY:
if (psiElement instanceof PsiAnonymousClass) {
final PsiElement firstChild = psiElement.getFirstChild();
annotation = annotationHolder.createWarningAnnotation(firstChild == null ? psiElement : firstChild, getAnnotationText(matchingDescriptors));
} else {
annotation = annotationHolder.createWarningAnnotation(textRange, getAnnotationText(matchingDescriptors));
}
// todo: use color from annotation configuration
annotation.setEnforcedTextAttributes(new TextAttributes(null, null, JBColor.YELLOW.darker(), EffectType.WAVE_UNDERSCORE, Font.PLAIN));
annotation.registerFix(new SuppressReportBugIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new SuppressReportBugForClassIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new ClearBugIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new ClearAndSuppressBugIntentionAction(problemDescriptor), textRange);
break;
case Detector.EXP_PRIORITY:
if (problemElement instanceof PsiAnonymousClass) {
final PsiElement firstChild = psiElement.getFirstChild();
annotation = annotationHolder.createWarningAnnotation(firstChild == null ? psiElement : firstChild, getAnnotationText(matchingDescriptors));
} else {
annotation = annotationHolder.createWarningAnnotation(textRange, getAnnotationText(matchingDescriptors));
}
// todo: use color from annotation configuration
annotation.setEnforcedTextAttributes(new TextAttributes(null, null, JBColor.GRAY, EffectType.WAVE_UNDERSCORE, Font.PLAIN));
annotation.registerFix(new SuppressReportBugIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new SuppressReportBugForClassIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new ClearBugIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new ClearAndSuppressBugIntentionAction(problemDescriptor), textRange);
break;
case Detector.LOW_PRIORITY:
if (psiElement instanceof PsiAnonymousClass) {
final PsiElement firstChild = psiElement.getFirstChild();
annotation = annotationHolder.createInfoAnnotation(firstChild == null ? psiElement : firstChild, getAnnotationText(matchingDescriptors));
} else {
annotation = annotationHolder.createInfoAnnotation(textRange, getAnnotationText(matchingDescriptors));
}
// todo: use color from annotation configuration
annotation.setEnforcedTextAttributes(new TextAttributes(null, null, JBColor.GREEN, EffectType.WAVE_UNDERSCORE, Font.PLAIN));
annotation.registerFix(new SuppressReportBugIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new SuppressReportBugForClassIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new ClearBugIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new ClearAndSuppressBugIntentionAction(problemDescriptor), textRange);
break;
case Detector.IGNORE_PRIORITY:
if (problemElement instanceof PsiAnonymousClass) {
final PsiElement firstChild = psiElement.getFirstChild();
annotation = annotationHolder.createWarningAnnotation(firstChild == null ? psiElement : firstChild, getAnnotationText(matchingDescriptors));
annotation.setEnforcedTextAttributes(new TextAttributes(null, null, JBColor.MAGENTA.brighter(), EffectType.WAVE_UNDERSCORE, Font.PLAIN));
} else {
annotation = annotationHolder.createWarningAnnotation(textRange, getAnnotationText(matchingDescriptors));
}
// todo: use color from annotation configuration
annotation.setEnforcedTextAttributes(new TextAttributes(null, null, JBColor.MAGENTA, EffectType.WAVE_UNDERSCORE, Font.PLAIN));
annotation.registerFix(new SuppressReportBugIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new SuppressReportBugForClassIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new ClearBugIntentionAction(problemDescriptor), textRange);
annotation.registerFix(new ClearAndSuppressBugIntentionAction(problemDescriptor), textRange);
break;
default:
throw new IllegalArgumentException("Unknown bugInstance.getPriority() == " + priority);
}