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


Java HighlightInfoType.getAttributesKey方法代码示例

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


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

示例1: addInspectionSeverityAttributes

import com.intellij.codeInsight.daemon.impl.HighlightInfoType; //导入方法依赖的package包/类
private static void addInspectionSeverityAttributes(List<AttributesDescriptor> descriptors) {
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.unknown.symbol"), CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.deprecated.symbol"), CodeInsightColors.DEPRECATED_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.unused.symbol"), CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.error"), CodeInsightColors.ERRORS_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.warning"), CodeInsightColors.WARNINGS_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.weak.warning"), CodeInsightColors.WEAK_WARNING_ATTRIBUTES));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.server.problems"), CodeInsightColors.GENERIC_SERVER_ERROR_OR_WARNING));
  descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.server.duplicate"), CodeInsightColors.DUPLICATE_FROM_SERVER));

  for (SeveritiesProvider provider : Extensions.getExtensions(SeveritiesProvider.EP_NAME)) {
    for (HighlightInfoType highlightInfoType : provider.getSeveritiesHighlightInfoTypes()) {
      final TextAttributesKey attributesKey = highlightInfoType.getAttributesKey();
      descriptors.add(new AttributesDescriptor(toDisplayName(attributesKey), attributesKey));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ColorSettingsUtil.java

示例2: registerProvidedSeverities

import com.intellij.codeInsight.daemon.impl.HighlightInfoType; //导入方法依赖的package包/类
public static void registerProvidedSeverities() {
  for (SeveritiesProvider provider : Extensions.getExtensions(SeveritiesProvider.EP_NAME)) {
    for (HighlightInfoType t : provider.getSeveritiesHighlightInfoTypes()) {
      HighlightSeverity highlightSeverity = t.getSeverity(null);
      SeverityRegistrar.registerStandard(t, highlightSeverity);
      TextAttributesKey attributesKey = t.getAttributesKey();
      Icon icon = t instanceof HighlightInfoType.Iconable ? ((HighlightInfoType.Iconable)t).getIcon() : null;
      HighlightDisplayLevel.registerSeverity(highlightSeverity, attributesKey, icon);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:InspectionProfileManagerImpl.java

示例3: findNextSuitableRange

import com.intellij.codeInsight.daemon.impl.HighlightInfoType; //导入方法依赖的package包/类
private void findNextSuitableRange() {
  myNextAttributes = null;
  while(myIterator.hasNext()) {
    RangeHighlighterEx highlighter = myIterator.next();
    if (highlighter == null || !highlighter.isValid() || !isInterestedInLayer(highlighter.getLayer())) {
      continue;
    }
    // LINES_IN_RANGE highlighters are not supported currently
    myNextStart = Math.max(highlighter.getStartOffset(), myStartOffset);
    myNextEnd = Math.min(highlighter.getEndOffset(), myEndOffset);
    if (myNextStart >= myEndOffset) {
      break;
    }
    if (myNextStart < myCurrentEnd) {
      continue; // overlapping ranges withing document markup model are not supported currently
    }
    TextAttributes attributes = null;
    Object tooltip = highlighter.getErrorStripeTooltip();
    if (tooltip instanceof HighlightInfo) {
      HighlightInfo info = (HighlightInfo)tooltip;
      TextAttributesKey key = info.forcedTextAttributesKey;
      if (key == null) {
        HighlightInfoType type = info.type;
        key = type.getAttributesKey();
      }
      if (key != null) {
        attributes = myColorsScheme.getAttributes(key);
      }
    }
    if (attributes == null) {
      continue;
    }
    Color foreground = attributes.getForegroundColor();
    Color background = attributes.getBackgroundColor();
    if ((foreground == null || myDefaultForeground.equals(foreground))
        && (background == null || myDefaultBackground.equals(background))
        && attributes.getFontType() == Font.PLAIN) {
      continue;
    }
    myNextAttributes = attributes;
    break;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:44,代码来源:TextWithMarkupProcessor.java


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