Project: Eclipse_Platform_UI
Bug 50994 [Wizards] NewWizardShortcutAction does not properly size wizard
Reported: 2004-01-30 15:28:34 | Status: verified fixed

We are using org.eclipse.ui.actions.NewWizardMenu() to create the New> menu option on a popup menu inside a tree view. The wizards registered for the perspective are coming up with odd, outlandish sizes. We traced the problem to org.eclipse.ui.internal.ide.NewWizardShortcutAction. When NewWizardShortcutAction creates the WizardDialog, it does not properly size the wizard. The problem does not show up from the general NewWizardDialog (where an individual wizard is selected from all available) because NewWizardAction handles the sizing of the initial WizardDialog, and the subsequent WizardPages added absorb the correct size. This is a simple fix, which could be accomplished with the following (minor) change: _Currently in NewWizardAction.java#159-64_ Shell parent = workbenchWindow.getShell(); WizardDialog dialog = new WizardDialog(parent, wizard); dialog.create(); // the following is the key line missing from NewWizardShortcutAction dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT); WorkbenchHelp.setHelp(dialog.getShell(), IHelpContextIds.NEW_WIZARD); dialog.open(); _Add the same line to NewWizardShortcutAction.java#92-98_ wizard.init(window.getWorkbench(), selectionToPass); Shell parent = window.getShell(); WizardDialog dialog = new WizardDialog(parent, wizard); dialog.create(); dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT); WorkbenchHelp.setHelp(dialog.getShell(), IHelpContextIds.NEW_WIZARD_SHORTCUT); dialog.open(); We have not tested the above modification. [Using Eclipse 3.0M6 on Windows 2000]

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/NewWizardShortcutAction.java