Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356787

Summary: [Wizards] Widget Dispose Error
Product: [Eclipse Project] Platform Reporter: Sandip Sahoo <sandipsahoo789>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Sandip Sahoo CLA 2011-09-06 05:51:26 EDT
Build Identifier: I20110613-1736

Hi, 

I got the Wiget is Disposed error when trying override The WizardDialog Class and invoke a wizard from the customized one. And I would like to suggest few changes as below.

WizardDialog API and line no 1179:

protected void setWizard(IWizard newWizard) {
		wizard = newWizard;
		wizard.setContainer(this);
		if (!createdWizards.contains(wizard)) {
			createdWizards.add(wizard);
			// New wizard so just add it to the end of our nested list
			nestedWizards.add(wizard);
			if (pageContainer != null) {
				// Dialog is already open
				// Allow the wizard pages to precreate their page controls
				// This allows the wizard to open to the correct size
				createPageControls();
				// Ensure the dialog is large enough for the wizard
				updateSizeForWizard(wizard);
				pageContainer.layout(true);
			}
		} else {
			// We have already seen this wizard, if it is the previous wizard
			// on the nested list then we assume we have gone back and remove
			// the last wizard from the list
			int size = nestedWizards.size();
			if (size >= 2 && nestedWizards.get(size - 2) == wizard) {
				nestedWizards.remove(size - 1);
			} else {
				// Assume we are going forward to revisit a wizard
				nestedWizards.add(wizard);
			}
		}
	}

Should be if (pageContainer != null !&& pageContainer .isDiposed()) {

Also further there needs a handle of PageContainer, the Help Button Bar in Wizard Dialog etc.

Regards,
Sandip

Reproducible: Always

Steps to Reproduce:
1. Dummy Wizard through extension
2. Override SetContiner() method try to invoke Another wizard using Custom Wizard Dialog 
3.
Comment 1 Sandip Sahoo CLA 2011-09-06 05:53:25 EDT
Sorry little mistake:

Should be if (pageContainer != null && !pageContainer .isDiposed()) {
Comment 2 Remy Suen CLA 2011-09-06 08:23:49 EDT
Why is your page container disposed anyway?
Comment 3 Sandip Sahoo CLA 2011-09-07 03:04:14 EDT
(In reply to comment #2)
> Why is your page container disposed anyway?

As I mentioned, I am trying to invoke Wizard2 from setContainer(IWizardContainer container) of Wizard1's after disposing its container. So when Wizard2 is closed, the control comes back to Wizard1 setContainer(IWizardContainer container), then  control enters into setWizard(), as container is already disposed, it gives Widget is disposed error.
Comment 4 Eclipse Genie CLA 2020-08-13 17:39:17 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.