@OpenApiAll
public class RichTextStringUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COLOR_POSTFIX
Color tag postfix
|
static java.lang.String |
COLOR_PREFIX
Color tag prefix
|
static java.awt.Color |
GRAY_COLOR
Gray color
|
Constructor and Description |
---|
RichTextStringUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
closeColor(java.lang.String text)
Close color tag.
|
static void |
closeColor(java.lang.StringBuffer text)
Close color tag.
|
static void |
closeColor(java.lang.StringBuilder text)
Close color tag.
|
static void |
startColor(java.lang.StringBuffer text,
java.awt.Color color)
Set given color to the given text.
|
static void |
startColor(java.lang.StringBuilder text,
java.awt.Color color)
Set given color to the given text.
|
static java.lang.String |
startColor(java.lang.String text,
java.awt.Color color)
Set given color to the given text.
|
static java.lang.String |
toString(java.awt.Color color) |
static java.lang.String |
trimText(java.lang.String text,
int index)
Trim text up to the given index.
|
static void |
wrapInColor(java.lang.StringBuffer text,
java.awt.Color color)
Set given color to the given text.
|
static void |
wrapInColor(java.lang.StringBuilder text,
java.awt.Color color)
Set given color to the given text.
|
static java.lang.String |
wrapInColor(java.lang.String text,
java.awt.Color color)
Set given color to the given text.
|
public static final java.awt.Color GRAY_COLOR
public static final java.lang.String COLOR_PREFIX
public static final java.lang.String COLOR_POSTFIX
public static java.lang.String closeColor(java.lang.String text)
text
- textpublic static void closeColor(java.lang.StringBuilder text)
text
- textpublic static void closeColor(java.lang.StringBuffer text)
text
- textpublic static void startColor(java.lang.StringBuffer text, java.awt.Color color)
text
- textcolor
- colorpublic static void startColor(java.lang.StringBuilder text, java.awt.Color color)
text
- textcolor
- colorpublic static java.lang.String startColor(java.lang.String text, java.awt.Color color)
text
- textcolor
- colorpublic static java.lang.String wrapInColor(@CheckForNull java.lang.String text, java.awt.Color color)
text
- textcolor
- colorpublic static void wrapInColor(java.lang.StringBuilder text, java.awt.Color color)
text
- textcolor
- colorpublic static void wrapInColor(java.lang.StringBuffer text, java.awt.Color color)
text
- textcolor
- colorpublic static java.lang.String trimText(java.lang.String text, int index)
text
- textindex
- indexpublic static java.lang.String toString(java.awt.Color color)
color
- color