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


Java HighlightInfoType.HighlightInfoTypeImpl方法代码示例

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


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

示例1: getTextAttributes

import com.intellij.codeInsight.daemon.impl.HighlightInfoType; //导入方法依赖的package包/类
@NotNull
public static TextAttributes getTextAttributes(@Nullable EditorColorsScheme editorColorsScheme, @NotNull SeverityRegistrar severityRegistrar, @NotNull HighlightSeverity severity) {
    TextAttributes textAttributes = severityRegistrar.getTextAttributesBySeverity(severity);
    if (textAttributes != null) {
        return textAttributes;
    }
    EditorColorsScheme colorsScheme = getColorsScheme(editorColorsScheme);
    HighlightInfoType.HighlightInfoTypeImpl infoType = severityRegistrar.getHighlightInfoTypeBySeverity(severity);
    TextAttributesKey key = infoType.getAttributesKey();
    return colorsScheme.getAttributes(key);
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:12,代码来源:AnnotatorUtils.java

示例2: getSeveritiesHighlightInfoTypes

import com.intellij.codeInsight.daemon.impl.HighlightInfoType; //导入方法依赖的package包/类
@Override
@NotNull
public List<HighlightInfoType> getSeveritiesHighlightInfoTypes() {
  class T extends HighlightInfoType.HighlightInfoTypeImpl implements HighlightInfoType.Iconable{
    public T(@NotNull HighlightSeverity severity, TextAttributesKey attributesKey) {
      super(severity, attributesKey);
    }

    @Override
    public Icon getIcon() {
      return AllIcons.General.InspectionsTypos;
    }
  }
  return Collections.<HighlightInfoType>singletonList(new T(TYPO, TYPO_KEY));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:SpellCheckerSeveritiesProvider.java

示例3: highlightTypeFromDescriptor

import com.intellij.codeInsight.daemon.impl.HighlightInfoType; //导入方法依赖的package包/类
@NotNull
public static HighlightInfoType highlightTypeFromDescriptor(@NotNull ProblemDescriptor problemDescriptor,
                                                            @NotNull HighlightSeverity severity,
                                                            @NotNull SeverityRegistrar severityRegistrar) {
  final ProblemHighlightType highlightType = problemDescriptor.getHighlightType();
  switch (highlightType) {
    case GENERIC_ERROR_OR_WARNING:
      return severityRegistrar.getHighlightInfoTypeBySeverity(severity);
    case LIKE_DEPRECATED:
      return new HighlightInfoType.HighlightInfoTypeImpl(severity, HighlightInfoType.DEPRECATED.getAttributesKey());
    case LIKE_UNKNOWN_SYMBOL:
      if (severity == HighlightSeverity.ERROR) {
        return new HighlightInfoType.HighlightInfoTypeImpl(severity, HighlightInfoType.WRONG_REF.getAttributesKey());
      }
      if (severity == HighlightSeverity.WARNING) {
        return new HighlightInfoType.HighlightInfoTypeImpl(severity, CodeInsightColors.WEAK_WARNING_ATTRIBUTES);
      }
      return severityRegistrar.getHighlightInfoTypeBySeverity(severity);
    case LIKE_UNUSED_SYMBOL:
      return new HighlightInfoType.HighlightInfoTypeImpl(severity, HighlightInfoType.UNUSED_SYMBOL.getAttributesKey());
    case INFO:
      return HighlightInfoType.INFO;
    case WEAK_WARNING:
      return HighlightInfoType.WEAK_WARNING;
    case ERROR:
      return HighlightInfoType.WRONG_REF;
    case GENERIC_ERROR:
      return HighlightInfoType.ERROR;
    case INFORMATION:
      final TextAttributesKey attributes = ((ProblemDescriptorBase)problemDescriptor).getEnforcedTextAttributes();
      if (attributes != null) {
        return new HighlightInfoType.HighlightInfoTypeImpl(HighlightSeverity.INFORMATION, attributes);
      }
      return HighlightInfoType.INFORMATION;
  }
  throw new RuntimeException("Cannot map " + highlightType);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:ProblemDescriptorUtil.java


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