diff options
author | Duong Nguyen <dnguyen> | 2008-08-25 17:39:48 +0000 |
---|---|---|
committer | Duong Nguyen <dnguyen> | 2008-08-25 17:39:48 +0000 |
commit | aa84c6a240362ee2647140df1ff56727b6270428 (patch) | |
tree | a84dd2c824c9d578e5552cfc2770c5c24f4357f2 /bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java | |
parent | 37adfc52312149fd26b34b5ad986938c7d4046e8 (diff) | |
download | eclipse.platform.swt-aa84c6a240362ee2647140df1ff56727b6270428.tar.gz eclipse.platform.swt-aa84c6a240362ee2647140df1ff56727b6270428.tar.xz eclipse.platform.swt-aa84c6a240362ee2647140df1ff56727b6270428.zip |
Bug 49996 - [CCombo] CCombo, CLabel - Custom widgets are nulling internal slots too soon
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java index fe513bf92f..cfd747f7e1 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java @@ -116,6 +116,7 @@ public class ViewForm extends Composite { Point oldSize; Color selectionBackground; + Listener listener; static final int OFFSCREEN = -200; static final int BORDER1_COLOR = SWT.COLOR_WIDGET_NORMAL_SHADOW; @@ -153,10 +154,10 @@ public ViewForm(Composite parent, int style) { setBorderVisible((style & SWT.BORDER) != 0); - Listener listener = new Listener() { + listener = new Listener() { public void handleEvent(Event e) { switch (e.type) { - case SWT.Dispose: onDispose(); break; + case SWT.Dispose: onDispose(e); break; case SWT.Paint: onPaint(e.gc); break; case SWT.Resize: onResize(); break; } @@ -239,7 +240,11 @@ public Control getTopRight() { //checkWidget(); return topRight; } -void onDispose() { +void onDispose(Event event) { + removeListener(SWT.Dispose, listener); + notifyListeners(SWT.Dispose, event); + event.type = SWT.None; + topLeft = null; topCenter = null; topRight = null; |