本文整理汇总了Java中com.intellij.openapi.editor.colors.TextAttributesKey.getFallbackAttributeKey方法的典型用法代码示例。如果您正苦于以下问题:Java TextAttributesKey.getFallbackAttributeKey方法的具体用法?Java TextAttributesKey.getFallbackAttributeKey怎么用?Java TextAttributesKey.getFallbackAttributeKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.editor.colors.TextAttributesKey
的用法示例。
在下文中一共展示了TextAttributesKey.getFallbackAttributeKey方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAttributes
import com.intellij.openapi.editor.colors.TextAttributesKey; //导入方法依赖的package包/类
@Override
public TextAttributes getAttributes(TextAttributesKey key) {
if (key != null) {
TextAttributesKey fallbackKey = key.getFallbackAttributeKey();
TextAttributes attributes = getDirectlyDefinedAttributes(key);
if (fallbackKey == null) {
if (containsValue(attributes)) return attributes;
}
else {
if (containsValue(attributes) && !attributes.isFallbackEnabled()) return attributes;
attributes = getFallbackAttributes(fallbackKey);
if (containsValue(attributes)) return attributes;
}
}
return myParentScheme.getAttributes(key);
}
示例2: isHighlightedAsComment
import com.intellij.openapi.editor.colors.TextAttributesKey; //导入方法依赖的package包/类
public static boolean isHighlightedAsComment(TextAttributesKey... keys) {
for (TextAttributesKey key : keys) {
if (key == DefaultLanguageHighlighterColors.DOC_COMMENT ||
key == SyntaxHighlighterColors.DOC_COMMENT ||
key == DefaultLanguageHighlighterColors.LINE_COMMENT ||
key == SyntaxHighlighterColors.LINE_COMMENT ||
key == DefaultLanguageHighlighterColors.BLOCK_COMMENT ||
key == SyntaxHighlighterColors.JAVA_BLOCK_COMMENT
) {
return true;
}
if (key == null) continue;
final TextAttributesKey fallbackAttributeKey = key.getFallbackAttributeKey();
if (fallbackAttributeKey != null && isHighlightedAsComment(fallbackAttributeKey)) {
return true;
}
}
return false;
}
示例3: SchemeTextAttributesDescription
import com.intellij.openapi.editor.colors.TextAttributesKey; //导入方法依赖的package包/类
private SchemeTextAttributesDescription(String name, String group, @NotNull TextAttributesKey key, @NotNull MyColorScheme scheme, Icon icon,
String toolTip) {
super(name, group,
getInitialAttributes(scheme, key).clone(),
key, scheme, icon, toolTip);
this.key = key;
myInitialAttributes = getInitialAttributes(scheme, key);
TextAttributesKey fallbackKey = key.getFallbackAttributeKey();
if (fallbackKey != null) {
myFallbackAttributes = scheme.getAttributes(fallbackKey);
myBaseAttributeDescriptor = ColorSettingsPages.getInstance().getAttributeDescriptor(fallbackKey);
if (myBaseAttributeDescriptor == null) {
myBaseAttributeDescriptor =
new Pair<ColorSettingsPage, AttributesDescriptor>(null, new AttributesDescriptor(fallbackKey.getExternalName(), fallbackKey));
}
}
myIsInheritedInitial = scheme.isInherited(key);
setInherited(myIsInheritedInitial);
if (myIsInheritedInitial) {
setInheritedAttributes(getTextAttributes());
}
initCheckedStatus();
}
示例4: isInherited
import com.intellij.openapi.editor.colors.TextAttributesKey; //导入方法依赖的package包/类
public boolean isInherited(TextAttributesKey key) {
TextAttributesKey fallbackKey = key.getFallbackAttributeKey();
if (fallbackKey != null) {
if (myParentScheme instanceof AbstractColorsScheme) {
TextAttributes ownAttrs = ((AbstractColorsScheme)myParentScheme).getDirectlyDefinedAttributes(key);
if (ownAttrs != null) {
return ownAttrs.isFallbackEnabled();
}
}
TextAttributes attributes = getAttributes(key);
if (attributes != null) {
TextAttributes fallbackAttributes = getAttributes(fallbackKey);
return attributes == fallbackAttributes;
}
}
return false;
}
示例5: getAttributes
import com.intellij.openapi.editor.colors.TextAttributesKey; //导入方法依赖的package包/类
@Override
@Nullable
public TextAttributes getAttributes(TextAttributesKey key) {
if (key == null) return null;
TextAttributes attrs = myAttributesMap.get(key);
if (attrs == null) {
if (key.getFallbackAttributeKey() != null) {
attrs = getFallbackAttributes(key.getFallbackAttributeKey());
if (attrs != null && !attrs.isFallbackEnabled()) return attrs;
}
attrs = key.getDefaultAttributes();
}
return attrs;
}
示例6: isHighlightedAsString
import com.intellij.openapi.editor.colors.TextAttributesKey; //导入方法依赖的package包/类
public static boolean isHighlightedAsString(TextAttributesKey... keys) {
for (TextAttributesKey key : keys) {
if (key == DefaultLanguageHighlighterColors.STRING || key == SyntaxHighlighterColors.STRING) {
return true;
}
if (key == null) continue;
final TextAttributesKey fallbackAttributeKey = key.getFallbackAttributeKey();
if (fallbackAttributeKey != null && isHighlightedAsString(fallbackAttributeKey)) {
return true;
}
}
return false;
}