public class SKDBidiUtil
extends java.lang.Object
Constructor and Description |
---|
SKDBidiUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addTooltipPair(java.util.List<java.lang.Object> pairs,
java.lang.Object label,
java.lang.Object data)
Convenience method that will add the tooltip pair, even if the data value is null.
|
static void |
addTooltipPair(java.util.List<java.lang.Object> pairs,
java.lang.Object label,
java.lang.Object data,
boolean addOnlyIfDataNotNull)
Simple convenience method to add 2 pieces of data (ie, a pair) to a List provided that the data is not null.
|
static java.lang.String |
htmlTableTooltip(boolean bidiEnabled,
boolean guiMirrorred,
java.lang.String headerText,
java.lang.String footerText,
boolean boldLabels,
java.lang.String separator,
java.lang.Object... parts)
Formats a tooltip as two column table layout where the first column is the Label and the second
column is the description.
|
static java.lang.String |
htmlTableTooltip(boolean boldLabels,
java.lang.String separator,
java.lang.Object... parts)
Convenience method for creating html table tooltips that don't require a header or footer text
|
static java.lang.String |
htmlTableTooltip(java.lang.String headerText,
java.lang.String footerText,
boolean boldLabels,
java.lang.String separator,
java.lang.Object... parts)
Convenience method for creating html table tooltips that autodiscovers the BIDI and GUI mirrorred settings
|
static boolean |
isRTL(java.lang.Object... parts)
Given an array of objects return true if any objects are RTL strings
|
static boolean |
isRTL(java.lang.String str)
Return true if the string is a RTL string
|
static java.lang.String |
join(java.lang.Object... parts)
Convenience method for joining multiple strings using a null separator (ie, no separator) and it will use
discover whether or not to use bidi enabled or not.
|
static java.lang.String |
joinBIDIWith(boolean bidiEnalbed,
java.lang.String sepString,
java.lang.Object... parts)
Joins multiple strings, applying a separactor string between them, if non null.
|
static java.lang.String |
joinWith(java.lang.String sepString,
java.lang.Object... parts)
Convenience method that auto determines the bidi enabled setting.
|
static java.lang.String |
toHTML(java.lang.String rtlString)
Given a BIDI string (ie, string with BIDI control chars) convert it to an emulated bidi string.
|
public static java.lang.String joinBIDIWith(boolean bidiEnalbed, java.lang.String sepString, java.lang.Object... parts)
C-B-Awhile the unicode string would look like{8235}{65}{8207}{45}{8207}{66}{8207}{45}{8207}{67}{8236}
if a null separator is passed in, then no separator will be used.
For example, if called as join(true, null, "A',"B","C") then the output would look likeCBAwhile the unicode string would look like{8235}{65}{8207}{66}{8207}{67}{8236}
If bidi is not enabled the normal string concatenation rules applies the resulting string will contain NO unicode control characters.
For example, if called as join(false, "-", "A',"B","C") then the output would look likeA-B-Cwhile the unicode string would look like{65}{66}{67}
bidiEnalbed
- true if you want the string to contain RLE bidi control codessepString
- if non null, then each part will be joined using this separatorparts
- variable arg array of objects (usualy strings) that will be joinedpublic static java.lang.String joinWith(java.lang.String sepString, java.lang.Object... parts)
String description = SKDBidiUtil.join("-", getAssetNum(), getAssetDescription());This would join the asset num and the asset description using bidi control characters, IF bidi is required
sepString
- parts
- public static java.lang.String join(java.lang.Object... parts)
String description = SKDBidiUtil.join(getAssetNum(), "-", getAssetDescription())This would join the asset num , "-" and description using bidi control control characters if bidi is required.
parts
- public static boolean isRTL(java.lang.String str)
str
- public static boolean isRTL(java.lang.Object... parts)
parts
- public static java.lang.String htmlTableTooltip(boolean boldLabels, java.lang.String separator, java.lang.Object... parts)
boldLabels
- separator
- parts
- public static java.lang.String htmlTableTooltip(java.lang.String headerText, java.lang.String footerText, boolean boldLabels, java.lang.String separator, java.lang.Object... parts)
headerText
- footerText
- boldLabels
- separator
- parts
- public static java.lang.String htmlTableTooltip(boolean bidiEnabled, boolean guiMirrorred, java.lang.String headerText, java.lang.String footerText, boolean boldLabels, java.lang.String separator, java.lang.Object... parts)
headerText
- Optional header text to display above the paired datafooterText
- Optional footer text to display below the paried databoldLabels
- if true, then the labels will bolded to stand outseparator
- if set, then this will be added to the labelparts
- Array data were every 2 elements is a row in the html tooltippublic static java.lang.String toHTML(java.lang.String rtlString)
rtlString
- public static void addTooltipPair(java.util.List<java.lang.Object> pairs, java.lang.Object label, java.lang.Object data)
pairs
- label
- data
- public static void addTooltipPair(java.util.List<java.lang.Object> pairs, java.lang.Object label, java.lang.Object data, boolean addOnlyIfDataNotNull)
pairs
- List
to which to add the label and data pairlabel
- data labeldata
- data valueaddOnlyIfDataNotNull
- when true, then the label/data pair will only be added if the data is not null