The previous example supplied a wizard for a specified extension point. Another, perhaps more common, case is that you want to launch your own plug-in's wizard from some action that you have defined. (In Workbench menu contributions, we discuss the ways you can contribute actions to the workbench.)
When you are launching your own wizard, you need to wrap the wizard in a WizardDialog. This detail will not be handled for you by the workbench like it is when you contribute a wizard extension.
For example, the ReadmeCreationWizard could be launched independently by creating a wizard dialog and associating it with the ReadmeCreationWizard. The following code snippet shows how this could be done from some action delegate. (The method assumes that we know the workbench and the selection.)
public void run(IAction action) { // Create the wizard ReadmeCreationWizard wizard = new ReadmeCreationWizard(); wizard.init(getWorkbench(), selection); // Create the wizard dialog WizardDialog dialog = new WizardDialog (getWorkbench().getActiveWorkbenchWindow().getShell(),wizard); // Open the wizard dialog dialog.open(); }