public final class BidiUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTO
Auto (contextual) Base Text Direction.
|
static String |
BTD_DEFAULT
Base Text Direction defined in
getTextDirection() |
static String |
LEFT_TO_RIGHT
Left-To-Right Base Text Direction.
|
static String |
RIGHT_TO_LEFT
Right-To-Left Base Text Direction.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
applyBidiProcessing(Combo combo,
String handlingType)
Applies bidi processing to the given combo.
|
static void |
applyBidiProcessing(StyledText field,
String handlingType)
Applies bidi processing to the given styled text field.
|
static void |
applyBidiProcessing(Text field,
String handlingType)
Applies bidi processing to the given text field.
|
static void |
applyTextDirection(Control control,
String textDirection)
Applies a Base Text Direction to the given control (and its descendants, if it's a
Composite). |
static boolean |
getBidiSupport()
Returns whether bidi support is enabled.
|
static SegmentListener |
getSegmentListener(String handlingType)
Returns a segment listener for the given
handlingType that
can e.g. be passed to Text.addSegmentListener(SegmentListener). |
static String |
getTextDirection()
Returns the Base Text Direction.
|
static void |
setBidiSupport(boolean bidi)
Enables or disables bidi support.
|
static void |
setTextDirection(String direction)
Sets the Base Text Direction.
|
public static final String LEFT_TO_RIGHT
getTextDirection(),
Constant Field Valuespublic static final String RIGHT_TO_LEFT
getTextDirection(),
Constant Field Valuespublic static final String AUTO
getTextDirection(),
Constant Field Valuespublic static final String BTD_DEFAULT
getTextDirection()public static String getTextDirection()
LEFT_TO_RIGHTRIGHT_TO_LEFTAUTOnull (no direction set)public static void setTextDirection(String direction)
LEFT_TO_RIGHTRIGHT_TO_LEFTAUTOnull (no default direction)direction - the text direction to setIllegalArgumentException - if direction is not legalpublic static boolean getBidiSupport()
true iff bidi support is enabledpublic static void setBidiSupport(boolean bidi)
bidi - true to enable bidi support, false to disablepublic static void applyBidiProcessing(Text field, String handlingType)
Possible values for handlingType are:
LEFT_TO_RIGHTRIGHT_TO_LEFTAUTOBTD_DEFAULTString constants in StructuredTextTypeHandlerFactoryorg.eclipse.equinox.bidi.bidiTypes extension point.
The 3 values LEFT_TO_RIGHT, RIGHT_TO_LEFT, and AUTO are
usable whether bidi support is enabled or disabled.
The remaining values only have an effect if bidi support is enabled.
The 4 first values LEFT_TO_RIGHT, RIGHT_TO_LEFT, AUTO, and BTD_DEFAULT
are for Base Text Direction (BTD) handling. The remaining values are for Structured Text handling.
Note:
If this method is called on a text control, then applyTextDirection(Control, String) must not be called on the same control.
Note: The Structured Text handling only works if the org.eclipse.equinox.bidi
bundle is on the classpath!
Note:
Text.addSegmentListener(SegmentListener)
is currently only implemented on Windows and GTK, so this method won't have an effect on Cocoa.
field - the text fieldhandlingType - the type of handlingIllegalArgumentException - if handlingType is not a known type identifierpublic static void applyBidiProcessing(StyledText field, String handlingType)
Possible values for handlingType are:
LEFT_TO_RIGHTRIGHT_TO_LEFTAUTOBTD_DEFAULTString constants in StructuredTextTypeHandlerFactoryorg.eclipse.equinox.bidi.bidiTypes extension point.
The 3 values LEFT_TO_RIGHT, RIGHT_TO_LEFT, and AUTO are
usable whether bidi support is enabled or disabled.
The remaining values only have an effect if bidi support is enabled.
The 4 first values LEFT_TO_RIGHT, RIGHT_TO_LEFT, AUTO, and BTD_DEFAULT
are for Base Text Direction (BTD) handling. The remaining values are for Structured Text handling.
Note:
If this method is called on a text control, then applyTextDirection(Control, String) must not be called on the same control.
Note: The Structured Text handling only works if the org.eclipse.equinox.bidi
bundle is on the classpath!
field - the styled text fieldhandlingType - the type of handlingIllegalArgumentException - if handlingType is not a known type identifierpublic static void applyBidiProcessing(Combo combo, String handlingType)
Possible values for handlingType are:
LEFT_TO_RIGHTRIGHT_TO_LEFTAUTOBTD_DEFAULTString constants in
StructuredTextTypeHandlerFactoryorg.eclipse.equinox.bidi.bidiTypes extension point.
The 3 values LEFT_TO_RIGHT, RIGHT_TO_LEFT, and
AUTO are usable whether bidi support
is enabled or disabled.
The remaining values only have an effect if bidi support is enabled.
The 4 first values LEFT_TO_RIGHT, RIGHT_TO_LEFT,
AUTO, and BTD_DEFAULT are for Base Text Direction (BTD)
handling. The remaining values are for Structured Text handling.
Note: If this method is called on a combo control, then
applyTextDirection(Control, String) must not be called on the
same control.
Note: The Structured Text handling only works if the
org.eclipse.equinox.bidi bundle is on the classpath!
Note:
Combo.addSegmentListener(SegmentListener)
is currently only implemented on Windows so this method won't have an
effect on Cocoa and GTK.
combo - the combo fieldhandlingType - the type of handlingIllegalArgumentException - if handlingType is not a known type identifierpublic static SegmentListener getSegmentListener(String handlingType)
handlingType that
can e.g. be passed to Text.addSegmentListener(SegmentListener).
Note: The Structured Text handling only works if the
org.eclipse.equinox.bidi bundle is on the classpath!
handlingType - the handling type as specified in
applyBidiProcessing(Text, String)null if no handling is
requiredIllegalArgumentException - if handlingType is not a known type identifierapplyBidiProcessing(Text, String)public static void applyTextDirection(Control control, String textDirection)
Composite).
Possible values for textDirection are:
The 3 values LEFT_TO_RIGHT, RIGHT_TO_LEFT, and AUTO are
usable whether bidi support is enabled or disabled.
AUTO currently only works for Text, StyledText, and Combo controls.
The remaining value BTD_DEFAULT only has an effect if bidi support is enabled.
Note:
If this method is called on a control, then no applyBidiProcessing method must be called on the same control.
Note:
Control.setTextDirection(int)
is currently only implemented on Windows, so the direction won't be inherited by descendants on GTK and Cocoa.
Note:
BTD_DEFAULT is currently not inherited by descendants of the control if
getTextDirection() is AUTO.
control - the controltextDirection - the text direction
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.