本文整理汇总了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();
}
示例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;
}
示例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);
}
示例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();
}
};
}