1 16 package org.apache.axis.tool.codegen.eclipse.ui; 17 18 import org.apache.axis.tool.codegen.eclipse.CodeGenWizard; 19 import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin; 20 import org.eclipse.swt.SWT; 21 import org.eclipse.swt.events.SelectionAdapter; 22 import org.eclipse.swt.events.SelectionEvent; 23 import org.eclipse.swt.layout.GridData; 24 import org.eclipse.swt.layout.GridLayout; 25 import org.eclipse.swt.widgets.Button; 26 import org.eclipse.swt.widgets.Composite; 27 import org.eclipse.swt.widgets.Label; 28 29 35 public class ToolSelectionPage extends AbstractWizardPage { 36 37 private Button java2WSDLRadioButton; 38 private Button wsdl2JavaRadioButton; 39 public ToolSelectionPage() { 40 super("page0"); 41 42 } 43 44 47 protected void initializeDefaultSettings() { 48 settings.put(PREF_TOOL_SELECTION_JAVA2WSDL, false); 49 settings.put(PREF_TOOL_SELECTION_WSDL2JAVA, true); 50 } 51 52 55 public void createControl(Composite parent) { 56 57 Composite container = new Composite(parent, SWT.NULL); 58 GridLayout layout = new GridLayout(); 59 container.setLayout(layout); 60 layout.numColumns = 1; 61 layout.verticalSpacing = 9; 62 63 GridData gd = new GridData(GridData.FILL_HORIZONTAL); 64 65 Label label = new Label(container, SWT.NULL); 66 label.setText(CodegenWizardPlugin.getResourceString("page0.options.desc")); 67 68 wsdl2JavaRadioButton = new Button(container,SWT.RADIO); 69 wsdl2JavaRadioButton.setText(CodegenWizardPlugin.getResourceString("page0.wsdl2java.caption")); 70 wsdl2JavaRadioButton.setToolTipText(CodegenWizardPlugin.getResourceString("page0.wsdl2java.desc")); 71 wsdl2JavaRadioButton.setSelection(settings.getBoolean(PREF_TOOL_SELECTION_WSDL2JAVA)); 72 wsdl2JavaRadioButton.addSelectionListener(new SelectionAdapter(){ 73 public void widgetSelected(SelectionEvent e) 74 { 75 handleCheckboxSelection(); 76 } 77 }); 78 79 java2WSDLRadioButton = new Button(container,SWT.RADIO); 80 java2WSDLRadioButton.setText(CodegenWizardPlugin.getResourceString("page0.java2wsdl.caption")); 81 java2WSDLRadioButton.setToolTipText(CodegenWizardPlugin.getResourceString("page0.java2wsdl.desc")); 82 java2WSDLRadioButton.setSelection(settings.getBoolean(PREF_TOOL_SELECTION_JAVA2WSDL)); 83 java2WSDLRadioButton.addSelectionListener(new SelectionAdapter(){ 84 public void widgetSelected(SelectionEvent e) 85 { 86 handleCheckboxSelection(); 87 } 88 }); 89 90 handleCheckboxSelection(); 91 setControl(container); 92 93 } 94 95 private void handleCheckboxSelection(){ 96 CodeGenWizard wizard = (CodeGenWizard)this.getWizard(); 97 if (wsdl2JavaRadioButton.getSelection()){ 98 settings.put(PREF_TOOL_SELECTION_WSDL2JAVA,true); 99 settings.put(PREF_TOOL_SELECTION_JAVA2WSDL,false); 100 wizard.setSelectedWizardType(WSDL_2_JAVA_TYPE); 101 }else if (java2WSDLRadioButton.getSelection()){ 102 settings.put(PREF_TOOL_SELECTION_WSDL2JAVA,false); 103 settings.put(PREF_TOOL_SELECTION_JAVA2WSDL,true); 104 wizard.setSelectedWizardType(JAVA_2_WSDL_TYPE); 105 } 106 } 107 108 109 112 public int getPageType() { 113 return UNSPECIFIED_TYPE; 114 } 115 116 117 } 118 | Popular Tags |