public final class TextAttributesKey extends java.lang.Object implements java.lang.Comparable<TextAttributesKey>
Modifier and Type | Class and Description |
---|---|
static interface |
TextAttributesKey.TextAttributeKeyDefaultsProvider |
Modifier and Type | Field and Description |
---|---|
static TextAttributesKey[] |
EMPTY_ARRAY |
Constructor and Description |
---|
TextAttributesKey(Element element) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(TextAttributesKey key) |
static TextAttributesKey |
createTempTextAttributesKey(java.lang.String externalName,
TextAttributes defaultAttributes)
Registers a temp text attribute key with the specified identifier and default attributes.
|
static TextAttributesKey |
createTextAttributesKey(java.lang.String externalName)
Registers a text attribute key with the specified identifier.
|
static TextAttributesKey |
createTextAttributesKey(java.lang.String externalName,
TextAttributes defaultAttributes)
Deprecated.
Use
createTextAttributesKey(String, TextAttributesKey) to guarantee compatibility with generic color schemes. |
static TextAttributesKey |
createTextAttributesKey(java.lang.String externalName,
TextAttributesKey fallbackAttributeKey)
Registers a text attribute key with the specified identifier and a fallback key.
|
boolean |
equals(java.lang.Object o) |
static TextAttributesKey |
find(java.lang.String externalName) |
TextAttributes |
getDefaultAttributes()
Returns the default text attributes associated with the key.
|
java.lang.String |
getExternalName() |
TextAttributesKey |
getFallbackAttributeKey() |
int |
hashCode() |
static boolean |
isTemp(TextAttributesKey key) |
void |
setFallbackAttributeKey(TextAttributesKey fallbackAttributeKey)
Deprecated.
|
java.lang.String |
toString() |
void |
writeExternal(Element element) |
public static final TextAttributesKey[] EMPTY_ARRAY
public static TextAttributesKey find(java.lang.String externalName)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getExternalName()
public int compareTo(TextAttributesKey key)
compareTo
in interface java.lang.Comparable<TextAttributesKey>
public static TextAttributesKey createTextAttributesKey(java.lang.String externalName)
externalName
- the unique identifier of the key.public void writeExternal(Element element)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public TextAttributes getDefaultAttributes()
@Deprecated public static TextAttributesKey createTextAttributesKey(java.lang.String externalName, TextAttributes defaultAttributes)
createTextAttributesKey(String, TextAttributesKey)
to guarantee compatibility with generic color schemes.externalName
- the unique identifier of the key.defaultAttributes
- the default text attributes associated with the key.public static TextAttributesKey createTextAttributesKey(java.lang.String externalName, TextAttributesKey fallbackAttributeKey)
Fallback keys can be chained, for example, text attribute key A can depend on key B which in turn can depend on key C. So if text attributes neither for A nor for B are found, they will be acquired by the key C.
Fallback keys can be used from any place including language's own definitions. Note that there is a common set of keys called
DefaultLanguageHighlighterColors
which can be used as a base. Scheme designers are supposed to set colors for these
keys primarily and using them guarantees that most (if not all) text attributes will be shown correctly for the language
regardless of a color scheme.
externalName
- the unique identifier of the key.fallbackAttributeKey
- the fallback key to use if text attributes for this key are not defined.public static TextAttributesKey createTempTextAttributesKey(java.lang.String externalName, TextAttributes defaultAttributes)
externalName
- the unique identifier of the key.defaultAttributes
- the default text attributes associated with the key.public TextAttributesKey getFallbackAttributeKey()
@Deprecated public void setFallbackAttributeKey(TextAttributesKey fallbackAttributeKey)
createTextAttributesKey(String, TextAttributesKey)
insteadpublic static boolean isTemp(TextAttributesKey key)