Extension SDK 10.1.2

oracle.javatools.editor.highlight
Class HighlightRegistry

java.lang.Object
  extended byoracle.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 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.
 
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, 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.
 java.util.Iterator getStyleIterator()
          Fetch an Iterator for all of the styles within this registry.
 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)
          Modifies this style's attributes.
 void modifyStyleBackground(java.lang.String styleName, boolean useBG, 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 modifyStyleForeground(java.lang.String styleName, boolean useFG, 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 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

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 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.

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.

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

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,
                                  boolean useFG,
                                  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,
                                  boolean useBG,
                                  java.awt.Color bgColor)
Modifies the style's background attributes.

Parameters:
styleName - the name of the style to modify
useBG - whether to use the background or not
bgColor - the background 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)
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

Extension SDK

 

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