summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe>2009-01-06 17:05:07 +0000
committerBogdan Gheorghe <gheorghe>2009-01-06 17:05:07 +0000
commit32b3d3f709dbef07cec32adb022c46bc4c3ddaf5 (patch)
tree9915abf0c01ba371d0d3d2abc449f801b84bfb7e /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
parentea6529e6474868b13bdeda7ed1c18eb1a162dc2a (diff)
downloadeclipse.platform.swt-32b3d3f709dbef07cec32adb022c46bc4c3ddaf5.tar.gz
eclipse.platform.swt-32b3d3f709dbef07cec32adb022c46bc4c3ddaf5.tar.xz
eclipse.platform.swt-32b3d3f709dbef07cec32adb022c46bc4c3ddaf5.zip
206232 Using the same Control for all Tab don't show the first selection
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
index 4742154af6..b09c0b7499 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
@@ -262,10 +262,16 @@ public void setControl (Control control) {
}
Control oldControl = this.control, newControl = control;
this.control = control;
- int index = parent.indexOf (this);
- if (index != parent.getSelectionIndex ()) {
- if (newControl != null) newControl.setVisible (false);
- return;
+ int index = parent.indexOf (this), selectionIndex = parent.getSelectionIndex();
+ if (index != selectionIndex) {
+ if (newControl != null) {
+ if (selectionIndex != -1) {
+ Control selectedControl = parent.getItem(selectionIndex).getControl();
+ if (selectedControl == newControl) return;
+ }
+ newControl.setVisible(false);
+ return;
+ }
}
if (newControl != null) {
newControl.setBounds (parent.getClientArea ());