diff options
author | Markus Keller | 2013-02-19 12:18:55 +0000 |
---|---|---|
committer | Markus Keller | 2013-02-19 12:20:37 +0000 |
commit | 7bce6c87f8bf16ca0283dabb046b13a1ac368444 (patch) | |
tree | d380e1da12cef587ddf868e998abf1f361a235fe /bundles/org.eclipse.equinox.bidi | |
parent | dd1f2c962688119327457c674529bd94aeb932d2 (diff) | |
download | rt.equinox.bundles-7bce6c87f8bf16ca0283dabb046b13a1ac368444.tar.gz rt.equinox.bundles-7bce6c87f8bf16ca0283dabb046b13a1ac368444.tar.xz rt.equinox.bundles-7bce6c87f8bf16ca0283dabb046b13a1ac368444.zip |
renamed *SText* to *StructuredText* (bug 380397)v20130219-122037I20130220-0922I20130219-1600I20130219-0800
Diffstat (limited to 'bundles/org.eclipse.equinox.bidi')
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/META-INF/MANIFEST.MF | 2 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/plugin.xml | 26 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/schema/StructuredTextType.exsd (renamed from bundles/org.eclipse.equinox.bidi/schema/STextType.exsd) | 6 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextProcessor.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextProcessor.java) | 30 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextTypeHandlerFactory.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextTypeHandlerFactory.java) | 28 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/IStructuredTextExpert.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/ISTextExpert.java) | 38 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextEnvironment.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextEnvironment.java) | 17 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextExpertFactory.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextExpertFactory.java) | 117 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/package.html | 27 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextCharTypes.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/STextCharTypes.java) | 46 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextOffsets.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/STextOffsets.java) | 9 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/STextTypeHandler.java) | 114 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/package.html | 3 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextActivator.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextActivator.java) | 8 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelims.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextDelims.java) | 15 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelimsEsc.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextDelimsEsc.java) | 16 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextImpl.java) | 63 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextSingle.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextSingle.java) | 18 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextStringRecord.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextStringRecord.java) | 42 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextTypesCollector.java) | 48 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextComma.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextComma.java) | 6 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextEmail.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextEmail.java) | 28 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextFile.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextFile.java) | 6 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextJava.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextJava.java) | 28 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextMath.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextMath.java) | 30 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextProperty.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextProperty.java) | 6 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextRegex.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextRegex.java) | 50 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSql.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextSql.java) | 28 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSystem.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextSystem.java) | 6 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextURL.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextURL.java) | 6 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextUnderscore.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextUnderscore.java) | 6 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextXPath.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextXPath.java) | 10 | ||||
-rw-r--r-- | bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/package.html | 15 |
33 files changed, 434 insertions, 464 deletions
diff --git a/bundles/org.eclipse.equinox.bidi/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.bidi/META-INF/MANIFEST.MF index b1bed7782..9946d234b 100644 --- a/bundles/org.eclipse.equinox.bidi/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.bidi/META-INF/MANIFEST.MF @@ -19,4 +19,4 @@ Import-Package: org.eclipse.osgi.framework.log;version="1.0.0", org.eclipse.osgi.util;version="1.1.0", org.osgi.framework;version="1.5.0", org.osgi.util.tracker;version="1.4.0" -Bundle-Activator: org.eclipse.equinox.bidi.internal.STextActivator +Bundle-Activator: org.eclipse.equinox.bidi.internal.StructuredTextActivator diff --git a/bundles/org.eclipse.equinox.bidi/plugin.xml b/bundles/org.eclipse.equinox.bidi/plugin.xml index bce6eac01..4db67dd65 100644 --- a/bundles/org.eclipse.equinox.bidi/plugin.xml +++ b/bundles/org.eclipse.equinox.bidi/plugin.xml @@ -1,68 +1,68 @@ <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.2"?> <plugin> - <extension-point id="bidiTypes" name="%bidiExpressionPointName" schema="schema/STextType.exsd"/> + <extension-point id="bidiTypes" name="%bidiExpressionPointName" schema="schema/StructuredTextType.exsd"/> <extension id="bidi" name="%bidiExtensionName" point="org.eclipse.equinox.bidi.bidiTypes"> <typeDescription - class="org.eclipse.equinox.bidi.internal.consumable.STextComma" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextComma" description="%commaProcessorName" type="comma"> </typeDescription> <typeDescription - class="org.eclipse.equinox.bidi.internal.consumable.STextEmail" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextEmail" description="%emailProcessorName" type="email"> </typeDescription> <typeDescription - class="org.eclipse.equinox.bidi.internal.consumable.STextFile" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextFile" description="%fileProcessorName" type="file"> </typeDescription> <typeDescription - class="org.eclipse.equinox.bidi.internal.consumable.STextJava" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextJava" description="%javaProcessorName" type="java"> </typeDescription> <typeDescription - class="org.eclipse.equinox.bidi.internal.consumable.STextMath" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextMath" description="%mathProcessorName" type="math"> </typeDescription> <typeDescription - class="org.eclipse.equinox.bidi.internal.consumable.STextProperty" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextProperty" description="%propertyProcessorName" type="property"> </typeDescription> <typeDescription description="%regexProcessorName" - class="org.eclipse.equinox.bidi.internal.consumable.STextRegex" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextRegex" type="regex"> </typeDescription> <typeDescription description="%sqlProcessorName" - class="org.eclipse.equinox.bidi.internal.consumable.STextSql" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextSql" type="sql"> </typeDescription> <typeDescription - class="org.eclipse.equinox.bidi.internal.consumable.STextSystem" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextSystem" description="%systemProcessorName" type="system"> </typeDescription> <typeDescription - class="org.eclipse.equinox.bidi.internal.consumable.STextUnderscore" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextUnderscore" description="%underscoreProcessorName" type="underscore"> </typeDescription> <typeDescription - class="org.eclipse.equinox.bidi.internal.consumable.STextURL" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextURL" description="%urlProcessorName" type="url"> </typeDescription> <typeDescription - class="org.eclipse.equinox.bidi.internal.consumable.STextXPath" + class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextXPath" description="%xpathProcessorName" type="xpath"> </typeDescription> diff --git a/bundles/org.eclipse.equinox.bidi/schema/STextType.exsd b/bundles/org.eclipse.equinox.bidi/schema/StructuredTextType.exsd index 543ea947c..0d3e30149 100644 --- a/bundles/org.eclipse.equinox.bidi/schema/STextType.exsd +++ b/bundles/org.eclipse.equinox.bidi/schema/StructuredTextType.exsd @@ -62,7 +62,7 @@ The processor that provides specialized bidirectional handling for this type of strings.
</documentation>
<appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.equinox.bidi.custom.STextProcessor:"/>
+ <meta.attribute kind="java" basedOn="org.eclipse.equinox.bidi.custom.StructuredTextProcessor:"/>
</appInfo>
</annotation>
</attribute>
@@ -96,9 +96,9 @@ A processor for the structured text strings that support "minus" delimiters can be described as:
<pre>
-public class STextSepMinus extends STextProcessor
+public class StructuredTextSepMinus extends StructuredTextProcessor
{
- public STextSepMinus()
+ public StructuredTextSepMinus()
{
super("-");
}
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/StructuredTextProcessor.java index 1940cd444..27aa08e6a 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/StructuredTextProcessor.java @@ -11,7 +11,7 @@ package org.eclipse.equinox.bidi; import org.eclipse.equinox.bidi.advanced.*; -import org.eclipse.equinox.bidi.custom.STextTypeHandler; +import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler; /** * Provides methods to process bidirectional text with a specific @@ -23,15 +23,13 @@ import org.eclipse.equinox.bidi.custom.STextTypeHandler; * <a href="package-summary.html">package documentation</a>). * <p> * This class can be used without OSGi running (but only the structured text types declared - * in {@link STextTypeHandlerFactory} are available in that mode). + * in {@link StructuredTextTypeHandlerFactory} are available in that mode). * </p> * * @noextend This class is not intended to be subclassed by clients. * @noinstantiate This class is not intended to be instantiated by clients. - * - * @author Matitiahu Allouche */ -public final class STextProcessor { +public final class StructuredTextProcessor { /** * The default set of separators used to segment a string: dot, @@ -54,7 +52,7 @@ public final class STextProcessor { /** * Prevents instantiation. */ - private STextProcessor() { + private StructuredTextProcessor() { // empty } @@ -105,7 +103,7 @@ public final class STextProcessor { if (str.charAt(0) == LRE && str.charAt(str.length() - 1) == PDF) return str; - STextEnvironment env = new STextEnvironment(null, false, STextEnvironment.ORIENT_UNKNOWN); + StructuredTextEnvironment env = new StructuredTextEnvironment(null, false, StructuredTextEnvironment.ORIENT_UNKNOWN); if (!env.isProcessingNeeded()) return str; // do not process a string if all the following conditions are true: @@ -135,8 +133,8 @@ public final class STextProcessor { separators = defaultSeparators; // make sure that LRE/PDF are added around the string - STextTypeHandler handler = new STextTypeHandler(separators); - ISTextExpert expert = STextExpertFactory.getStatefulExpert(handler, env); + StructuredTextTypeHandler handler = new StructuredTextTypeHandler(separators); + IStructuredTextExpert expert = StructuredTextExpertFactory.getStatefulExpert(handler, env); return expert.leanToFullText(str); } @@ -149,7 +147,7 @@ public final class STextProcessor { * @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 + * {@link StructuredTextTypeHandlerFactory} or a type handler identifier * registered by a plug-in. * * @return the processed string (<i>full</i> text). @@ -166,10 +164,10 @@ public final class STextProcessor { return str; // make sure that LRE/PDF are added around the string - STextEnvironment env = new STextEnvironment(null, false, STextEnvironment.ORIENT_UNKNOWN); + StructuredTextEnvironment env = new StructuredTextEnvironment(null, false, StructuredTextEnvironment.ORIENT_UNKNOWN); if (!env.isProcessingNeeded()) return str; - ISTextExpert expert = STextExpertFactory.getExpert(textType, env); + IStructuredTextExpert expert = StructuredTextExpertFactory.getExpert(textType, env); return expert.leanToFullText(str); } @@ -183,7 +181,7 @@ public final class STextProcessor { public static String deprocess(String str) { if ((str == null) || (str.length() <= 1)) return str; - STextEnvironment env = new STextEnvironment(null, false, STextEnvironment.ORIENT_UNKNOWN); + StructuredTextEnvironment env = new StructuredTextEnvironment(null, false, StructuredTextEnvironment.ORIENT_UNKNOWN); if (!env.isProcessingNeeded()) return str; @@ -212,7 +210,7 @@ public final class STextProcessor { * @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 + * {@link StructuredTextTypeHandlerFactory} or a type handler identifier * registered by a plug-in. * * @return string without directional formatting characters (<i>lean</i> text). @@ -224,10 +222,10 @@ public final class STextProcessor { return str; // make sure that LRE/PDF are added around the string - STextEnvironment env = new STextEnvironment(null, false, STextEnvironment.ORIENT_UNKNOWN); + StructuredTextEnvironment env = new StructuredTextEnvironment(null, false, StructuredTextEnvironment.ORIENT_UNKNOWN); if (!env.isProcessingNeeded()) return str; - ISTextExpert expert = STextExpertFactory.getExpert(textType, env); + IStructuredTextExpert expert = StructuredTextExpertFactory.getExpert(textType, env); return expert.fullToLeanText(str); } 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/StructuredTextTypeHandlerFactory.java index f3203cbdb..62e494eef 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/StructuredTextTypeHandlerFactory.java @@ -10,36 +10,36 @@ ******************************************************************************/ 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; +import org.eclipse.equinox.bidi.advanced.StructuredTextEnvironment; +import org.eclipse.equinox.bidi.advanced.StructuredTextExpertFactory; +import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler; +import org.eclipse.equinox.bidi.internal.StructuredTextTypesCollector; /** * Provides access to registered structured text handlers. * <p> - * A structured text handler is a subclass of {@link STextTypeHandler} + * A structured text handler is a subclass of {@link StructuredTextTypeHandler} * adapted for a given type of structured text. * <p> * 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 <code>getExpert</code> methods in {@link STextExpertFactory}. + * Text handler identifiers can be used when invoking {@link StructuredTextProcessor#processTyped(String, String)}, + * or when invoking <code>getExpert</code> methods in {@link StructuredTextExpertFactory}. * <p> * 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 via * the <code>org.eclipse.equinox.bidi.bidiTypes</code> extension point. * Text handler references can be used when invoking - * {@link STextExpertFactory#getStatefulExpert(STextTypeHandler, STextEnvironment)}. + * {@link StructuredTextExpertFactory#getStatefulExpert(StructuredTextTypeHandler, StructuredTextEnvironment)}. * <p> * This class can be used without OSGi running, but only the structured text types declared - * in {@link STextTypeHandlerFactory} and as string constants in this class are available in that mode. + * in {@link StructuredTextTypeHandlerFactory} and as string constants in this class are available in that mode. * </p> * * @noinstantiate This class is not intended to be instantiated by clients. */ -public final class STextTypeHandlerFactory { +public final class StructuredTextTypeHandlerFactory { /** * Structured text handler identifier for comma-delimited lists, such as: @@ -122,12 +122,12 @@ public final class STextTypeHandlerFactory { */ public static final String XPATH = "xpath"; //$NON-NLS-1$ - // *** New types must be added to STextTypesCollector#getDefaultTypeHandlers()! + // *** New types must be added to StructuredTextTypesCollector#getDefaultTypeHandlers()! /** * Prevents instantiation */ - private STextTypeHandlerFactory() { + private StructuredTextTypeHandlerFactory() { // placeholder } @@ -139,8 +139,8 @@ public final class STextTypeHandlerFactory { * @return a handler of the required type, or <code>null</code> * if the type is unknown. */ - static public STextTypeHandler getHandler(String id) { - return STextTypesCollector.getInstance().getHandler(id); + static public StructuredTextTypeHandler getHandler(String id) { + return StructuredTextTypesCollector.getInstance().getHandler(id); } } 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/IStructuredTextExpert.java index 574f4fb43..c1475938d 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/IStructuredTextExpert.java @@ -10,7 +10,7 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.advanced; -import org.eclipse.equinox.bidi.custom.STextTypeHandler; +import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler; /** * Provides advanced methods for processing bidirectional text with @@ -23,9 +23,9 @@ import org.eclipse.equinox.bidi.custom.STextTypeHandler; * package documentation</a>}. * <p> * Identifiers for several common handlers are included in - * {@link org.eclipse.equinox.bidi.STextTypeHandlerFactory}. For handlers + * {@link org.eclipse.equinox.bidi.StructuredTextTypeHandlerFactory}. For handlers * supplied by other packages, a handler instance can be obtained using the - * {@link org.eclipse.equinox.bidi.STextTypeHandlerFactory#getHandler} + * {@link org.eclipse.equinox.bidi.StructuredTextTypeHandlerFactory#getHandler} * method for the registered handlers, or by instantiating a private handler. * </p><p> * Most of the methods in this interface have a <code>text</code> @@ -35,8 +35,8 @@ import org.eclipse.equinox.bidi.custom.STextTypeHandler; * one invocation to the next one. For instance, one invocation * may detect that a comment or a literal has been started but * has not been completed. In such cases, the state must be managed - * by a <code>ISTextExpert</code> instance obtained with the - * {@link STextExpertFactory#getStatefulExpert} method. + * by a {@link IStructuredTextExpert} instance obtained with the + * {@link StructuredTextExpertFactory#getStatefulExpert} method. * </p><p> * The <code>state</code> returned after processing a string * can be retrieved, set and reset using the {@link #getState()}, @@ -44,7 +44,7 @@ import org.eclipse.equinox.bidi.custom.STextTypeHandler; * </p><p> * When submitting the initial part of a text, the state should be * reset if it is not the first processing call for this - * <code>ISTextExpert</code> instance. + * {@link IStructuredTextExpert} instance. * </p><p> * Values returned by {@link #getState()} are opaque objects whose meaning * is internal to the relevant structured type handler. These values can only @@ -62,7 +62,7 @@ import org.eclipse.equinox.bidi.custom.STextTypeHandler; * (directory and file paths) in order to obtain the <i>full</i> * text corresponding to the given <i>lean</i> text. * <pre> - * ISTextExpert expert = STextExpertFactory.getExpert(STextTypeHandlerFactory.FILE); + * IStructuredTextExpert expert = StructuredTextExpertFactory.getExpert(StructuredTextTypeHandlerFactory.FILE); * String leanText = "D:\\\u05d0\u05d1\\\u05d2\\\u05d3.ext"; * String fullText = expert.leanToFullText(leanText); * System.out.println("full text = " + fullText); @@ -72,7 +72,7 @@ import org.eclipse.equinox.bidi.custom.STextTypeHandler; * code in order to obtain the <i>full</i> * text corresponding to the <i>lean</i> text of each line. * <pre> - * ISTextExpert expert = STextExpertFactory.getStatefulExpert(STextTypeHandlerFactory.JAVA); + * IStructuredTextExpert expert = StructuredTextExpertFactory.getStatefulExpert(StructuredTextTypeHandlerFactory.JAVA); * String leanText = "int i = 3; // first Java statement"; * String fullText = expert.leanToFullText(leanText); * System.out.println("full text = " + fullText); @@ -81,15 +81,13 @@ import org.eclipse.equinox.bidi.custom.STextTypeHandler; * System.out.println("full text = " + fullText); * </pre> * </p> - * @author Matitiahu Allouche - * */ -public interface ISTextExpert { +public interface IStructuredTextExpert { /** * Constant specifying that the base direction of a structured text is LTR. * The base direction may depend on whether the GUI is - * {@link STextEnvironment#getMirrored mirrored} and + * {@link StructuredTextEnvironment#getMirrored mirrored} and * may be different for Arabic and for Hebrew. * This constant can appear as value returned by the * {@link #getTextDirection} method. @@ -99,7 +97,7 @@ public interface ISTextExpert { /** * Constant specifying that the base direction of a structured text is RTL. * The base direction may depend on whether the GUI is - * {@link STextEnvironment#getMirrored mirrored} and may + * {@link StructuredTextEnvironment#getMirrored mirrored} and may * may be different for Arabic and for Hebrew. * This constant can appear as value returned by the * {@link #getTextDirection} method. @@ -108,18 +106,18 @@ public interface ISTextExpert { /** * Obtains the structured type handler associated with this - * <code>ISTextExpert</code> instance. + * <code>IStructuredTextExpert</code> instance. * * @return the type handler instance. */ - public STextTypeHandler getTypeHandler(); + public StructuredTextTypeHandler getTypeHandler(); /** * Obtains the environment associated with this - * <code>ISTextExpert</code> instance. + * <code>IStructuredTextExpert</code> instance. * @return the environment instance. */ - public STextEnvironment getEnvironment(); + public StructuredTextEnvironment getEnvironment(); /** * Adds directional formatting characters to a structured text @@ -152,7 +150,7 @@ public interface ISTextExpert { * Only LRMs (for a string with LTR base direction) and RLMs (for * a string with RTL base direction) are considered. Leading and * trailing LRE, RLE and PDF which might be prefixed or suffixed - * depending on the {@link STextEnvironment#getOrientation orientation} of the + * depending on the {@link StructuredTextEnvironment#getOrientation orientation} of the * GUI component used for display are not reflected in this method. * </p> * @param text is the structured text string @@ -198,7 +196,7 @@ public interface ISTextExpert { * <p> * LRMs (for a string with LTR base direction), RLMs (for a string with RTL base direction) * are considered as well as leading and trailing LRE, RLE and PDF which might be prefixed - * or suffixed depending on the {@link STextEnvironment#getOrientation orientation} + * or suffixed depending on the {@link StructuredTextEnvironment#getOrientation orientation} * of the GUI component used for display. * </p> * @param text is the structured text string including directional formatting characters @@ -231,7 +229,7 @@ public interface ISTextExpert { * have the text orientation explicitly specified.</li> * <li>A value of 0 means that no prefix or suffix are needed.</li> * </ul> - * @see ISTextExpert#leanBidiCharOffsets(String) + * @see IStructuredTextExpert#leanBidiCharOffsets(String) * * @param text the structured text string * @param offsets an array of offsets to characters in <code>text</code> 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/StructuredTextEnvironment.java index d1bd99d8e..fe06e8365 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/StructuredTextEnvironment.java @@ -11,7 +11,7 @@ package org.eclipse.equinox.bidi.advanced; import java.util.Locale; -import org.eclipse.equinox.bidi.internal.STextActivator; +import org.eclipse.equinox.bidi.internal.StructuredTextActivator; /** * Describes the environment within which structured text strings are @@ -21,9 +21,8 @@ import org.eclipse.equinox.bidi.internal.STextActivator; * <li>desired orientation,</li> * <li>text mirroring attributes.</li> * </ul> - * @author Matitiahu Allouche */ -public class STextEnvironment { +public class StructuredTextEnvironment { /** * Specifies that a GUI component should display text Left-To-Right (value is 0). @@ -65,10 +64,10 @@ public class STextEnvironment { public static final int ORIENT_IGNORE = 1 << 3; /** - * Pre-defined <code>STextEnvironment</code> instance which uses default locale, + * Pre-defined {@link StructuredTextEnvironment} instance which uses default locale, * non-mirrored environment, and a Left-to-Right presentation component. */ - public static final STextEnvironment DEFAULT = new STextEnvironment(null, false, ORIENT_LTR); + public static final StructuredTextEnvironment DEFAULT = new StructuredTextEnvironment(null, false, ORIENT_LTR); /** * This string is a 2-letters code representing a language as defined by @@ -110,14 +109,14 @@ public class STextEnvironment { * {@link #ORIENT_UNKNOWN ORIENT_UNKNOWN}, or * {@link #ORIENT_IGNORE ORIENT_IGNORE}. */ - public STextEnvironment(String lang, boolean mirrored, int orientation) { + public StructuredTextEnvironment(String lang, boolean mirrored, int orientation) { if (lang != null) { if (lang.length() > 2) language = lang.substring(0, 2); else language = lang; } else { - Locale defaultLocale = STextActivator.getInstance() != null ? STextActivator.getInstance().getDefaultLocale() : Locale.getDefault(); + Locale defaultLocale = StructuredTextActivator.getInstance() != null ? StructuredTextActivator.getInstance().getDefaultLocale() : Locale.getDefault(); language = defaultLocale.getLanguage(); } this.mirrored = mirrored; @@ -175,7 +174,7 @@ public class STextEnvironment { */ public boolean isProcessingNeeded() { if (processingNeeded == null) { - String osName = STextActivator.getProperty("os.name"); //$NON-NLS-1$/ + String osName = StructuredTextActivator.getProperty("os.name"); //$NON-NLS-1$/ if (osName != null) osName = osName.toLowerCase(); boolean supportedOS = osName.startsWith("windows") || osName.startsWith("linux") || osName.startsWith("mac"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -227,7 +226,7 @@ public class STextEnvironment { return false; if (getClass() != obj.getClass()) return false; - STextEnvironment other = (STextEnvironment) obj; + StructuredTextEnvironment other = (StructuredTextEnvironment) obj; if (language == null) { if (other.language != null) return false; diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextExpertFactory.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextExpertFactory.java index ead93f3f5..36c1a31f0 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextExpertFactory.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextExpertFactory.java @@ -12,17 +12,17 @@ package org.eclipse.equinox.bidi.advanced; import java.util.HashMap; import java.util.Map; -import org.eclipse.equinox.bidi.STextProcessor; -import org.eclipse.equinox.bidi.STextTypeHandlerFactory; -import org.eclipse.equinox.bidi.custom.STextTypeHandler; -import org.eclipse.equinox.bidi.internal.STextImpl; +import org.eclipse.equinox.bidi.StructuredTextProcessor; +import org.eclipse.equinox.bidi.StructuredTextTypeHandlerFactory; +import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler; +import org.eclipse.equinox.bidi.internal.StructuredTextImpl; /** - * Obtains ISTextExpert instances. - * An {@link ISTextExpert} instance (called in short an "expert") provides + * Obtains IStructuredTextExpert instances. + * An {@link IStructuredTextExpert} instance (called in short an "expert") provides * the advanced methods to process a certain type of structured text, and * is thus related to a specific - * {@link STextTypeHandler structured text type handler}. + * {@link StructuredTextTypeHandler structured text type handler}. * There are two kinds of experts: * <ul> * <li>stateful, obtained by calling {@link #getStatefulExpert}.</li> @@ -32,70 +32,67 @@ import org.eclipse.equinox.bidi.internal.STextImpl; * a text processing method and transmit it as initial state in the next call * to a text processing method. * <p>In other words, the methods - * {@link ISTextExpert#getState()}, - * {@link ISTextExpert#setState} and - * {@link ISTextExpert#clearState()} of - * {@link ISTextExpert} are inoperative for experts which are not stateful. + * {@link IStructuredTextExpert#getState()}, + * {@link IStructuredTextExpert#setState} and + * {@link IStructuredTextExpert#clearState()} of + * {@link IStructuredTextExpert} are inoperative for experts which are not stateful. * <p> * Using a stateful expert is more resource intensive, thus not stateful * experts should be used when feasible. - * - * @author Matitiahu Allouche - * */ -final public class STextExpertFactory { +final public class StructuredTextExpertFactory { /** * The default set of separators used to segment a string: dot, colon, slash, backslash. */ - private static final String defaultSeparators = STextProcessor.getDefaultSeparators(); + private static final String defaultSeparators = StructuredTextProcessor.getDefaultSeparators(); static private Map sharedDefaultExperts = new HashMap(); // String type -> expert static private Map sharedExperts = new HashMap(); // String type -> map of { environment -> expert } - static private ISTextExpert defaultExpert; + static private IStructuredTextExpert defaultExpert; - private STextExpertFactory() { + private StructuredTextExpertFactory() { // prevents instantiation } /** - * Obtains a ISTextExpert instance for processing structured text with + * Obtains a IStructuredTextExpert instance for processing structured text with * a default type handler segmenting the text according to default separators. * This expert instance does not handle states. - * @return the ISTextExpert instance. - * @see STextProcessor#getDefaultSeparators() + * @return the IStructuredTextExpert instance. + * @see StructuredTextProcessor#getDefaultSeparators() */ - static public ISTextExpert getExpert() { + static public IStructuredTextExpert getExpert() { if (defaultExpert == null) { - STextTypeHandler handler = new STextTypeHandler(defaultSeparators); - defaultExpert = new STextImpl(handler, STextEnvironment.DEFAULT, false); + StructuredTextTypeHandler handler = new StructuredTextTypeHandler(defaultSeparators); + defaultExpert = new StructuredTextImpl(handler, StructuredTextEnvironment.DEFAULT, false); } return defaultExpert; } /** - * Obtains a ISTextExpert instance for processing structured text with + * Obtains a IStructuredTextExpert instance for processing structured text with * the specified type handler. * This expert instance does not handle states. * * @param type the identifier for the required type handler. This identifier - * may be one of those listed in {@link STextTypeHandlerFactory} + * may be one of those listed in {@link StructuredTextTypeHandlerFactory} * or it may be have been registered by a plug-in. - * @return the ISTextExpert instance. + * @return the IStructuredTextExpert instance. * @throws IllegalArgumentException if <code>type</code> is not a known type * identifier. */ - static public ISTextExpert getExpert(String type) { - ISTextExpert expert; + static public IStructuredTextExpert getExpert(String type) { + IStructuredTextExpert expert; synchronized (sharedDefaultExperts) { - expert = (ISTextExpert) sharedDefaultExperts.get(type); + expert = (IStructuredTextExpert) sharedDefaultExperts.get(type); if (expert == null) { - STextTypeHandler handler = STextTypeHandlerFactory.getHandler(type); + StructuredTextTypeHandler handler = StructuredTextTypeHandlerFactory.getHandler(type); if (handler == null) throw new IllegalArgumentException("Invalid type argument"); //$NON-NLS-1$ - expert = new STextImpl(handler, STextEnvironment.DEFAULT, false); + expert = new StructuredTextImpl(handler, StructuredTextEnvironment.DEFAULT, false); sharedDefaultExperts.put(type, expert); } } @@ -103,38 +100,38 @@ final public class STextExpertFactory { } /** - * Obtains a ISTextExpert instance for processing structured text with + * Obtains a IStructuredTextExpert instance for processing structured text with * the specified type handler and the specified environment. * This expert instance does not handle states. * * @param type the identifier for the required type handler. This identifier - * may be one of those listed in {@link STextTypeHandlerFactory} + * may be one of those listed in {@link StructuredTextTypeHandlerFactory} * or it may be have been registered by a plug-in. * @param environment the current environment, which may affect the behavior of * the expert. This parameter may be specified as * <code>null</code>, in which case the - * {@link STextEnvironment#DEFAULT} + * {@link StructuredTextEnvironment#DEFAULT} * environment should be assumed. - * @return the ISTextExpert instance. + * @return the IStructuredTextExpert instance. * @throws IllegalArgumentException if <code>type</code> is not a known type * identifier. */ - static public ISTextExpert getExpert(String type, STextEnvironment environment) { - ISTextExpert expert; + static public IStructuredTextExpert getExpert(String type, StructuredTextEnvironment environment) { + IStructuredTextExpert expert; if (environment == null) - environment = STextEnvironment.DEFAULT; + environment = StructuredTextEnvironment.DEFAULT; synchronized (sharedExperts) { Map experts = (Map) sharedExperts.get(type); if (experts == null) { experts = new HashMap(); // environment -> expert sharedExperts.put(type, experts); } - expert = (ISTextExpert) experts.get(environment); + expert = (IStructuredTextExpert) experts.get(environment); if (expert == null) { - STextTypeHandler handler = STextTypeHandlerFactory.getHandler(type); + StructuredTextTypeHandler handler = StructuredTextTypeHandlerFactory.getHandler(type); if (handler == null) throw new IllegalArgumentException("Invalid type argument"); //$NON-NLS-1$ - expert = new STextImpl(handler, environment, false); + expert = new StructuredTextImpl(handler, environment, false); experts.put(type, expert); } } @@ -142,66 +139,66 @@ final public class STextExpertFactory { } /** - * Obtains a ISTextExpert instance for processing structured text with + * Obtains a IStructuredTextExpert instance for processing structured text with * the specified type handler. * This expert instance can handle states. * * @param type the identifier for the required type handler. This identifier - * may be one of those listed in {@link STextTypeHandlerFactory} + * may be one of those listed in {@link StructuredTextTypeHandlerFactory} * or it may be have been registered by a plug-in. - * @return the ISTextExpert instance. + * @return the IStructuredTextExpert instance. * @throws IllegalArgumentException if <code>type</code> is not a known type * identifier. */ - static public ISTextExpert getStatefulExpert(String type) { - return getStatefulExpert(type, STextEnvironment.DEFAULT); + static public IStructuredTextExpert getStatefulExpert(String type) { + return getStatefulExpert(type, StructuredTextEnvironment.DEFAULT); } /** - * Obtains a ISTextExpert instance for processing structured text with + * Obtains a IStructuredTextExpert instance for processing structured text with * the specified type handler and the specified environment. * This expert instance can handle states. * * @param type the identifier for the required type handler. This identifier - * may be one of those listed in {@link STextTypeHandlerFactory} + * may be one of those listed in {@link StructuredTextTypeHandlerFactory} * or it may be have been registered by a plug-in. * @param environment the current environment, which may affect the behavior of * the expert. This parameter may be specified as * <code>null</code>, in which case the - * {@link STextEnvironment#DEFAULT} + * {@link StructuredTextEnvironment#DEFAULT} * environment should be assumed. - * @return the ISTextExpert instance. + * @return the IStructuredTextExpert instance. * @throws IllegalArgumentException if <code>type</code> is not a known type * identifier. */ - static public ISTextExpert getStatefulExpert(String type, STextEnvironment environment) { - STextTypeHandler handler = STextTypeHandlerFactory.getHandler(type); + static public IStructuredTextExpert getStatefulExpert(String type, StructuredTextEnvironment environment) { + StructuredTextTypeHandler handler = StructuredTextTypeHandlerFactory.getHandler(type); if (handler == null) throw new IllegalArgumentException("Invalid type argument"); //$NON-NLS-1$ return getStatefulExpert(handler, environment); } /** - * Obtains a ISTextExpert instance for processing structured text with + * Obtains a IStructuredTextExpert instance for processing structured text with * the specified type handler and the specified environment. * This expert instance can handle states. * * @param handler the type handler instance. It may have been obtained using - * {@link STextTypeHandlerFactory#getHandler(String)} or + * {@link StructuredTextTypeHandlerFactory#getHandler(String)} or * by instantiating a type handler. * @param environment the current environment, which may affect the behavior of * the expert. This parameter may be specified as * <code>null</code>, in which case the - * {@link STextEnvironment#DEFAULT} + * {@link StructuredTextEnvironment#DEFAULT} * environment should be assumed. - * @return the ISTextExpert instance. + * @return the IStructuredTextExpert instance. * @throws IllegalArgumentException if <code>type</code> is not a known type * identifier. */ - static public ISTextExpert getStatefulExpert(STextTypeHandler handler, STextEnvironment environment) { + static public IStructuredTextExpert getStatefulExpert(StructuredTextTypeHandler handler, StructuredTextEnvironment environment) { if (environment == null) - environment = STextEnvironment.DEFAULT; - return new STextImpl(handler, environment, true); + environment = StructuredTextEnvironment.DEFAULT; + return new StructuredTextImpl(handler, environment, true); } } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/package.html b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/package.html index 438719bbe..b24875b83 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/package.html +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/package.html @@ -1,20 +1,17 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> -<head> -<META name="Author" content="Matitiahu Allouche"> -</head> <body bgcolor="white"> <p> This package provides classes for users who need finer control on structured text handling. In particular, the user should use the methods in the -<a href="ISTextExpert.html">ISTextExpert</a> class +<a href="IStructuredTextExpert.html">IStructuredTextExpert</a> class in the following cases:</p> <ul> <li>The structured type handler to use is not one of those - predefined in {@link <a href="../STextTypeHandlerFactory.html"> - STextTypeHandlerFactory</a>}.</li> - <li>A non-default {@link <a href="STextEnvironment.html"> + predefined in {@link <a href="../StructuredTextTypeHandlerFactory.html"> + StructuredTextTypeHandlerFactory</a>}.</li> + <li>A non-default {@link <a href="StructuredTextEnvironment.html"> environment</a>} needs to be specified.</li> <li>A call to a method processing a piece of text may create a state which affects the processing of the next piece of text.</li> @@ -25,26 +22,26 @@ in the following cases:</p> Note that the basic functions are provided in package {@link <a href="../package-summary.html"> org.eclipse.equinox.bidi</a>} and its -{@link <a href="../STextProcessor.html">STextProcessor</a>} class. +{@link <a href="../StructuredTextProcessor.html">StructuredTextProcessor</a>} class. </p><p> To access the more sophisticated methods for processing structured text, the user should proceed as follows:</p> <ul> <li>The user has to obtain an appropriate - <code>ISTextExpert</code> instance using the methods in - <a href="STextExpertFactory.html">STextExpertFactory</a>.</li> + <code>IStructuredTextExpert</code> instance using the methods in + <a href="StructuredTextExpertFactory.html">StructuredTextExpertFactory</a>.</li> <li>The user may then invoke the more sophisticated methods provided by - <a href="ISTextExpert.html">ISTextExpert</a> + <a href="IStructuredTextExpert.html">IStructuredTextExpert</a> for processing the structured text.</li> <li>If those methods should work in an environment different from the default, the user may specify properties of the environment using the class - <a href="STextEnvironment.html">STextEnvironment</a>. + <a href="StructuredTextEnvironment.html">StructuredTextEnvironment</a>. <p> - This should be done before obtaining a <code>ISTextExpert</code> instance, + This should be done before obtaining a <code>IStructuredTextExpert</code> instance, and the specific environment must be specified when invoking - <code>STextExpertFactory</code> methods. This will + <code>StructuredTextExpertFactory</code> methods. This will associate a type handler with the given environment and provide - a customized <code>ISTextExpert</code> instance to the user.</p></li> + a customized <code>IStructuredTextExpert</code> instance to the user.</p></li> </ul> </body> diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/STextCharTypes.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextCharTypes.java index edb87611a..bcb1a457d 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/STextCharTypes.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextCharTypes.java @@ -10,13 +10,13 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.custom; -import org.eclipse.equinox.bidi.advanced.ISTextExpert; -import org.eclipse.equinox.bidi.advanced.STextEnvironment; +import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert; +import org.eclipse.equinox.bidi.advanced.StructuredTextEnvironment; /** * Provides services related to the bidi classification of characters. */ -public class STextCharTypes { +public class StructuredTextCharTypes { // In the following lines, B, L, R and AL represent bidi categories // as defined in the Unicode Bidirectional Algorithm @@ -37,17 +37,17 @@ public class STextCharTypes { private static final int CHARTYPES_ADD = 2; /** - * The ISTextExpert instance which created this instance. + * The IStructuredTextExpert instance which created this instance. */ - final protected ISTextExpert expert; + final protected IStructuredTextExpert expert; /** - * The STextTypeHandler instance utilized by the expert. + * The StructuredTextTypeHandler instance utilized by the expert. */ - final protected STextTypeHandler handler; + final protected StructuredTextTypeHandler handler; /** * The environment associated with the expert. */ - final protected STextEnvironment environment; + final protected StructuredTextEnvironment environment; /** * The source text whose characters are analyzed. */ @@ -62,14 +62,14 @@ public class STextCharTypes { /** * Constructor * - * @param expert ISTextExpert instance through which this handler - * is invoked. The handler can use ISTextExpert methods to + * @param 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 current - * {@link STextEnvironment environment}. + * {@link StructuredTextEnvironment environment}. * * @param text is the text whose characters are analyzed. */ - public STextCharTypes(ISTextExpert expert, String text) { + public StructuredTextCharTypes(IStructuredTextExpert expert, String text) { this.expert = expert; this.handler = expert.getTypeHandler(); this.environment = expert.getEnvironment(); @@ -86,8 +86,8 @@ public class STextCharTypes { * whether the structured text contains Arabic or Hebrew * letters.<br> * The value returned is either - * {@link ISTextExpert#DIR_LTR DIR_LTR} or - * {@link ISTextExpert#DIR_RTL DIR_RTL}. + * {@link IStructuredTextExpert#DIR_LTR DIR_LTR} or + * {@link IStructuredTextExpert#DIR_RTL DIR_RTL}. */ public int getDirection() { if (direction < 0) @@ -124,7 +124,7 @@ public class STextCharTypes { direction = -2; // signal we go within handler.getDirection direction = handler.getDirection(expert, text, this); } - charType = (direction == STextEnvironment.ORIENT_RTL) ? R : L; + charType = (direction == StructuredTextEnvironment.ORIENT_RTL) ? R : L; } setBidiTypeAt(index, charType); return charType; @@ -148,18 +148,18 @@ public class STextCharTypes { * be displayed. * * @return the orientation as either - * {@link STextEnvironment#ORIENT_LTR}, - * {@link STextEnvironment#ORIENT_RTL}, - * {@link STextEnvironment#ORIENT_UNKNOWN} or - * {@link STextEnvironment#ORIENT_IGNORE}. + * {@link StructuredTextEnvironment#ORIENT_LTR}, + * {@link StructuredTextEnvironment#ORIENT_RTL}, + * {@link StructuredTextEnvironment#ORIENT_UNKNOWN} or + * {@link StructuredTextEnvironment#ORIENT_IGNORE}. */ public int resolveOrientation() { int orient = environment.getOrientation(); - if ((orient & STextEnvironment.ORIENT_CONTEXTUAL) == 0) { // absolute orientation + if ((orient & StructuredTextEnvironment.ORIENT_CONTEXTUAL) == 0) { // absolute orientation return orient; } // contextual orientation: - orient &= ~STextEnvironment.ORIENT_CONTEXTUAL; // initiate to the default orientation minus contextual bit + orient &= ~StructuredTextEnvironment.ORIENT_CONTEXTUAL; // initiate to the default orientation minus contextual bit int len = text.length(); byte charType; for (int i = 0; i < len; i++) { @@ -171,9 +171,9 @@ public class STextCharTypes { } else charType = getCachedTypeAt(i); if (charType == L) - return STextEnvironment.ORIENT_LTR; + return StructuredTextEnvironment.ORIENT_LTR; if (charType == R || charType == AL) - return STextEnvironment.ORIENT_RTL; + return StructuredTextEnvironment.ORIENT_RTL; } return orient; } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/STextOffsets.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextOffsets.java index 0cff8f845..cb8dac5b1 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/STextOffsets.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextOffsets.java @@ -14,11 +14,8 @@ package org.eclipse.equinox.bidi.custom; * Provides various services related to managing the array of * offsets where directional formatting characters should be inserted * in a source string. - * - * @author Matitiahu Allouche - * */ -public class STextOffsets { +public class StructuredTextOffsets { private static final byte L = Character.DIRECTIONALITY_LEFT_TO_RIGHT; private static final byte R = Character.DIRECTIONALITY_RIGHT_TO_LEFT; @@ -38,7 +35,7 @@ public class STextOffsets { /** * Default constructor */ - public STextOffsets() { + public StructuredTextOffsets() { } /** @@ -93,7 +90,7 @@ public class STextOffsets { * * @param offset the value to insert. */ - public void insertOffset(STextCharTypes charTypes, int offset) { + public void insertOffset(StructuredTextCharTypes charTypes, int offset) { if (count >= offsets.length) { int[] newOffsets = new int[offsets.length * 2]; System.arraycopy(offsets, 0, newOffsets, 0, count); diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/STextTypeHandler.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java index 0385284ae..e73549cc8 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/STextTypeHandler.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java @@ -10,9 +10,9 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.custom; -import org.eclipse.equinox.bidi.advanced.ISTextExpert; -import org.eclipse.equinox.bidi.advanced.STextEnvironment; -import org.eclipse.equinox.bidi.internal.STextImpl; +import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert; +import org.eclipse.equinox.bidi.advanced.StructuredTextEnvironment; +import org.eclipse.equinox.bidi.internal.StructuredTextImpl; /** * Generic handler to be used as superclass (base class) @@ -24,7 +24,7 @@ import org.eclipse.equinox.bidi.internal.STextImpl; * <li>Handler instances may be accessed simultaneously by * several threads. They should have no instance variables.</li> * <li>This class provides common logic in code which can be invoked - * by any {@link STextTypeHandler structured text handler}. + * by any {@link StructuredTextTypeHandler structured text handler}. * This common logic uses handler methods to query the * characteristics of the specific handler: * <ul> @@ -54,25 +54,23 @@ import org.eclipse.equinox.bidi.internal.STextImpl; * unconditionally (by calling {@link #insertMark} or * conditionally (by calling {@link #processSeparator}).</li> * </ul> - * - * @author Matitiahu Allouche */ -public class STextTypeHandler { +public class StructuredTextTypeHandler { final private String separators; /** - * Creates a new instance of the STextTypeHandler class. + * Creates a new instance of the StructuredTextTypeHandler class. */ - public STextTypeHandler() { + public StructuredTextTypeHandler() { separators = ""; //$NON-NLS-1$ } /** - * Creates a new instance of the STextTypeHandler class. + * Creates a new instance of the StructuredTextTypeHandler class. * @param separators string consisting of characters that split the text into fragments. */ - public STextTypeHandler(String separators) { + public StructuredTextTypeHandler(String separators) { this.separators = separators; } @@ -85,10 +83,10 @@ public class STextTypeHandler { * </p><p> * A handler handling special cases must override this method. * </p> - * @param expert ISTextExpert instance through which this handler - * is invoked. The handler can use ISTextExpert methods to + * @param 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 current - * {@link STextEnvironment environment}. + * {@link StructuredTextEnvironment environment}. * @param text the structured text string before * addition of any directional formatting characters. * @param charTypes an object whose methods can be useful to the @@ -120,7 +118,7 @@ public class STextTypeHandler { * number of special cases is zero, which means that * <code>indexOfSpecial</code> should never be called for them. */ - public int indexOfSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int fromIndex) { + public int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) { // This method must be overridden by all subclasses with special cases. throw new IllegalStateException("A handler with specialsCount > 0 must have an indexOfSpecial() method."); //$NON-NLS-1$ } @@ -134,23 +132,23 @@ public class STextTypeHandler { * <code>processSpecial</code> (for instance, a comment has been started * in the current line but its end appears in a following line), * <code>processSpecial</code> should specify a final state by calling - * {@link ISTextExpert#setState(Object)}. + * {@link IStructuredTextExpert#setState(Object)}. * The meaning of this state is internal to the handler. * <p> * On a later call, <code>processSpecial</code> will be called with * <code>-1</code> for parameter <code>separLocation</code>. It should then - * retrieve the last state by calling {@link ISTextExpert#getState()} and - * clear the state by calling {@link ISTextExpert#clearState()}. After that, + * retrieve the last state by calling {@link IStructuredTextExpert#getState()} and + * clear the state by calling {@link IStructuredTextExpert#clearState()}. After that, * it should perform whatever initializations are required * depending on the last state. * </p><p> * A handler handling special cases (with a number of * special cases greater than zero) must override this method. * </p> - * @param expert ISTextExpert instance through which this handler - * is invoked. The handler can use ISTextExpert methods to + * @param 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 current - * {@link STextEnvironment environment}. + * {@link StructuredTextEnvironment environment}. * @param text the structured text string before * addition of any directional formatting characters. * @param charTypes an object whose methods can be useful to the @@ -160,8 +158,8 @@ public class STextTypeHandler { * @param caseNumber number of the special case to handle. * @param separLocation the position returned by * {@link #indexOfSpecial}. After calls to - * {@link ISTextExpert#leanToFullText} and other - * methods of {@link ISTextExpert} which set a non-null + * {@link IStructuredTextExpert#leanToFullText} and other + * methods of {@link IStructuredTextExpert} which set a non-null * final state, <code>processSpecial</code> is * called when initializing the processing with value of * <code>separLocation</code> equal to <code>-1</code>. @@ -179,7 +177,7 @@ public class STextTypeHandler { * number of special cases is zero, which means that * <code>processSpecial</code> should never be called for them. */ - public int processSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int separLocation) { + public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) { // This method must be overridden by all subclasses with any special case. throw new IllegalStateException("A handler with specialsCount > 0 must have a processSpecial() method."); //$NON-NLS-1$ } @@ -190,7 +188,7 @@ public class STextTypeHandler { * <i>full</i> text. This method can be called from within * {@link #indexOfSpecial} or * {@link #processSpecial} in extensions of - * <code>STextTypeHandler</code>. + * <code>StructuredTextTypeHandler</code>. * The mark character will be LRM for structured text * with a LTR base direction, and RLM for structured text with RTL * base direction. The mark character is not added physically by this @@ -210,7 +208,7 @@ public class STextTypeHandler { * For the benefit of efficiency, it is better to insert * multiple marks in ascending order of the offsets. */ - public static final void insertMark(String text, STextCharTypes charTypes, STextOffsets offsets, int offset) { + public static final void insertMark(String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int offset) { offsets.insertOffset(charTypes, offset); } @@ -221,7 +219,7 @@ public class STextTypeHandler { * following the separator itself. This method * can be called from within {@link #indexOfSpecial} or * {@link #processSpecial} in extensions of - * <code>STextTypeHandler</code>. + * <code>StructuredTextTypeHandler</code>. * <p> * The logic implemented in this method considers the text before * <code>separLocation</code> and the text following it. If, and only if, @@ -240,8 +238,8 @@ public class STextTypeHandler { * It must be a non-negative number smaller than the length * of the <i>lean</i> text. */ - public static final void processSeparator(String text, STextCharTypes charTypes, STextOffsets offsets, int separLocation) { - STextImpl.processSeparator(text, charTypes, offsets, separLocation); + public static final void processSeparator(String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int separLocation) { + StructuredTextImpl.processSeparator(text, charTypes, offsets, separLocation); } /** @@ -250,15 +248,15 @@ public class STextTypeHandler { * <p> * If no separators are specified, this method returns an empty string. * </p> - * @param expert ISTextExpert instance through which this handler - * is invoked. The handler can use ISTextExpert methods to + * @param 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 current - * {@link STextEnvironment environment}. + * {@link StructuredTextEnvironment environment}. * * @return a string grouping one-character separators which separate * the structured text into tokens. */ - public String getSeparators(ISTextExpert expert) { + public String getSeparators(IStructuredTextExpert expert) { return separators; } @@ -266,12 +264,12 @@ public class STextTypeHandler { * Indicates the base text direction appropriate for an instance of * structured text. This method is invoked before starting the processing. * <p> - * If not overridden, this method returns {@link ISTextExpert#DIR_LTR DIR_LTR}. + * If not overridden, this method returns {@link IStructuredTextExpert#DIR_LTR DIR_LTR}. * </p> - * @param expert ISTextExpert instance through which this handler - * is invoked. The handler can use ISTextExpert methods to + * @param 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 current - * {@link STextEnvironment environment}. + * {@link StructuredTextEnvironment environment}. * @param text the structured text string to process. * * @return the base direction of the structured text. This direction @@ -279,23 +277,23 @@ public class STextTypeHandler { * whether the structured text contains Arabic or Hebrew * letters.<br> * The value returned is either - * {@link ISTextExpert#DIR_LTR DIR_LTR} or - * {@link ISTextExpert#DIR_RTL DIR_RTL}. + * {@link IStructuredTextExpert#DIR_LTR DIR_LTR} or + * {@link IStructuredTextExpert#DIR_RTL DIR_RTL}. */ - public int getDirection(ISTextExpert expert, String text) { - return ISTextExpert.DIR_LTR; + public int getDirection(IStructuredTextExpert expert, String text) { + return IStructuredTextExpert.DIR_LTR; } /** * Indicates the base text direction appropriate for an instance of * structured text. This method is invoked before starting the processing. * <p> - * If not overridden, this method returns {@link ISTextExpert#DIR_LTR DIR_LTR}. + * If not overridden, this method returns {@link IStructuredTextExpert#DIR_LTR DIR_LTR}. * </p> - * @param expert ISTextExpert instance through which this handler - * is invoked. The handler can use ISTextExpert methods to + * @param 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 current - * {@link STextEnvironment environment}. + * {@link StructuredTextEnvironment environment}. * @param text is the structured text string to process. * @param charTypes is a parameter received by <code>indexOfSpecial</code> * or <code>processSpecial</code>. @@ -305,10 +303,10 @@ public class STextTypeHandler { * whether the structured text contains Arabic or Hebrew * letters.<br> * The value returned is either - * {@link ISTextExpert#DIR_LTR DIR_LTR} or {@link ISTextExpert#DIR_RTL DIR_RTL}. + * {@link IStructuredTextExpert#DIR_LTR DIR_LTR} or {@link IStructuredTextExpert#DIR_RTL DIR_RTL}. */ - public int getDirection(ISTextExpert expert, String text, STextCharTypes charTypes) { - return ISTextExpert.DIR_LTR; + public int getDirection(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes) { + return IStructuredTextExpert.DIR_LTR; } /** @@ -319,21 +317,21 @@ public class STextTypeHandler { * <p> * If not overridden, this method returns <code>zero</code>. * </p> - * @param expert ISTextExpert instance through which this handler - * is invoked. The handler can use ISTextExpert methods to + * @param 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 current - * {@link STextEnvironment environment}. + * {@link StructuredTextEnvironment environment}. * * @return the number of special cases for the associated handler. * Special cases exist for some types of structured text * handlers. They are implemented by overriding methods - * {@link STextTypeHandler#indexOfSpecial} and - * {@link STextTypeHandler#processSpecial}. + * {@link StructuredTextTypeHandler#indexOfSpecial} and + * {@link StructuredTextTypeHandler#processSpecial}. * Examples of special cases are comments, literals, or * anything which is not identified by a one-character separator. * */ - public int getSpecialsCount(ISTextExpert expert) { + public int getSpecialsCount(IStructuredTextExpert expert) { return 0; } @@ -346,10 +344,10 @@ public class STextTypeHandler { * <p> * If not overridden, this method returns <code>false</code>. * </p> - * @param expert ISTextExpert instance through which this handler - * is invoked. The handler can use ISTextExpert methods to + * @param 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 current - * {@link STextEnvironment environment}. + * {@link StructuredTextEnvironment environment}. * @param text is the structured text string to process. * @param charTypes is a parameter received by <code>indexOfSpecial</code> * or <code>processSpecial</code>. @@ -358,7 +356,7 @@ public class STextTypeHandler { * text to add directional formatting characters. * */ - public boolean skipProcessing(ISTextExpert expert, String text, STextCharTypes charTypes) { + public boolean skipProcessing(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes) { return false; } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/package.html b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/package.html index 4e205c7fa..f2adb77bf 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/package.html +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/package.html @@ -1,8 +1,5 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> -<head> -<META name="Author" content="Matitiahu Allouche"> -</head> <body bgcolor="white"> <p> This package provides APIs for plug-in developers to contribute diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextActivator.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextActivator.java index 9478a77bc..712b563e2 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextActivator.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextActivator.java @@ -20,13 +20,13 @@ import org.osgi.util.tracker.ServiceTracker; /** * Provides services related to OSGi bundles. */ -public class STextActivator implements BundleActivator { +public class StructuredTextActivator implements BundleActivator { private ServiceTracker logTracker = null; private BundleContext bundleContext; - private static STextActivator instance; + private static StructuredTextActivator instance; - public STextActivator() { + public StructuredTextActivator() { instance = this; // there is only one bundle activator } @@ -46,7 +46,7 @@ public class STextActivator implements BundleActivator { /** * @return the bundle instance, or <code>null</code> iff OSGi is not running */ - public static STextActivator getInstance() { + public static StructuredTextActivator getInstance() { return instance; } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextDelims.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelims.java index ba6419ff6..91dc493ac 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextDelims.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelims.java @@ -10,7 +10,7 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal; -import org.eclipse.equinox.bidi.advanced.ISTextExpert; +import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert; import org.eclipse.equinox.bidi.custom.*; /** @@ -20,15 +20,14 @@ import org.eclipse.equinox.bidi.custom.*; * <p> * A delimited part is bounded by a start delimiter and an end delimiter. * </p> - * @author Matitiahu Allouche */ -public abstract class STextDelims extends STextTypeHandler { +public abstract class StructuredTextDelims extends StructuredTextTypeHandler { - public STextDelims() { + public StructuredTextDelims() { // placeholder } - public STextDelims(String separators) { + public StructuredTextDelims(String separators) { super(separators); } @@ -43,7 +42,7 @@ public abstract class STextDelims extends STextTypeHandler { * * @see #getDelimiters */ - public int indexOfSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int fromIndex) { + public int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) { char delim = getDelimiters().charAt((caseNumber - 1) * 2); return text.indexOf(delim, fromIndex); } @@ -57,8 +56,8 @@ public abstract class STextDelims extends STextTypeHandler { * @return the position after the matching end delimiter, or the length * of <code>text</code> if no end delimiter is found. */ - public int processSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int separLocation) { - STextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); + public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) { + StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); int loc = separLocation + 1; char delim = getDelimiters().charAt((caseNumber * 2) - 1); loc = text.indexOf(delim, loc); diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextDelimsEsc.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelimsEsc.java index 85f170aef..9cf526ee4 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextDelimsEsc.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextDelimsEsc.java @@ -10,7 +10,7 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal; -import org.eclipse.equinox.bidi.advanced.ISTextExpert; +import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert; import org.eclipse.equinox.bidi.custom.*; /** @@ -19,7 +19,7 @@ import org.eclipse.equinox.bidi.custom.*; * which separators are treated like regular characters and the delimiters * may be escaped. * <p> - * This is similar to {@link STextDelims} except that delimiters can be escaped + * This is similar to {@link StructuredTextDelims} except that delimiters can be escaped * using the backslash character. * <ul> * <li>Two consecutive backslashes in a delimited part are treated like @@ -28,16 +28,14 @@ import org.eclipse.equinox.bidi.custom.*; * treated like a regular character within the delimited part.</li> * </ul> * </p> - * - * @author Matitiahu Allouche */ -public abstract class STextDelimsEsc extends STextDelims { +public abstract class StructuredTextDelimsEsc extends StructuredTextDelims { - public STextDelimsEsc() { + public StructuredTextDelimsEsc() { // placeholder } - public STextDelimsEsc(String separator) { + public StructuredTextDelimsEsc(String separator) { super(separator); } @@ -48,8 +46,8 @@ public abstract class STextDelimsEsc extends STextDelims { * and skips until after the matching end delimiter, * ignoring possibly escaped end delimiters. */ - public int processSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int separLocation) { - STextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); + public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) { + StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); int location = separLocation + 1; char delim = getDelimiters().charAt((caseNumber * 2) - 1); while (true) { diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextImpl.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java index d26f41901..790395a76 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextImpl.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java @@ -14,12 +14,9 @@ import org.eclipse.equinox.bidi.advanced.*; import org.eclipse.equinox.bidi.custom.*; /** - * Implementation for ISTextExpert. - * - * @author Matitiahu Allouche - * + * Implementation for IStructuredTextExpert. */ -public class STextImpl implements ISTextExpert { +public class StructuredTextImpl implements IStructuredTextExpert { static final String EMPTY_STRING = ""; //$NON-NLS-1$ @@ -54,11 +51,11 @@ public class STextImpl implements ISTextExpert { /** * The structured text handler utilized by this expert. */ - protected final STextTypeHandler handler; + protected final StructuredTextTypeHandler handler; /** * The environment associated with the expert. */ - protected final STextEnvironment environment; + protected final StructuredTextEnvironment environment; /** * Flag which is true if the expert is stateful. */ @@ -69,23 +66,23 @@ public class STextImpl implements ISTextExpert { protected Object state; /** - * Constructor used in {@link STextExpertFactory}. + * Constructor used in {@link StructuredTextExpertFactory}. * * @param structuredTextHandler the structured text handler used by this expert. * @param environment the environment associated with this expert. * @param shared flag which is true if the expert is stateful. */ - public STextImpl(STextTypeHandler structuredTextHandler, STextEnvironment environment, boolean shared) { + public StructuredTextImpl(StructuredTextTypeHandler structuredTextHandler, StructuredTextEnvironment environment, boolean shared) { this.handler = structuredTextHandler; this.environment = environment; sharedExpert = shared; } - public STextTypeHandler getTypeHandler() { + public StructuredTextTypeHandler getTypeHandler() { return handler; } - public STextEnvironment getEnvironment() { + public StructuredTextEnvironment getEnvironment() { return environment; } @@ -107,7 +104,7 @@ public class STextImpl implements ISTextExpert { return state; } - long computeNextLocation(String text, STextCharTypes charTypes, STextOffsets offsets, int[] locations, int curPos) { + long computeNextLocation(String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int[] locations, int curPos) { String separators = handler.getSeparators(this); int separCount = separators.length(); int specialsCount = handler.getSpecialsCount(this); @@ -146,9 +143,9 @@ public class STextImpl implements ISTextExpert { } /** - * @see STextTypeHandler#processSeparator STextTypeHandler.processSeparator + * @see StructuredTextTypeHandler#processSeparator StructuredTextTypeHandler.processSeparator */ - static public void processSeparator(String text, STextCharTypes charTypes, STextOffsets offsets, int separLocation) { + static public void processSeparator(String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int separLocation) { int len = text.length(); int direction = charTypes.getDirection(); if (direction == DIR_RTL) { @@ -209,42 +206,42 @@ public class STextImpl implements ISTextExpert { /** * When the orientation is <code>ORIENT_LTR</code> and the * structured text has a RTL base direction, - * {@link ISTextExpert#leanToFullText leanToFullText} + * {@link IStructuredTextExpert#leanToFullText leanToFullText} * adds RLE+RLM at the head of the <i>full</i> text and RLM+PDF at its * end. * <p> * When the orientation is <code>ORIENT_RTL</code> and the * structured text has a LTR base direction, - * {@link ISTextExpert#leanToFullText leanToFullText} + * {@link IStructuredTextExpert#leanToFullText leanToFullText} * adds LRE+LRM at the head of the <i>full</i> text and LRM+PDF at its * end. * <p> * When the orientation is <code>ORIENT_CONTEXTUAL_LTR</code> or * <code>ORIENT_CONTEXTUAL_RTL</code> and the data content would resolve * to a RTL orientation while the structured text has a LTR base - * direction, {@link ISTextExpert#leanToFullText leanToFullText} + * direction, {@link IStructuredTextExpert#leanToFullText leanToFullText} * adds LRM at the head of the <i>full</i> text. * <p> * When the orientation is <code>ORIENT_CONTEXTUAL_LTR</code> or * <code>ORIENT_CONTEXTUAL_RTL</code> and the data content would resolve * to a LTR orientation while the structured text has a RTL base - * direction, {@link ISTextExpert#leanToFullText leanToFullText} + * direction, {@link IStructuredTextExpert#leanToFullText leanToFullText} * adds RLM at the head of the <i>full</i> text. * <p> * When the orientation is <code>ORIENT_UNKNOWN</code> and the * structured text has a LTR base direction, - * {@link ISTextExpert#leanToFullText leanToFullText} + * {@link IStructuredTextExpert#leanToFullText leanToFullText} * adds LRE+LRM at the head of the <i>full</i> text and LRM+PDF at its * end. * <p> * When the orientation is <code>ORIENT_UNKNOWN</code> and the * structured text has a RTL base direction, - * {@link ISTextExpert#leanToFullText leanToFullText} + * {@link IStructuredTextExpert#leanToFullText leanToFullText} * adds RLE+RLM at the head of the <i>full</i> text and RLM+PDF at its * end. * <p> * When the orientation is <code>ORIENT_IGNORE</code>, - * {@link ISTextExpert#leanToFullText leanToFullText} does not add any directional + * {@link IStructuredTextExpert#leanToFullText leanToFullText} does not add any directional * formatting characters as either prefix or suffix of the <i>full</i> text. * <p> */ @@ -252,8 +249,8 @@ public class STextImpl implements ISTextExpert { int len = text.length(); if (len == 0) return text; - STextCharTypes charTypes = new STextCharTypes(this, text); - STextOffsets offsets = leanToFullCommon(text, charTypes); + StructuredTextCharTypes charTypes = new StructuredTextCharTypes(this, text); + StructuredTextOffsets offsets = leanToFullCommon(text, charTypes); int prefixLength = offsets.getPrefixLength(); int direction = charTypes.getDirection(); return insertMarks(text, offsets.getOffsets(), direction, prefixLength); @@ -263,8 +260,8 @@ public class STextImpl implements ISTextExpert { int len = text.length(); if (len == 0) return EMPTY_INT_ARRAY; - STextCharTypes charTypes = new STextCharTypes(this, text); - STextOffsets offsets = leanToFullCommon(text, charTypes); + StructuredTextCharTypes charTypes = new StructuredTextCharTypes(this, text); + StructuredTextOffsets offsets = leanToFullCommon(text, charTypes); int prefixLength = offsets.getPrefixLength(); int[] map = new int[len]; int count = offsets.getCount(); // number of used entries @@ -283,15 +280,15 @@ public class STextImpl implements ISTextExpert { int len = text.length(); if (len == 0) return EMPTY_INT_ARRAY; - STextCharTypes charTypes = new STextCharTypes(this, text); - STextOffsets offsets = leanToFullCommon(text, charTypes); + StructuredTextCharTypes charTypes = new StructuredTextCharTypes(this, text); + StructuredTextOffsets offsets = leanToFullCommon(text, charTypes); return offsets.getOffsets(); } - private STextOffsets leanToFullCommon(String text, STextCharTypes charTypes) { + private StructuredTextOffsets leanToFullCommon(String text, StructuredTextCharTypes charTypes) { int len = text.length(); int direction = handler.getDirection(this, text, charTypes); - STextOffsets offsets = new STextOffsets(); + StructuredTextOffsets offsets = new StructuredTextOffsets(); if (!handler.skipProcessing(this, text, charTypes)) { // initialize locations int separCount = handler.getSeparators(this).length(); @@ -327,13 +324,13 @@ public class STextImpl implements ISTextExpert { } // end if (!handler.skipProcessing()) int prefixLength; int orientation = environment.getOrientation(); - if (orientation == STextEnvironment.ORIENT_IGNORE) + if (orientation == StructuredTextEnvironment.ORIENT_IGNORE) prefixLength = 0; else { int resolvedOrientation = charTypes.resolveOrientation(); - if (orientation != STextEnvironment.ORIENT_UNKNOWN && resolvedOrientation == direction) + if (orientation != StructuredTextEnvironment.ORIENT_UNKNOWN && resolvedOrientation == direction) prefixLength = 0; - else if ((orientation & STextEnvironment.ORIENT_CONTEXTUAL) != 0) + else if ((orientation & StructuredTextEnvironment.ORIENT_CONTEXTUAL) != 0) prefixLength = 1; else prefixLength = 2; @@ -482,7 +479,7 @@ public class STextImpl implements ISTextExpert { if (lenFull == 0) return EMPTY_INT_ARRAY; String lean = fullToLeanText(full); - STextOffsets offsets = new STextOffsets(); + StructuredTextOffsets offsets = new StructuredTextOffsets(); int lenLean = lean.length(); int idxLean, idxFull; // lean must be a subset of Full, so we only check on iLean < leanLen diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextSingle.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextSingle.java index a1bc6ed4c..a34390822 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextSingle.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextSingle.java @@ -10,7 +10,7 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal; -import org.eclipse.equinox.bidi.advanced.ISTextExpert; +import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert; import org.eclipse.equinox.bidi.custom.*; /** @@ -23,15 +23,13 @@ import org.eclipse.equinox.bidi.custom.*; * <pre> * part1=part2 * </pre> - * The string returned by {@link STextTypeHandler#getSeparators getSeparators} + * The string returned by {@link StructuredTextTypeHandler#getSeparators getSeparators} * for this handler should contain exactly one character. * Additional characters will be ignored. - * - * @author Matitiahu Allouche */ -public class STextSingle extends STextTypeHandler { +public class StructuredTextSingle extends StructuredTextTypeHandler { - public STextSingle(String separator) { + public StructuredTextSingle(String separator) { super(separator); } @@ -40,7 +38,7 @@ public class STextSingle extends STextTypeHandler { * * @see #getSeparators getSeparators */ - public int indexOfSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int fromIndex) { + public int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) { return text.indexOf(this.getSeparators(expert).charAt(0), fromIndex); } @@ -50,8 +48,8 @@ public class STextSingle extends STextTypeHandler { * * @return the length of <code>text</code>. */ - public int processSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int separLocation) { - STextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); + public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) { + StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); return text.length(); } @@ -60,7 +58,7 @@ public class STextSingle extends STextTypeHandler { * * @return 1. */ - public int getSpecialsCount(ISTextExpert expert) { + public int getSpecialsCount(IStructuredTextExpert expert) { return 1; } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextStringRecord.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextStringRecord.java index df62726d4..6a897cafe 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextStringRecord.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextStringRecord.java @@ -11,7 +11,7 @@ package org.eclipse.equinox.bidi.internal; import java.lang.ref.SoftReference; -import org.eclipse.equinox.bidi.STextTypeHandlerFactory; +import org.eclipse.equinox.bidi.StructuredTextTypeHandlerFactory; /** * Records strings which contain structured text. Several static @@ -28,7 +28,7 @@ import org.eclipse.equinox.bidi.STextTypeHandlerFactory; * segment is identified by its starting and ending offsets within the * string, and by the handler which is appropriate to handle it. */ -public class STextStringRecord { +public class StructuredTextStringRecord { /** * Number of entries in the pool of recorded strings */ @@ -69,7 +69,7 @@ public class STextStringRecord { /** * Constructor */ - private STextStringRecord() { + private StructuredTextStringRecord() { // inhibit creation of new instances by customers } @@ -84,7 +84,7 @@ public class STextStringRecord { * @param handlerID identifier for the handler appropriate to handle * the type of structured text present in the first segment. * It may be one of the predefined identifiers in - * {@link STextTypeHandlerFactory}, or it may be an identifier + * {@link StructuredTextTypeHandlerFactory}, or it may be an identifier * for a type handler created by a plug-in or by the application. * @param start offset in the string of the starting character of the first * segment. It must be >= 0 and less than the length of the string. @@ -92,15 +92,21 @@ public class STextStringRecord { * must be greater than the <code>start</code> argument and * not greater than the length of the string. * - * @return an instance of STextRecordString which represents this record. + * @return an instance of StructuredTextRecordString which represents this record. * This instance may be used to specify additional segments with * {@link #addSegment addSegment}. * * @throws IllegalArgumentException if <code>string</code> is null or * if <code>segmentCount</code> is less than 1. - * @throws also the same exceptions as {@link #addSegment addSegment}. + * @throws IllegalArgumentException if <code>handlerID</code> is null, + * or if <code>start</code> or <code>limit</code> have invalid + * values. + * @throws IllegalStateException if the current segment exceeds the + * number of segments specified by <code>segmentCount</code> + * in the call to {@link #addRecord addRecord} which created + * the StructuredTextStringRecord instance. */ - public static STextStringRecord addRecord(String string, int segmentCount, String handlerID, int start, int limit) { + public static StructuredTextStringRecord addRecord(String string, int segmentCount, String handlerID, int start, int limit) { if (string == null) throw new IllegalArgumentException("The string argument must not be null!"); //$NON-NLS-1$ if (segmentCount < 1) @@ -113,11 +119,11 @@ public class STextStringRecord { last = 0; } } - STextStringRecord record = null; + StructuredTextStringRecord record = null; if (recordRefs[last] != null) - record = (STextStringRecord) recordRefs[last].get(); + record = (StructuredTextStringRecord) recordRefs[last].get(); if (record == null) { - record = new STextStringRecord(); + record = new StructuredTextStringRecord(); recordRefs[last] = new SoftReference(record); } hashArray[last] = string.hashCode(); @@ -140,7 +146,7 @@ public class STextStringRecord { * @param handlerID identifier for the handler appropriate to handle * the type of structured text present in the first segment. * It may be one of the predefined identifiers in - * {@link STextTypeHandlerFactory}, or it may be an identifier + * {@link StructuredTextTypeHandlerFactory}, or it may be an identifier * for a type handler created by a plug-in or by the application. * @param start offset in the string of the starting character of the * segment. It must be >= 0 and less than the length of the string. @@ -154,7 +160,7 @@ public class STextStringRecord { * @throws IllegalStateException if the current segment exceeds the * number of segments specified by <code>segmentCount</code> * in the call to {@link #addRecord addRecord} which created - * the STextStringRecord instance. + * the StructuredTextStringRecord instance. */ public void addSegment(String handlerID, int start, int limit) { if (handlerID == null) @@ -177,7 +183,7 @@ public class STextStringRecord { * @param string the string to check. * * @return <code>null</code> if the string is not recorded in the pool; - * otherwise, return the <code>STextStringRecord</code> instance + * otherwise, return the <code>StructuredTextStringRecord</code> instance * which records this string.<br> * Once a record has been found, the number of its segments can * be retrieved using {@link #getSegmentCount getSegmentCount}, @@ -188,18 +194,18 @@ public class STextStringRecord { * its ending offset can * be retrieved using {@link #getLimit getLimit}, */ - public static STextStringRecord getRecord(String string) { + public static StructuredTextStringRecord getRecord(String string) { if (last < 0) // no records at all return null; if (string == null || string.length() < 1) return null; - STextStringRecord record; + StructuredTextStringRecord record; int myLast = last; int hash = string.hashCode(); for (int i = myLast; i >= 0; i--) { if (hash != hashArray[i]) continue; - record = (STextStringRecord) recordRefs[i].get(); + record = (StructuredTextStringRecord) recordRefs[i].get(); if (record == null) continue; if (string.equals(record.string)) @@ -210,7 +216,7 @@ public class STextStringRecord { for (int i = MAXINDEX; i > myLast; i--) { if (hash != hashArray[i]) continue; - record = (STextStringRecord) recordRefs[i].get(); + record = (StructuredTextStringRecord) recordRefs[i].get(); if (record == null) continue; if (string.equals(record.string)) @@ -298,7 +304,7 @@ public class STextStringRecord { SoftReference softRef = recordRefs[i]; if (softRef == null) continue; - STextStringRecord record = (STextStringRecord) softRef.get(); + StructuredTextStringRecord record = (StructuredTextStringRecord) softRef.get(); if (record == null) continue; record.boundaries = null; diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextTypesCollector.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java index 9428fa1ec..ed5f4bd7b 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextTypesCollector.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java @@ -12,14 +12,14 @@ package org.eclipse.equinox.bidi.internal; import java.util.*; import org.eclipse.core.runtime.*; -import org.eclipse.equinox.bidi.STextTypeHandlerFactory; -import org.eclipse.equinox.bidi.custom.STextTypeHandler; +import org.eclipse.equinox.bidi.StructuredTextTypeHandlerFactory; +import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler; import org.eclipse.equinox.bidi.internal.consumable.*; /** * Provides services related to registered structured text handlers. */ -public class STextTypesCollector implements IRegistryEventListener { +public class StructuredTextTypesCollector implements IRegistryEventListener { private static final String EXT_POINT = "org.eclipse.equinox.bidi.bidiTypes"; //$NON-NLS-1$ @@ -30,9 +30,9 @@ public class STextTypesCollector implements IRegistryEventListener { private Map types; private Map factories; - static private STextTypesCollector instance = new STextTypesCollector(); + static private StructuredTextTypesCollector instance = new StructuredTextTypesCollector(); - private STextTypesCollector() { + private StructuredTextTypesCollector() { IExtensionRegistry registry = RegistryFactory.getRegistry(); if (registry != null) registry.addListener(this, EXT_POINT); @@ -41,7 +41,7 @@ public class STextTypesCollector implements IRegistryEventListener { /** * @return a static instance. */ - static public STextTypesCollector getInstance() { + static public StructuredTextTypesCollector getInstance() { return instance; } @@ -62,12 +62,12 @@ public class STextTypesCollector implements IRegistryEventListener { * * @return the structured text handler instance. */ - public STextTypeHandler getHandler(String type) { + public StructuredTextTypeHandler getHandler(String type) { if (types == null) read(); Object handler = types.get(type); - if (handler instanceof STextTypeHandler) - return (STextTypeHandler) handler; + if (handler instanceof StructuredTextTypeHandler) + return (StructuredTextTypeHandler) handler; return null; } @@ -95,13 +95,13 @@ public class STextTypesCollector implements IRegistryEventListener { IConfigurationElement[] confElements = extensions[i].getConfigurationElements(); for (int j = 0; j < confElements.length; j++) { if (!CE_NAME.equals(confElements[j].getName())) - STextActivator.logError("BiDi types: unexpected element name " + confElements[j].getName(), new IllegalArgumentException()); //$NON-NLS-1$ + StructuredTextActivator.logError("BiDi types: unexpected element name " + confElements[j].getName(), new IllegalArgumentException()); //$NON-NLS-1$ String type = confElements[j].getAttribute(ATTR_TYPE); Object handler; try { handler = confElements[j].createExecutableExtension(ATTR_HANDLER); } catch (CoreException e) { - STextActivator.logError("BiDi types: unable to create handler for " + type, e); //$NON-NLS-1$ + StructuredTextActivator.logError("BiDi types: unable to create handler for " + type, e); //$NON-NLS-1$ continue; } types.put(type, handler); @@ -135,23 +135,23 @@ public class STextTypesCollector implements IRegistryEventListener { * also supported without OSGi running. * * @return a map from structured text type handler identifier (key type: {@link String}) - * to structured text type handler (value type: {@link STextTypeHandler}). + * to structured text type handler (value type: {@link StructuredTextTypeHandler}). */ public static Map getDefaultTypeHandlers() { Map types = new LinkedHashMap(); - types.put(STextTypeHandlerFactory.COMMA_DELIMITED, new STextComma()); - types.put(STextTypeHandlerFactory.EMAIL, new STextEmail()); - types.put(STextTypeHandlerFactory.FILE, new STextFile()); - types.put(STextTypeHandlerFactory.JAVA, new STextJava()); - types.put(STextTypeHandlerFactory.MATH, new STextMath()); - types.put(STextTypeHandlerFactory.PROPERTY, new STextProperty()); - types.put(STextTypeHandlerFactory.REGEXP, new STextRegex()); - types.put(STextTypeHandlerFactory.SQL, new STextSql()); - types.put(STextTypeHandlerFactory.SYSTEM_USER, new STextSystem()); - types.put(STextTypeHandlerFactory.UNDERSCORE, new STextUnderscore()); - types.put(STextTypeHandlerFactory.URL, new STextURL()); - types.put(STextTypeHandlerFactory.XPATH, new STextXPath()); + types.put(StructuredTextTypeHandlerFactory.COMMA_DELIMITED, new StructuredTextComma()); + types.put(StructuredTextTypeHandlerFactory.EMAIL, new StructuredTextEmail()); + types.put(StructuredTextTypeHandlerFactory.FILE, new StructuredTextFile()); + types.put(StructuredTextTypeHandlerFactory.JAVA, new StructuredTextJava()); + types.put(StructuredTextTypeHandlerFactory.MATH, new StructuredTextMath()); + types.put(StructuredTextTypeHandlerFactory.PROPERTY, new StructuredTextProperty()); + types.put(StructuredTextTypeHandlerFactory.REGEXP, new StructuredTextRegex()); + types.put(StructuredTextTypeHandlerFactory.SQL, new StructuredTextSql()); + types.put(StructuredTextTypeHandlerFactory.SYSTEM_USER, new StructuredTextSystem()); + types.put(StructuredTextTypeHandlerFactory.UNDERSCORE, new StructuredTextUnderscore()); + types.put(StructuredTextTypeHandlerFactory.URL, new StructuredTextURL()); + types.put(StructuredTextTypeHandlerFactory.XPATH, new StructuredTextXPath()); return Collections.unmodifiableMap(types); } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextComma.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextComma.java index 7aab1f487..cfe6e8d5c 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextComma.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextComma.java @@ -10,7 +10,7 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.custom.STextTypeHandler; +import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler; /** * Handler adapted to processing comma-delimited lists, such as: @@ -18,8 +18,8 @@ import org.eclipse.equinox.bidi.custom.STextTypeHandler; * part1,part2,part3 * </pre> */ -public class STextComma extends STextTypeHandler { - public STextComma() { +public class StructuredTextComma extends StructuredTextTypeHandler { + public StructuredTextComma() { super(","); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextEmail.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextEmail.java index 0554e7fc4..c9433f62d 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextEmail.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextEmail.java @@ -10,28 +10,28 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.advanced.ISTextExpert; -import org.eclipse.equinox.bidi.custom.STextCharTypes; -import org.eclipse.equinox.bidi.internal.STextDelimsEsc; +import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert; +import org.eclipse.equinox.bidi.custom.StructuredTextCharTypes; +import org.eclipse.equinox.bidi.internal.StructuredTextDelimsEsc; /** * Handler adapted to processing e-mail addresses. */ -public class STextEmail extends STextDelimsEsc { +public class StructuredTextEmail extends StructuredTextDelimsEsc { static final byte L = Character.DIRECTIONALITY_LEFT_TO_RIGHT; static final byte R = Character.DIRECTIONALITY_RIGHT_TO_LEFT; static final byte AL = Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC; - public STextEmail() { + public StructuredTextEmail() { super("<>.:,;@"); //$NON-NLS-1$ } - public int getDirection(ISTextExpert expert, String text) { - return getDirection(expert, text, new STextCharTypes(expert, text)); + public int getDirection(IStructuredTextExpert expert, String text) { + return getDirection(expert, text, new StructuredTextCharTypes(expert, text)); } /** - * @return {@link ISTextExpert#DIR_RTL DIR_RTL} if the following + * @return {@link IStructuredTextExpert#DIR_RTL DIR_RTL} if the following * conditions are satisfied: * <ul> * <li>The current locale (as expressed by the environment @@ -39,12 +39,12 @@ public class STextEmail extends STextDelimsEsc { * <li>The domain part of the email address contains * at least one RTL character.</li> * </ul> - * Otherwise, returns {@link ISTextExpert#DIR_LTR DIR_LTR}. + * Otherwise, returns {@link IStructuredTextExpert#DIR_LTR DIR_LTR}. */ - public int getDirection(ISTextExpert expert, String text, STextCharTypes charTypes) { + public int getDirection(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes) { String language = expert.getEnvironment().getLanguage(); if (!language.equals("ar")) //$NON-NLS-1$ - return ISTextExpert.DIR_LTR; + return IStructuredTextExpert.DIR_LTR; int domainStart; domainStart = text.indexOf('@'); if (domainStart < 0) @@ -52,15 +52,15 @@ public class STextEmail extends STextDelimsEsc { for (int i = domainStart; i < text.length(); i++) { byte charType = charTypes.getBidiTypeAt(i); if (charType == AL || charType == R) - return ISTextExpert.DIR_RTL; + return IStructuredTextExpert.DIR_RTL; } - return ISTextExpert.DIR_LTR; + return IStructuredTextExpert.DIR_LTR; } /** * @return 2 as number of special cases handled by this handler. */ - public int getSpecialsCount(ISTextExpert expert) { + public int getSpecialsCount(IStructuredTextExpert expert) { return 2; } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextFile.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextFile.java index b8f4b10af..92a2ee865 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextFile.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextFile.java @@ -10,14 +10,14 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.custom.STextTypeHandler; +import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler; /** * Handler adapted to processing directory and file paths. */ -public class STextFile extends STextTypeHandler { +public class StructuredTextFile extends StructuredTextTypeHandler { - public STextFile() { + public StructuredTextFile() { super(":/\\."); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextJava.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextJava.java index 73572d506..8e2012f6e 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextJava.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextJava.java @@ -10,9 +10,9 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.advanced.ISTextExpert; +import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert; import org.eclipse.equinox.bidi.custom.*; -import org.eclipse.equinox.bidi.internal.STextActivator; +import org.eclipse.equinox.bidi.internal.StructuredTextActivator; /** * Handler for structured text composed of Java statements. @@ -20,31 +20,29 @@ import org.eclipse.equinox.bidi.internal.STextActivator; * <p> * In applications like an editor where parts of the text might be modified * while other parts are not, the user may want to call - * {@link ISTextExpert#leanToFullText} + * {@link IStructuredTextExpert#leanToFullText} * separately on each line and save the initial state of each line (this is * the final state of the previous line which can be retrieved using - * {@link ISTextExpert#getState()}). + * {@link IStructuredTextExpert#getState()}). * If both the content * of a line and its initial state have not changed, the user can be sure that * the last <i>full</i> text computed for this line has not changed either. * - * @see ISTextExpert explanation of state - * - * @author Matitiahu Allouche + * @see IStructuredTextExpert explanation of state */ -public class STextJava extends STextTypeHandler { +public class StructuredTextJava extends StructuredTextTypeHandler { private static final byte WS = Character.DIRECTIONALITY_WHITESPACE; - static final String lineSep = STextActivator.getProperty("line.separator"); //$NON-NLS-1$ + static final String lineSep = StructuredTextActivator.getProperty("line.separator"); //$NON-NLS-1$ private static final Integer STATE_SLASH_ASTER_COMMENT = new Integer(3); - public STextJava() { + public StructuredTextJava() { super("[](){}.+-<>=~!&*/%^|?:,;\t"); //$NON-NLS-1$ } /** * @return 4 as the number of special cases handled by this handler. */ - public int getSpecialsCount(ISTextExpert expert) { + public int getSpecialsCount(IStructuredTextExpert expert) { return 4; } @@ -57,7 +55,7 @@ public class STextJava extends STextTypeHandler { * <li>comments starting with slash-slash</li> * </ol> */ - public int indexOfSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int fromIndex) { + public int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) { switch (caseNumber) { case 1 : /* space */ return text.indexOf(' ', fromIndex); @@ -81,10 +79,10 @@ public class STextJava extends STextTypeHandler { * <li>skip until after a line separator</li> * </ol> */ - public int processSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int separLocation) { + public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) { int location, counter, i; - STextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); + StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); if (separLocation < 0) { caseNumber = ((Integer) expert.getState()).intValue(); // TBD guard against "undefined" expert.clearState(); @@ -122,7 +120,7 @@ public class STextJava extends STextTypeHandler { } // we need to call processSeparator since text may follow the // end of comment immediately without even a space - STextTypeHandler.processSeparator(text, charTypes, offsets, location); + StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, location); return location + 2; case 4 : /* slash-slash comment */ location = text.indexOf(lineSep, separLocation + 2); diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextMath.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextMath.java index e46f8321b..bae7763fa 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextMath.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextMath.java @@ -10,30 +10,30 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.advanced.ISTextExpert; -import org.eclipse.equinox.bidi.custom.STextCharTypes; -import org.eclipse.equinox.bidi.custom.STextTypeHandler; +import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert; +import org.eclipse.equinox.bidi.custom.StructuredTextCharTypes; +import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler; /** * Handler adapted to processing arithmetic expressions with * a possible right-to-left base direction. */ -public class STextMath extends STextTypeHandler { +public class StructuredTextMath extends StructuredTextTypeHandler { static final byte L = Character.DIRECTIONALITY_LEFT_TO_RIGHT; static final byte R = Character.DIRECTIONALITY_RIGHT_TO_LEFT; static final byte AL = Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC; static final byte AN = Character.DIRECTIONALITY_ARABIC_NUMBER; - public STextMath() { + public StructuredTextMath() { super("+-/*()="); //$NON-NLS-1$ } - public int getDirection(ISTextExpert expert, String text) { - return getDirection(expert, text, new STextCharTypes(expert, text)); + public int getDirection(IStructuredTextExpert expert, String text) { + return getDirection(expert, text, new StructuredTextCharTypes(expert, text)); } /** - * @return {@link ISTextExpert#DIR_RTL DIR_RTL} if the following + * @return {@link IStructuredTextExpert#DIR_RTL DIR_RTL} if the following * conditions are satisfied: * <ul> * <li>The current locale (as expressed by the environment @@ -42,24 +42,24 @@ public class STextMath extends STextTypeHandler { * <li>If there is no strong character in the text, there is * at least one Arabic-Indic digit in the text.</li> * </ul> - * Otherwise, returns {@link ISTextExpert#DIR_LTR DIR_LTR}. + * Otherwise, returns {@link IStructuredTextExpert#DIR_LTR DIR_LTR}. */ - public int getDirection(ISTextExpert expert, String text, STextCharTypes charTypes) { + public int getDirection(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes) { String language = expert.getEnvironment().getLanguage(); if (!language.equals("ar")) //$NON-NLS-1$ - return ISTextExpert.DIR_LTR; + return IStructuredTextExpert.DIR_LTR; boolean flagAN = false; for (int i = 0; i < text.length(); i++) { byte charType = charTypes.getBidiTypeAt(i); if (charType == AL) - return ISTextExpert.DIR_RTL; + return IStructuredTextExpert.DIR_RTL; if (charType == L || charType == R) - return ISTextExpert.DIR_LTR; + return IStructuredTextExpert.DIR_LTR; if (charType == AN) flagAN = true; } if (flagAN) - return ISTextExpert.DIR_RTL; - return ISTextExpert.DIR_LTR; + return IStructuredTextExpert.DIR_RTL; + return IStructuredTextExpert.DIR_LTR; } } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextProperty.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextProperty.java index a99f12fbb..54ead37ce 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextProperty.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextProperty.java @@ -10,7 +10,7 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.internal.STextSingle; +import org.eclipse.equinox.bidi.internal.StructuredTextSingle; /** * Handler adapted to processing property file statements. @@ -19,9 +19,9 @@ import org.eclipse.equinox.bidi.internal.STextSingle; * name=value * </pre> */ -public class STextProperty extends STextSingle { +public class StructuredTextProperty extends StructuredTextSingle { - public STextProperty() { + public StructuredTextProperty() { super("="); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextRegex.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextRegex.java index 336883906..d86ebd688 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextRegex.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextRegex.java @@ -10,8 +10,8 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.advanced.ISTextExpert; -import org.eclipse.equinox.bidi.advanced.STextEnvironment; +import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert; +import org.eclipse.equinox.bidi.advanced.StructuredTextEnvironment; import org.eclipse.equinox.bidi.custom.*; /** @@ -20,19 +20,17 @@ import org.eclipse.equinox.bidi.custom.*; * <p> * In applications like an editor where parts of the text might be modified * while other parts are not, the user may want to call - * {@link ISTextExpert#leanToFullText} + * {@link IStructuredTextExpert#leanToFullText} * separately on each line and save the initial state of each line (this is * the final state of the previous line which can be retrieved using - * {@link ISTextExpert#getState()}. + * {@link IStructuredTextExpert#getState()}. * If both the content * of a line and its initial state have not changed, the user can be sure that * the last <i>full</i> text computed for this line has not changed either. * - * @see ISTextExpert explanation of state - * - * @author Matitiahu Allouche + * @see IStructuredTextExpert explanation of state */ -public class STextRegex extends STextTypeHandler { +public class StructuredTextRegex extends StructuredTextTypeHandler { static final String[] startStrings = {"", /* 0 *//* dummy *///$NON-NLS-1$ "(?#", /* 1 *//* comment (?#...) *///$NON-NLS-1$ "(?<", /* 2 *//* named group (?<name> *///$NON-NLS-1$ @@ -70,7 +68,7 @@ public class STextRegex extends STextTypeHandler { * * @return the number of special cases for this handler. */ - public int getSpecialsCount(ISTextExpert expert) { + public int getSpecialsCount(IStructuredTextExpert expert) { return maxSpecial; } @@ -78,7 +76,7 @@ public class STextRegex extends STextTypeHandler { * Locates occurrences of the syntactic strings and of * R, AL, EN, AN characters. */ - public int indexOfSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int fromIndex) { + public int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) { // In this method, L, R, AL, AN and EN represent bidi categories // as defined in the Unicode Bidirectional Algorithm // ( http://www.unicode.org/reports/tr9/ ). @@ -146,7 +144,7 @@ public class STextRegex extends STextTypeHandler { /** * Processes the special cases. */ - public int processSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int separLocation) { + public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) { int location; if (separLocation < 0) { @@ -159,7 +157,7 @@ public class STextRegex extends STextTypeHandler { // initial state from previous line location = 0; } else { - STextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); + StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); // skip the opening "(?#" location = separLocation + 3; } @@ -175,7 +173,7 @@ public class STextRegex extends STextTypeHandler { case 5 : /* conditional named back reference (?(<name>) */ case 6 : /* conditional named back reference (?('name') */ case 7 : /* named parentheses reference (?&name) */ - STextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); + StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); // no need for calling processSeparator() for the following cases // since the starting string contains a L char case 8 : /* named group (?P<name> */ @@ -199,7 +197,7 @@ public class STextRegex extends STextTypeHandler { // initial state from previous line location = 0; } else { - STextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); + StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); // skip the opening "\Q" location = separLocation + 2; } @@ -212,7 +210,7 @@ public class STextRegex extends STextTypeHandler { charTypes.setBidiTypeAt(location + 1, L); return location + 2; case 18 : /* R, AL, AN, EN */ - STextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); + StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); return separLocation + 1; } @@ -220,12 +218,12 @@ public class STextRegex extends STextTypeHandler { return text.length(); } - public int getDirection(ISTextExpert expert, String text) { - return getDirection(expert, text, new STextCharTypes(expert, text)); + public int getDirection(IStructuredTextExpert expert, String text) { + return getDirection(expert, text, new StructuredTextCharTypes(expert, text)); } /** - * @return {@link ISTextExpert#DIR_RTL DIR_RTL} if the following + * @return {@link IStructuredTextExpert#DIR_RTL DIR_RTL} if the following * conditions are satisfied: * <ul> * <li>The current locale (as expressed by the environment @@ -234,23 +232,23 @@ public class STextRegex extends STextTypeHandler { * <li>If there is no strong character in the text, the * GUI is mirrored. * </ul> - * Otherwise, returns {@link ISTextExpert#DIR_LTR DIR_LTR}. + * Otherwise, returns {@link IStructuredTextExpert#DIR_LTR DIR_LTR}. */ - public int getDirection(ISTextExpert expert, String text, STextCharTypes charTypes) { - STextEnvironment environment = expert.getEnvironment(); + public int getDirection(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes) { + StructuredTextEnvironment environment = expert.getEnvironment(); String language = environment.getLanguage(); if (!language.equals("ar")) //$NON-NLS-1$ - return ISTextExpert.DIR_LTR; + return IStructuredTextExpert.DIR_LTR; for (int i = 0; i < text.length(); i++) { byte charType = charTypes.getBidiTypeAt(i); if (charType == AL || charType == R) - return ISTextExpert.DIR_RTL; + return IStructuredTextExpert.DIR_RTL; if (charType == L) - return ISTextExpert.DIR_LTR; + return IStructuredTextExpert.DIR_LTR; } if (environment.getMirrored()) - return ISTextExpert.DIR_RTL; - return ISTextExpert.DIR_LTR; + return IStructuredTextExpert.DIR_RTL; + return IStructuredTextExpert.DIR_LTR; } } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextSql.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSql.java index 762e9d017..cfca9c48f 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextSql.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSql.java @@ -10,9 +10,9 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.advanced.ISTextExpert; +import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert; import org.eclipse.equinox.bidi.custom.*; -import org.eclipse.equinox.bidi.internal.STextActivator; +import org.eclipse.equinox.bidi.internal.StructuredTextActivator; /** * Handler for structured text composed of SQL statements. @@ -20,32 +20,30 @@ import org.eclipse.equinox.bidi.internal.STextActivator; * <p> * In applications like an editor where parts of the text might be modified * while other parts are not, the user may want to call - * {@link ISTextExpert#leanToFullText} + * {@link IStructuredTextExpert#leanToFullText} * separately on each line and save the initial state of each line (this is * the final state of the previous line which can be retrieved by calling - * {@link ISTextExpert#getState()}. + * {@link IStructuredTextExpert#getState()}. * If both the content * of a line and its initial state have not changed, the user can be sure that * the last <i>full</i> text computed for this line has not changed either. * - * @see ISTextExpert explanation of state - * - * @author Matitiahu Allouche + * @see IStructuredTextExpert explanation of state */ -public class STextSql extends STextTypeHandler { +public class StructuredTextSql extends StructuredTextTypeHandler { private static final byte WS = Character.DIRECTIONALITY_WHITESPACE; - static final String lineSep = STextActivator.getProperty("line.separator"); //$NON-NLS-1$ + static final String lineSep = StructuredTextActivator.getProperty("line.separator"); //$NON-NLS-1$ private static final Integer STATE_LITERAL = new Integer(2); private static final Integer STATE_SLASH_ASTER_COMMENT = new Integer(4); - public STextSql() { + public StructuredTextSql() { super("\t!#%&()*+,-./:;<=>?|[]{}"); //$NON-NLS-1$ } /** * @return 5 as the number of special cases handled by this handler. */ - public int getSpecialsCount(ISTextExpert expert) { + public int getSpecialsCount(IStructuredTextExpert expert) { return 5; } @@ -59,7 +57,7 @@ public class STextSql extends STextTypeHandler { * <li>comments starting with hyphen-hyphen</li> * </ol> */ - public int indexOfSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int fromIndex) { + public int indexOfSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int fromIndex) { switch (caseNumber) { case 1 : /* space */ return text.indexOf(" ", fromIndex); //$NON-NLS-1$ @@ -86,10 +84,10 @@ public class STextSql extends STextTypeHandler { * <li>skip until after a line separator</li> * </ol> */ - public int processSpecial(ISTextExpert expert, String text, STextCharTypes charTypes, STextOffsets offsets, int caseNumber, int separLocation) { + public int processSpecial(IStructuredTextExpert expert, String text, StructuredTextCharTypes charTypes, StructuredTextOffsets offsets, int caseNumber, int separLocation) { int location; - STextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); + StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, separLocation); if (separLocation < 0) { caseNumber = ((Integer) expert.getState()).intValue(); // TBD guard against "undefined" expert.clearState(); @@ -141,7 +139,7 @@ public class STextSql extends STextTypeHandler { } // we need to call processSeparator since text may follow the // end of comment immediately without even a space - STextTypeHandler.processSeparator(text, charTypes, offsets, location); + StructuredTextTypeHandler.processSeparator(text, charTypes, offsets, location); return location + 2; case 5 : /* hyphen-hyphen comment */ location = text.indexOf(lineSep, separLocation + 2); diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextSystem.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSystem.java index a4241fbef..a2b6373e2 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextSystem.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSystem.java @@ -10,7 +10,7 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.internal.STextSingle; +import org.eclipse.equinox.bidi.internal.StructuredTextSingle; /** * Handler adapted to processing structured text with the following format: @@ -18,9 +18,9 @@ import org.eclipse.equinox.bidi.internal.STextSingle; * system(user) * </pre> */ -public class STextSystem extends STextSingle { +public class StructuredTextSystem extends StructuredTextSingle { - public STextSystem() { + public StructuredTextSystem() { super("("); //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextURL.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextURL.java index 09794fadd..16b2caa93 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextURL.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextURL.java @@ -10,13 +10,13 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.custom.STextTypeHandler; +import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler; /** * Handler adapted to processing URLs. */ -public class STextURL extends STextTypeHandler { - public STextURL() { +public class StructuredTextURL extends StructuredTextTypeHandler { + public StructuredTextURL() { super(":?#/@.[]"); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextUnderscore.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextUnderscore.java index 387f39f97..5da80e720 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextUnderscore.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextUnderscore.java @@ -10,7 +10,7 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.custom.STextTypeHandler; +import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler; /** * Handler adapted to processing compound names. @@ -19,9 +19,9 @@ import org.eclipse.equinox.bidi.custom.STextTypeHandler; * part1_part2_part3 * </pre> */ -public class STextUnderscore extends STextTypeHandler { +public class StructuredTextUnderscore extends StructuredTextTypeHandler { - public STextUnderscore() { + public StructuredTextUnderscore() { super("_"); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextXPath.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextXPath.java index a0f7bf32b..4f7397b64 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextXPath.java +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextXPath.java @@ -10,22 +10,22 @@ ******************************************************************************/ package org.eclipse.equinox.bidi.internal.consumable; -import org.eclipse.equinox.bidi.advanced.ISTextExpert; -import org.eclipse.equinox.bidi.internal.STextDelims; +import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert; +import org.eclipse.equinox.bidi.internal.StructuredTextDelims; /** * Handler adapted to processing XPath expressions. */ -public class STextXPath extends STextDelims { +public class StructuredTextXPath extends StructuredTextDelims { - public STextXPath() { + public StructuredTextXPath() { super(" /[]<>=!:@.|()+-*"); //$NON-NLS-1$ } /** * @return 2 as the number of special cases handled by this handler. */ - public int getSpecialsCount(ISTextExpert expert) { + public int getSpecialsCount(IStructuredTextExpert expert) { return 2; } diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/package.html b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/package.html index a60f856a8..efdbb806b 100644 --- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/package.html +++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/package.html @@ -1,8 +1,5 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> -<head> -<META name="Author" content="Matitiahu Allouche"> -</head> <body bgcolor="white"> This package provides classes for processing bidirectional @@ -44,11 +41,11 @@ called <b><i>lean</i></b> text while the text with added directional formatting characters is called <b><i>full</i></b> text. </p><p> The class {@link -<a href="STextProcessor.html"><b>STextProcessor</b></a>} +<a href="StructuredTextProcessor.html"><b>StructuredTextProcessor</b></a>} is the main tool for processing structured text. It facilitates handling several types of structured text, each type being handled by a specific -{@link <a href="custom/STextTypeHandler.html"> +{@link <a href="custom/StructuredTextTypeHandler.html"> <b><i>type handler</i></b></a>} :</p> <ul> <li>property (name=value)</li> @@ -66,10 +63,10 @@ by a specific </ul> <p> For each of these types, an identifier is defined in -{@link <a href="STextTypeHandlerFactory.html"> -<b><i>STextTypeHandlerFactory</i></b></a>} :</p> +{@link <a href="StructuredTextTypeHandlerFactory.html"> +<b><i>StructuredTextTypeHandlerFactory</i></b></a>} :</p> These identifiers can be used as argument in some methods of -<b>STextProcessor</b> to specify the type of handler to apply. +<b>StructuredTextProcessor</b> to specify the type of handler to apply. </p><p> The classes included in this package are intended for users who need to process structured text in the most straightforward @@ -78,7 +75,7 @@ manner, when the following conditions are satisfied: <li>There exists an appropriate handler for the type of the structured text.</li> <li>There is no need to specify non-default conditions related - to the {@link <a href="advanced/STextEnvironment.html"> + to the {@link <a href="advanced/StructuredTextEnvironment.html"> environment</a>}.</li> <li>The only operations needed are to transform <i>lean</i> text into <i>full</i> text or vice versa.</li> |