summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2011-01-31 17:52:10 +0000
committerFelipe Heidrich <fheidric>2011-01-31 17:52:10 +0000
commitf7f5054d66e9730a6e9b654c7a4633777814d295 (patch)
tree5fe78e4c48e81e6854b76198534179bce1d01efa
parent9448da8f33a133c9a9c76541a6246f39825e8419 (diff)
downloadeclipse.platform.swt-f7f5054d66e9730a6e9b654c7a4633777814d295.tar.gz
eclipse.platform.swt-f7f5054d66e9730a6e9b654c7a4633777814d295.tar.xz
eclipse.platform.swt-f7f5054d66e9730a6e9b654c7a4633777814d295.zip
Bug 335882 -bidi: overload SashForm#setOrientation to change bidi direction
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java
index 232652d665..f110664068 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java
@@ -107,6 +107,11 @@ Sash createSash() {
* Returns SWT.HORIZONTAL if the controls in the SashForm are laid out side by side
* or SWT.VERTICAL if the controls in the SashForm are laid out top to bottom.
*
+ * <p>
+ * To retrieve the bidi orientation of the SashForm use <code>{@link #getStyle()}</code>
+ * and test if the SWT.RIGHT_TO_LEFT or SWT.LEFT_TO_RIGHT bits are set.
+ * </p>
+ *
* @return SWT.HORIZONTAL or SWT.VERTICAL
*/
public int getOrientation() {
@@ -286,16 +291,27 @@ void onDragSash(Event event) {
* out side by side. If orientation is SWT.VERTICAL, lay the
* controls in the SashForm out top to bottom.
*
- * @param orientation SWT.HORIZONTAL or SWT.VERTICAL
+ * <p>
+ * Since 3.7, this method can also be called with SWT.RIGHT_TO_LEFT or SWT.LEFT_TO_RIGHT
+ * to change the bidi orientation of the SashForm.
+ * </p>
+ *
+ * @param orientation SWT.HORIZONTAL or SWT.VERTICAL, SWT.RIGHT_TO_LEFT or SWT.LEFT_TO_RIGHT
+ *
+ * @see Control#setOrientation(int)
*
* @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>
- * <li>ERROR_INVALID_ARGUMENT - if the value of orientation is not SWT.HORIZONTAL or SWT.VERTICAL
+ * <li>ERROR_INVALID_ARGUMENT - if the value of orientation is not SWT.HORIZONTAL or SWT.VERTICAL, SWT.RIGHT_TO_LEFT or SWT.LEFT_TO_RIGHT
* </ul>
*/
public void setOrientation(int orientation) {
checkWidget();
+ if (orientation == SWT.RIGHT_TO_LEFT || orientation == SWT.LEFT_TO_RIGHT) {
+ super.setOrientation(orientation);
+ return;
+ }
if (getOrientation() == orientation) return;
if (orientation != SWT.HORIZONTAL && orientation != SWT.VERTICAL) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);