当前位置: 首页>>代码示例>>Java>>正文


Java HighlightSeverity.WEAK_WARNING属性代码示例

本文整理汇总了Java中com.intellij.lang.annotation.HighlightSeverity.WEAK_WARNING属性的典型用法代码示例。如果您正苦于以下问题:Java HighlightSeverity.WEAK_WARNING属性的具体用法?Java HighlightSeverity.WEAK_WARNING怎么用?Java HighlightSeverity.WEAK_WARNING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.intellij.lang.annotation.HighlightSeverity的用法示例。


在下文中一共展示了HighlightSeverity.WEAK_WARNING属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertSeverity

@NotNull
public static HighlightInfoType convertSeverity(@NotNull HighlightSeverity severity) {
  return severity == HighlightSeverity.ERROR? HighlightInfoType.ERROR :
         severity == HighlightSeverity.WARNING ? HighlightInfoType.WARNING :
         severity == HighlightSeverity.INFO ? HighlightInfoType.INFO :
         severity == HighlightSeverity.WEAK_WARNING ? HighlightInfoType.WEAK_WARNING :
         severity ==HighlightSeverity.GENERIC_SERVER_ERROR_OR_WARNING ? HighlightInfoType.GENERIC_WARNINGS_OR_ERRORS_FROM_SERVER :
         HighlightInfoType.INFORMATION;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:HighlightInfo.java

示例2: convertSeverityToProblemHighlight

@NotNull
public static ProblemHighlightType convertSeverityToProblemHighlight(HighlightSeverity severity) {
  return severity == HighlightSeverity.ERROR ? ProblemHighlightType.ERROR :
         severity == HighlightSeverity.WARNING ? ProblemHighlightType.GENERIC_ERROR_OR_WARNING :
         severity == HighlightSeverity.INFO ? ProblemHighlightType.INFO :
         severity == HighlightSeverity.WEAK_WARNING ? ProblemHighlightType.WEAK_WARNING : ProblemHighlightType.INFORMATION;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:HighlightInfo.java

示例3: createAnnotation

@Override
public Annotation createAnnotation(T element, @NotNull HighlightSeverity severity, String message) {
  if (severity == HighlightSeverity.ERROR) {
    return myHolder.createErrorAnnotation(element, message);
  } else if (severity == HighlightSeverity.WARNING) {
    return myHolder.createWarningAnnotation(element, message);
  } else if (severity == HighlightSeverity.WEAK_WARNING) {
    return myHolder.createWeakWarningAnnotation(element, message);
  } else {
    return myHolder.createInfoAnnotation(element, message);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:CommonAnnotationHolder.java

示例4: accept

@Override
public boolean accept(@NotNull HighlightInfo highlightInfo, @Nullable PsiFile file) {
  if (highlightInfo.getSeverity() != HighlightSeverity.WARNING &&
      highlightInfo.getSeverity() != HighlightSeverity.WEAK_WARNING) return true;
  if (file == null || !isFrankenstein(file)) return true;
  int start = highlightInfo.getStartOffset();
  int end = highlightInfo.getEndOffset();
  String text = file.getText().substring(start, end);
  return !"missingValue".equals(text);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:FrankensteinErrorFilter.java

示例5: getUnresolvedHighlightSeverity

@Nullable
@Override
public HighlightSeverity getUnresolvedHighlightSeverity(TypeEvalContext context) {
  return HighlightSeverity.WEAK_WARNING;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:DocStringParameterReference.java

示例6: createAnnotation

@SuppressWarnings("deprecation")
@NotNull
private Annotation createAnnotation(@NotNull AnnotationHolder holder,
                                    @NotNull String message,
                                    @NotNull TextRange range,
                                    @NotNull HighlightDisplayLevel displayLevel,
                                    @NotNull Issue issue) {
  // Convert from inspection severity to annotation severity
  HighlightSeverity severity;
  if (displayLevel == HighlightDisplayLevel.ERROR) {
    severity = HighlightSeverity.ERROR;
  } else if (displayLevel == HighlightDisplayLevel.WARNING) {
    severity = HighlightSeverity.WARNING;
  } else if (displayLevel == HighlightDisplayLevel.WEAK_WARNING) {
    severity = HighlightSeverity.WEAK_WARNING;
  } else if (displayLevel == HighlightDisplayLevel.INFO) {
    severity = HighlightSeverity.INFO;
  } else {
    severity = HighlightSeverity.WARNING;
  }

  // Attempt to mark up as HTML? Only if available
  Method createHtmlAnnotation = getCreateHtmlAnnotation();
  if (createHtmlAnnotation != null) {
    // Based on LocalInspectionsPass#createHighlightInfo
    String link = " <a "
        +"href=\"#lint/" + issue.getId() + "\""
        + (UIUtil.isUnderDarcula() ? " color=\"7AB4C9\" " : "")
        +">" + DaemonBundle.message("inspection.extended.description")
        +"</a> " + getShowMoreShortCut();
    String tooltip = XmlStringUtil.wrapInHtml(RAW.convertTo(message, HTML) + link);

    try {
      return (Annotation)createHtmlAnnotation.invoke(holder, severity, range, message, tooltip);
    }
    catch (IllegalAccessException ignored) {
      ourCreateHtmlAnnotationMethod = null;
      //noinspection AssignmentToStaticFieldFromInstanceMethod
      ourCreateHtmlAnnotationMethodFailed = true;
    }
    catch (InvocationTargetException e) {
      ourCreateHtmlAnnotationMethod = null;
      //noinspection AssignmentToStaticFieldFromInstanceMethod
      ourCreateHtmlAnnotationMethodFailed = true;
    }
  }

  return holder.createAnnotation(severity, range, message);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:49,代码来源:AndroidLintExternalAnnotator.java


注:本文中的com.intellij.lang.annotation.HighlightSeverity.WEAK_WARNING属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。