Eclipse Platform
Release 4.2

org.eclipse.equinox.bidi.custom
Class STextCharTypes

java.lang.Object
  extended by org.eclipse.equinox.bidi.custom.STextCharTypes

public class STextCharTypes
extends Object

Provides services related to the bidi classification of characters.


Field Summary
protected  STextEnvironment environment
          The environment associated with the expert.
protected  ISTextExpert expert
          The ISTextExpert instance which created this instance.
protected  STextTypeHandler handler
          The STextTypeHandler instance utilized by the expert.
protected  String text
          The source text whose characters are analyzed.
 
Constructor Summary
STextCharTypes(ISTextExpert expert, String text)
          Constructor
 
Method Summary
 byte getBidiTypeAt(int index)
          Gets the directionality of the character in the original string at the specified index.
 int getDirection()
          Indicates the base text direction appropriate for an instance of structured text.
 int resolveOrientation()
          Gets the orientation of the component in which the text will be displayed.
 void setBidiTypeAt(int index, byte charType)
          Forces a bidi type on a character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expert

protected final ISTextExpert expert
The ISTextExpert instance which created this instance.


handler

protected final STextTypeHandler handler
The STextTypeHandler instance utilized by the expert.


environment

protected final STextEnvironment environment
The environment associated with the expert.


text

protected final String text
The source text whose characters are analyzed.

Constructor Detail

STextCharTypes

public STextCharTypes(ISTextExpert expert,
                      String text)
Constructor

Parameters:
expert - ISTextExpert instance through which this handler is invoked. The handler can use ISTextExpert methods to query items stored in the expert instance, like the current environment.
text - is the text whose characters are analyzed.
Method Detail

getDirection

public int getDirection()
Indicates the base text direction appropriate for an instance of structured text.

Returns:
the base direction of the structured text. This direction may not be the same depending on the environment and on whether the structured text contains Arabic or Hebrew letters.
The value returned is either DIR_LTR or DIR_RTL.

getBidiTypeAt

public byte getBidiTypeAt(int index)
Gets the directionality of the character in the original string at the specified index.

Parameters:
index - position of the character in the lean text
Returns:
the bidi type of the character. It is one of the values which can be returned by Character.getDirectionality(char).

setBidiTypeAt

public void setBidiTypeAt(int index,
                          byte charType)
Forces a bidi type on a character.

Parameters:
index - position of the character whose bidi type is set.
charType - bidirectional type of the character. It must be one of the values which can be returned by java.lang.Character.getDirectionality.

resolveOrientation

public int resolveOrientation()
Gets the orientation of the component in which the text will be displayed.

Returns:
the orientation as either STextEnvironment.ORIENT_LTR, STextEnvironment.ORIENT_RTL, STextEnvironment.ORIENT_UNKNOWN or STextEnvironment.ORIENT_IGNORE.

Eclipse Platform
Release 4.2

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2013. All rights reserved.