Skip navigation links

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

E13403-10


oracle.javatools.editor.highlight
Class HighlightRegistry

java.lang.Object
  extended by oracle.javatools.editor.highlight.HighlightRegistry


public final class HighlightRegistry
extends java.lang.Object

A HighlightRegistry is a registry of all known highlight styles used for background highlighting.


Field Summary
static int DOUBLE_DOTTED_SEPARATOR
          This is similar to DOUBLE_LINE_SEPARATOR except that the separator is dotted instead of being solid.
static int DOUBLE_DOTTED_UNDERLINE
          This is similar to DOUBLE_UNDERLINE except that the separator is dotted instead of being solid.
static int DOUBLE_SEPARATOR
          This is a double-pixel thickness (solid) line separator that is positioned at the bottom of the text area (below the baseline by descent pixels.) It is intended to be used to separate regions of text in the editor view.
static int DOUBLE_STRIKETHRU
          This is a double-pixel thickness (solid) line strikethru that is positioned centered in the text area.
static int DOUBLE_UNDERLINE
          This is a double-pixel (solid) underline that is positioned at the baseline of the text.
static int PERFORATED_SEPARATOR
          This is similar to SINGLE_DOTTED_SEPARATOR with shorter dots and gaps (really subtle).
static java.lang.String PROPERTY_HIGHLIGHT_CHANGED
          Name of the pseudo-property that the HighlightRegistry uses to notify listeners (views) that settings in the registry have changed.
static int SINGLE_DOTTED_SEPARATOR
          This is similar to SINGLE_LINE_SEPARATOR except that the separator is dotted instead of being solid.
static int SINGLE_DOTTED_UNDERLINE
          This is similar to SINGLE_UNDERLINE except that the separator is dotted instead of being solid.
static int SINGLE_SEPARATOR
          This is a single-pixel thickness (solid) line separator that is positioned at the bottom of the text area (below the baseline by descent pixels.) It is intended to be used to separate regions of text in the editor view.
static int SINGLE_STRIKETHRU
          This is a single-pixel thickness (solid) line strikethru that is positioned centered in the text area.
static int SINGLE_UNDERLINE
          This is a single-pixel (solid) underline that is positioned at the baseline of the text.
static int ZIGZAG_UNDERLINE
          This is a zig-zag (squiggly) underline, similar to what Microsoft Word uses to flag spelling errors.

 

Constructor Summary
HighlightRegistry()
          Constructs a new highlight registry.

 

Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to this registry to track changes to styles.
 java.lang.Object clone()
          Creates and returns a copy of this class.
 HighlightStyle createStyle(java.lang.String styleName, java.lang.String presentationName, boolean enabled, int priority, java.awt.Color fgColor, java.awt.Color bgColor)
          Create a new HighlightStyle with the given name and highlight attributes.
 HighlightStyle createStyle(java.lang.String styleName, java.lang.String presentationName, boolean enabled, int priority, java.awt.Color fgColor, java.awt.Color bgColor, int fontStyle, int underlinePredefinedPainter, java.awt.Color underlineColor)
          Create a new HighlightStyle with the given name and highlight attributes.
 HighlightStyle createStyle(java.lang.String styleName, java.lang.String presentationName, boolean enabled, int priority, int fontStyle)
          Create a new HighlightStyle with the given name and highlight attributes.
 HighlightStyle createStyle(java.lang.String styleName, java.lang.String presentationName, boolean enabled, int priority, int underlinePredefinedPainter, java.awt.Color underlineColor)
          Create a new HighlightStyle with the given name and highlight attributes.
 HighlightStyle createStyle(java.lang.String styleName, java.lang.String presentationName, int priority, java.awt.Color fgColor, java.awt.Color bgColor)
          Create a new HighlightStyle with the given name and highlight attributes with a default enabled status of true.
 HighlightStyle createTransientStyle(java.lang.String styleName, boolean enabled, int priority, java.awt.Color fgColor, java.awt.Color bgColor, int fontStyle, int underlinePredefinedPainter, java.awt.Color underlineColor)
          Create a new transient HighlightStyle with the given name and highlight attributes.
 java.util.Iterator<HighlightStyle> getStyleIterator()
          Fetch an Iterator for all of the styles within this registry.
static int lookupPredefinedPainter(UnderlinePainter painter)
          Utility routine to determine the predefined index number for a painter.
 HighlightStyle lookupStyle(java.lang.String styleName)
          Fetches the style with the given name.
 void modifyStyle(java.lang.String styleName, boolean enabled, int priority, boolean useFG, java.awt.Color fgColor, boolean useBG, java.awt.Color bgColor)
          Deprecated.  
 void modifyStyle(java.lang.String styleName, boolean enabled, int priority, java.awt.Color fgColor, java.awt.Color bgColor, int fontStyle, int underlinePredefinedPainter, java.awt.Color underlineColor)
          Modifies this style's attributes.
 void modifyStyleBackground(java.lang.String styleName, java.awt.Color bgColor)
          Modifies the style's background attributes.
 void modifyStyleEnabled(java.lang.String styleName, boolean enabled)
          Modifies the style's enabled status.
 void modifyStyleFont(java.lang.String styleName, int fontStyle)
          Modifies the style's font attributes.
 void modifyStyleForeground(java.lang.String styleName, java.awt.Color fgColor)
          Modifies the style's foreground attributes.
 void modifyStylePriority(java.lang.String styleName, int priority)
          Modifies the style's priority attribute.
 void modifyStyleUnderline(java.lang.String styleName, int underlinePredefinedPainter, java.awt.Color underlineColor)
          Modifies the style's underline attributes.
 void modifyStyleUnderline(java.lang.String styleName, UnderlinePainter underlinePainter, java.awt.Color underlineColor)
          Modifies the style's underline attributes.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener from this registry.

 

Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

SINGLE_UNDERLINE

public static final int SINGLE_UNDERLINE
This is a single-pixel (solid) underline that is positioned at the baseline of the text. It is intended to be used to underline a run of text.
See Also:
Constant Field Values

DOUBLE_UNDERLINE

public static final int DOUBLE_UNDERLINE
This is a double-pixel (solid) underline that is positioned at the baseline of the text. It is intended to be used to underline a run of text.
See Also:
Constant Field Values

SINGLE_DOTTED_UNDERLINE

public static final int SINGLE_DOTTED_UNDERLINE
This is similar to SINGLE_UNDERLINE except that the separator is dotted instead of being solid.
See Also:
Constant Field Values

DOUBLE_DOTTED_UNDERLINE

public static final int DOUBLE_DOTTED_UNDERLINE
This is similar to DOUBLE_UNDERLINE except that the separator is dotted instead of being solid.
See Also:
Constant Field Values

ZIGZAG_UNDERLINE

public static final int ZIGZAG_UNDERLINE
This is a zig-zag (squiggly) underline, similar to what Microsoft Word uses to flag spelling errors.
See Also:
Constant Field Values

SINGLE_SEPARATOR

public static final int SINGLE_SEPARATOR
This is a single-pixel thickness (solid) line separator that is positioned at the bottom of the text area (below the baseline by descent pixels.) It is intended to be used to separate regions of text in the editor view.
See Also:
Constant Field Values

DOUBLE_SEPARATOR

public static final int DOUBLE_SEPARATOR
This is a double-pixel thickness (solid) line separator that is positioned at the bottom of the text area (below the baseline by descent pixels.) It is intended to be used to separate regions of text in the editor view.
See Also:
Constant Field Values

SINGLE_DOTTED_SEPARATOR

public static final int SINGLE_DOTTED_SEPARATOR
This is similar to SINGLE_LINE_SEPARATOR except that the separator is dotted instead of being solid.
See Also:
Constant Field Values

DOUBLE_DOTTED_SEPARATOR

public static final int DOUBLE_DOTTED_SEPARATOR
This is similar to DOUBLE_LINE_SEPARATOR except that the separator is dotted instead of being solid.
See Also:
Constant Field Values

PERFORATED_SEPARATOR

public static final int PERFORATED_SEPARATOR
This is similar to SINGLE_DOTTED_SEPARATOR with shorter dots and gaps (really subtle).
See Also:
Constant Field Values

SINGLE_STRIKETHRU

public static final int SINGLE_STRIKETHRU
This is a single-pixel thickness (solid) line strikethru that is positioned centered in the text area.
See Also:
Constant Field Values

DOUBLE_STRIKETHRU

public static final int DOUBLE_STRIKETHRU
This is a double-pixel thickness (solid) line strikethru that is positioned centered in the text area.
See Also:
Constant Field Values

PROPERTY_HIGHLIGHT_CHANGED

public static final java.lang.String PROPERTY_HIGHLIGHT_CHANGED
Name of the pseudo-property that the HighlightRegistry uses to notify listeners (views) that settings in the registry have changed.
See Also:
Constant Field Values

Constructor Detail

HighlightRegistry

public HighlightRegistry()
Constructs a new highlight registry.

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this registry to track changes to styles.
Parameters:
listener - the listener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from this registry.
Parameters:
listener - the listener to be removed

getStyleIterator

public java.util.Iterator<HighlightStyle> getStyleIterator()
Fetch an Iterator for all of the styles within this registry. Note that some of these styles may not be completely initialized - clients that use this style list for the purposes of display a list of available styles should call lookupStyle() on each style to ensure that the given style has been initialized properly. Transient styles are not returned by this iterator
Returns:
an iterator for all styles

clone

public java.lang.Object clone()
Creates and returns a copy of this class. This will return a completely independent HighlightRegistry with a copy of its own styles separate from this one.
Overrides:
clone in class java.lang.Object
Returns:
a copy of this HighlightRegistry

createStyle

public HighlightStyle createStyle(java.lang.String styleName,
                                  java.lang.String presentationName,
                                  int priority,
                                  java.awt.Color fgColor,
                                  java.awt.Color bgColor)
Create a new HighlightStyle with the given name and highlight attributes with a default enabled status of true.
Parameters:
styleName - the name of the style
presentationName - the presentation or public name of the style that can be used for UI purposes
priority - the priority of the highlight
fgColor - the foreground color to use
bgColor - the background color to use

createStyle

public HighlightStyle createStyle(java.lang.String styleName,
                                  java.lang.String presentationName,
                                  boolean enabled,
                                  int priority,
                                  java.awt.Color fgColor,
                                  java.awt.Color bgColor)
Create a new HighlightStyle with the given name and highlight attributes.
Parameters:
styleName - the name of the style
presentationName - the presentation or public name of the style that can be used for UI purposes
enabled - whether the highlight is enabled by default
priority - the priority of the highlight
fgColor - the foreground color to use
bgColor - the background color to use

createStyle

public HighlightStyle createStyle(java.lang.String styleName,
                                  java.lang.String presentationName,
                                  boolean enabled,
                                  int priority,
                                  int underlinePredefinedPainter,
                                  java.awt.Color underlineColor)
Create a new HighlightStyle with the given name and highlight attributes.
Parameters:
styleName - the name of the style
presentationName - the presentation or public name of the style that can be used for UI purposes
enabled - whether the highlight is enabled by default
priority - the priority of the highlight
underlinePredefinedPainter - one of the predefined painters, i.e., SINGLE_UNDERLINE
underlineColor - the underline color to use, or null for none

createStyle

public HighlightStyle createStyle(java.lang.String styleName,
                                  java.lang.String presentationName,
                                  boolean enabled,
                                  int priority,
                                  int fontStyle)
Create a new HighlightStyle with the given name and highlight attributes.
Parameters:
styleName - the name of the style
presentationName - the presentation or public name of the style that can be used for UI purposes
enabled - whether the highlight is enabled by default
priority - the priority of the highlight
fontStyle - the font style to apply, i.e., HighlightStyle.FONT_BOLD

createStyle

public HighlightStyle createStyle(java.lang.String styleName,
                                  java.lang.String presentationName,
                                  boolean enabled,
                                  int priority,
                                  java.awt.Color fgColor,
                                  java.awt.Color bgColor,
                                  int fontStyle,
                                  int underlinePredefinedPainter,
                                  java.awt.Color underlineColor)
Create a new HighlightStyle with the given name and highlight attributes.
Parameters:
styleName - the name of the style
presentationName - the presentation or public name of the style that can be used for UI purposes
enabled - whether the highlight is enabled by default
priority - the priority of the highlight
fgColor - the foreground color to use, or null for none
bgColor - the background color to use, or null for none
fontStyle - the font style to apply, i.e., HighlightStyle.FONT_BOLD
underlinePredefinedPainter - one of the predefined painters, i.e., SINGLE_UNDERLINE
underlineColor - the underline color to use, or null for none

lookupPredefinedPainter

public static int lookupPredefinedPainter(UnderlinePainter painter)
Utility routine to determine the predefined index number for a painter. This may be used by syntax highlighting to determine a constant to use for persistence. Returns -1 if the given painter is not a predefined painter.
Parameters:
painter - the painter to look up
Returns:
the predefined index number of the given painter

createTransientStyle

public HighlightStyle createTransientStyle(java.lang.String styleName,
                                           boolean enabled,
                                           int priority,
                                           java.awt.Color fgColor,
                                           java.awt.Color bgColor,
                                           int fontStyle,
                                           int underlinePredefinedPainter,
                                           java.awt.Color underlineColor)
Create a new transient HighlightStyle with the given name and highlight attributes. Transient styles are not persisted, not displayed to users for customizations, and are generally based on a non-transient style and used for some special effect (such as fading).
Parameters:
styleName - the name of the style
enabled - whether the highlight is enabled by default
priority - the priority of the highlight
fgColor - the foreground color to use, or null for none
bgColor - the background color to use, or null for none
fontStyle - the font style to apply, i.e., HighlightStyle.FONT_BOLD
underlinePredefinedPainter - one of the predefined painters, i.e., SINGLE_UNDERLINE
underlineColor - the underline color to use, or null for none

lookupStyle

public HighlightStyle lookupStyle(java.lang.String styleName)
Fetches the style with the given name.
Returns:
the style with the given name, or null if it is not found

modifyStyleEnabled

public void modifyStyleEnabled(java.lang.String styleName,
                               boolean enabled)
Modifies the style's enabled status.
Parameters:
styleName - the name of the style to modify
enabled - the enabled status of the style

modifyStylePriority

public void modifyStylePriority(java.lang.String styleName,
                                int priority)
Modifies the style's priority attribute.
Parameters:
styleName - the name of the style to modify
priority - the new priority to use

modifyStyleForeground

public void modifyStyleForeground(java.lang.String styleName,
                                  java.awt.Color fgColor)
Modifies the style's foreground attributes.
Parameters:
styleName - the name of the style to modify
useFG - whether to use the foreground or not
fgColor - the foreground color to use

modifyStyleBackground

public void modifyStyleBackground(java.lang.String styleName,
                                  java.awt.Color bgColor)
Modifies the style's background attributes.
Parameters:
styleName - the name of the style to modify
bgColor - the background color to use

modifyStyleFont

public void modifyStyleFont(java.lang.String styleName,
                            int fontStyle)
Modifies the style's font attributes.
Parameters:
styleName - the name of the style to modify
fontStyle - the font style to use

modifyStyleUnderline

public void modifyStyleUnderline(java.lang.String styleName,
                                 int underlinePredefinedPainter,
                                 java.awt.Color underlineColor)
Modifies the style's underline attributes.
Parameters:
styleName - the name of the style to modify
underlinePredefinedPainter - the predefined painter index to use
underlineColor - the underline color to use

modifyStyleUnderline

public void modifyStyleUnderline(java.lang.String styleName,
                                 UnderlinePainter underlinePainter,
                                 java.awt.Color underlineColor)
Modifies the style's underline attributes. Note, if you use a custom underline painter here, rather than a predefined painter, this style will probably not be editable by the syntax highlighting preference panel.
Parameters:
styleName - the name of the style to modify
underlinePainter - the underline painter to use
underlineColor - the underline color to use

modifyStyle

public void modifyStyle(java.lang.String styleName,
                        boolean enabled,
                        int priority,
                        boolean useFG,
                        java.awt.Color fgColor,
                        boolean useBG,
                        java.awt.Color bgColor)
Deprecated. 
Modifies this style's attributes. If the style has not yet been created or initialized, these settings will be stored and applied when the style is actually created by the owner of the style.
Parameters:
styleName - the name of the style to modify
enabled - whether to enable the highlight or not
priority - the new priority to use
useFG - whether to use the fg or not
fgColor - the foreground color to use
useBG - whether to use the bg or not
bgColor - the background color to use

modifyStyle

public void modifyStyle(java.lang.String styleName,
                        boolean enabled,
                        int priority,
                        java.awt.Color fgColor,
                        java.awt.Color bgColor,
                        int fontStyle,
                        int underlinePredefinedPainter,
                        java.awt.Color underlineColor)
Modifies this style's attributes. If the style has not yet been created or initialized, these settings will be stored and applied when the style is actually created by the owner of the style.
Parameters:
styleName - the name of the style to modify
enabled - whether to enable the highlight or not
priority - the new priority to use
fgColor - the foreground color to use
bgColor - the background color to use
fontStyle - the font style to use
underlinePredefinedPainter - the predefined painter index to use
underlineColor - the underlineColor to use

Skip navigation links

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

E13403-10


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