Package org.twodividedbyzero.idea.findbugs.intentions

Examples of org.twodividedbyzero.idea.findbugs.intentions.SuppressReportBugIntentionAction


          annotation = annotationHolder.createWarningAnnotation(textRange, getAnnotationText(matchingDescriptors));
          // todo: use color from annotation configuration
          annotation.setEnforcedTextAttributes(new TextAttributes(null, null, JBColor.RED, 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.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;
View Full Code Here


      final List<GroupBugIntentionListPopupStep> intentionGroups = new ArrayList<GroupBugIntentionListPopupStep>();

      for (final ExtendedProblemDescriptor problemDescriptor : _descriptors) {
        final List<SuppressReportBugIntentionAction> intentionActions = new ArrayList<SuppressReportBugIntentionAction>(_descriptors.size());

        intentionActions.add(new SuppressReportBugIntentionAction(problemDescriptor));
        intentionActions.add(new SuppressReportBugForClassIntentionAction(problemDescriptor));
        intentionActions.add(new ClearBugIntentionAction(problemDescriptor));
        intentionActions.add(new ClearAndSuppressBugIntentionAction(problemDescriptor));

        final GroupBugIntentionListPopupStep intentionActionGroup = new GroupBugIntentionListPopupStep(_psiElement, intentionActions);
View Full Code Here

TOP

Related Classes of org.twodividedbyzero.idea.findbugs.intentions.SuppressReportBugIntentionAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.