public enum TextDirection extends Enum<TextDirection>
| Modifier and Type | Method and Description |
|---|---|
String |
addEmbeddingMarks(String string)
Surround the string with the appropriate LTR or RTL mark
|
char |
getBaseDirectionChar()
Append this marker next to "weak" characters (numbers and punctuation chars)
to provide direction to that and all other neighboring "weak" characters
See Sec 7.3, http://www.w3.org/TR/i18n-html-tech-bidi/#ri20030218.135304584
|
String |
getCapLeft() |
String |
getCapRight() |
static TextDirection |
getDirection(Locale locale)
Get the text direction for the given locale.
|
static TextDirection |
getDirection(String lang)
Get the text direction for the given language iso code (2 characters please)
|
String |
getLeft() |
static boolean |
getNormalTextDirection() |
String |
getRight() |
String |
getToken(String token) |
static TextDirection |
invertIfNotNormalDirection(TextDirection direction)
To aid debugging RTL issues, setNormalTextDirection(false) which
allows a page to be shown with its text direction inverted.
|
String |
makeStringLeftToRight(String string)
Make the string display as left to right, if necessary, based on whether this direction needs it (i.e.
|
static void |
setNormalTextDirection(boolean normal)
Set to false to allow LTR languages to be shown as RTL, or RTL
as LTR.
|
static TextDirection |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TextDirection[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TextDirection LTR
public static final TextDirection RTL
public static TextDirection[] values()
for (TextDirection c : TextDirection.values()) System.out.println(c);
public static TextDirection valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getLeft()
public String getCapLeft()
public String getRight()
public String getCapRight()
public String addEmbeddingMarks(String string)
string - the string to surroundpublic String makeStringLeftToRight(String string)
string - the string to embed as left to rightpublic static TextDirection getDirection(Locale locale)
locale - the locale to testpublic static TextDirection getDirection(String lang)
lang - the language to testpublic char getBaseDirectionChar()
public static TextDirection invertIfNotNormalDirection(TextDirection direction)
direction - the direction to invertpublic static void setNormalTextDirection(boolean normal)
normal - what the normal text direction should bepublic static boolean getNormalTextDirection()
Copyright (c) 2016-2017, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE.txt file in the repository.