This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 429598 - org.eclipse.jface.wizard.Wizard class must clearly report when the top level control is not created
Summary: org.eclipse.jface.wizard.Wizard class must clearly report when the top level ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Lars Vogel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-04 16:00 EST by Dmitry Spiridenok CLA
Modified: 2014-04-29 06:04 EDT (History)
7 users (show)

See Also:


Attachments
Exception stack (4.86 KB, text/plain)
2014-03-04 16:00 EST, Dmitry Spiridenok CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Spiridenok CLA 2014-03-04 16:00:20 EST
Created attachment 240514 [details]
Exception stack

Currently if a JFace wizard page does not set the created top level control for the dialog page, a very cumbersome exception is raised.

Example code (only relevant code is shown):
public class MyWizardPage1 extends WizardPage {

	public MyWizardPage1() {
		super("page1");
	}
	
 	@Override
	public void createControl(Composite parent) {
		Composite container = new Composite(parent, NONE);
		... create some GUI ...
		// setControl is not called -> exception raised.
		// setControl(container);
	}
}

See the attached file for the complete exception stack.

The exception seems to be triggered by the following assert in Wizard.java, line 181:
     Assert.isNotNull(page.getControl());
Possible solution could be to add an extra message to the assert to clearly indicate what's going wrong at this moment. Possible improvement:
     Assert.isNotNull(page.getControl(), "Top level control is not set, probably setControl() is not called called"); //$NON-NLS-1$
Comment 1 Lars Vogel CLA 2014-03-04 17:51:09 EST
https://git.eclipse.org/r/#/c/22872/
Comment 2 Lars Vogel CLA 2014-03-04 17:51:46 EST
Thanks for the bug report, we currently in a "freeze mode", in 1-2 week we can apply the fix.
Comment 4 Lars Vogel CLA 2014-04-29 06:04:53 EDT
Reports the error like a charm in Build id: I20140427-2030