Class StructuredTextEnvironment
java.lang.Object
org.eclipse.equinox.bidi.advanced.StructuredTextEnvironment
Describes the environment within which structured text strings are processed.
It includes:
- locale,
- desired orientation,
- text mirroring attributes.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final StructuredTextEnvironment
Pre-definedStructuredTextEnvironment
instance which uses default locale, non-mirrored environment, and a Left-to-Right presentation component.static final int
Specifies that a GUI component should display text depending on the context (value is 2).static final int
Specifies that a GUI component should display text depending on the context with default orientation being Left-To-Right (value is 2).static final int
Specifies that a GUI component should display text depending on the context with default orientation being Right-To-Left (value is 3).static final int
Used to specify that no directional formatting characters should be added as prefix or suffix (value is 8).static final int
Specifies that a GUI component should display text Left-To-Right (value is 0).static final int
Specifies that a GUI component should display text Right-To-Left (value is 1).static final int
Used when the orientation of a GUI component is not known (value is 4). -
Constructor Summary
ConstructorDescriptionStructuredTextEnvironment
(String lang, boolean mirrored, int orientation) Creates an instance of a structured text environment. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns a 2-letters code representing a language as defined by ISO-639.boolean
Returns a flag indicating that structured text processed within this environment should assume that the GUI is mirrored (globally going from right to left).int
Returns the orientation (a.k.a. base direction) of the GUI component in which the full structured text will be displayed.int
hashCode()
boolean
Deprecated.let users control bidi processing independent of the locale
-
Field Details
-
ORIENT_LTR
public static final int ORIENT_LTRSpecifies that a GUI component should display text Left-To-Right (value is 0).- See Also:
-
ORIENT_RTL
public static final int ORIENT_RTLSpecifies that a GUI component should display text Right-To-Left (value is 1).- See Also:
-
ORIENT_CONTEXTUAL
public static final int ORIENT_CONTEXTUALSpecifies that a GUI component should display text depending on the context (value is 2).- See Also:
-
ORIENT_CONTEXTUAL_LTR
public static final int ORIENT_CONTEXTUAL_LTRSpecifies that a GUI component should display text depending on the context with default orientation being Left-To-Right (value is 2).- See Also:
-
ORIENT_CONTEXTUAL_RTL
public static final int ORIENT_CONTEXTUAL_RTLSpecifies that a GUI component should display text depending on the context with default orientation being Right-To-Left (value is 3).- See Also:
-
ORIENT_UNKNOWN
public static final int ORIENT_UNKNOWNUsed when the orientation of a GUI component is not known (value is 4).- See Also:
-
ORIENT_IGNORE
public static final int ORIENT_IGNOREUsed to specify that no directional formatting characters should be added as prefix or suffix (value is 8).- See Also:
-
DEFAULT
Pre-definedStructuredTextEnvironment
instance which uses default locale, non-mirrored environment, and a Left-to-Right presentation component.
-
-
Constructor Details
-
StructuredTextEnvironment
Creates an instance of a structured text environment.- Parameters:
lang
- the language of the environment, encoded as specified in ISO-639. Might benull
, in which case the default locale is used.mirrored
- specifies if the environment is mirrored.orientation
- the orientation of the GUI component, one of the values:ORIENT_LTR
,ORIENT_RTL
,ORIENT_CONTEXTUAL_LTR
,ORIENT_CONTEXTUAL_RTL
,ORIENT_UNKNOWN
, orORIENT_IGNORE
.
-
-
Method Details
-
getLanguage
Returns a 2-letters code representing a language as defined by ISO-639.- Returns:
- language of the environment
-
getMirrored
public boolean getMirrored()Returns a flag indicating that structured text processed within this environment should assume that the GUI is mirrored (globally going from right to left).- Returns:
true
if environment is mirrored
-
getOrientation
public int getOrientation()Returns the orientation (a.k.a. base direction) of the GUI component in which the full structured text will be displayed.The orientation value is one of the following:
-
isProcessingNeeded
public boolean isProcessingNeeded()Deprecated.let users control bidi processing independent of the localeChecks if bidi processing is needed in this environment. The result depends on the operating system (must be supported by this package) and on the language supplied when constructing the instance (it must be a language using a bidirectional script).Note: This API is rarely used any more. E.g. in Eclipse/JFace, bidi support is typically controlled by the application via
org.eclipse.jface.util.BidiUtils#setBidiSupport(boolean)
.- Returns:
true
if bidi processing is needed in this environment.
-
hashCode
public int hashCode() -
equals
-