コード例 #1
0
 @Nullable
 @Override
 public JComponent createOptionsPanel() {
   final MultipleCheckboxOptionsPanel optionsPanel = new MultipleCheckboxOptionsPanel(this);
   optionsPanel.addCheckbox(
       GroovyInspectionBundle.message("highlight.if.groovy.object.methods.overridden"),
       "myHighlightIfGroovyObjectOverridden");
   optionsPanel.addCheckbox(
       GroovyInspectionBundle.message("highlight.if.missing.methods.declared"),
       "myHighlightIfMissingMethodsDeclared");
   return optionsPanel;
 }
コード例 #2
0
  public void doApplyInformationToEditor() {
    AnnotationHolder annotationHolder = new AnnotationHolderImpl();
    Annotation[] annotations = new Annotation[myUnusedImports.size()];
    int i = 0;
    for (GrImportStatement unusedImport : myUnusedImports) {
      IntentionAction action = createUnusedImportIntention();
      Annotation annotation =
          annotationHolder.createWarningAnnotation(
              unusedImport, GroovyInspectionBundle.message("unused.import"));
      annotation.setHighlightType(ProblemHighlightType.LIKE_UNUSED_SYMBOL);
      annotation.registerFix(action);
      annotations[i++] = annotation;
    }

    HighlightInfoHolder holder = new HighlightInfoHolder(myFile, HighlightInfoFilter.EMPTY_ARRAY);
    holder.setWritable(true);
    List<HighlightInfo> infos =
        ContainerUtil.map(
            annotations,
            new Function<Annotation, HighlightInfo>() {
              public HighlightInfo fun(Annotation annotation) {
                return HighlightInfo.fromAnnotation(annotation);
              }
            });
    UpdateHighlightersUtil.setHighlightersToEditor(
        myProject, myDocument, 0, myFile.getTextLength(), infos, getId());
  }
コード例 #3
0
 @Override
 protected String buildErrorString(Object... args) {
   PsiType ltype = (PsiType) args[0];
   PsiType rtype = (PsiType) args[1];
   return GroovyInspectionBundle.message(
       "rtype.cannot.contain.ltype", ltype.getPresentableText(), rtype.getPresentableText());
 }
コード例 #4
0
 public GrRemoveModifierFix(@NotNull @GrModifier.GrModifierConstant String modifier) {
   this(modifier, GroovyInspectionBundle.message("unnecessary.modifier.remove", modifier));
 }
コード例 #5
0
 @Nls
 @NotNull
 @Override
 public String getDisplayName() {
   return GroovyInspectionBundle.message("check.labeled.statement");
 }
 @Nls
 @NotNull
 @Override
 public String getDisplayName() {
   return GroovyInspectionBundle.message("unnecessary.qualified.reference");
 }
 @Override
 protected String buildErrorString(Object... args) {
   return GroovyInspectionBundle.message("unnecessary.qualified.reference");
 }