public class TextPainterHelper
extends java.lang.Object
Constructor and Description |
---|
TextPainterHelper() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
cleanUp(java.lang.String string)
Removes all markups out of the given string.
|
static org.eclipse.swt.graphics.Point |
drawText(org.eclipse.swt.graphics.GC gc,
java.lang.String text,
int x,
int y)
Will draw the given text to the given GC.
|
static org.eclipse.swt.graphics.Color |
getColor(java.lang.String str)
Gets the color for a color markup in the given string.
|
static int |
getSize(java.lang.String str)
Gets the font size out of a size markup in the given string.
|
static boolean |
isBold(java.lang.String str)
Checks for the existence of the bold markup.
|
static boolean |
isItalic(java.lang.String str)
Checks for the existence of the italic markup.
|
static boolean |
isNormalize(java.lang.String str)
Checks for the existence of the normalize markup.
|
public static org.eclipse.swt.graphics.Point drawText(org.eclipse.swt.graphics.GC gc, java.lang.String text, int x, int y)
gc
- The GC to draw the text totext
- The text to drawx
- The x coordinate where the text should be drawed to the GCy
- The y coordinate where the text should be drawed to the GCpublic static java.lang.String cleanUp(java.lang.String string)
string
- The string whose markups should be removed.public static boolean isNormalize(java.lang.String str)
str
- The string to check for the normalize markuptrue
if the given string contains the
normalize markuppublic static boolean isBold(java.lang.String str)
str
- The string to check for the bold markuptrue
if the given string contains the
bold markuppublic static boolean isItalic(java.lang.String str)
str
- The string to check for the italic markuptrue
if the given string contains the
italic markuppublic static int getSize(java.lang.String str)
str
- The string containing the size markuppublic static org.eclipse.swt.graphics.Color getColor(java.lang.String str)
str
- The string containing a color markup