oracle.javatools.editor.highlight
Class HighlightStyle

java.lang.Object
oracle.javatools.editor.highlight.HighlightStyle

public final class HighlightStyle

extends java.lang.Object

The HighlightStyle class defines a set of foreground
and background color attributes used for painting highlights for a
segment of text. This is useful for highlighting certain segments
of text to the user's attention, such as find text occurrences,
compiler errors, breakpoints, and so on. Create new highlights
or modify existing highlights through the
HighlightRegistry.

A HighlightStyle can define a foreground attribute,
a background attribute, a font override, an underline style, or
any combination of these. Text highlights are applied in layers
to styled text (such as syntax highlighted text) based on the priority
of the highlight - this is similar to how the priority levels work in
a JLayeredPane. In general, do not define highlights
with a higher priority level then the priority level for the
selected text unless you want the particular highlight to really
stand out.

When highlights are applied to syntax highlights, these attributes
(foreground, background, font override, and underline style) are
considered and applied separately. This allows two separately applied
HighlightStyles applied to the same region to be combined if they
apply different attributes. If those two HighlightStyles attempt to
apply the same attribute, then the priorities will be compared to
determine which attribute is applied.

getName

getPresentationName

Fetch the visible or presentation name of the style. This is
generally a translated name that can be used for UI purposes.

Returns:

the visible or presentation name of the style

toString

public java.lang.String toString()

Fetches the human-readable name of the style.

Overrides:

toString in class java.lang.Object

Returns:

the style name

getEnabled

public boolean getEnabled()

Fetches the enabled status of this highlight style.

Returns:

whether this style is enabled or not

getPriority

public int getPriority()

Fetches the priority of the highlight

Returns:

the priority of the highlight

getUseForegroundColor

public boolean getUseForegroundColor()

Fetches whether the foreground color is in use or not.

Returns:

whether the foreground color is in use

getUseBackgroundColor

public boolean getUseBackgroundColor()

Fetches whether the background color is in use or not.

Returns:

whether the background color is in use

getUseFontStyle

public boolean getUseFontStyle()

Fetches whether the font style is in use or not.

Returns:

whether the font style is in use or not

getUseUnderline

public boolean getUseUnderline()

Fetches whether the underline is in use or not.

Returns:

whether the underline is in use or not

isTransient

public boolean isTransient()

A transient style is a HighlightStyle that is not persisted, does not
show up for customization by the user, does not have a user visible name.
It is designed for a temporary style that may be based off a no-transient style
for certain text effects (e.g. fading text animation).