本文整理了Java中java.text.Bidi.isLeftToRight()
方法的一些代码示例,展示了Bidi.isLeftToRight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bidi.isLeftToRight()
方法的具体详情如下:
包路径:java.text.Bidi
类名称:Bidi
方法名:isLeftToRight
[英]Indicates whether the text is from left to right, that is, both the base direction and the text direction is from left to right.
[中]指示文本是否从左向右,即基本方向和文本方向都是从左向右。
代码示例来源:origin: robovm/robovm
/**
* Indicates whether a range of characters of a text requires a {@code Bidi}
* object to display properly.
*
* @param text
* the char array of the text.
* @param start
* the start offset of the range of characters.
* @param limit
* the limit offset of the range of characters.
* @return {@code true} if the range of characters requires a {@code Bidi}
* object; {@code false} otherwise.
* @throws IllegalArgumentException
* if {@code start} or {@code limit} is negative; {@code start >
* limit} or {@code limit} is greater than the length of this
* object's paragraph text.
*/
public static boolean requiresBidi(char[] text, int start, int limit) {
if (limit < 0 || start < 0 || start > limit || limit > text.length) {
throw new IllegalArgumentException();
}
Bidi bidi = new Bidi(text, start, null, 0, limit - start, 0);
return !bidi.isLeftToRight();
}
代码示例来源:origin: at.bestsolution.eclipse/com.ibm.icu.base
/**
* Return true if the line is all left-to-right text and the base direction
* is left-to-right.
*
* @return true if the line is all left-to-right text and the base direction
* is left-to-right.
*
* @throws IllegalStateException if this call is not preceded by a successful
* call to <code>setPara</code>
* @stable ICU 3.8
*/
public boolean isLeftToRight()
{
return bidi.isLeftToRight();
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.ibm.icu.base
/**
* Return true if the line is all left-to-right text and the base direction
* is left-to-right.
*
* @return true if the line is all left-to-right text and the base direction
* is left-to-right.
*
* @throws IllegalStateException if this call is not preceded by a successful
* call to <code>setPara</code>
* @stable ICU 3.8
*/
public boolean isLeftToRight()
{
return bidi.isLeftToRight();
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* Indicates whether a range of characters of a text requires a {@code Bidi}
* object to display properly.
*
* @param text
* the char array of the text.
* @param start
* the start offset of the range of characters.
* @param limit
* the limit offset of the range of characters.
* @return {@code true} if the range of characters requires a {@code Bidi}
* object; {@code false} otherwise.
* @throws IllegalArgumentException
* if {@code start} or {@code limit} is negative; {@code start >
* limit} or {@code limit} is greater than the length of this
* object's paragraph text.
*/
public static boolean requiresBidi(char[] text, int start, int limit) {
if (limit < 0 || start < 0 || start > limit || limit > text.length) {
throw new IllegalArgumentException();
}
Bidi bidi = new Bidi(text, start, null, 0, limit - start, 0);
return !bidi.isLeftToRight();
}
代码示例来源:origin: ibinti/bugvm
/**
* Indicates whether a range of characters of a text requires a {@code Bidi}
* object to display properly.
*
* @param text
* the char array of the text.
* @param start
* the start offset of the range of characters.
* @param limit
* the limit offset of the range of characters.
* @return {@code true} if the range of characters requires a {@code Bidi}
* object; {@code false} otherwise.
* @throws IllegalArgumentException
* if {@code start} or {@code limit} is negative; {@code start >
* limit} or {@code limit} is greater than the length of this
* object's paragraph text.
*/
public static boolean requiresBidi(char[] text, int start, int limit) {
if (limit < 0 || start < 0 || start > limit || limit > text.length) {
throw new IllegalArgumentException();
}
Bidi bidi = new Bidi(text, start, null, 0, limit - start, 0);
return !bidi.isLeftToRight();
}
代码示例来源:origin: MobiVM/robovm
/**
* Indicates whether a range of characters of a text requires a {@code Bidi}
* object to display properly.
*
* @param text
* the char array of the text.
* @param start
* the start offset of the range of characters.
* @param limit
* the limit offset of the range of characters.
* @return {@code true} if the range of characters requires a {@code Bidi}
* object; {@code false} otherwise.
* @throws IllegalArgumentException
* if {@code start} or {@code limit} is negative; {@code start >
* limit} or {@code limit} is greater than the length of this
* object's paragraph text.
*/
public static boolean requiresBidi(char[] text, int start, int limit) {
if (limit < 0 || start < 0 || start > limit || limit > text.length) {
throw new IllegalArgumentException();
}
Bidi bidi = new Bidi(text, start, null, 0, limit - start, 0);
return !bidi.isLeftToRight();
}
代码示例来源:origin: stackoverflow.com
private void setLtr(){
String languageToLoad = "en"; // ltr language English
Locale locale = new Locale(languageToLoad);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config,
getBaseContext().getResources().getDisplayMetrics());
//layout direction
Bidi b = new Bidi(languageToLoad, Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT);
b.isLeftToRight();
//save current locale in SharedPreferences
SharedPreferences languagepref = getSharedPreferences("language",MODE_PRIVATE);
SharedPreferences.Editor editor = languagepref.edit();
editor.putString("languageToLoad",languageToLoad );
editor.commit();
startActivity(...);// refresh activity.
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* Indicates whether a range of characters of a text requires a {@code Bidi}
* object to display properly.
*
* @param text
* the char array of the text.
* @param start
* the start offset of the range of characters.
* @param limit
* the limit offset of the range of characters.
* @return {@code true} if the range of characters requires a {@code Bidi}
* object; {@code false} otherwise.
* @throws IllegalArgumentException
* if {@code start} or {@code limit} is negative; {@code start >
* limit} or {@code limit} is greater than the length of this
* object's paragraph text.
*/
public static boolean requiresBidi(char[] text, int start, int limit) {
if (limit < 0 || start < 0 || start > limit || limit > text.length) {
throw new IllegalArgumentException();
}
Bidi bidi = new Bidi(text, start, null, 0, limit - start, 0);
return !bidi.isLeftToRight();
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* Indicates whether a range of characters of a text requires a {@code Bidi}
* object to display properly.
*
* @param text
* the char array of the text.
* @param start
* the start offset of the range of characters.
* @param limit
* the limit offset of the range of characters.
* @return {@code true} if the range of characters requires a {@code Bidi}
* object; {@code false} otherwise.
* @throws IllegalArgumentException
* if {@code start} or {@code limit} is negative; {@code start >
* limit} or {@code limit} is greater than the length of this
* object's paragraph text.
*/
public static boolean requiresBidi(char[] text, int start, int limit) {
if (limit < 0 || start < 0 || start > limit || limit > text.length) {
throw new IllegalArgumentException();
}
Bidi bidi = new Bidi(text, start, null, 0, limit - start, 0);
return !bidi.isLeftToRight();
}
代码示例来源:origin: FlexoVM/flexovm
/**
* Indicates whether a range of characters of a text requires a {@code Bidi}
* object to display properly.
*
* @param text
* the char array of the text.
* @param start
* the start offset of the range of characters.
* @param limit
* the limit offset of the range of characters.
* @return {@code true} if the range of characters requires a {@code Bidi}
* object; {@code false} otherwise.
* @throws IllegalArgumentException
* if {@code start} or {@code limit} is negative; {@code start >
* limit} or {@code limit} is greater than the length of this
* object's paragraph text.
*/
public static boolean requiresBidi(char[] text, int start, int limit) {
if (limit < 0 || start < 0 || start > limit || limit > text.length) {
throw new IllegalArgumentException();
}
Bidi bidi = new Bidi(text, start, null, 0, limit - start, 0);
return !bidi.isLeftToRight();
}
代码示例来源:origin: stackoverflow.com
Bidi bidi = new Bidi(app_locale,
Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT);
bidi.isLeftToRight();
YourGlobalClass.updateLanguage(getActivity(), "en");
代码示例来源:origin: google/sagetv
if (booty.isLeftToRight())
内容来源于网络,如有侵权,请联系作者删除!