Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Plug-in Developer Guide
Previous Page Home Next Page

Wizard dialogs

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.)

Wizards are displayed in the UI by placing them in a containing dialog.  This detail is handled for you when you contribute to a wizard extension.  When you are launching your own wizard, you must display it yourself by wrapping it in a WizardDialog.

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();
   }

If you need to embed a wizard anywhere else in your plug-in's user interface, the interface IWizardContainer defines the necessary protocol for hosting a wizard.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire