diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableTree.java')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableTree.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableTree.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableTree.java index 4c8f74cd0f..f118229914 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableTree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableTree.java @@ -91,7 +91,7 @@ public class TableTree extends Composite { * @see #getStyle */ public TableTree(Composite parent, int style) { - super(parent, SWT.NONE); + super(parent, checkStyle (style)); table = new Table(this, style); Listener tableListener = new Listener() { public void handleEvent(Event e) { @@ -196,7 +196,12 @@ public void addTreeListener(TreeListener listener) { TypedListener typedListener = new TypedListener (listener); addListener (SWT.Expand, typedListener); addListener (SWT.Collapse, typedListener); -} +} +private static int checkStyle (int style) { + int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; + style = style & mask; + return style; +} public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); return table.computeSize (wHint, hHint, changed); @@ -502,7 +507,8 @@ void onKeyDown (Event e) { TableTreeItem item = selection[0]; int type = 0; if (e.keyCode == SWT.ARROW_RIGHT || e.keyCode == SWT.ARROW_LEFT) { - if (e.keyCode == SWT.ARROW_RIGHT) { + int trailKey = (getStyle() & SWT.MIRRORED) != 0 ? SWT.ARROW_LEFT : SWT.ARROW_RIGHT; + if (e.keyCode == trailKey) { if (item.getItemCount() == 0) return; if (item.getExpanded()) { TableTreeItem newSelection = item.getItems()[0]; |