java.lang.Object | |
↳ | com.google.gwt.i18n.shared.BidiUtils |
Utility functions for performing common Bidi tests on strings.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Like
endsWithLtr(String, boolean) , but assumes str is not
HTML / HTML-escaped. | |||||||||||
Check whether the last strongly-directional character in the string is LTR.
| |||||||||||
Like
endsWithRtl(String, boolean) , but assumes str is not
HTML / HTML-escaped. | |||||||||||
Check whether the last strongly-directional character in the string is RTL.
| |||||||||||
Like
estimateDirection(String, boolean) , but assumes str
is not HTML / HTML-escaped. | |||||||||||
Estimates the directionality of a string based on relative word counts.
| |||||||||||
Get an instance of BidiUtils.
| |||||||||||
Checks if the given string has any LTR characters in it.
| |||||||||||
Like
hasAnyLtr(String, boolean) , but assumes str is not
HTML / HTML-escaped. | |||||||||||
Like
hasAnyRtl(String, boolean) , but assumes str is not
HTML / HTML-escaped. | |||||||||||
Checks if the given string has any RTL characters in it.
| |||||||||||
Like
startsWithLtr(String, boolean) , but assumes str is
not HTML / HTML-escaped. | |||||||||||
Check whether the first strongly-directional character in the string is
LTR.
| |||||||||||
Like
startsWithRtl(String, boolean) , but assumes str is
not HTML / HTML-escaped. | |||||||||||
Check whether the first strongly-directional character in the string is
RTL.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Like endsWithLtr(String, boolean)
, but assumes str
is not
HTML / HTML-escaped.
Check whether the last strongly-directional character in the string is LTR.
str | the string to check |
---|---|
isHtml | whether str is HTML / HTML-escaped |
Like endsWithRtl(String, boolean)
, but assumes str
is not
HTML / HTML-escaped.
Check whether the last strongly-directional character in the string is RTL.
str | the string to check |
---|---|
isHtml | whether str is HTML / HTML-escaped |
Like estimateDirection(String, boolean)
, but assumes str
is not HTML / HTML-escaped.
Estimates the directionality of a string based on relative word counts. If the number of RTL words is above a certain percentage of the total number of strongly directional words, returns RTL. Otherwise, if any words are strongly or weakly LTR, returns LTR. Otherwise, returns DEFAULT, which is used to mean "neutral". Numbers are counted as weakly LTR.
str | the string to check |
---|---|
isHtml | whether str is HTML / HTML-escaped. Use this to
ignore HTML tags and escapes that would otherwise be mistaken for
LTR text. |
Checks if the given string has any LTR characters in it.
str | the string to be tested |
---|---|
isHtml | whether str is HTML / HTML-escaped |
Like hasAnyLtr(String, boolean)
, but assumes str
is not
HTML / HTML-escaped.
str | the string to be tested |
---|
Like hasAnyRtl(String, boolean)
, but assumes str
is not
HTML / HTML-escaped.
str | the string to be tested |
---|
Checks if the given string has any RTL characters in it.
str | the string to be tested |
---|---|
isHtml | whether str is HTML / HTML-escaped |
Like startsWithLtr(String, boolean)
, but assumes str
is
not HTML / HTML-escaped.
Check whether the first strongly-directional character in the string is LTR.
str | the string to check |
---|---|
isHtml | whether str is HTML / HTML-escaped |
Like startsWithRtl(String, boolean)
, but assumes str
is
not HTML / HTML-escaped.
Check whether the first strongly-directional character in the string is RTL.
str | the string to check |
---|---|
isHtml | whether str is HTML / HTML-escaped |