Package com.nomagic.text.rich
Class RichTextStringUtils
java.lang.Object
com.nomagic.text.rich.RichTextStringUtils
Utility class to work with rich text.
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic StringcloseColor(String text) Close color tag.static voidcloseColor(StringBuffer text) Close color tag.static voidcloseColor(StringBuilder text) Close color tag.static voidstartColor(StringBuffer text, Color color) Set given color to the given text.static voidstartColor(StringBuilder text, Color color) Set given color to the given text.static StringstartColor(String text, Color color) Set given color to the given text.static Stringstatic StringTrim text up to the given index.static StringTrim text from-to the given index.static voidwrapInColor(StringBuffer text, Color color) Set given color to the given text.static voidwrapInColor(StringBuilder text, Color color) Set given color to the given text.static StringwrapInColor(String text, Color color) Set given color to the given text. 
- 
Field Details
- 
GRAY_COLOR
Gray color - 
COLOR_PREFIX
Color tag prefix- See Also:
 
 - 
COLOR_POSTFIX
Color tag postfix- See Also:
 
 
 - 
 - 
Constructor Details
- 
RichTextStringUtils
public RichTextStringUtils() 
 - 
 - 
Method Details
- 
closeColor
Close color tag.- Parameters:
 text- text
 - 
closeColor
Close color tag.- Parameters:
 text- text
 - 
closeColor
Close color tag.- Parameters:
 text- text
 - 
startColor
Set given color to the given text.- Parameters:
 text- textcolor- color
 - 
startColor
Set given color to the given text.- Parameters:
 text- textcolor- color
 - 
startColor
Set given color to the given text.- Parameters:
 text- textcolor- color- Returns:
 - text with given color
 
 - 
wrapInColor
Set given color to the given text.- Parameters:
 text- textcolor- color- Returns:
 - text with given color
 
 - 
wrapInColor
Set given color to the given text.- Parameters:
 text- textcolor- color
 - 
wrapInColor
Set given color to the given text.- Parameters:
 text- textcolor- color
 - 
trimText
Trim text up to the given index. Make sure that "color" tag is not cut.- Parameters:
 text- textendIndex- cut end index- Returns:
 - cut text
 
 - 
trimText
Trim text from-to the given index. Make sure that "color" tag is not cut.- Parameters:
 text- textstartIndex- cut start indexendIndex- cut end index- Returns:
 - cut text
 
 - 
toString
- Parameters:
 color- color- Returns:
 - color representation
 
 
 -