![EclipseRCP 마법사 사용하기(EclipseRCP Wizard)[마법사,wizard,이클립스 RCP,eclipse RCP]](http://images.google.com/images?q=tbn:rFfVzEr-s4uB7M::www.mobilefish.com/images/developer/eclipse_logo_3.0.gif)
이미지출처 : www.mobilefish.com
EclipseRCP 마법사 사용하기(EclipseRCP Wizard)
When you use wizard, you and users probably will be happy. 
마법사를 이용하면 개발자 사용자 모두 편해 질 수 있습니다.
Wizard can have one ore more pages.
마법사는 하나 또는 여러개의 페이지를 가질 수 있습니다.
I wrote simple single page wizard code in this post.
이 포스트에는 간단하게 만들수 있는 단일 페이지 마법사 코드를 작성 해 봤습니다.
MyWizard.java
Code:
| public class MyWizard extends Wizard { | |
|   | |
|   MyWizardPage mainPage; | |
|    | |
|   public MyWizard() {     | |
|   } | |
|    | |
|     public void addPages() { | |
|           super.addPages(); | |
|           mainPage = new MyWizardPage(); | |
|       addPage(mainPage); | |
|       } | |
|      | |
|     public boolean performFinish() { | |
|       if(mainpage.isActionValid()) return true; | |
|       return false; | |
|     } | |
|   | |
|   public boolean performCancel() { | |
|     return true; | |
|   } | |
| } | 
MyWizardPage.java
Code:
| public class MyWizardPage  extends WizardPage { | |
|   | |
|    public MyWizardPage() { | |
|       super("pageName"); | |
|       setTitle("Title"); | |
|       setDescription("Description"); | |
| //    super(pageName,title,titleImage); | |
|    } | |
|   | |
|    public void createControl(Composite parent) { | |
|       // $begin code generated by SWT-Designer$ | |
|       Composite container = new Composite(parent, SWT.NULL); | |
|       final GridLayout gridLayout = new GridLayout(); | |
|       gridLayout.numColumns = 3; | |
|       container.setLayout(gridLayout); | |
|       setControl(container); | |
|       //add Components | |
|     //....     | |
|    } | |
|   | |
|    public void init(ISelection selection) { | |
|    if (!(selection instanceof IStructuredSelection)) return; | |
|    //init..  | |
|    } | |
|   | |
| } | 
by 月風
