Package org.freeplane.core.util
Class TextUtils
java.lang.Object
org.freeplane.core.util.TextUtils
utilities for translations, conversions to/from number and dates etc.
In scripts available as "global variable"
textUtils
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
capitalize
(String string) static void
copyHtmlToClipboard
(String html) Shortcut for scripting: Copieshtml
with mimetype text/html to the system clipboard.static void
copyToClipboard
(String string) Shortcut for scripting: Copiesstring
to the system clipboard.static org.freeplane.core.resources.TranslatedObject
static void
escapeUtf8
(Writer out, String str) Escapes the UTF-8 non-ASCII characters in aString
to aWriter
.static String
escapeUtf8
(String str) The escapeUtf8 method is a stripped down version of the StringEscapeUtils.escapeJava method in Commons Lang 2.6 It escapes the UTF-8 non-ASCII characters in aString
.static String
accessor for scripts.accessor for scripts.accessor for scripts.static String
getOptionalText
(String string) static String
getOptionalText
(String string, String defaultValue) static String
getOptionalTranslation
(String text) static String
getOriginalRawText
(String key) static String
getRawText
(String key) static String
getRawText
(String key, String defaultString) static String
getShortText
(String text, int maximumCharacters, String continuationMark) static String
static String
static boolean
static boolean
static boolean
matchesUriPattern
(String text) in opposite to the URI make scheme mandatory.static String
removeMnemonic
(String rawLabel) static String
removeTranslateComment
(String inputString) Removes the "TranslateMe" sign from the end of not translated texts.static String
replaceAtBegin
(String source, String from, String to) static Number
-
Constructor Details
-
TextUtils
public TextUtils()
-
-
Method Details
-
format
-
getOptionalText
-
getOptionalText
-
removeMnemonic
-
removeTranslateComment
Removes the "TranslateMe" sign from the end of not translated texts. -
createTranslatedString
-
getText
-
getRawText
-
getOriginalRawText
-
getText
-
getRawText
-
getOptionalTranslation
-
toNumber
- Throws:
NumberFormatException
-
isNumber
-
isEmpty
-
matchesUriPattern
in opposite to the URI make scheme mandatory. -
getShortText
-
getDefaultNumberFormat
accessor for scripts. -
getDefaultDateFormat
accessor for scripts. -
getDefaultDateTimeFormat
accessor for scripts. -
capitalize
-
replaceAtBegin
-
copyToClipboard
Shortcut for scripting: Copiesstring
to the system clipboard. -
copyHtmlToClipboard
Shortcut for scripting: Copieshtml
with mimetype text/html to the system clipboard. -
escapeUtf8
The escapeUtf8 method is a stripped down version of the StringEscapeUtils.escapeJava method in Commons Lang 2.6 It escapes the UTF-8 non-ASCII characters in aString
.Such a character becomes
'\\'
and'u'
followed by a 4 digit hex code.Any ASCII character will stay intact
Example:
input string: jalapeƱo output string: jalape\u00F1o
- Parameters:
str
- String to escape values in, may be null- Returns:
- String with escaped values,
null
if null string input
-
escapeUtf8
Escapes the UTF-8 non-ASCII characters in aString
to aWriter
.A
null
string input has no effect.- Parameters:
out
- Writer to write escaped string intostr
- String to escape values in, may be null- Throws:
IllegalArgumentException
- if the Writer isnull
IOException
- if error occurs on underlying Writer- See Also:
-