1 16 package org.apache.axis.tool.service.eclipse.ui; 17 18 19 import org.apache.axis.tool.service.bean.WizardBean; 20 import org.apache.axis.tool.service.control.Controller; 21 import org.apache.axis.tool.service.control.ProcessException; 22 import org.apache.axis.tool.service.eclipse.plugin.ServiceArchiver; 23 import org.eclipse.jface.dialogs.MessageDialog; 24 import org.eclipse.jface.viewers.IStructuredSelection; 25 import org.eclipse.jface.wizard.IWizardPage; 26 import org.eclipse.jface.wizard.Wizard; 27 import org.eclipse.ui.INewWizard; 28 import org.eclipse.ui.IWorkbench; 29 30 31 37 public class ServiceArchiveWizard extends Wizard implements INewWizard { 38 39 private WizardPane1 wizardPane1; 40 private WizardPane2 wizardPane2; 41 private WizardPane3 wizardPane3; 42 private WizardPane4 wizardPane4; 43 44 45 48 public ServiceArchiveWizard() { 49 super(); 50 setWindowTitle(ServiceArchiver.getResourceString("main.title")); 51 } 52 53 54 55 56 59 public IWizardPage getNextPage(IWizardPage page) { 60 IWizardPage pageout = super.getNextPage(page); 61 if (page.equals(wizardPane2)){ 62 if (((WizardPane2)page).isSkipNextPage()){ 63 pageout = super.getNextPage(pageout); 64 } 65 } 66 return pageout; 67 } 68 69 72 public void addPages() { 73 wizardPane1 = new WizardPane1(); 74 this.addPage(wizardPane1); 75 wizardPane2 = new WizardPane2(); 76 this.addPage(wizardPane2); 77 wizardPane3 = new WizardPane3(); 78 this.addPage(wizardPane3); 79 wizardPane4 = new WizardPane4(); 80 this.addPage(wizardPane4); 81 } 82 85 public boolean performFinish() { 86 WizardBean wizBean = new WizardBean(); 88 wizBean.setPage1bean(wizardPane1.getBean()); 89 wizBean.setPage2bean(wizardPane2.getBean()); 90 wizBean.setPage3bean(wizardPane4.getBean()); 91 try { 92 new Controller().process(wizBean); 93 showSuccessMessage(" jar file creation successful! "); 94 return true; 95 } catch (ProcessException e) { 96 showErrorMessage(e.getMessage()); 97 return false; 98 } catch (Exception e) { 99 showErrorMessage("Unknown Error! " +e.getMessage() ); 100 return false; 101 } 102 103 104 105 } 106 107 108 111 public void init(IWorkbench workbench, IStructuredSelection selection) { 112 114 } 115 116 private void showErrorMessage(String message){ 117 MessageDialog.openError(this.getShell(),"Error",message); 118 } 119 120 private void showSuccessMessage(String message){ 121 MessageDialog.openInformation(this.getShell(),"Success",message); 122 } 123 } 124 | Popular Tags |