Class MultiLineStringUtil
java.lang.Object
com.inductiveautomation.ignition.common.util.gui.MultiLineStringUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
toMultiLineByChar
(String s, int max) Helper function to format string by characters.static String[]
toMultiLineByWord
(String s, int max) Helper function to format string by words.static String[]
Convert a string to a multi line tooltip string using the default max character per line and max lines.static String[]
toMultiLineStringFormat
(String s, boolean formatByWord) Convert a string to a multi line tooltip string using the default max character per line and max lines.static String[]
toMultiLineStringFormat
(String s, int max, int maxLines, boolean formatByWord) Convert a string to a multi line tooltip string given a max character per line
-
Constructor Details
-
MultiLineStringUtil
public MultiLineStringUtil()
-
-
Method Details
-
toMultiLineStringFormat
Convert a string to a multi line tooltip string using the default max character per line and max lines. By default it will format by word.- Parameters:
s
- String to be formatted- Returns:
- String array to be displayed
-
toMultiLineStringFormat
Convert a string to a multi line tooltip string using the default max character per line and max lines.- Parameters:
s
- String to be formattedformatByWord
- formatted by word by default, set to false to format by character- Returns:
- String array to be displayed
-
toMultiLineStringFormat
public static String[] toMultiLineStringFormat(String s, int max, int maxLines, boolean formatByWord) Convert a string to a multi line tooltip string given a max character per line- Parameters:
s
- String to be formattedmax
- Max characters per line. Spaces COUNT towards the max.maxLines
- Max number of lines. Use -1 (or any number less than 0) for indefinite number of lines.formatByWord
- boolean to determine whether to format by word or by character- Returns:
- String array to be displayed
-
toMultiLineByWord
Helper function to format string by words. DOES NOT take into account new lines.- Parameters:
s
- String to be formattedmax
- Max characters per line. Spaces COUNT towards the max.- Returns:
- String array formatted by word
-
toMultiLineByChar
Helper function to format string by characters. DOES NOT take into account new lines.- Parameters:
s
- String to be formattedmax
- Max characters per line. Spaces COUNT towards the max.- Returns:
- String array formatted by characters
-