org.eclipse.graphiti.util
Class TextBuilder.TextBuilderRegion

java.lang.Object
  extended by org.eclipse.graphiti.util.TextBuilder.TextBuilderRegion
Enclosing class:
TextBuilder

public static class TextBuilder.TextBuilderRegion
extends Object

Inner class for storing the partial region styles.


Field Summary
private  int start
          Start offset of the region in the text.
private  TextStyle style
          Current style of the region, null means default style.
 
Constructor Summary
TextBuilder.TextBuilderRegion()
          Constructor of the TextBuilder.TextBuilderRegion class.
 
Method Summary
private  void ensureStyle()
          Ensure a non-default style is available for modification.
 int getStart()
          Get start offset of the region in the text.
 TextStyle getStyle()
          Get the text style of the region in the text.
 TextBuilder.TextBuilderRegion setBackground(Color col)
          Set the background color of the text for the region.
 TextBuilder.TextBuilderRegion setFont(Font font)
          Set the font for the region.
 TextBuilder.TextBuilderRegion setForeground(Color col)
          Set the foreground color of the text for the region.
 TextBuilder.TextBuilderRegion setStart(int start)
          Assign a start to the partial region style.
 TextBuilder.TextBuilderRegion setStrikeOut(boolean value, Color col)
          Set strikeout for the region.
 TextBuilder.TextBuilderRegion setStyle(TextStyle style)
          Assign a style to the region of text.
 TextBuilder.TextBuilderRegion setUnderline(Color col)
          Set the underline color for the region.
 TextBuilder.TextBuilderRegion setUnderline(UnderlineStyle uStyle, Color col)
          Set the underline style for the region.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

style

private TextStyle style
Current style of the region, null means default style.


start

private int start
Start offset of the region in the text.

Constructor Detail

TextBuilder.TextBuilderRegion

public TextBuilder.TextBuilderRegion()
Constructor of the TextBuilder.TextBuilderRegion class.

Method Detail

getStart

public int getStart()
Get start offset of the region in the text.

Returns:
The start offset of the region.

getStyle

public TextStyle getStyle()
Get the text style of the region in the text.

Returns:
The text style, or null for the default style.

ensureStyle

private void ensureStyle()
Ensure a non-default style is available for modification.


setStyle

public TextBuilder.TextBuilderRegion setStyle(TextStyle style)
Assign a style to the region of text.

Parameters:
style - Style to assign.
Returns:
The updated partial region style.

setStart

public TextBuilder.TextBuilderRegion setStart(int start)
Assign a start to the partial region style.

Parameters:
start - New start offset of the region in the text.
Returns:
The updated partial region style.

setUnderline

public TextBuilder.TextBuilderRegion setUnderline(UnderlineStyle uStyle,
                                                  Color col)
Set the underline style for the region.

Parameters:
uStyle - Underline style to assign. null means disable underline.
col - Color of the underline, null means skip setting the color.
Returns:
The updated partial region style.

setUnderline

public TextBuilder.TextBuilderRegion setUnderline(Color col)
Set the underline color for the region.

Parameters:
col - Color of the underline, null means skip setting the color.
Returns:
The updated partial region style.

setStrikeOut

public TextBuilder.TextBuilderRegion setStrikeOut(boolean value,
                                                  Color col)
Set strikeout for the region.

Parameters:
value - Enable or disable strikeout.
col - Color of the strikeout, if enabled. null means skip setting of the color.
Returns:
The updated partial region style.

setForeground

public TextBuilder.TextBuilderRegion setForeground(Color col)
Set the foreground color of the text for the region.

Parameters:
col - Foreground color to set. null means skip setting of the color.
Returns:
The updated partial region style.

setBackground

public TextBuilder.TextBuilderRegion setBackground(Color col)
Set the background color of the text for the region.

Parameters:
col - Background color to set. null means skip setting of the color.
Returns:
The updated partial region style.

setFont

public TextBuilder.TextBuilderRegion setFont(Font font)
Set the font for the region.

Parameters:
font - Font to set.
Returns:
The updated partial region style.


Copyright (c) SAP AG 2005, 2012.