Package com.nomagic.reportwizard.tools
Class TextTool
java.lang.Object
java.util.Observable
com.nomagic.magicreport.engine.Tool
com.nomagic.reportwizard.tools.TextTool
- All Implemented Interfaces:
ITool,IVariable,Serializable,Cloneable
Contains utilities functions for text renderer. Recommended context name of this class is "text".
- Since:
- Jun 6, 2008
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.nomagic.magicreport.engine.ITool
ITool.HTMLString, ITool.RetainedString, ITool.Void -
Field Summary
Fields inherited from class com.nomagic.magicreport.engine.Tool
context, properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionForce report to render given text in bold style.booleanCompares two strings.getPureText(String source) Get Pure text from html source.Convert text from RTF into Java String.Force report to render given text in HTML.Force report to render given text in italic style.noLineBreak(String text) Remove all control characters such as U+0009 (Tab), U+000A (Line Feed) and U+000D (Carriage Return) from given text.Convert the string argument to signed decimaldouble.Convert the string argument to signed decimalinteger.Force report to render given text in underline style.Methods inherited from class com.nomagic.magicreport.engine.Tool
clone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContext, setPropertiesMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged
-
Constructor Details
-
TextTool
public TextTool()
-
-
Method Details
-
noLineBreak
Remove all control characters such as U+0009 (Tab), U+000A (Line Feed) and U+000D (Carriage Return) from given text. This method will performs text filtering under category "Cc" in the Unicode specification.- Parameters:
text- input text- Returns:
- new text
-
toInteger
Convert the string argument to signed decimalinteger.- Parameters:
text- aStringcontaining theintrepresentation to be converted- Returns:
- the integer value represented by the argument in decimal
-
toDouble
Convert the string argument to signed decimaldouble.- Parameters:
text- aStringcontaining theintrepresentation to be converted- Returns:
- the integer value represented by the argument in decimal
-
italic
Force report to render given text in italic style.- Parameters:
text- input text- Returns:
- HTML text in italic style.
-
bold
Force report to render given text in bold style.- Parameters:
text- input text- Returns:
- HTML text in bold style.
-
underline
Force report to render given text in underline style.- Parameters:
text- input text- Returns:
- HTML text in underline style.
-
html
Force report to render given text in HTML.For example:
$text.html('<ul><li>A</li><li>B</li></ul>')- Parameters:
text- input text- Returns:
- HTML text.
-
equals
Compares two strings. The result istrueif and only if thestr1is represents the same sequence of characters asstr2.- Parameters:
str1- first stringstr2- second string- Returns:
trueif theStringare equal;falseotherwise.
-
getString
Convert text from RTF into Java String.For example:
#set ($str = $text.getString("bersetzer"))- Parameters:
str- a RTF text.- Returns:
- a Java String
-
getPureText
Get Pure text from html source.- Parameters:
source- The given html source.- Returns:
- pure text from html source.
-