aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2013-03-11 19:07:29 (EDT)
committerMarkus Keller2013-03-11 19:08:11 (EDT)
commit3c0f419f41d1e83256757acaeabe5564398fdb56 (patch)
tree2b4b34a905eb877a59b1869fb57c426947241b24
parenta290d16b9b037b0eab1486d21554558c50e27258 (diff)
downloadrt.equinox.bundles-3c0f419f41d1e83256757acaeabe5564398fdb56.zip
rt.equinox.bundles-3c0f419f41d1e83256757acaeabe5564398fdb56.tar.gz
rt.equinox.bundles-3c0f419f41d1e83256757acaeabe5564398fdb56.tar.bz2
Bug 380397: [bidi] Should bidi bundle version be 1.0.0I20130312-1000I20130312-0800I20130311-2000
- more cleanup - removed some default structured text types: math, property, system
-rw-r--r--bundles/org.eclipse.equinox.bidi.tests/.settings/org.eclipse.pde.prefs33
-rw-r--r--bundles/org.eclipse.equinox.bidi.tests/plugin.xml17
-rw-r--r--bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextExtensionsTest.java23
-rw-r--r--bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextMath.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextMath.java)2
-rw-r--r--bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextMathTest.java5
-rw-r--r--bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextProperty.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextProperty.java)2
-rw-r--r--bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextSystem.java (renamed from bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSystem.java)2
-rw-r--r--bundles/org.eclipse.equinox.bidi/.settings/org.eclipse.pde.api.tools.prefs2
-rw-r--r--bundles/org.eclipse.equinox.bidi/plugin.properties5
-rw-r--r--bundles/org.eclipse.equinox.bidi/plugin.xml17
-rw-r--r--bundles/org.eclipse.equinox.bidi/schema/bidiTypes.exsd (renamed from bundles/org.eclipse.equinox.bidi/schema/StructuredTextType.exsd)282
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextProcessor.java57
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextTypeHandlerFactory.java46
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextExpertFactory.java7
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java3
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java83
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java3
17 files changed, 302 insertions, 287 deletions
diff --git a/bundles/org.eclipse.equinox.bidi.tests/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.equinox.bidi.tests/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000..48f0b51
--- /dev/null
+++ b/bundles/org.eclipse.equinox.bidi.tests/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,33 @@
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=1
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.matching-pom-version=0
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.equinox.bidi.tests/plugin.xml b/bundles/org.eclipse.equinox.bidi.tests/plugin.xml
index 5c92493..ecd3dda 100644
--- a/bundles/org.eclipse.equinox.bidi.tests/plugin.xml
+++ b/bundles/org.eclipse.equinox.bidi.tests/plugin.xml
@@ -9,7 +9,22 @@
description="Test"
type="test.ID">
</typeDescription>
-
+
+ <typeDescription
+ class="org.eclipse.equinox.bidi.internal.tests.StructuredTextMath"
+ description="Processor for arithmetic expressions"
+ type="math">
+ </typeDescription>
+ <typeDescription
+ class="org.eclipse.equinox.bidi.internal.tests.StructuredTextProperty"
+ description="Processor for property file lines (incomplete: only handles '=')"
+ type="property">
+ </typeDescription>
+ <typeDescription
+ class="org.eclipse.equinox.bidi.internal.tests.StructuredTextSystem"
+ description="%Processor for system(user) statements"
+ type="system">
+ </typeDescription>
</extension>
</plugin>
diff --git a/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextExtensionsTest.java b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextExtensionsTest.java
index 6ff0cc5..5641d38 100644
--- a/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextExtensionsTest.java
+++ b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextExtensionsTest.java
@@ -19,6 +19,9 @@ import org.eclipse.equinox.bidi.advanced.*;
*/
public class StructuredTextExtensionsTest extends StructuredTextTestBase {
+ private static final String PROPERTY = "property";
+ private static final String SYSTEM_USER = "system";
+
private StructuredTextEnvironment env = StructuredTextEnvironment.DEFAULT;
private StructuredTextEnvironment envArabic = new StructuredTextEnvironment("ar", false, StructuredTextEnvironment.ORIENT_LTR);
private StructuredTextEnvironment envHebrew = new StructuredTextEnvironment("he", false, StructuredTextEnvironment.ORIENT_LTR);
@@ -40,7 +43,7 @@ public class StructuredTextExtensionsTest extends StructuredTextTestBase {
assertEquals(label + " data = " + data, result, toPseudo(full));
}
- public void testExtensions() {
+ public void testDefaultExtensions() {
String data;
expert = StructuredTextExpertFactory.getExpert(StructuredTextTypeHandlerFactory.COMMA_DELIMITED, env);
@@ -78,11 +81,6 @@ public class StructuredTextExtensionsTest extends StructuredTextTestBase {
doTest1("Java #9", "A = //B+C* D;", "A@ = //B+C* D;");
doTest1("Java #10", "A = //B+C`|D+E;", "A@ = //B+C`|D@+E;");
- expert = StructuredTextExpertFactory.getExpert(StructuredTextTypeHandlerFactory.PROPERTY, env);
- doTest1("Property #0", "NAME,VAL1,VAL2", "NAME,VAL1,VAL2");
- doTest1("Property #1", "NAME=VAL1,VAL2", "NAME@=VAL1,VAL2");
- doTest1("Property #2", "NAME=VAL1,VAL2=VAL3", "NAME@=VAL1,VAL2=VAL3");
-
expert = StructuredTextExpertFactory.getStatefulExpert(StructuredTextTypeHandlerFactory.REGEXP, env);
data = toUT16("ABC(?") + "#" + toUT16("DEF)GHI");
doTest2("Regex #0.0", data, "A@B@C@(?#DEF)@G@H@I");
@@ -185,9 +183,6 @@ public class StructuredTextExtensionsTest extends StructuredTextTestBase {
doTest1("SQL #12", "ABC\"DEF \"\" G I\" JKL,MN", "ABC@\"DEF \"\" G I\"@ JKL@,MN");
doTest1("SQL #13", "ABC--DEF GHI`|JKL MN", "ABC@--DEF GHI`|JKL@ MN");
- expert = StructuredTextExpertFactory.getExpert(StructuredTextTypeHandlerFactory.SYSTEM_USER, env);
- doTest1("System #1", "HOST(JACK)", "HOST@(JACK)");
-
expert = StructuredTextExpertFactory.getExpert(StructuredTextTypeHandlerFactory.UNDERSCORE, env);
doTest1("Underscore #1", "A_B_C_d_e_F_G", "A@_B@_C_d_e_F@_G");
@@ -209,4 +204,14 @@ public class StructuredTextExtensionsTest extends StructuredTextTestBase {
doTest3("DelimsEsc #6", "DEF.GHI (A\\\\):C ;JK ", "DEF@.GHI @(A\\\\)@:C @;JK ");
doTest3("DelimsEsc #7", "DEF.GHI (A\\):C ;JK ", "DEF@.GHI @(A\\):C ;JK ");
}
+
+ public void testTestExtensions() {
+ expert = StructuredTextExpertFactory.getExpert(PROPERTY, env);
+ doTest1("Property #0", "NAME,VAL1,VAL2", "NAME,VAL1,VAL2");
+ doTest1("Property #1", "NAME=VAL1,VAL2", "NAME@=VAL1,VAL2");
+ doTest1("Property #2", "NAME=VAL1,VAL2=VAL3", "NAME@=VAL1,VAL2=VAL3");
+
+ expert = StructuredTextExpertFactory.getExpert(SYSTEM_USER, env);
+ doTest1("System #1", "HOST(JACK)", "HOST@(JACK)");
+ }
}
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextMath.java b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextMath.java
index bae7763..210a8f6 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextMath.java
+++ b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextMath.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
-package org.eclipse.equinox.bidi.internal.consumable;
+package org.eclipse.equinox.bidi.internal.tests;
import org.eclipse.equinox.bidi.advanced.IStructuredTextExpert;
import org.eclipse.equinox.bidi.custom.StructuredTextCharTypes;
diff --git a/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextMathTest.java b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextMathTest.java
index 2505cd6..d2aad26 100644
--- a/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextMathTest.java
+++ b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextMathTest.java
@@ -11,7 +11,6 @@
package org.eclipse.equinox.bidi.internal.tests;
-import org.eclipse.equinox.bidi.StructuredTextTypeHandlerFactory;
import org.eclipse.equinox.bidi.advanced.*;
/**
@@ -22,8 +21,8 @@ public class StructuredTextMathTest extends StructuredTextTestBase {
private StructuredTextEnvironment envLTR = new StructuredTextEnvironment("ar", false, StructuredTextEnvironment.ORIENT_LTR);
private StructuredTextEnvironment envRTL = new StructuredTextEnvironment("ar", false, StructuredTextEnvironment.ORIENT_RTL);
- private IStructuredTextExpert expertLTR = StructuredTextExpertFactory.getExpert(StructuredTextTypeHandlerFactory.MATH, envLTR);
- private IStructuredTextExpert expertRTL = StructuredTextExpertFactory.getExpert(StructuredTextTypeHandlerFactory.MATH, envRTL);
+ private IStructuredTextExpert expertLTR = StructuredTextExpertFactory.getStatefulExpert(new StructuredTextMath(), envLTR);
+ private IStructuredTextExpert expertRTL = StructuredTextExpertFactory.getStatefulExpert(new StructuredTextMath(), envRTL);
private void verifyOneLine(String msg, String data, String resLTR, String resRTL) {
String lean = toUT16(data);
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextProperty.java b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextProperty.java
index 54ead37..3ae7269 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextProperty.java
+++ b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextProperty.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
-package org.eclipse.equinox.bidi.internal.consumable;
+package org.eclipse.equinox.bidi.internal.tests;
import org.eclipse.equinox.bidi.internal.StructuredTextSingle;
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSystem.java b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextSystem.java
index a2b6373..82173da 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/StructuredTextSystem.java
+++ b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/StructuredTextSystem.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
-package org.eclipse.equinox.bidi.internal.consumable;
+package org.eclipse.equinox.bidi.internal.tests;
import org.eclipse.equinox.bidi.internal.StructuredTextSingle;
diff --git a/bundles/org.eclipse.equinox.bidi/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.equinox.bidi/.settings/org.eclipse.pde.api.tools.prefs
index 2498085..7387d42 100644
--- a/bundles/org.eclipse.equinox.bidi/.settings/org.eclipse.pde.api.tools.prefs
+++ b/bundles/org.eclipse.equinox.bidi/.settings/org.eclipse.pde.api.tools.prefs
@@ -60,7 +60,7 @@ INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Ignore
INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Ignore
INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Ignore
INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Ignore
-INVALID_JAVADOC_TAG=Ignore
+INVALID_JAVADOC_TAG=Error
INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Error
LEAK_EXTEND=Warning
LEAK_FIELD_DECL=Warning
diff --git a/bundles/org.eclipse.equinox.bidi/plugin.properties b/bundles/org.eclipse.equinox.bidi/plugin.properties
index 5bb3e28..aca3d2b 100644
--- a/bundles/org.eclipse.equinox.bidi/plugin.properties
+++ b/bundles/org.eclipse.equinox.bidi/plugin.properties
@@ -10,18 +10,15 @@
###############################################################################
pluginName = Bidirectional Text Support
providerName = Eclipse.org - Equinox
-bidiExpressionPointName = Add new structured text type
+bidiExtensionPointName = Bidi structured text types
bidiExtensionName = Default bidirectional processors
commaProcessorName = Processor for comma-separated lists
emailProcessorName = Processor for E-mail addresses
fileProcessorName = Processor for file and directory names
javaProcessorName = Processor for Java statements
-mathProcessorName = Processor for arithmetic expressions
-propertyProcessorName = Processor for property file lines
regexProcessorName = Processor for regular expressions
sqlProcessorName = Processor for SQL statements
-systemProcessorName = Processor for system(user) statements
underscoreProcessorName = Processor for names segmented by underscores
urlProcessorName = Processor for URLs
xpathProcessorName = Processor for XPath expressions
diff --git a/bundles/org.eclipse.equinox.bidi/plugin.xml b/bundles/org.eclipse.equinox.bidi/plugin.xml
index 4db67dd..5df58f4 100644
--- a/bundles/org.eclipse.equinox.bidi/plugin.xml
+++ b/bundles/org.eclipse.equinox.bidi/plugin.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
- <extension-point id="bidiTypes" name="%bidiExpressionPointName" schema="schema/StructuredTextType.exsd"/>
+ <extension-point id="bidiTypes" name="%bidiExtensionPointName" schema="schema/bidiTypes.exsd"/>
<extension
id="bidi"
name="%bidiExtensionName"
@@ -27,16 +27,6 @@
type="java">
</typeDescription>
<typeDescription
- class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextMath"
- description="%mathProcessorName"
- type="math">
- </typeDescription>
- <typeDescription
- class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextProperty"
- description="%propertyProcessorName"
- type="property">
- </typeDescription>
- <typeDescription
description="%regexProcessorName"
class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextRegex"
type="regex">
@@ -47,11 +37,6 @@
type="sql">
</typeDescription>
<typeDescription
- class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextSystem"
- description="%systemProcessorName"
- type="system">
- </typeDescription>
- <typeDescription
class="org.eclipse.equinox.bidi.internal.consumable.StructuredTextUnderscore"
description="%underscoreProcessorName"
type="underscore">
diff --git a/bundles/org.eclipse.equinox.bidi/schema/StructuredTextType.exsd b/bundles/org.eclipse.equinox.bidi/schema/bidiTypes.exsd
index 0d3e301..f457bdc 100644
--- a/bundles/org.eclipse.equinox.bidi/schema/StructuredTextType.exsd
+++ b/bundles/org.eclipse.equinox.bidi/schema/bidiTypes.exsd
@@ -1,142 +1,140 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.equinox.bidi" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.equinox.bidi" id="org.eclipse.equinox.bidi.bidiTypes" name="String types that need special bidirectional handling"/>
- </appInfo>
- <documentation>
- Use this extension point to describe processing for strings that need special bidirectional handling, such as file paths, SQL statements, or Java code.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="typeDescription" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- Unique identifier of this extension
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="typeDescription">
- <complexType>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- Type of the structured text that this processor will work on.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- The processor that provides specialized bidirectional handling for this type of strings.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.equinox.bidi.custom.StructuredTextProcessor:"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- The description of the string type.
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- A processor for the structured text strings that support &quot;minus&quot; delimiters can be described as:
-
-&lt;pre&gt;
-public class StructuredTextSepMinus extends StructuredTextProcessor
-{
- public StructuredTextSepMinus()
- {
- super(&quot;-&quot;);
- }
-}
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- TBD
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- All the classes mentioned as Examples
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2011 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which
-accompanies this distribution, and is available at
-&lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.equinox.bidi" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.equinox.bidi" id="bidiTypes" name="Structured text types that need special bidirectional handling"/>
+ </appInfo>
+ <documentation>
+ Use this extension point to describe processing for strings that need special bidirectional handling, such as file paths, SQL statements, or Java code.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="typeDescription" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Unique identifier of this extension
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="typeDescription">
+ <complexType>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+ Type of the structured text that this processor will work on.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The processor that provides specialized bidirectional handling for this type of strings.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler:"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+ The description of the string type.
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.10
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ A processor for the structured text strings that support &quot;minus&quot; delimiters can be described as:
+
+&lt;pre&gt;
+public class StructuredTextSepMinus extends StructuredTextTypeHandler {
+ public StructuredTextSepMinus() {
+ super(&quot;-&quot;);
+ }
+}
+&lt;/pre&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ TBD
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ All the classes mentioned as Examples
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2011 IBM Corporation and others.&lt;br&gt;
+All rights reserved. This program and the accompanying materials are made
+available under the terms of the Eclipse Public License v1.0 which
+accompanies this distribution, and is available at
+&lt;a
+href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextProcessor.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextProcessor.java
index 27aa08e..59190f1 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextProcessor.java
+++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextProcessor.java
@@ -14,19 +14,18 @@ import org.eclipse.equinox.bidi.advanced.*;
import org.eclipse.equinox.bidi.custom.StructuredTextTypeHandler;
/**
- * Provides methods to process bidirectional text with a specific
- * structure. The methods in this class are the most straightforward
- * way to add directional formatting characters to the source text to
- * ensure correct presentation, or to remove those characters to
- * restore the original text
- * (for more explanations, please see the
- * <a href="package-summary.html">package documentation</a>).
+ * Provides methods to process bidirectional text with a specific
+ * structure. The methods in this class are the most straightforward
+ * way to add directional formatting characters to the source text to
+ * ensure correct presentation, or to remove those characters to
+ * restore the original text
+ * (for more explanations, please see the
+ * {@link org.eclipse.equinox.bidi package documentation</a>}.
* <p>
* This class can be used without OSGi running (but only the structured text types declared
* 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.
*/
public final class StructuredTextProcessor {
@@ -57,25 +56,25 @@ public final class StructuredTextProcessor {
}
/**
- * Processes the given (<i>lean</i>) text and returns a string with appropriate
- * directional formatting characters (<i>full</i> text). This is equivalent to
- * calling {@link #process(String str, String separators)} with the default
- * set of separators.
- * <p>
- * The processing adds directional formatting characters so that presentation
- * using the Unicode Bidirectional Algorithm will provide the expected result.
- * The text is segmented according to the provided separators.
- * Each segment has the Unicode Bidi Algorithm applied to it,
- * but as a whole, the string is oriented left to right.
- * </p><p>
- * For example, a file path such as <tt>d:\myfolder\FOLDER\MYFILE.java</tt>
- * (where capital letters indicate RTL text) should render as
- * <tt>d:\myfolder\REDLOF\ELIFYM.java</tt>.
- * </p>
- *
- * @param str the <i>lean</i> text to process.
+ * Processes the given (<i>lean</i>) text and returns a string with appropriate
+ * directional formatting characters (<i>full</i> text). This is equivalent to
+ * calling {@link #process(String str, String separators)} with the default
+ * set of separators.
+ * <p>
+ * The processing adds directional formatting characters so that presentation
+ * using the Unicode Bidirectional Algorithm will provide the expected result.
+ * The text is segmented according to the provided separators.
+ * Each segment has the Unicode Bidi Algorithm applied to it,
+ * but as a whole, the string is oriented left to right.
+ * </p><p>
+ * For example, a file path such as <tt>d:\myfolder\FOLDER\MYFILE.java</tt>
+ * (where capital letters indicate RTL text) should render as
+ * <tt>d:\myfolder\REDLOF\ELIFYM.java</tt>.
+ * </p>
+ *
+ * @param str the <i>lean</i> text to process
*
- * @return the processed string (<i>full</i> text).
+ * @return the processed string (<i>full</i> text)
*
* @see #deprocess(String)
*/
@@ -88,10 +87,10 @@ public final class StructuredTextProcessor {
* it correctly on bidi locales.
* For more details, see {@link #process(String)}.
*
- * @param str the <i>lean</i> text to process.
- * @param separators characters by which the string will be segmented.
+ * @param str the <i>lean</i> text to process
+ * @param separators characters by which the string will be segmented
*
- * @return the processed string (<i>full</i> text).
+ * @return the processed string (<i>full</i> text)
*
* @see #deprocess(String)
*/
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextTypeHandlerFactory.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextTypeHandlerFactory.java
index 62e494e..74410f4 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextTypeHandlerFactory.java
+++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/StructuredTextTypeHandlerFactory.java
@@ -34,7 +34,7 @@ import org.eclipse.equinox.bidi.internal.StructuredTextTypesCollector;
* {@link StructuredTextExpertFactory#getStatefulExpert(StructuredTextTypeHandler, StructuredTextEnvironment)}.
* <p>
* This class can be used without OSGi running, but only the structured text types declared
- * in {@link StructuredTextTypeHandlerFactory} and as string constants in this class are available in that mode.
+ * as string constants in this class are available in that mode.
* </p>
*
* @noinstantiate This class is not intended to be instantiated by clients.
@@ -66,24 +66,6 @@ public final class StructuredTextTypeHandlerFactory {
public static final String JAVA = "java"; //$NON-NLS-1$
/**
- * Structured text handler identifier for basic arithmetic expressions.
- * <p>
- * Currently supported operators are: <code>+-/*()=</code>
- * </p></p>
- * This set my be extended in the future.
- * <p>
- */
- public static final String MATH = "math"; //$NON-NLS-1$
-
- /**
- * Structured text handler identifier for property file statements. It expects the following format:
- * <pre>
- * name=value
- * </pre>
- */
- public static final String PROPERTY = "property"; //$NON-NLS-1$
-
- /**
* Structured text handler identifier for regular expressions,
* possibly spanning multiple lines.
*/
@@ -96,14 +78,6 @@ public final class StructuredTextTypeHandlerFactory {
public static final String SQL = "sql"; //$NON-NLS-1$
/**
- * Structured text handler identifier for strings with the following format:
- * <pre>
- * system(user)
- * </pre>
- */
- public static final String SYSTEM_USER = "system"; //$NON-NLS-1$
-
- /**
* Structured text handler identifier for compound names. It expects text to be made of one or more
* parts separated by underscores:
* <pre>
@@ -132,12 +106,18 @@ public final class StructuredTextTypeHandlerFactory {
}
/**
- * Obtains a structured text handler of a given type.
- *
- * @param id the string identifying a structured text handler.
- *
- * @return a handler of the required type, or <code>null</code>
- * if the type is unknown.
+ * Obtains a structured text handler of a given type.
+ *
+ * Supported type ids are:
+ * <ul>
+ * <li>the <code>String</code> constants in {@link StructuredTextTypeHandlerFactory}</li>
+ * <li>if OSGi is running, the types that have been contributed to the
+ * <code>org.eclipse.equinox.bidi.bidiTypes</code> extension point.</li>
+ * </ul>
+ *
+ * @param id the string identifying a structured text handler
+ * @return a handler of the required type, or <code>null</code>
+ * if the type is unknown
*/
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/StructuredTextExpertFactory.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextExpertFactory.java
index 36c1a31..bd1f5fe 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextExpertFactory.java
+++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/StructuredTextExpertFactory.java
@@ -191,11 +191,12 @@ final public class StructuredTextExpertFactory {
* <code>null</code>, in which case the
* {@link StructuredTextEnvironment#DEFAULT}
* environment should be assumed.
- * @return the IStructuredTextExpert instance.
- * @throws IllegalArgumentException if <code>type</code> is not a known type
- * identifier.
+ * @return the IStructuredTextExpert instance
+ * @throws IllegalArgumentException if the <code>handler</code> is <code>null</code>
*/
static public IStructuredTextExpert getStatefulExpert(StructuredTextTypeHandler handler, StructuredTextEnvironment environment) {
+ if (handler == null)
+ throw new IllegalArgumentException("handler must not be null"); //$NON-NLS-1$
if (environment == null)
environment = StructuredTextEnvironment.DEFAULT;
return new StructuredTextImpl(handler, environment, true);
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java
index e73549c..2da3b23 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java
+++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/custom/StructuredTextTypeHandler.java
@@ -360,4 +360,7 @@ public class StructuredTextTypeHandler {
return false;
}
+ public String toString() {
+ return super.toString() + " [" + separators + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java
index 790395a..435385c 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java
+++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextImpl.java
@@ -204,46 +204,46 @@ public class StructuredTextImpl implements IStructuredTextExpert {
}
/**
- * When the orientation is <code>ORIENT_LTR</code> and the
- * structured text has a RTL base direction,
- * {@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 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 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 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 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 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 IStructuredTextExpert#leanToFullText leanToFullText} does not add any directional
- * formatting characters as either prefix or suffix of the <i>full</i> text.
- * <p>
+ * When the orientation is <code>ORIENT_LTR</code> and the
+ * structured text has a RTL base direction,
+ * {@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 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 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 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 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 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 IStructuredTextExpert#leanToFullText leanToFullText} does not add any directional
+ * formatting characters as either prefix or suffix of the <i>full</i> text.
+ * <p>
*/
public String leanToFullText(String text) {
int len = text.length();
@@ -542,4 +542,7 @@ public class StructuredTextImpl implements IStructuredTextExpert {
return new String(fullChars);
}
+ public String toString() {
+ return super.toString() + " [handler=" + handler.toString() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java
index ed5f4bd..1d702bb 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java
+++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/StructuredTextTypesCollector.java
@@ -144,11 +144,8 @@ public class StructuredTextTypesCollector implements IRegistryEventListener {
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());