diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextProcessor.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextProcessor.java index 0d6a2e9..c8c23a1 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextProcessor.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextProcessor.java @@ -14,8 +14,11 @@ import org.eclipse.equinox.bidi.custom.STextTypeHandler; /** - * Provides a number of convenience functions facilitating the - * processing of structured text. + * Provides methods to process structured text. The methods in this class + * are the most straightforward way to transform lean text into + * full text and vice versa (for the meaning of lean and + * full text, please see the + * package documentation). * * @noextend This class is not intended to be subclassed by clients. * @noinstantiate This class is not intended to be instantiated by clients. @@ -50,9 +53,9 @@ } /** - * Processes the given text and returns a string with appropriate - * directional formatting characters. This is equivalent to calling - * {@link #process(String str, String separators)} with the default + * Processes the given (lean) text and returns a string with appropriate + * directional formatting characters (full text). This is equivalent to + * calling {@link #process(String str, String separators)} with the default * set of separators. *

* The processing adds directional formatting characters so that presentation @@ -66,9 +69,11 @@ * d:\myfolder\REDLOF\ELIFYM.java. *

* - * @param str the text to be processed. + * @param str the lean text to process. * - * @return the processed string. + * @return the processed string (full text). + * + * @see #deprocess(String) */ public static String process(String str) { return process(str, defaultSeparators); @@ -77,13 +82,14 @@ /** * Processes a string that has a particular semantic meaning to render * it correctly on bidi locales. - * - * @see #process(String) + * For more details, see {@link #process(String)}. * - * @param str the text to process. + * @param str the lean text to process. * @param separators characters by which the string will be segmented. * - * @return the processed string. + * @return the processed string (full text). + * + * @see #deprocess(String) */ public static String process(String str, String separators) { if ((str == null) || (str.length() <= 1)) @@ -131,17 +137,18 @@ /** * Processes a string that has a particular semantic meaning to render * it correctly on bidi locales. + * For more details, see {@link #process(String)}. * - * @see #process(String) - * - * @param str the text to process. - * @param textType an identifier for the handler instance appropriate - * for the type of the structured text. + * @param str the lean text to process. + * @param textType an identifier for the structured text handler + * appropriate for the type of the text submitted. * It may be one of the identifiers defined in * {@link STextTypeHandlerFactory} or a type handler identifier - * specified in a plug-in. + * registered by a plug-in. * - * @return the processed string + * @return the processed string (full text). + * + * @see #deprocessTyped */ public static String processTyped(String str, String textType) { if ((str == null) || (str.length() <= 1)) @@ -163,9 +170,9 @@ /** * Removes directional formatting characters in the given string. * - * @param str string with directional characters to remove. + * @param str string with directional characters to remove (full text). * - * @return string without directional formatting characters. + * @return string without directional formatting characters (lean text). */ public static String deprocess(String str) { if ((str == null) || (str.length() <= 1)) @@ -195,15 +202,16 @@ /** * Removes directional formatting characters in the given string. * - * @param str string with directional characters to remove. - * - * @param textType an identifier for the handler instance appropriate - * for the type of the structured text. + * @param str string with directional characters to remove (full text). + * @param textType an identifier for the structured text handler + * appropriate for the type of the text submitted. * It may be one of the identifiers defined in * {@link STextTypeHandlerFactory} or a type handler identifier - * specified in a plug-in. + * registered by a plug-in. * - * @return string without directional formatting characters. + * @return string without directional formatting characters (lean text). + * + * @see #processTyped(String, String) */ public static String deprocessTyped(String str, String textType) { if ((str == null) || (str.length() <= 1)) diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextTypeHandlerFactory.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextTypeHandlerFactory.java index d134e55..4f4513a 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextTypeHandlerFactory.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextTypeHandlerFactory.java @@ -10,12 +10,28 @@ ******************************************************************************/ package org.eclipse.equinox.bidi; +import org.eclipse.equinox.bidi.advanced.STextEnvironment; +import org.eclipse.equinox.bidi.advanced.STextExpertFactory; import org.eclipse.equinox.bidi.custom.STextTypeHandler; import org.eclipse.equinox.bidi.internal.STextTypesCollector; /** * Provides access to registered structured text handlers. - * + *

+ * A structured text handler is a subclass of {@link STextTypeHandler} + * adapted for a given type of structured text. + *

+ * The constants in this class are identifiers for structured text + * handlers which are defined and supported "out of the box" by this package. + * Text handler identifiers can be used when invoking {@link STextProcessor#processTyped(String, String)}, + * or when invoking getExpert methods in {@link STextExpertFactory}. + *

+ * The {@link #getHandler} method in this class can be used to get a + * structured text handler reference for one of the handlers defined in this + * package or for additional structured text handlers registered by plug-ins. + * Text handler references can be used when invoking + * {@link STextExpertFactory#getStatefulExpert(STextTypeHandler, STextEnvironment)}. + * * @noinstantiate This class is not intended to be instantiated by clients. */ final public class STextTypeHandlerFactory { diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/ISTextExpert.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/ISTextExpert.java index 171a2e6..9cea28f 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/ISTextExpert.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/ISTextExpert.java @@ -105,6 +105,7 @@ /** * Obtains the structured type handler associated with this * ISTextExpert instance. + * * @return the type handler instance. */ public STextTypeHandler getTypeHandler(); @@ -214,8 +215,18 @@ *

* If necessary, leading and trailing directional formatting characters * (LRE, RLE and PDF) can be added depending on the value of the - * affix argument. - *

+ * affix argument.

+ * * @see ISTextExpert#leanBidiCharOffsets(String) * * @param text the structured text string @@ -256,6 +267,7 @@ /** * Sets the state for the next text processing call. * This method does nothing if the expert instance is not a stateful one. + * * @param state an object returned by a previous call to {@link #getState}. */ public void setState(Object state); @@ -263,7 +275,8 @@ /** * Gets the state established by the last text processing call. * This is null if the expert instance is not a stateful one, - * or if the last text processing call has nothing to pass to the next call. + * or if the last text processing call had nothing to pass to the next call. + * * @return the last established state. */ public Object getState(); diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextEnvironment.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextEnvironment.java index 474fb00..6705ddf 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextEnvironment.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextEnvironment.java @@ -97,11 +97,11 @@ /** * Creates an instance of a structured text environment. * - * @param lang the language to of the environment, encoded as specified + * @param lang the language of the environment, encoded as specified * in ISO-639. Might be null, in which case the default * locale is used. * @param mirrored specifies if the environment is mirrored. - * @param orientation the orientation of the GUI component: + * @param orientation the orientation of the GUI component, one of the values: * {@link #ORIENT_LTR ORIENT_LTR}, * {@link #ORIENT_LTR ORIENT_RTL}, * {@link #ORIENT_CONTEXTUAL_LTR ORIENT_CONTEXTUAL_LTR}, @@ -124,6 +124,7 @@ /** * Returns a 2-letters code representing a language as defined by * ISO-639. + * * @return language of the environment */ public String getLanguage() { @@ -134,6 +135,7 @@ * Returns a flag indicating that structured text processed * within this environment should assume that the GUI is mirrored * (globally going from right to left). + * * @return true if environment is mirrored */ public boolean getMirrored() { @@ -145,7 +147,7 @@ * component in which the full structured text * will be displayed. *

- * The orientation values: + * The orientation value is one of the following: *