Skip to content

Commit 465b41b

Browse files
author
soheil_h_y
committed
1.CTabFolderListeners parent should be preserved before doing any other activities.
1 parent 8922156 commit 465b41b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/custom

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/custom/CTabItem.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ public void setControl (Control control) {
446446
if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
447447
if (control.parent != parent) error (SWT.ERROR_INVALID_PARENT);
448448
}
449+
System.out.println("Ctab setControl " + control + " " + control.parent + " " + parent);
449450
if (this.control != null && this.control.isDisposed ()) {
450451
this.control = null;
451452
}
@@ -461,7 +462,9 @@ public void setControl (Control control) {
461462
if (clientArea.height <= 0 || clientArea.width <= 0) {
462463
System.out.println("client area has trouble");
463464
} else {
464-
newControl.setBounds (clientArea);
465+
if(this.isSelected){
466+
newControl.setBounds (clientArea);
467+
}
465468
newControl.setVisible(true);
466469
}
467470
// if (newControl != null) {
@@ -612,6 +615,7 @@ public void run() {
612615
e.time = display.getLastEventTime ();
613616
e.item = CTabItem.this;
614617
e.doit = true;
618+
CTabFolder parent = CTabItem.this.parent;
615619
for (int j = 0; j < parent.folderListeners.length; j++) {
616620
CTabFolder2Listener listener = parent.folderListeners[j];
617621
listener.close(e);

0 commit comments

Comments
 (0)