summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2003-09-16 21:59:58 +0000
committerFelipe Heidrich <fheidric>2003-09-16 21:59:58 +0000
commitd7699aef0279f3be5923cf02ea522a19c71c33db (patch)
treea2f777b7d4402b2957331e8bf2b710ba5cb7d64e
parent7d0406f3cd34a4ec2370b47adca24ce96b36611c (diff)
downloadeclipse.platform.swt-d7699aef0279f3be5923cf02ea522a19c71c33db.tar.gz
eclipse.platform.swt-d7699aef0279f3be5923cf02ea522a19c71c33db.tar.xz
eclipse.platform.swt-d7699aef0279f3be5923cf02ea522a19c71c33db.zip
backport 37608 (part of 42426)
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java36
1 files changed, 27 insertions, 9 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
index 5fbfc91851..8ec811134a 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
@@ -4305,6 +4305,18 @@ public String getSelectionText() {
checkWidget();
return content.getTextRange(selection.x, selection.y - selection.x);
}
+
+public int getStyle() {
+ int style = super.getStyle();
+ style &= ~(SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT | SWT.MIRRORED);
+ if (isMirrored()) {
+ style |= SWT.RIGHT_TO_LEFT | SWT.MIRRORED;
+ } else {
+ style |= SWT.LEFT_TO_RIGHT;
+ }
+ return style;
+}
+
/**
* Returns the text segments that should be treated as if they
* had a different direction than the surrounding text.
@@ -7411,27 +7423,32 @@ void setMouseWordSelectionAnchor() {
}
}
/**
- * Sets the widget orientation (writing order). Text will be right aligned
- * for right to left writing order.
+ * Sets the orientation of the receiver, which must be one
+ * of the constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.LEFT_TO_RIGHT</code>.
* <p>
*
- * @param newOrientation one of SWT.RIGHT_TO_LEFT or SWT.LEFT_TO_RIGHT
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1.2
*/
-void setOrientation(int orientation) {
+public boolean setOrientation(int orientation) {
if ((orientation & (SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT)) == 0) {
- return;
+ return false;
}
if ((orientation & SWT.RIGHT_TO_LEFT) != 0 && (orientation & SWT.LEFT_TO_RIGHT) != 0) {
- return;
+ return false;
}
if ((orientation & SWT.RIGHT_TO_LEFT) != 0 && isMirrored()) {
- return;
+ return false;
}
if ((orientation & SWT.LEFT_TO_RIGHT) != 0 && isMirrored() == false) {
- return;
+ return false;
}
if (StyledTextBidi.setOrientation(this, orientation) == false) {
- return;
+ return false;
}
isMirrored = (orientation & SWT.RIGHT_TO_LEFT) != 0;
isBidi = StyledTextBidi.isBidiPlatform() || isMirrored();
@@ -7445,6 +7462,7 @@ void setOrientation(int orientation) {
keyActionMap.clear();
createKeyBindings();
super.redraw();
+ return true;
}
/**
* Adjusts the maximum and the page size of the scroll bars to