Package org.eclipse.equinox.bidi.custom
Class StructuredTextCharTypes
java.lang.Object
org.eclipse.equinox.bidi.custom.StructuredTextCharTypes
Provides services related to the bidi classification of characters.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final StructuredTextEnvironment
The environment associated with the expert.protected final IStructuredTextExpert
The IStructuredTextExpert instance which created this instance.protected final StructuredTextTypeHandler
The StructuredTextTypeHandler instance utilized by the expert.protected final String
The source text whose characters are analyzed. -
Constructor Summary
ConstructorDescriptionStructuredTextCharTypes
(IStructuredTextExpert expert, String text) Constructor -
Method Summary
Modifier and TypeMethodDescriptionbyte
getBidiTypeAt
(int index) Gets the directionality of the character in the original string at the specified index.int
Indicates the base text direction appropriate for an instance of structured text.int
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.
-
Field Details
-
expert
The IStructuredTextExpert instance which created this instance. -
handler
The StructuredTextTypeHandler instance utilized by the expert. -
environment
The environment associated with the expert. -
text
The source text whose characters are analyzed.
-
-
Constructor Details
-
StructuredTextCharTypes
Constructor- Parameters:
expert
- IStructuredTextExpert instance through which this handler is invoked. The handler can use IStructuredTextExpert methods to query items stored in the expert instance, like the currentenvironment
.text
- is the text whose characters are analyzed.
-
-
Method Details
-
getDirection
public int getDirection()Indicates the base text direction appropriate for an instance of structured text. -
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 byjava.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
StructuredTextEnvironment.ORIENT_LTR
,StructuredTextEnvironment.ORIENT_RTL
,StructuredTextEnvironment.ORIENT_UNKNOWN
orStructuredTextEnvironment.ORIENT_IGNORE
.
-