---
title: "WIZARD 内容"
author: "dmwdmc"
date: "2010-04-29T11:29:51Z"
tags: []
categories: ["企业架构"]
slug: "wizard"
draft: false
lastmod: "2010-05-06T11:56:00Z"
id: 655988
url: "https://dmwdmc.iteye.com/blog/655988"
---

<span style="color:darkblue">Wizard has 3 layers.</span>

The first layer.
IDialogPage:is the base interface for the pages in any multipage dialog. The interface privider mehtods to configure all the attributes for a given page, such as its title, a desc,or an image. The most inporttant method is createControl().

IWizardPage: it extends IDialogPage, it defines getName,getNextPage,getPreviousPage,isPageComplete,canFlipTONExtpage.

WizardPage:it is abstract. It implements IWizardPage interface and provides mush of the basic logic for a page. You only need implement createControl mehtod.




The second layer.
IWizard:it is a interface ,it has quite a few methods, most of which are straightforward accessors for configuiration options.

Wizard:it implements IWizard.
e.g . We can do this


```java
public class ProjectWizard extends Wizard{
      ..........
      public void addPages(){
         addPage(new WizardPage(..){..});
      }
      ........
      public boolean performFinish(){
         WizardPage wp=(WizardPage)getPage(strPageName);
         .......
          return true;
      }
}
```



The third layer.......wizard container.
WizardDialog: it implements IWizardContainer and IRunnableContext,and extends TitleAreaDialog.Client can provide their own implementations of IWizardContainer, but WizardDialog will be sufficient for most needs.
e.g.


```java
public class WizardDialogDemo{
   public static void main(String[]args){
       WizardDialog wd=new WizardDialog(shell,wizard);
       wd.create();
       wd.open;
   }
}
```






<span style="color:darkblue">Persistent wizard data</span>

DialogSettings: it provides an implementation of the IDialogSettings interface using hash table and backed by an XML file.