1 16 package org.apache.axis.tool.codegen.eclipse.ui; 17 18 import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin; 19 import org.apache.axis.tool.codegen.eclipse.util.SettingsConstants; 20 import org.eclipse.jface.dialogs.IDialogSettings; 21 import org.eclipse.jface.wizard.WizardPage; 22 23 public abstract class AbstractWizardPage extends WizardPage implements SettingsConstants { 24 25 protected IDialogSettings settings; 26 protected boolean restoredFromPreviousSettings = false; 27 28 public AbstractWizardPage(String pageName){ 29 super(pageName+".name"); 30 init(pageName); 31 } 32 33 protected void init(String pageName){ 34 setTitle(CodegenWizardPlugin.getResourceString(pageName+".title")); 35 setDescription(CodegenWizardPlugin.getResourceString(pageName+".desc")); 36 setImageDescriptor(CodegenWizardPlugin.getWizardImageDescriptor()); 37 38 42 IDialogSettings rootSettings = CodegenWizardPlugin.getDefault() 43 .getDialogSettings(); 44 IDialogSettings section = rootSettings.getSection(this.getClass() 45 .getName()); 46 if (section == null) { 47 settings = rootSettings.addNewSection(this.getClass().getName()); 48 restoredFromPreviousSettings = false; 49 initializeDefaultSettings(); 50 } else { 51 restoredFromPreviousSettings=true; 52 settings = section; 53 } 54 } 55 56 protected void updateStatus(String message) { 57 setErrorMessage(message); 58 setPageComplete(message == null); 59 } 60 61 protected abstract void initializeDefaultSettings(); 62 63 public abstract int getPageType() ; 64 } 65 | Popular Tags |