Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.javatools.editor.highlight
Class HighlightStyle

java.lang.Object
  extended by 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.


Field Summary
static int DEFAULT_SELECTION_PRIORITY
          The default priority level given to the highlight for selected text.
static int FONT_BOLD
          Constant for bold font highlight.
static int FONT_BOLD_ITALIC
          Constant for bold and italic font highlight.
static int FONT_ITALIC
          Constant for italic font highlight.
static int FONT_NORMAL
          Constant for no font highlight.
static int MAXIMUM_PRIORITY
          The maximum priority level a highlight can use.
static int MINIMUM_PRIORITY
          The minimum priority level a highlight can use.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 java.awt.Color getBackgroundColor()
          Fetches the background color of the higlight
 boolean getEnabled()
          Fetches the enabled status of this highlight style.
 int getFontStyle()
          Fetch the font style to apply.
 java.awt.Color getForegroundColor()
          Fetches the foreground color of the highlight
 java.lang.String getName()
          Fetches the name of the highlight.
 java.lang.String getPresentationName()
          Fetch the visible or presentation name of the style.
 int getPriority()
          Fetches the priority of the highlight
 java.awt.Color getUnderlineColor()
          Fetches the color of the underline.
 UnderlinePainter getUnderlinePainter()
          Fetches the painter to use for painting the underline.
 boolean getUseBackgroundColor()
          Fetches whether the background color is in use or not.
 boolean getUseFontStyle()
          Fetches whether the font style is in use or not.
 boolean getUseForegroundColor()
          Fetches whether the foreground color is in use or not.
 boolean getUseUnderline()
          Fetches whether the underline is in use or not.
 int hashCode()
           
 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.
 java.lang.String toString()
          Fetches the human-readable name of the style.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MINIMUM_PRIORITY

public static final int MINIMUM_PRIORITY
The minimum priority level a highlight can use.

See Also:
Constant Field Values

MAXIMUM_PRIORITY

public static final int MAXIMUM_PRIORITY
The maximum priority level a highlight can use.

See Also:
Constant Field Values

DEFAULT_SELECTION_PRIORITY

public static final int DEFAULT_SELECTION_PRIORITY
The default priority level given to the highlight for selected text.

See Also:
Constant Field Values

FONT_NORMAL

public static final int FONT_NORMAL
Constant for no font highlight.

See Also:
Constant Field Values

FONT_BOLD

public static final int FONT_BOLD
Constant for bold font highlight.

See Also:
Constant Field Values

FONT_ITALIC

public static final int FONT_ITALIC
Constant for italic font highlight.

See Also:
Constant Field Values

FONT_BOLD_ITALIC

public static final int FONT_BOLD_ITALIC
Constant for bold and italic font highlight.

See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
Fetches the name of the highlight.

Returns:
the highlight name

getPresentationName

public java.lang.String 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).

Returns:
true if the style is transient

getForegroundColor

public java.awt.Color getForegroundColor()
Fetches the foreground color of the highlight

Returns:
the foreground color

getBackgroundColor

public java.awt.Color getBackgroundColor()
Fetches the background color of the higlight

Returns:
the background color

getFontStyle

public int getFontStyle()
Fetch the font style to apply.

Returns:
the font style to apply

getUnderlineColor

public java.awt.Color getUnderlineColor()
Fetches the color of the underline.

Returns:
the color of the underline

getUnderlinePainter

public UnderlinePainter getUnderlinePainter()
Fetches the painter to use for painting the underline.

Returns:
the painter for the underline

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.