ITeye博客

WIZARD 内容

dmwdmc · 2010-04-29 11:29 · SWT/JFACE/RCP · 企业架构 · Markdown

Wizard has 3 layers.

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

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.

public class WizardDialogDemo{
   public static void main(String[]args){
       WizardDialog wd=new WizardDialog(shell,wizard);
       wd.create();
       wd.open;
   }
}

Persistent wizard data

DialogSettings: it provides an implementation of the IDialogSettings interface using hash table and backed by an XML file.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。