### Eclipse Workspace Patch 1.0
#P org.eclipse.equinox.bidi
Index: src/org/eclipse/equinox/bidi/complexp/IComplExpProcessor.java
===================================================================
RCS file: /cvsroot/rt/org.eclipse.equinox/components/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/complexp/IComplExpProcessor.java,v
retrieving revision 1.2
diff -u -r1.2 IComplExpProcessor.java
--- src/org/eclipse/equinox/bidi/complexp/IComplExpProcessor.java 3 Feb 2010 20:00:59 -0000 1.2
+++ src/org/eclipse/equinox/bidi/complexp/IComplExpProcessor.java 23 Feb 2010 23:27:09 -0000
@@ -366,6 +366,22 @@
*/
public int fullToLeanPos(int pos);
+ /** Set the operators which separate a complex expression into tokens.
+ *
+ * @param operators is a string where each character is an operator.
+ *
+ * @see #getOperators
+ */
+ public void setOperators(String operators);
+
+ /** Get the operators which separate a complex expression into tokens.
+ *
+ * @return a string where each character is an operator.
+ *
+ * @see #getOperators
+ */
+ public String getOperators();
+
/** Specify whether the GUI where the complex expression will be displayed
* is mirrored (is laid out from right to left). The value specified in
* this method overrides the default assumed for all complex expressions
@@ -430,7 +446,7 @@
* {@link #leanToFullText leanToFullText} does not add any directional
* formatting characters as either prefix or suffix of the full text.
*
- * @param desiredOrientation orientation of the GUI component where the
+ * @param componentOrientation orientation of the GUI component where the
* complex expression will be displayed. It must be one of the
* values {@link #ORIENT_LTR}, {@link #ORIENT_RTL},
* {@link #ORIENT_CONTEXTUAL_LTR}, {@link #ORIENT_CONTEXTUAL_RTL},
@@ -438,7 +454,7 @@
*
* @see #recallOrientation
*/
- public void assumeOrientation(int desiredOrientation);
+ public void assumeOrientation(int componentOrientation);
/** Retrieve the value currently assumed for the orientation.
*
Index: src/org/eclipse/equinox/bidi/internal/complexp/ComplExpBasic.java
===================================================================
RCS file: /cvsroot/rt/org.eclipse.equinox/components/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/complexp/ComplExpBasic.java,v
retrieving revision 1.1
diff -u -r1.1 ComplExpBasic.java
--- src/org/eclipse/equinox/bidi/internal/complexp/ComplExpBasic.java 3 Feb 2010 20:01:02 -0000 1.1
+++ src/org/eclipse/equinox/bidi/internal/complexp/ComplExpBasic.java 23 Feb 2010 23:27:09 -0000
@@ -69,7 +69,7 @@
* Type of the complex expression processor specified when calling
* {@link ComplExpUtil#create}
*/
- protected int type;
+ protected String type;
/**
* Base direction of the complex expression. This is an array such that
@@ -187,8 +187,14 @@
locations = new int[operCount];
}
- public void setType(int expressionType) {
- type = expressionType;
+ public void setOperators(String operators) {
+ this.operators = operators.toCharArray();
+ operCount = this.operators.length;
+ locations = new int[operCount + specialsCount];
+ }
+
+ public String getOperators() {
+ return new String(operators);
}
/**
@@ -285,7 +291,8 @@
* of this number is internal to the class implementing
* indexOfSpecial
.
*
- * @param text text of the complex expression.
+ * @param leanText text of the complex expression before addition of any
+ * directional formatting characters.
*
* @param fromIndex the index within leanText
to start
* the search from.
@@ -302,7 +309,7 @@
* In ComplExpBasic
this method always returns -1.
*
*/
- protected int indexOfSpecial(int whichSpecial, String text, int fromIndex) {
+ protected int indexOfSpecial(int whichSpecial, String leanText, int fromIndex) {
// This method must be overridden by all subclasses with special cases.
return -1;
}
@@ -866,7 +873,7 @@
if (dirProp == L || dirProp == R || dirProp == AL || dirProp == EN || dirProp == AN)
index = offset - 1;
else
- // if the current char is a neutral, we change its own dirProp
+ // if the current char is a neutral, we change its own dirProp
index = offset;
setMarkAndFixes();
setDirProp(index, curStrong);
@@ -931,10 +938,11 @@
return mirrored;
}
- public void assumeOrientation(int desiredOrientation) {
- if (desiredOrientation < ORIENT_LTR || desiredOrientation > ORIENT_IGNORE)
+ public void assumeOrientation(int componentOrientation) {
+ if (componentOrientation < ORIENT_LTR || componentOrientation > ORIENT_IGNORE)
orientation = ORIENT_UNKNOWN; // TBD should throw new IllegalArgumentException()?
- orientation = desiredOrientation;
+ else
+ orientation = componentOrientation;
}
public int recallOrientation() {
Index: src/org/eclipse/equinox/bidi/internal/complexp/ComplExpDoNothing.java
===================================================================
RCS file: /cvsroot/rt/org.eclipse.equinox/components/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/complexp/ComplExpDoNothing.java,v
retrieving revision 1.1
diff -u -r1.1 ComplExpDoNothing.java
--- src/org/eclipse/equinox/bidi/internal/complexp/ComplExpDoNothing.java 3 Feb 2010 20:01:02 -0000 1.1
+++ src/org/eclipse/equinox/bidi/internal/complexp/ComplExpDoNothing.java 23 Feb 2010 23:27:09 -0000
@@ -25,6 +25,7 @@
// TBD is this needed?
public class ComplExpDoNothing implements IComplExpProcessor {
+ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
private static final int[] EMPTY_INT_ARRAY = new int[0];
private static final int[][] ALL_LTR = new int[][] { {DIRECTION_LTR, DIRECTION_LTR}, {DIRECTION_LTR, DIRECTION_LTR}};
@@ -42,6 +43,22 @@
* For class ComplExpDoNothing
* this method does nothing.
*/
+ public void setOperators(String operators) {
+ // empty
+ }
+
+ /**
+ * For class ComplExpDoNothing
+ * this method returns a zero-length string.
+ */
+ public String getOperators() {
+ return EMPTY_STRING;
+ }
+
+ /**
+ * For class ComplExpDoNothing
+ * this method does nothing.
+ */
public void selectBidiScript(boolean arabic, boolean hebrew) {
// empty
}