Overview

 
Package  Use  Tree  Serialized  Deprecated  Index  Help 
SWT LPEX
v3.0.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

com.ibm.lpex.core
Class LpexPaletteAttributes

java.lang.Object
  extended bycom.ibm.lpex.core.LpexPaletteAttributes


public final class LpexPaletteAttributes
extends Object

Class LpexPaletteAttributes provides a mechanism for converting style attributes to a specified palette.


Method Summary
static String background(LpexView lpexView)
          Use this method to determine the background color of the default style (parameter styleAttributes.default) that is used by the specified document view.
static String convert(String styleAttributesString, String fromBackground, String toBackground)
          Use this method to convert a style attributes string from one background color to another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

 

 

background

public static String background(LpexView lpexView)

Use this method to determine the background color of the default style (parameter styleAttributes.default) that is used by the specified document view. The color is returned as a string of three integers representing the red, green, and blue components of the background color.


 

 

convert

public static String convert(String styleAttributesString,
                             String fromBackground,
                             String toBackground)

Use this method to convert a style attributes string from one background color to another.

As an example, below is how the style character for comments ('c') is defined in the Java document parser, in order to ensure correct colors for the active palette. The parser uses the common ATTRIBUTES_COMMENT style attributes, which are defined for BACKGROUND_COLOR (white), first converted to the currently active palette.

 
 // get the background color of view's active palette
 String toBackground = LpexPaletteAttributes.background(view);
 // convert style attributes from definition background to the active one 
 String attributes = LpexPaletteAttributes.convert(ATTRIBUTES_COMMENT,
                                                   BACKGROUND_COLOR,
                                                   toBackground);
 // define the style character
 setStyle("c", attributes); 

See Also:
LpexCommonParser.setStyle(java.lang.String, java.lang.String)


 

Overview

 
Package  Use  Tree  Serialized  Deprecated  Index  Help 
SWT LPEX
v3.0.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD