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


Java TextAttributes.ERASE_MARKER属性代码示例

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


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

示例1: getColorInner

@Nullable
public Color getColorInner() {
  final EditorColorsManager manager = EditorColorsManager.getInstance();
  if (manager != null) {
    TextAttributes attributes = manager.getGlobalScheme().getAttributes(myKey);
    Color stripe = attributes.getErrorStripeColor();
    if (stripe != null) return stripe;
    return attributes.getEffectColor();
  }
  TextAttributes defaultAttributes = myKey.getDefaultAttributes();
  if (defaultAttributes == null) defaultAttributes = TextAttributes.ERASE_MARKER;
  return defaultAttributes.getErrorStripeColor();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:HighlightDisplayLevel.java

示例2: expectedInfosContainsInfo

private boolean expectedInfosContainsInfo(HighlightInfo info) {
  if (info.getTextAttributes(null, null) == TextAttributes.ERASE_MARKER) return true;
  final Collection<ExpectedHighlightingSet> expectedHighlights = highlightingTypes.values();
  for (ExpectedHighlightingSet highlightingSet : expectedHighlights) {
    if (highlightingSet.severity != info.getSeverity()) continue;
    if (!highlightingSet.enabled) return true;
    final Set<HighlightInfo> infos = highlightingSet.infos;
    for (HighlightInfo expectedInfo : infos) {
      if (infoEquals(expectedInfo, info)) {
        return true;
      }
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ExpectedHighlightingData.java

示例3: accept

@Override
public boolean accept(@NotNull HighlightInfo info, PsiFile file) {
  if (Holder.ourTestMode) return true; // Tests need to verify highlighting is applied no matter what attributes are defined for this kind of highlighting

  TextAttributes attributes = info.getTextAttributes(file, null);
  // optimization
   return attributes == TextAttributes.ERASE_MARKER || attributes != null &&
         !(attributes.isEmpty() && info.getSeverity() == HighlightSeverity.INFORMATION && info.getGutterIconRenderer() == null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:HighlightInfoFilterImpl.java

示例4: getPresentation

@NotNull
public UsagePresentation getPresentation() {
  return new UsagePresentation() {
    @Nullable
    public Icon getIcon() {
      return myElement.isValid() ? myElement.getIcon(0) : null;
    }

    @NotNull
    public TextChunk[] getText() {
      if (myElement.isValid()) {
        TextChunk[] chunks = new TextChunk[3];
        PsiFile file = myElement.getContainingFile();
        String line_id = "...";
        final Document document = file.getViewProvider().getDocument();
        if (document != null) {
          line_id = String.valueOf(document.getLineNumber(myElement.getTextOffset()));
        }
        chunks[0] = new TextChunk(SLANTED, "(" + line_id + ") ");
        chunks[1] = new TextChunk(TextAttributes.ERASE_MARKER, myElement.getText());
        StringBuilder sb = new StringBuilder(" would become ").append(myName);
        if (myIsPrefix) sb.append(".").append(myElement.getText());
        chunks[2] = new TextChunk(SLANTED, sb.toString());
        return chunks;
      }
      else return new TextChunk[]{new TextChunk(SLANTED, "?")}; 
    }

    @NotNull
    public String getPlainText() {
      return myElement.getText();
    }

    public String getTooltipText() {
      return myElement.getText();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:NameUsage.java


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