EclipseRCP 마법사 사용하기(EclipseRCP Wizard)[마법사,wizard,이클립스 RCP,eclipse RCP]

이미지출처 : 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


Tags : , , , , , ,

  • 재미있게 읽으셨나요?
    광고를 클릭해주시면,
    블로그 운영에 큰 도움이 됩니다!