當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。