Example usage for java.text Bidi requiresBidi

List of usage examples for java.text Bidi requiresBidi

Introduction

In this page you can find the example usage for java.text Bidi requiresBidi.

Prototype

public static boolean requiresBidi(char[] text, int start, int limit) 

Source Link

Document

Return true if the specified text requires bidi analysis.

Usage

From source file:net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.java

protected boolean isLeftToRight(char[] chars) {
    boolean leftToRight = true;
    if (Bidi.requiresBidi(chars, 0, chars.length)) {
        // determining the text direction
        // using default LTR as there's no way to have other default in the text
        Bidi bidi = new Bidi(chars, 0, null, 0, chars.length, Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT);
        leftToRight = bidi.baseIsLeftToRight();
    }/* w ww .j  a va 2  s  . c om*/
    return leftToRight;
}