本文整理匯總了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();
}
};
}