Example usage for java.text Bidi Bidi

List of usage examples for java.text Bidi Bidi

Introduction

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

Prototype

public Bidi(char[] text, int textStart, byte[] embeddings, int embStart, int paragraphLength, int flags) 

Source Link

Document

Create Bidi from the given text, embedding, and direction information.

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();
    }//from w w  w  . j  a  v  a2s .c om
    return leftToRight;
}