org.LexGrid.LexBIG.gui.displayResults
Class TextContent

java.lang.Object
  extended by org.LexGrid.LexBIG.gui.displayResults.TextContent

public class TextContent
extends java.lang.Object

This class makes it easier to display formatted text in a SWT StyledText. You can mark up your text with tags like - basic html tags - and it will create the necessary style ranges for the StyledText object. Supported Tags: (pre is not supported - it is just here so you can read this from the javadocs)

 <b> - bold
 <i> - italic
 <u> - underline
 <so> - strikeout
 <red> - red font color
 <green> - green font color
 <blue> - blue font color
 

Version:
subversion $Revision: $ checked in on $Date: $
Author:
Dan Armbrust

Field Summary
protected  org.eclipse.swt.graphics.Color black
           
protected  org.eclipse.swt.graphics.Color blue
           
protected  java.lang.String content
           
protected  org.eclipse.swt.custom.StyleRange curRange
           
protected  org.eclipse.swt.graphics.Color green
           
protected  int nesting
           
protected  int rangeStyle
           
protected  org.eclipse.swt.graphics.Color red
           
protected  java.util.List<org.eclipse.swt.custom.StyleRange> styleRanges
           
protected  org.eclipse.swt.graphics.Color white
           
 
Constructor Summary
TextContent(org.eclipse.swt.widgets.Display display)
           
 
Method Summary
protected  void endRange(int posn)
           
 java.lang.String getContent()
           
 org.eclipse.swt.custom.StyleRange[] getStyleRanges()
           
 void setContent(java.lang.String content)
           
protected  void startRange(int posn)
           
 java.lang.String toPlainText()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

content

protected java.lang.String content

nesting

protected int nesting

styleRanges

protected java.util.List<org.eclipse.swt.custom.StyleRange> styleRanges

black

protected org.eclipse.swt.graphics.Color black

white

protected org.eclipse.swt.graphics.Color white

red

protected org.eclipse.swt.graphics.Color red

green

protected org.eclipse.swt.graphics.Color green

blue

protected org.eclipse.swt.graphics.Color blue

curRange

protected org.eclipse.swt.custom.StyleRange curRange

rangeStyle

protected int rangeStyle
Constructor Detail

TextContent

public TextContent(org.eclipse.swt.widgets.Display display)
Method Detail

getContent

public java.lang.String getContent()
Returns:
Returns the content.

setContent

public void setContent(java.lang.String content)
Parameters:
content - The content to set.

startRange

protected void startRange(int posn)

endRange

protected void endRange(int posn)

toPlainText

public java.lang.String toPlainText()

getStyleRanges

public org.eclipse.swt.custom.StyleRange[] getStyleRanges()

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.