aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2013-02-15 15:00:24 (EST)
committerMarkus Keller2013-02-15 15:01:18 (EST)
commitdd1f2c962688119327457c674529bd94aeb932d2 (patch)
tree385c1d7fb8b5d866134b9907ce11342e996c376e
parentce9a763c246cc24ea504a41a1af624229a385c20 (diff)
downloadrt.equinox.bundles-dd1f2c962688119327457c674529bd94aeb932d2.zip
rt.equinox.bundles-dd1f2c962688119327457c674529bd94aeb932d2.tar.gz
rt.equinox.bundles-dd1f2c962688119327457c674529bd94aeb932d2.tar.bz2
Fixes for bug 380397 (API work):
- made basic functionality work without OSGi - renamed RTL_ARITHMETIC constant to MATH - sorted structured text types - Javadoc fixes
-rw-r--r--bundles/org.eclipse.equinox.bidi.tests/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.bidi.tests/STextTestSuite.launch9
-rw-r--r--bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/STextMathTest.java4
-rw-r--r--bundles/org.eclipse.equinox.bidi/.settings/org.eclipse.pde.api.tools.prefs147
-rw-r--r--bundles/org.eclipse.equinox.bidi/plugin.properties10
-rw-r--r--bundles/org.eclipse.equinox.bidi/plugin.xml30
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextProcessor.java4
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextTypeHandlerFactory.java89
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextEnvironment.java9
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextActivator.java31
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/STextTypesCollector.java39
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextJava.java2
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextSql.java2
13 files changed, 227 insertions, 154 deletions
diff --git a/bundles/org.eclipse.equinox.bidi.tests/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.bidi.tests/META-INF/MANIFEST.MF
index 4e0297a..12ca6da 100644
--- a/bundles/org.eclipse.equinox.bidi.tests/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.bidi.tests/META-INF/MANIFEST.MF
@@ -4,9 +4,10 @@ Bundle-Name: BiDi tests
Bundle-SymbolicName: org.eclipse.equinox.bidi.tests;singleton:=true
Bundle-Version: 1.0.0.qualifier
Require-Bundle: org.junit;bundle-version="3.8.2",
- org.eclipse.equinox.bidi;bundle-version="0.9.0",
+ org.eclipse.equinox.bidi;bundle-version="0.10.0",
org.eclipse.equinox.registry;bundle-version="3.5.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Export-Package: org.eclipse.equinox.bidi.internal.tests;x-internal:=true
+Export-Package: org.eclipse.equinox.bidi.internal.tests;x-internal:=true,
+ org.eclipse.equinox.bidi.tests
Eclipse-BundleShape: dir
diff --git a/bundles/org.eclipse.equinox.bidi.tests/STextTestSuite.launch b/bundles/org.eclipse.equinox.bidi.tests/STextTestSuite.launch
index 49e45fe..a3f1a2a 100644
--- a/bundles/org.eclipse.equinox.bidi.tests/STextTestSuite.launch
+++ b/bundles/org.eclipse.equinox.bidi.tests/STextTestSuite.launch
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
<booleanAttribute key="append.args" value="true"/>
<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
<booleanAttribute key="askclear" value="false"/>
@@ -21,10 +20,10 @@
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="true"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.equinox.bidi.tests.STextTestSuite"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.equinox.bidi.tests"/>
@@ -39,4 +38,4 @@
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="false"/>
<booleanAttribute key="useProduct" value="false"/>
-</launchConfiguration>
+</launchConfiguration> \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/STextMathTest.java b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/STextMathTest.java
index 3ebef2d..03c8956 100644
--- a/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/STextMathTest.java
+++ b/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/STextMathTest.java
@@ -22,8 +22,8 @@ public class STextMathTest extends STextTestBase {
private STextEnvironment envLTR = new STextEnvironment("ar", false, STextEnvironment.ORIENT_LTR);
private STextEnvironment envRTL = new STextEnvironment("ar", false, STextEnvironment.ORIENT_RTL);
- private ISTextExpert expertLTR = STextExpertFactory.getExpert(STextTypeHandlerFactory.RTL_ARITHMETIC, envLTR);
- private ISTextExpert expertRTL = STextExpertFactory.getExpert(STextTypeHandlerFactory.RTL_ARITHMETIC, envRTL);
+ private ISTextExpert expertLTR = STextExpertFactory.getExpert(STextTypeHandlerFactory.MATH, envLTR);
+ private ISTextExpert expertRTL = STextExpertFactory.getExpert(STextTypeHandlerFactory.MATH, envRTL);
private void verifyOneLine(String msg, String data, String resLTR, String resRTL) {
String lean = toUT16(data);
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 1fe8a5c..2498085 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
@@ -1,63 +1,65 @@
-#Tue Feb 02 14:52:27 EST 2010
-ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
-ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
-CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
-CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
-CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
-CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
-CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
-ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
-ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
-ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
-FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
-FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
-FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
-FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Ignore
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Ignore
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Ignore
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Ignore
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Ignore
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Ignore
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Ignore
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Ignore
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Ignore
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Ignore
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Ignore
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Ignore
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Ignore
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Ignore
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Ignore
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Ignore
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Ignore
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Ignore
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Ignore
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Ignore
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Ignore
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Ignore
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Ignore
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Ignore
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Ignore
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Ignore
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Ignore
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Ignore
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Ignore
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Ignore
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Ignore
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Ignore
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Ignore
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Ignore
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Ignore
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Ignore
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Ignore
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Ignore
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Ignore
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Ignore
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Ignore
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Ignore
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Ignore
ILLEGAL_EXTEND=Warning
ILLEGAL_IMPLEMENT=Warning
ILLEGAL_INSTANTIATE=Warning
ILLEGAL_OVERRIDE=Warning
ILLEGAL_REFERENCE=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
-INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Ignore
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Ignore
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Ignore
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Ignore
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Ignore
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Ignore
+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_REFERENCE_IN_SYSTEM_LIBRARIES=Error
LEAK_EXTEND=Warning
@@ -65,22 +67,23 @@ LEAK_FIELD_DECL=Warning
LEAK_IMPLEMENT=Warning
LEAK_METHOD_PARAM=Warning
LEAK_METHOD_RETURN_TYPE=Warning
-METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
-METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Ignore
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Ignore
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Ignore
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Ignore
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Ignore
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Ignore
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Ignore
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Ignore
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Ignore
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Ignore
+MISSING_EE_DESCRIPTIONS=Warning
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Ignore
UNUSED_PROBLEM_FILTERS=Warning
automatically_removed_unused_problem_filters=false
eclipse.preferences.version=1
@@ -89,6 +92,6 @@ incompatible_api_component_version_include_major_without_breaking_change=Disable
incompatible_api_component_version_include_minor_without_api_change=Disabled
invalid_since_tag_version=Error
malformed_since_tag=Error
-missing_since_tag=Error
+missing_since_tag=Ignore
report_api_breakage_when_major_version_incremented=Disabled
report_resolution_errors_api_component=Warning
diff --git a/bundles/org.eclipse.equinox.bidi/plugin.properties b/bundles/org.eclipse.equinox.bidi/plugin.properties
index 25af8aa..5bb3e28 100644
--- a/bundles/org.eclipse.equinox.bidi/plugin.properties
+++ b/bundles/org.eclipse.equinox.bidi/plugin.properties
@@ -12,14 +12,16 @@ pluginName = Bidirectional Text Support
providerName = Eclipse.org - Equinox
bidiExpressionPointName = Add new structured text type
bidiExtensionName = Default bidirectional processors
-sqlProcessorName = Processor for SQL statements
-regexProcessorName = Processor for regular expressions
-javaProcessorName = Processor for Java statements
+
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
-systemProcessorName = Processor for System / user statements
+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 8a91854..bce6eac 100644
--- a/bundles/org.eclipse.equinox.bidi/plugin.xml
+++ b/bundles/org.eclipse.equinox.bidi/plugin.xml
@@ -7,21 +7,6 @@
name="%bidiExtensionName"
point="org.eclipse.equinox.bidi.bidiTypes">
<typeDescription
- description="%sqlProcessorName"
- class="org.eclipse.equinox.bidi.internal.consumable.STextSql"
- type="sql">
- </typeDescription>
- <typeDescription
- description="%regexProcessorName"
- class="org.eclipse.equinox.bidi.internal.consumable.STextRegex"
- type="regex">
- </typeDescription>
- <typeDescription
- description="%javaProcessorName"
- class="org.eclipse.equinox.bidi.internal.consumable.STextJava"
- type="java">
- </typeDescription>
- <typeDescription
class="org.eclipse.equinox.bidi.internal.consumable.STextComma"
description="%commaProcessorName"
type="comma">
@@ -37,6 +22,11 @@
type="file">
</typeDescription>
<typeDescription
+ class="org.eclipse.equinox.bidi.internal.consumable.STextJava"
+ description="%javaProcessorName"
+ type="java">
+ </typeDescription>
+ <typeDescription
class="org.eclipse.equinox.bidi.internal.consumable.STextMath"
description="%mathProcessorName"
type="math">
@@ -47,6 +37,16 @@
type="property">
</typeDescription>
<typeDescription
+ description="%regexProcessorName"
+ class="org.eclipse.equinox.bidi.internal.consumable.STextRegex"
+ type="regex">
+ </typeDescription>
+ <typeDescription
+ description="%sqlProcessorName"
+ class="org.eclipse.equinox.bidi.internal.consumable.STextSql"
+ type="sql">
+ </typeDescription>
+ <typeDescription
class="org.eclipse.equinox.bidi.internal.consumable.STextSystem"
description="%systemProcessorName"
type="system">
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextProcessor.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextProcessor.java
index 219b2b8..1940cd4 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextProcessor.java
+++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextProcessor.java
@@ -21,6 +21,10 @@ import org.eclipse.equinox.bidi.custom.STextTypeHandler;
* restore the original text
* (for more explanations, please see the
* <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).
+ * </p>
*
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextTypeHandlerFactory.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextTypeHandlerFactory.java
index 4f4513a..f3203cb 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextTypeHandlerFactory.java
+++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/STextTypeHandlerFactory.java
@@ -28,30 +28,18 @@ import org.eclipse.equinox.bidi.internal.STextTypesCollector;
* <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.
+ * 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)}.
+ * <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.
+ * </p>
*
* @noinstantiate This class is not intended to be instantiated by clients.
*/
-final public class STextTypeHandlerFactory {
-
- /**
- * 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 compound names. It expects text to be made of one or more
- * parts separated by underscores:
- * <pre>
- * part1_part2_part3
- * </pre>
- */
- public static final String UNDERSCORE = "underscore"; //$NON-NLS-1$
+public final class STextTypeHandlerFactory {
/**
* Structured text handler identifier for comma-delimited lists, such as:
@@ -62,12 +50,9 @@ final public class STextTypeHandlerFactory {
public static final String COMMA_DELIMITED = "comma"; //$NON-NLS-1$
/**
- * Structured text handler identifier for strings with the following format:
- * <pre>
- * system(user)
- * </pre>
+ * Structured text handler identifier for e-mail addresses.
*/
- public static final String SYSTEM_USER = "system"; //$NON-NLS-1$
+ public static final String EMAIL = "email"; //$NON-NLS-1$
/**
* Structured text handler identifier for directory and file paths.
@@ -75,14 +60,28 @@ final public class STextTypeHandlerFactory {
public static final String FILE = "file"; //$NON-NLS-1$
/**
- * Structured text handler identifier for e-mail addresses.
+ * Structured text handler identifier for Java code,
+ * possibly spanning multiple lines.
*/
- public static final String EMAIL = "email"; //$NON-NLS-1$
+ public static final String JAVA = "java"; //$NON-NLS-1$
/**
- * Structured text handler identifier for URLs.
+ * 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 URL = "url"; //$NON-NLS-1$
+ 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,
@@ -91,27 +90,39 @@ final public class STextTypeHandlerFactory {
public static final String REGEXP = "regex"; //$NON-NLS-1$
/**
- * Structured text handler identifier for XPath expressions.
+ * Structured text handler identifier for SQL statements,
+ * possibly spanning multiple lines.
*/
- public static final String XPATH = "xpath"; //$NON-NLS-1$
+ public static final String SQL = "sql"; //$NON-NLS-1$
/**
- * Structured text handler identifier for Java code,
- * possibly spanning multiple lines.
+ * Structured text handler identifier for strings with the following format:
+ * <pre>
+ * system(user)
+ * </pre>
*/
- public static final String JAVA = "java"; //$NON-NLS-1$
+ public static final String SYSTEM_USER = "system"; //$NON-NLS-1$
/**
- * Structured text handler identifier for SQL statements,
- * possibly spanning multiple lines.
+ * Structured text handler identifier for compound names. It expects text to be made of one or more
+ * parts separated by underscores:
+ * <pre>
+ * part1_part2_part3
+ * </pre>
*/
- public static final String SQL = "sql"; //$NON-NLS-1$
+ public static final String UNDERSCORE = "underscore"; //$NON-NLS-1$
/**
- * Structured text handler identifier for arithmetic expressions,
- * possibly with a RTL base direction.
+ * Structured text handler identifier for URLs.
+ */
+ public static final String URL = "url"; //$NON-NLS-1$
+
+ /**
+ * Structured text handler identifier for XPath expressions.
*/
- public static final String RTL_ARITHMETIC = "math"; //$NON-NLS-1$
+ public static final String XPATH = "xpath"; //$NON-NLS-1$
+
+ // *** New types must be added to STextTypesCollector#getDefaultTypeHandlers()!
/**
* Prevents instantiation
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextEnvironment.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextEnvironment.java
index 7af08f0..d1bd99d 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextEnvironment.java
+++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/advanced/STextEnvironment.java
@@ -10,6 +10,7 @@
******************************************************************************/
package org.eclipse.equinox.bidi.advanced;
+import java.util.Locale;
import org.eclipse.equinox.bidi.internal.STextActivator;
/**
@@ -115,8 +116,10 @@ public class STextEnvironment {
language = lang.substring(0, 2);
else
language = lang;
- } else
- language = STextActivator.getInstance().getDefaultLocale().getLanguage();
+ } else {
+ Locale defaultLocale = STextActivator.getInstance() != null ? STextActivator.getInstance().getDefaultLocale() : Locale.getDefault();
+ language = defaultLocale.getLanguage();
+ }
this.mirrored = mirrored;
this.orientation = orientation >= ORIENT_LTR && orientation <= ORIENT_IGNORE ? orientation : ORIENT_UNKNOWN;
}
@@ -172,7 +175,7 @@ public class STextEnvironment {
*/
public boolean isProcessingNeeded() {
if (processingNeeded == null) {
- String osName = STextActivator.getInstance().getProperty("os.name"); //$NON-NLS-1$/
+ String osName = STextActivator.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$
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/STextActivator.java
index f364fe2..9478a77 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/STextActivator.java
@@ -18,7 +18,7 @@ import org.osgi.framework.*;
import org.osgi.util.tracker.ServiceTracker;
/**
- * Provides services related to OSGI bundles.
+ * Provides services related to OSGi bundles.
*/
public class STextActivator implements BundleActivator {
@@ -43,12 +43,27 @@ public class STextActivator implements BundleActivator {
bundleContext = null;
}
+ /**
+ * @return the bundle instance, or <code>null</code> iff OSGi is not running
+ */
public static STextActivator getInstance() {
return instance;
}
- public String getProperty(String key) {
- return bundleContext.getProperty(key);
+ /**
+ * Returns the value of the specified property. If OSGi is not running or the key is not found in
+ * the Framework properties, the system properties are then searched.
+ * <p>
+ * This method can be used without OSGi running.
+ * </p>
+ *
+ * @param key the name of the requested property
+ * @return the value of the requested property, or {@code null} if the property is undefined
+ */
+ public static String getProperty(String key) {
+ if (instance != null)
+ return instance.bundleContext.getProperty(key);
+ return System.getProperty(key);
}
public Locale getDefaultLocale() {
@@ -81,10 +96,12 @@ public class STextActivator implements BundleActivator {
}
static public void logError(String message, Exception e) {
- FrameworkLog frameworkLog = instance.getFrameworkLog();
- if (frameworkLog != null) {
- frameworkLog.log(new FrameworkLogEntry("org.eclipse.equinox.bidi", FrameworkLogEntry.ERROR, 1, message, 0, e, null)); //$NON-NLS-1$
- return;
+ if (instance != null) {
+ FrameworkLog frameworkLog = instance.getFrameworkLog();
+ if (frameworkLog != null) {
+ frameworkLog.log(new FrameworkLogEntry("org.eclipse.equinox.bidi", FrameworkLogEntry.ERROR, 1, message, 0, e, null)); //$NON-NLS-1$
+ return;
+ }
}
System.err.println(message);
if (e != 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/STextTypesCollector.java
index d061c25..9428fa1 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/STextTypesCollector.java
@@ -10,10 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.bidi.internal;
-import java.util.HashMap;
-import java.util.Map;
+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.internal.consumable.*;
/**
* Provides services related to registered structured text handlers.
@@ -33,7 +34,8 @@ public class STextTypesCollector implements IRegistryEventListener {
private STextTypesCollector() {
IExtensionRegistry registry = RegistryFactory.getRegistry();
- registry.addListener(this, EXT_POINT);
+ if (registry != null)
+ registry.addListener(this, EXT_POINT);
}
/**
@@ -81,6 +83,11 @@ public class STextTypesCollector implements IRegistryEventListener {
factories.clear();
IExtensionRegistry registry = RegistryFactory.getRegistry();
+ if (registry == null) {
+ types.putAll(getDefaultTypeHandlers());
+ return;
+ }
+
IExtensionPoint extPoint = registry.getExtensionPoint(EXT_POINT);
IExtension[] extensions = extPoint.getExtensions();
@@ -122,4 +129,30 @@ public class STextTypesCollector implements IRegistryEventListener {
types = null;
factories = null;
}
+
+ /**
+ * Returns the default structured text type handlers. These handlers are
+ * 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}).
+ */
+ 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());
+
+ return Collections.unmodifiableMap(types);
+ }
}
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/STextJava.java
index e987291..73572d5 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/STextJava.java
@@ -34,7 +34,7 @@ import org.eclipse.equinox.bidi.internal.STextActivator;
*/
public class STextJava extends STextTypeHandler {
private static final byte WS = Character.DIRECTIONALITY_WHITESPACE;
- static final String lineSep = STextActivator.getInstance().getProperty("line.separator"); //$NON-NLS-1$
+ static final String lineSep = STextActivator.getProperty("line.separator"); //$NON-NLS-1$
private static final Integer STATE_SLASH_ASTER_COMMENT = new Integer(3);
public STextJava() {
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/STextSql.java
index 4ab4276..762e9d0 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/STextSql.java
@@ -34,7 +34,7 @@ import org.eclipse.equinox.bidi.internal.STextActivator;
*/
public class STextSql extends STextTypeHandler {
private static final byte WS = Character.DIRECTIONALITY_WHITESPACE;
- static final String lineSep = STextActivator.getInstance().getProperty("line.separator"); //$NON-NLS-1$
+ static final String lineSep = STextActivator.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);