Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 38299 invoked from network); 11 Jul 2005 15:54:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Jul 2005 15:54:38 -0000 Received: (qmail 64539 invoked by uid 500); 11 Jul 2005 15:53:38 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 64284 invoked by uid 500); 11 Jul 2005 15:53:20 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 63889 invoked by uid 99); 11 Jul 2005 15:53:15 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 11 Jul 2005 08:52:39 -0700 Received: (qmail 37302 invoked by uid 65534); 11 Jul 2005 15:52:32 -0000 Message-ID: <20050711155232.37301.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r210150 [20/35] - in /webservices/axis/trunk/java: ./ etc/ modules/addressing/ modules/addressing/src/org/apache/axis2/handlers/addressing/ modules/addressing/test-resources/ modules/addressing/test/org/apache/axis2/handlers/addressing/ mod... Date: Mon, 11 Jul 2005 15:49:55 -0000 To: axis-cvs@ws.apache.org From: gdaniels@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/AbstractWizardPage.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/AbstractWizardPage.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/AbstractWizardPage.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/AbstractWizardPage.java Mon Jul 11 08:49:30 2005 @@ -21,18 +21,18 @@ import org.eclipse.jface.wizard.WizardPage; public abstract class AbstractWizardPage extends WizardPage implements SettingsConstants { - + protected IDialogSettings settings; protected boolean restoredFromPreviousSettings = false; - - public AbstractWizardPage(String pageName){ - super(pageName+".name"); + + public AbstractWizardPage(String pageName) { + super(pageName + ".name"); init(pageName); } - - protected void init(String pageName){ - setTitle(CodegenWizardPlugin.getResourceString(pageName+".title")); - setDescription(CodegenWizardPlugin.getResourceString(pageName+".desc")); + + protected void init(String pageName) { + setTitle(CodegenWizardPlugin.getResourceString(pageName + ".title")); + setDescription(CodegenWizardPlugin.getResourceString(pageName + ".desc")); setImageDescriptor(CodegenWizardPlugin.getWizardImageDescriptor()); /* @@ -42,13 +42,13 @@ IDialogSettings rootSettings = CodegenWizardPlugin.getDefault() .getDialogSettings(); IDialogSettings section = rootSettings.getSection(this.getClass() - .getName()); + .getName()); if (section == null) { settings = rootSettings.addNewSection(this.getClass().getName()); restoredFromPreviousSettings = false; initializeDefaultSettings(); } else { - restoredFromPreviousSettings=true; + restoredFromPreviousSettings = true; settings = section; } } @@ -58,7 +58,7 @@ setPageComplete(message == null); } - protected abstract void initializeDefaultSettings(); - - public abstract int getPageType() ; + protected abstract void initializeDefaultSettings(); + + public abstract int getPageType(); } Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaSourceSelectionPage.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaSourceSelectionPage.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaSourceSelectionPage.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaSourceSelectionPage.java Mon Jul 11 08:49:30 2005 @@ -15,6 +15,13 @@ */ package org.apache.axis.tool.codegen.eclipse.ui; +import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.*; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.*; + import java.io.File; import java.lang.reflect.Method; import java.net.MalformedURLException; @@ -22,36 +29,18 @@ import java.net.URLClassLoader; import java.util.Vector; -import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.swt.widgets.Text; +public class JavaSourceSelectionPage extends AbstractWizardPage { -public class JavaSourceSelectionPage extends AbstractWizardPage{ - private Text javaClassFileLocationBox; private Text javaClassNameBox; private Button searchDeclaredMethodsCheckBox; - + private Table table; - + private boolean dirty; - public JavaSourceSelectionPage() { + public JavaSourceSelectionPage() { super("page4"); } @@ -85,44 +74,44 @@ Label label = new Label(container, SWT.NULL); label.setText(CodegenWizardPlugin - .getResourceString("page4.javafilelocation.label")); + .getResourceString("page4.javafilelocation.label")); javaClassFileLocationBox = new Text(container, SWT.BORDER); javaClassFileLocationBox.setLayoutData(gd); javaClassFileLocationBox.setText(settings.get(JAVA_CLASS_LOCATION_NAME)); - javaClassFileLocationBox.addModifyListener(new ModifyListener(){ - public void modifyText(ModifyEvent e){ - handleLocationTextChange(); + javaClassFileLocationBox.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + handleLocationTextChange(); } }); - + Button browseButton = new Button(container, SWT.PUSH); browseButton.setText(CodegenWizardPlugin - .getResourceString("general.browse")); + .getResourceString("general.browse")); browseButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { handleDirectoryBrowse(); } }); - + label = new Label(container, SWT.NULL); label.setText(CodegenWizardPlugin - .getResourceString("page4.classname.label")); - + .getResourceString("page4.classname.label")); + gd = new GridData(GridData.FILL_HORIZONTAL); - javaClassNameBox = new Text(container,SWT.BORDER); + javaClassNameBox = new Text(container, SWT.BORDER); javaClassNameBox.setLayoutData(gd); javaClassNameBox.setText(settings.get(JAVA_CLASS_NAME)); - javaClassNameBox.addModifyListener(new ModifyListener(){ - public void modifyText(ModifyEvent e){ + javaClassNameBox.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { handleClassNameTextChange(); - } - }); - + } + }); + Button searchButton = new Button(container, SWT.PUSH); searchButton.setText(CodegenWizardPlugin - .getResourceString("general.search")); + .getResourceString("general.search")); searchButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { updateTable(); @@ -131,49 +120,51 @@ //searchButton.setEnabled(false); gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 3; - - searchDeclaredMethodsCheckBox = new Button(container,SWT.CHECK); + + searchDeclaredMethodsCheckBox = new Button(container, SWT.CHECK); searchDeclaredMethodsCheckBox.setLayoutData(gd); searchDeclaredMethodsCheckBox.setText("List Declared Methods Only"); - searchDeclaredMethodsCheckBox.addSelectionListener(new SelectionListener(){ - public void widgetSelected(SelectionEvent e){ + searchDeclaredMethodsCheckBox.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { updateDirtyStatus(true);//dirty } - public void widgetDefaultSelected(SelectionEvent e){} + + public void widgetDefaultSelected(SelectionEvent e) { + } }); - + gd = new GridData(GridData.FILL_BOTH); - gd.horizontalSpan=3; - gd.verticalSpan=5; - table = new Table(container,SWT.SINGLE|SWT.FULL_SELECTION|SWT.CHECK); + gd.horizontalSpan = 3; + gd.verticalSpan = 5; + table = new Table(container, SWT.SINGLE | SWT.FULL_SELECTION | SWT.CHECK); table.setLinesVisible(true); - table.setHeaderVisible(true); + table.setHeaderVisible(true); table.setLayoutData(gd); - declareColumn(table,20,""); - declareColumn(table,100,"Method Name"); - declareColumn(table,100,"Return Type"); - declareColumn(table,100,"Parameter Count"); + declareColumn(table, 20, ""); + declareColumn(table, 100, "Method Name"); + declareColumn(table, 100, "Return Type"); + declareColumn(table, 100, "Parameter Count"); table.setVisible(false); - + setPageComplete(false); - - if (restoredFromPreviousSettings){ + + if (restoredFromPreviousSettings) { handleLocationTextChange(); handleClassNameTextChange(); } - + setControl(container); } - private void declareColumn(Table table, int width,String colName){ - TableColumn column = new TableColumn(table,SWT.NONE); + private void declareColumn(Table table, int width, String colName) { + TableColumn column = new TableColumn(table, SWT.NONE); column.setWidth(width); column.setText(colName); } + /** * Pops up the file browse dialog box - * */ private void handleDirectoryBrowse() { DirectoryDialog fileDialog = new DirectoryDialog(this.getShell()); @@ -183,62 +174,62 @@ } } - - private void handleLocationTextChange(){ + + private void handleLocationTextChange() { String locationText = javaClassFileLocationBox.getText(); - settings.put(JAVA_CLASS_LOCATION_NAME,locationText); - if (locationText==null || "".equals(locationText.trim())){ + settings.put(JAVA_CLASS_LOCATION_NAME, locationText); + if (locationText == null || "".equals(locationText.trim())) { updateStatus("Class file location needs to be specified!"); - }else{ + } else { updateStatus(null); } } - - private void handleClassNameTextChange(){ + + private void handleClassNameTextChange() { String className = javaClassNameBox.getText(); - settings.put(JAVA_CLASS_NAME,className); - if (className==null || "".equals(className.trim())){ + settings.put(JAVA_CLASS_NAME, className); + if (className == null || "".equals(className.trim())) { updateStatus("Fully qualified class name needs to be specified!"); - }else if(className.endsWith(".")){ + } else if (className.endsWith(".")) { updateStatus("Class name is not properly terminated!"); - }else{ + } else { updateStatus(null); } } - - public String getClassName(){ + + public String getClassName() { return javaClassNameBox.getText(); } - - public String getClassLocation(){ + + public String getClassLocation() { return javaClassFileLocationBox.getText(); } - - public Vector getSelectedMethods(){ + + public Vector getSelectedMethods() { Vector list = new Vector(); TableItem[] items = table.getItems(); int itemLength = items.length; - for(int i=0;i 0) { table.removeAll(); TableItem[] items = new TableItem[methodCount]; // An item for each field - for (int i = 0 ; i < methodCount; i++){ - items[i] = new TableItem(table, SWT.NONE); - items[i].setText(1,methods[i].getName()); - items[i].setText(2,methods[i].getReturnType().getName()); - items[i].setText(3,methods[i].getParameterTypes().length+""); - items[i].setChecked(true);//check them all by default + for (int i = 0; i < methodCount; i++) { + items[i] = new TableItem(table, SWT.NONE); + items[i].setText(1, methods[i].getName()); + items[i].setText(2, methods[i].getReturnType().getName()); + items[i].setText(3, methods[i].getParameterTypes().length + ""); + items[i].setChecked(true);//check them all by default } table.setVisible(true); //update the dirty variable - updateDirtyStatus(false); - updateStatus(null); + updateDirtyStatus(false); + updateStatus(null); } } catch (MalformedURLException e) { - updateStatus("Error : invalid location " +e.getMessage()); + updateStatus("Error : invalid location " + e.getMessage()); } catch (ClassNotFoundException e) { - updateStatus("Error : Class not found " + e.getMessage()); + updateStatus("Error : Class not found " + e.getMessage()); } } - - private void updateDirtyStatus(boolean status){ + + private void updateDirtyStatus(boolean status) { dirty = status; - if (table.isVisible()){ + if (table.isVisible()) { table.setEnabled(!status); } setPageComplete(!status); Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOptionsPage.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOptionsPage.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOptionsPage.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOptionsPage.java Mon Jul 11 08:49:30 2005 @@ -75,7 +75,7 @@ private Text bindingTextBox; private Combo modeSelectionCombo; - + private Combo styleSelectionCombo; @@ -87,12 +87,12 @@ * @see org.apache.axis.tool.codegen.eclipse.ui.AbstractWizardPage#initializeDefaultSettings() */ protected void initializeDefaultSettings() { - settings.put(PREF_JAVA_INPUT_WSDL_NAME,""); - settings.put(PREF_JAVA_LOCATION,"http://localhost:8080"); - settings.put(PREF_JAVA_BINDING_NAME,""); - settings.put(PREF_JAVA_PORTYPE_NAME,""); - settings.put(PREF_JAVA_MODE_INDEX,0); - settings.put(PREF_JAVA_STYLE_INDEX,0); + settings.put(PREF_JAVA_INPUT_WSDL_NAME, ""); + settings.put(PREF_JAVA_LOCATION, "http://localhost:8080"); + settings.put(PREF_JAVA_BINDING_NAME, ""); + settings.put(PREF_JAVA_PORTYPE_NAME, ""); + settings.put(PREF_JAVA_MODE_INDEX, 0); + settings.put(PREF_JAVA_STYLE_INDEX, 0); } /** @@ -127,7 +127,7 @@ GridData gd = new GridData(GridData.FILL_HORIZONTAL); Label label = new Label(container, SWT.NULL); label.setText(CodegenWizardPlugin - .getResourceString("page5.inputwsdl.label")); + .getResourceString("page5.inputwsdl.label")); inputWSDLNameTextBox = new Text(container, SWT.BORDER | SWT.SINGLE); inputWSDLNameTextBox.setLayoutData(gd); @@ -141,7 +141,7 @@ label = new Label(container, SWT.NULL); label.setText(CodegenWizardPlugin - .getResourceString("page5.servicelocation.label")); + .getResourceString("page5.servicelocation.label")); gd = new GridData(GridData.FILL_HORIZONTAL); serviceLocationURLTextBox = new Text(container, SWT.BORDER); @@ -153,10 +153,10 @@ //dialogChanged(); } }); - + label = new Label(container, SWT.NULL); label.setText(CodegenWizardPlugin - .getResourceString("page5.binding.label")); + .getResourceString("page5.binding.label")); gd = new GridData(GridData.FILL_HORIZONTAL); bindingTextBox = new Text(container, SWT.BORDER); @@ -168,10 +168,10 @@ //dialogChanged(); } }); - + label = new Label(container, SWT.NULL); label.setText(CodegenWizardPlugin - .getResourceString("page5.porttype.label")); + .getResourceString("page5.porttype.label")); gd = new GridData(GridData.FILL_HORIZONTAL); portTypeNameTextBox = new Text(container, SWT.BORDER); @@ -188,38 +188,42 @@ label = new Label(container, SWT.NULL); label .setText(CodegenWizardPlugin - .getResourceString("page5.mode.label")); + .getResourceString("page5.mode.label")); gd = new GridData(GridData.FILL_HORIZONTAL); modeSelectionCombo = new Combo(container, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY); modeSelectionCombo.setLayoutData(gd); - // modeSelectionCombo. + // modeSelectionCombo. populateModeCombo(); - modeSelectionCombo.addSelectionListener(new SelectionListener(){ - public void widgetSelected(SelectionEvent e){ - settings.put(PREF_JAVA_MODE_INDEX,modeSelectionCombo.getSelectionIndex()); + modeSelectionCombo.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + settings.put(PREF_JAVA_MODE_INDEX, modeSelectionCombo.getSelectionIndex()); + } + + public void widgetDefaultSelected(SelectionEvent e) { } - public void widgetDefaultSelected(SelectionEvent e){} }); // ##################################################### label = new Label(container, SWT.NULL); label .setText(CodegenWizardPlugin - .getResourceString("page5.style.label")); + .getResourceString("page5.style.label")); gd = new GridData(GridData.FILL_HORIZONTAL); styleSelectionCombo = new Combo(container, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY); styleSelectionCombo.setLayoutData(gd); populateStyleCombo(); - styleSelectionCombo.addSelectionListener(new SelectionListener(){ - public void widgetSelected(SelectionEvent e){ - settings.put(PREF_JAVA_STYLE_INDEX,styleSelectionCombo.getSelectionIndex()); + styleSelectionCombo.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + settings.put(PREF_JAVA_STYLE_INDEX, styleSelectionCombo.getSelectionIndex()); + } + + public void widgetDefaultSelected(SelectionEvent e) { } - public void widgetDefaultSelected(SelectionEvent e){} }); - - + + setControl(container); } @@ -239,24 +243,25 @@ styleSelectionCombo.select(settings.getInt(PREF_JAVA_STYLE_INDEX)); } - public int getMode(){ + + public int getMode() { String selectedOption = modeSelectionCombo.getItem(modeSelectionCombo.getSelectionIndex()); - if (WSDL_ALL.equals(selectedOption)){ + if (WSDL_ALL.equals(selectedOption)) { return Emitter.MODE_ALL; - }else if (WSDL_INTERFACE_ONLY.equals(selectedOption)){ + } else if (WSDL_INTERFACE_ONLY.equals(selectedOption)) { return Emitter.MODE_INTERFACE; - }else if (WSDL_IMPLEMENTATION_ONLY.equals(selectedOption)){ + } else if (WSDL_IMPLEMENTATION_ONLY.equals(selectedOption)) { return Emitter.MODE_IMPLEMENTATION; - }else{ + } else { throw new RuntimeException("Unknown Exception"); } } - - - public String getStyle(){ + + public String getStyle() { return this.styleSelectionCombo.getItem(styleSelectionCombo.getSelectionIndex()).toUpperCase(); } + public String getLocationURL() { return this.serviceLocationURLTextBox.getText(); } @@ -272,11 +277,10 @@ public String getBindingName() { return this.bindingTextBox.getText(); } - - private String getgetClassFileLocation(){ - return null; - } - - - + + private String getgetClassFileLocation() { + return null; + } + + } Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOutputLocationPage.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOutputLocationPage.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOutputLocationPage.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOutputLocationPage.java Mon Jul 11 08:49:30 2005 @@ -15,8 +15,6 @@ */ package org.apache.axis.tool.codegen.eclipse.ui; -import java.io.File; - import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; @@ -25,20 +23,18 @@ import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; +import org.eclipse.swt.widgets.*; + +import java.io.File; /** * @author Ajith - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates + *

+ * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates */ public class JavaWSDLOutputLocationPage extends AbstractWizardPage { - + private Text outputFolderTextBox; private Text outputFileNameTextBox; @@ -48,12 +44,13 @@ public JavaWSDLOutputLocationPage() { super("page6"); } + /* (non-Javadoc) * @see org.apache.axis.tool.codegen.eclipse.ui.AbstractWizardPage#initializeDefaultSettings() */ protected void initializeDefaultSettings() { - settings.put(PREF_JAVA_OUTPUT_WSDL_LOCATION,System.getProperty("user.dir")); - settings.put(JAVA_OUTPUT_WSDL_NAME,"service.wsdl"); + settings.put(PREF_JAVA_OUTPUT_WSDL_LOCATION, System.getProperty("user.dir")); + settings.put(JAVA_OUTPUT_WSDL_NAME, "service.wsdl"); } @@ -61,7 +58,7 @@ * @see org.apache.axis.tool.codegen.eclipse.ui.AbstractWizardPage#getPageType() */ public int getPageType() { - return JAVA_2_WSDL_TYPE; + return JAVA_2_WSDL_TYPE; } /* (non-Javadoc) @@ -77,73 +74,75 @@ GridData gd = new GridData(GridData.FILL_HORIZONTAL); Label label = new Label(container, SWT.NULL); label.setText(CodegenWizardPlugin - .getResourceString("page6.output.label")); + .getResourceString("page6.output.label")); - outputFolderTextBox = new Text(container,SWT.BORDER); + outputFolderTextBox = new Text(container, SWT.BORDER); outputFolderTextBox.setLayoutData(gd); outputFolderTextBox.setText(settings.get(PREF_JAVA_OUTPUT_WSDL_LOCATION)); - outputFolderTextBox.addModifyListener(new ModifyListener(){ - public void modifyText(ModifyEvent e){ + outputFolderTextBox.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { handleFolderTextChange(); } }); - - Button browseButton = new Button(container,SWT.PUSH); + + Button browseButton = new Button(container, SWT.PUSH); browseButton.setText(CodegenWizardPlugin - .getResourceString("general.browse")); - browseButton.addSelectionListener(new SelectionListener(){ - public void widgetSelected(SelectionEvent e){ - handleBrowse(); + .getResourceString("general.browse")); + browseButton.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + handleBrowse(); + } + + public void widgetDefaultSelected(SelectionEvent e) { } - public void widgetDefaultSelected(SelectionEvent e){} }); - + label = new Label(container, SWT.NULL); label.setText(CodegenWizardPlugin - .getResourceString("page6.outputname.label")); - + .getResourceString("page6.outputname.label")); + gd = new GridData(GridData.FILL_HORIZONTAL); - outputFileNameTextBox = new Text(container,SWT.BORDER); + outputFileNameTextBox = new Text(container, SWT.BORDER); outputFileNameTextBox.setLayoutData(gd); outputFileNameTextBox.setText(settings.get(JAVA_OUTPUT_WSDL_NAME)); - outputFileNameTextBox.addModifyListener(new ModifyListener(){ - public void modifyText(ModifyEvent e){ - handleFileNameTextChange(); + outputFileNameTextBox.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + handleFileNameTextChange(); } }); - - if(restoredFromPreviousSettings){ + + if (restoredFromPreviousSettings) { handleFolderTextChange(); handleFolderTextChange(); } - + setControl(container); } - - private void handleFolderTextChange(){ + + private void handleFolderTextChange() { String outputFolder = outputFolderTextBox.getText(); - settings.put(PREF_JAVA_OUTPUT_WSDL_LOCATION,outputFolder); - if ("".equals(outputFolder.trim())){ + settings.put(PREF_JAVA_OUTPUT_WSDL_LOCATION, outputFolder); + if ("".equals(outputFolder.trim())) { updateStatus("Input a proper location for the output"); - }else{ + } else { updateStatus(null); } } - - private void handleFileNameTextChange(){ - String outFileName = outputFileNameTextBox .getText(); - settings.put(JAVA_OUTPUT_WSDL_NAME,outFileName); - if ("".equals(outFileName.trim())){ + + private void handleFileNameTextChange() { + String outFileName = outputFileNameTextBox.getText(); + settings.put(JAVA_OUTPUT_WSDL_NAME, outFileName); + if ("".equals(outFileName.trim())) { updateStatus("Input a file name"); - }else if (outFileName.matches("\\W")){ + } else if (outFileName.matches("\\W")) { updateStatus("Input a valid file name"); - }else{ - updateStatus(null); + } else { + updateStatus(null); } } - - private void handleBrowse(){ + + private void handleBrowse() { DirectoryDialog fileDialog = new DirectoryDialog(this.getShell()); String dirName = fileDialog.open(); if (dirName != null) { @@ -151,21 +150,21 @@ } } - - public String getFullFileName(){ - String folder =this.outputFolderTextBox.getText(); + + public String getFullFileName() { + String folder = this.outputFolderTextBox.getText(); String fileName = this.outputFileNameTextBox.getText(); - if (!fileName.endsWith(".wsdl")){ + if (!fileName.endsWith(".wsdl")) { fileName = fileName + ".wsdl"; } - return folder + File.separator +fileName; + return folder + File.separator + fileName; } - - public String getOutputWSDLName(){ + + public String getOutputWSDLName() { return this.outputFileNameTextBox.getText(); } - - public String getOutputLocation(){ + + public String getOutputLocation() { return this.outputFolderTextBox.getText(); } Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OptionsPage.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OptionsPage.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OptionsPage.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OptionsPage.java Mon Jul 11 08:49:30 2005 @@ -23,367 +23,317 @@ import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; +import org.eclipse.swt.widgets.*; /** * Options Page lets the user change general settings on the code generation. It is used in the CodegenWizardPlugin, * CodeGenWizard. - * */ -public class OptionsPage extends AbstractWizardPage implements UIConstants -{ - - /** - * Selection list for target languages - */ - private Combo languageSelectionComboBox; - - /** - * A radio button to enable/disable code generation for synchronous and asynchronous calls. - */ - private Button syncAndAsyncRadioButton; - - /** - * A radio button to choose "synchronous only" code generation - */ - private Button syncOnlyRadioButton; - - /** - * A radio button to choose "asynchronous only" code generation - */ - private Button asyncOnlyRadioButton; - - /** - * Label holding the full qualified package name for generated code - */ - private Text packageText; - - /** - * Checkbox to enable server-side skeleton code generation. If enabled, generates an empty implementation of the - * service - */ - private Button serverSideCheckBoxButton; - - /** - * Checkbox to enable the generation of test case classes for the generated implementation of the webservice. - */ - private Button testCaseCheckBoxButton; - - /** - * Checkbox to enable the generation of a default server.xml configuration file - */ - private Button serverXMLCheckBoxButton; - - - /** - * Creates the page and initialize some settings - */ - public OptionsPage() - { - super("page2"); - - } - - /** - * Sets the default values for the Options page - * - * @param settings2 the settings store to save the values to - */ - protected void initializeDefaultSettings() - { - settings.put(PREF_CHECK_GENERATE_SERVERCONFIG, false); - settings.put(PREF_CHECK_GENERATE_SERVERSIDE, false); - settings.put(PREF_CHECK_GENERATE_TESTCASE, false); - settings.put(PREF_LANGUAGE_INDEX, 0); - settings.put(PREF_PACKAGE_NAME, "org.example.webservice"); - settings.put(PREF_RADIO_ASYNC_ONLY, false); - settings.put(PREF_RADIO_SYNC_AND_ASYNC, true); - settings.put(PREF_RADIO_SYNC_ONLY, false); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) - { - - Composite container = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 3; - layout.verticalSpacing = 9; - - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 2; - - Label label = new Label(container, SWT.NULL); - label.setText(CodegenWizardPlugin.getResourceString("page2.language.caption")); - - languageSelectionComboBox = new Combo(container, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY); - // fill the combo - this.fillLanguageCombo(); - languageSelectionComboBox.setLayoutData(gd); - languageSelectionComboBox.select(settings.getInt(PREF_LANGUAGE_INDEX)); - languageSelectionComboBox.addSelectionListener(new SelectionListener() - { - public void widgetSelected(SelectionEvent e) - { - settings.put(PREF_LANGUAGE_INDEX, languageSelectionComboBox.getSelectionIndex()); - } - - public void widgetDefaultSelected(SelectionEvent e) - { - } - }); - - syncAndAsyncRadioButton = new Button(container, SWT.RADIO); - syncAndAsyncRadioButton.setText(CodegenWizardPlugin.getResourceString("page2.syncAsync.caption")); - syncAndAsyncRadioButton.setSelection(settings.getBoolean(PREF_RADIO_SYNC_AND_ASYNC)); - syncAndAsyncRadioButton.addSelectionListener(new SelectionListener() - { - public void widgetSelected(SelectionEvent e) - { - settings.put(PREF_RADIO_SYNC_AND_ASYNC, syncAndAsyncRadioButton.getSelection()); - } - - public void widgetDefaultSelected(SelectionEvent e) - { - } - }); - - syncOnlyRadioButton = new Button(container, SWT.RADIO); - syncOnlyRadioButton.setText(CodegenWizardPlugin.getResourceString("page2.sync.caption")); - syncOnlyRadioButton.setSelection(settings.getBoolean(PREF_RADIO_SYNC_ONLY)); - syncOnlyRadioButton.addSelectionListener(new SelectionListener() - { - public void widgetSelected(SelectionEvent e) - { - settings.put(PREF_RADIO_SYNC_ONLY, syncOnlyRadioButton.getSelection()); - } - - public void widgetDefaultSelected(SelectionEvent e) - { - } - }); - - asyncOnlyRadioButton = new Button(container, SWT.RADIO); - asyncOnlyRadioButton.setText(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin - .getResourceString("page2.async.caption")); - asyncOnlyRadioButton.setSelection(settings.getBoolean(PREF_RADIO_ASYNC_ONLY)); - asyncOnlyRadioButton.addSelectionListener(new SelectionListener() - { - public void widgetSelected(SelectionEvent e) - { - settings.put(PREF_RADIO_ASYNC_ONLY, asyncOnlyRadioButton.getSelection()); - } - - public void widgetDefaultSelected(SelectionEvent e) - { - } - }); - - label = new Label(container, SWT.NULL); - label.setText(CodegenWizardPlugin.getResourceString("page2.package.caption")); - - packageText = new Text(container, SWT.BORDER); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 2; - - packageText.setLayoutData(gd); - String packageName; - String storedPackageName = settings.get(PREF_PACKAGE_NAME); - if (storedPackageName.equals("")) - { - packageName = URLProcessor.getNameSpaceFromURL(""); - } - else - { - packageName = storedPackageName; - } - packageText.setText(packageName); // get this text from the URLProcessor - packageText.addModifyListener(new ModifyListener() - { - public void modifyText(ModifyEvent e) - { - settings.put(PREF_PACKAGE_NAME, packageText.getText()); - } - }); - - - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 3; - testCaseCheckBoxButton = new Button(container, SWT.CHECK); - testCaseCheckBoxButton.setLayoutData(gd); - testCaseCheckBoxButton.setText(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin - .getResourceString("page2.testcase.caption")); - testCaseCheckBoxButton.setSelection(settings.getBoolean(PREF_CHECK_GENERATE_TESTCASE)); - testCaseCheckBoxButton.addSelectionListener(new SelectionListener() - { - public void widgetSelected(SelectionEvent e) - { - settings.put(PREF_CHECK_GENERATE_TESTCASE, testCaseCheckBoxButton.getEnabled()); - } - - public void widgetDefaultSelected(SelectionEvent e) - { - } - }); - - serverSideCheckBoxButton = new Button(container, SWT.CHECK); - serverSideCheckBoxButton.setText(CodegenWizardPlugin.getResourceString("page2.serverside.caption")); - serverSideCheckBoxButton.setSelection(settings.getBoolean(PREF_CHECK_GENERATE_SERVERSIDE)); - serverSideCheckBoxButton.addSelectionListener(new SelectionListener() - { - public void widgetSelected(SelectionEvent e) - { - handleServersideSelection(); - settings.put(PREF_CHECK_GENERATE_SERVERSIDE, serverSideCheckBoxButton.getEnabled()); - } - - public void widgetDefaultSelected(SelectionEvent e) - { - } - }); - - serverXMLCheckBoxButton = new Button(container, SWT.CHECK); - serverXMLCheckBoxButton.setSelection(settings.getBoolean(PREF_CHECK_GENERATE_SERVERCONFIG)); - serverXMLCheckBoxButton.setText(CodegenWizardPlugin.getResourceString("page2.serviceXML.caption")); - serverXMLCheckBoxButton.addSelectionListener(new SelectionListener() - { - public void widgetSelected(SelectionEvent e) - { - settings.put(PREF_CHECK_GENERATE_SERVERCONFIG, serverXMLCheckBoxButton.getEnabled()); - } - - public void widgetDefaultSelected(SelectionEvent e) - { - } - }); - - /* - * Check the state of server-side selection, so we can enable/disable - * the serverXML checkbox button. - */ - handleServersideSelection(); - - - setControl(container); - setPageComplete(true); - - } - - /** - * Fill the combo with proper language names - * - */ - private void fillLanguageCombo() - { - - languageSelectionComboBox.add(JAVA); - languageSelectionComboBox.add(C_SHARP); - languageSelectionComboBox.add(C_PLUS_PLUS); - - languageSelectionComboBox.select(0); - } - - /** - * Validates the status of the server-side checkbox, and enables/disables - * the generation checkbox for XML configuration file - */ - private void handleServersideSelection() - { - if (this.serverSideCheckBoxButton.getSelection()) - { - this.serverXMLCheckBoxButton.setEnabled(true); - } - else - { - this.serverXMLCheckBoxButton.setEnabled(false); - } - } - - /** - * Get the selected language - * - * @return a string containing the name of the target language - */ - public String getSelectedLanguage() - { - return languageSelectionComboBox.getItem(languageSelectionComboBox.getSelectionIndex()); - } - - /** - * the async only status - * - * @return true if "Generate asynchronous code only" is checked - */ - public boolean isAsyncOnlyOn() - { - return asyncOnlyRadioButton.getSelection(); - } - - /** - * the sync only status - * - * @return true if "Generate synchronous code only" is checked - */ - public boolean isSyncOnlyOn() - { - return syncOnlyRadioButton.getSelection(); - } - - /** - * return the package name - * - * @return a string containing the package name to use for code generation - */ - public String getPackageName() - { - return this.packageText.getText(); - } - - /** - * The serverside status - * - * @return true if "Generate Server-Side" is checked - */ - public boolean isServerside() - { - return this.serverSideCheckBoxButton.getSelection(); - } - - /** - * - * @return true if "Generate XML configuration file" is checked - */ - public boolean isServerXML() - { - if (this.serverXMLCheckBoxButton.isEnabled()) - return this.serverXMLCheckBoxButton.getSelection(); - else - return false; - } - - /** - * - * @return true if "Generate test case" is checked - */ - public boolean isGenerateTestCase() - { - return this.testCaseCheckBoxButton.getSelection(); - } - - +public class OptionsPage extends AbstractWizardPage implements UIConstants { + + /** + * Selection list for target languages + */ + private Combo languageSelectionComboBox; + + /** + * A radio button to enable/disable code generation for synchronous and asynchronous calls. + */ + private Button syncAndAsyncRadioButton; + + /** + * A radio button to choose "synchronous only" code generation + */ + private Button syncOnlyRadioButton; + + /** + * A radio button to choose "asynchronous only" code generation + */ + private Button asyncOnlyRadioButton; + + /** + * Label holding the full qualified package name for generated code + */ + private Text packageText; + + /** + * Checkbox to enable server-side skeleton code generation. If enabled, generates an empty implementation of the + * service + */ + private Button serverSideCheckBoxButton; + + /** + * Checkbox to enable the generation of test case classes for the generated implementation of the webservice. + */ + private Button testCaseCheckBoxButton; + + /** + * Checkbox to enable the generation of a default server.xml configuration file + */ + private Button serverXMLCheckBoxButton; + + + /** + * Creates the page and initialize some settings + */ + public OptionsPage() { + super("page2"); + + } + + /** + * Sets the default values for the Options page + * + * @param settings2 the settings store to save the values to + */ + protected void initializeDefaultSettings() { + settings.put(PREF_CHECK_GENERATE_SERVERCONFIG, false); + settings.put(PREF_CHECK_GENERATE_SERVERSIDE, false); + settings.put(PREF_CHECK_GENERATE_TESTCASE, false); + settings.put(PREF_LANGUAGE_INDEX, 0); + settings.put(PREF_PACKAGE_NAME, "org.example.webservice"); + settings.put(PREF_RADIO_ASYNC_ONLY, false); + settings.put(PREF_RADIO_SYNC_AND_ASYNC, true); + settings.put(PREF_RADIO_SYNC_ONLY, false); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) + */ + public void createControl(Composite parent) { + + Composite container = new Composite(parent, SWT.NULL); + GridLayout layout = new GridLayout(); + container.setLayout(layout); + layout.numColumns = 3; + layout.verticalSpacing = 9; + + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.horizontalSpan = 2; + + Label label = new Label(container, SWT.NULL); + label.setText(CodegenWizardPlugin.getResourceString("page2.language.caption")); + + languageSelectionComboBox = new Combo(container, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY); + // fill the combo + this.fillLanguageCombo(); + languageSelectionComboBox.setLayoutData(gd); + languageSelectionComboBox.select(settings.getInt(PREF_LANGUAGE_INDEX)); + languageSelectionComboBox.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + settings.put(PREF_LANGUAGE_INDEX, languageSelectionComboBox.getSelectionIndex()); + } + + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + syncAndAsyncRadioButton = new Button(container, SWT.RADIO); + syncAndAsyncRadioButton.setText(CodegenWizardPlugin.getResourceString("page2.syncAsync.caption")); + syncAndAsyncRadioButton.setSelection(settings.getBoolean(PREF_RADIO_SYNC_AND_ASYNC)); + syncAndAsyncRadioButton.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + settings.put(PREF_RADIO_SYNC_AND_ASYNC, syncAndAsyncRadioButton.getSelection()); + } + + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + syncOnlyRadioButton = new Button(container, SWT.RADIO); + syncOnlyRadioButton.setText(CodegenWizardPlugin.getResourceString("page2.sync.caption")); + syncOnlyRadioButton.setSelection(settings.getBoolean(PREF_RADIO_SYNC_ONLY)); + syncOnlyRadioButton.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + settings.put(PREF_RADIO_SYNC_ONLY, syncOnlyRadioButton.getSelection()); + } + + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + asyncOnlyRadioButton = new Button(container, SWT.RADIO); + asyncOnlyRadioButton.setText(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin + .getResourceString("page2.async.caption")); + asyncOnlyRadioButton.setSelection(settings.getBoolean(PREF_RADIO_ASYNC_ONLY)); + asyncOnlyRadioButton.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + settings.put(PREF_RADIO_ASYNC_ONLY, asyncOnlyRadioButton.getSelection()); + } + + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + label = new Label(container, SWT.NULL); + label.setText(CodegenWizardPlugin.getResourceString("page2.package.caption")); + + packageText = new Text(container, SWT.BORDER); + gd = new GridData(GridData.FILL_HORIZONTAL); + gd.horizontalSpan = 2; + + packageText.setLayoutData(gd); + String packageName; + String storedPackageName = settings.get(PREF_PACKAGE_NAME); + if (storedPackageName.equals("")) { + packageName = URLProcessor.getNameSpaceFromURL(""); + } else { + packageName = storedPackageName; + } + packageText.setText(packageName); // get this text from the URLProcessor + packageText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + settings.put(PREF_PACKAGE_NAME, packageText.getText()); + } + }); + + + gd = new GridData(GridData.FILL_HORIZONTAL); + gd.horizontalSpan = 3; + testCaseCheckBoxButton = new Button(container, SWT.CHECK); + testCaseCheckBoxButton.setLayoutData(gd); + testCaseCheckBoxButton.setText(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin + .getResourceString("page2.testcase.caption")); + testCaseCheckBoxButton.setSelection(settings.getBoolean(PREF_CHECK_GENERATE_TESTCASE)); + testCaseCheckBoxButton.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + settings.put(PREF_CHECK_GENERATE_TESTCASE, testCaseCheckBoxButton.getEnabled()); + } + + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + serverSideCheckBoxButton = new Button(container, SWT.CHECK); + serverSideCheckBoxButton.setText(CodegenWizardPlugin.getResourceString("page2.serverside.caption")); + serverSideCheckBoxButton.setSelection(settings.getBoolean(PREF_CHECK_GENERATE_SERVERSIDE)); + serverSideCheckBoxButton.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + handleServersideSelection(); + settings.put(PREF_CHECK_GENERATE_SERVERSIDE, serverSideCheckBoxButton.getEnabled()); + } + + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + serverXMLCheckBoxButton = new Button(container, SWT.CHECK); + serverXMLCheckBoxButton.setSelection(settings.getBoolean(PREF_CHECK_GENERATE_SERVERCONFIG)); + serverXMLCheckBoxButton.setText(CodegenWizardPlugin.getResourceString("page2.serviceXML.caption")); + serverXMLCheckBoxButton.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + settings.put(PREF_CHECK_GENERATE_SERVERCONFIG, serverXMLCheckBoxButton.getEnabled()); + } + + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + /* + * Check the state of server-side selection, so we can enable/disable + * the serverXML checkbox button. + */ + handleServersideSelection(); + + + setControl(container); + setPageComplete(true); + + } + + /** + * Fill the combo with proper language names + */ + private void fillLanguageCombo() { + + languageSelectionComboBox.add(JAVA); + languageSelectionComboBox.add(C_SHARP); + languageSelectionComboBox.add(C_PLUS_PLUS); + + languageSelectionComboBox.select(0); + } + + /** + * Validates the status of the server-side checkbox, and enables/disables + * the generation checkbox for XML configuration file + */ + private void handleServersideSelection() { + if (this.serverSideCheckBoxButton.getSelection()) { + this.serverXMLCheckBoxButton.setEnabled(true); + } else { + this.serverXMLCheckBoxButton.setEnabled(false); + } + } + + /** + * Get the selected language + * + * @return a string containing the name of the target language + */ + public String getSelectedLanguage() { + return languageSelectionComboBox.getItem(languageSelectionComboBox.getSelectionIndex()); + } + + /** + * the async only status + * + * @return true if "Generate asynchronous code only" is checked + */ + public boolean isAsyncOnlyOn() { + return asyncOnlyRadioButton.getSelection(); + } + + /** + * the sync only status + * + * @return true if "Generate synchronous code only" is checked + */ + public boolean isSyncOnlyOn() { + return syncOnlyRadioButton.getSelection(); + } + + /** + * return the package name + * + * @return a string containing the package name to use for code generation + */ + public String getPackageName() { + return this.packageText.getText(); + } + + /** + * The serverside status + * + * @return true if "Generate Server-Side" is checked + */ + public boolean isServerside() { + return this.serverSideCheckBoxButton.getSelection(); + } + + /** + * @return true if "Generate XML configuration file" is checked + */ + public boolean isServerXML() { + if (this.serverXMLCheckBoxButton.isEnabled()) + return this.serverXMLCheckBoxButton.getSelection(); + else + return false; + } + + /** + * @return true if "Generate test case" is checked + */ + public boolean isGenerateTestCase() { + return this.testCaseCheckBoxButton.getSelection(); + } + + /* (non-Javadoc) * @see org.apache.axis.tool.codegen.eclipse.ui.CodegenPage#getPageType() */ public int getPageType() { - return WSDL_2_JAVA_TYPE; + return WSDL_2_JAVA_TYPE; } } Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OutputPage.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OutputPage.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OutputPage.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OutputPage.java Mon Jul 11 08:49:30 2005 @@ -25,22 +25,18 @@ import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; +import org.eclipse.swt.widgets.*; import org.eclipse.ui.dialogs.ContainerSelectionDialog; public class OutputPage extends AbstractWizardPage { - + private Text outputLocation; private Button browseButton; private Button locationSelectCheckBox; - + /** * */ @@ -72,7 +68,7 @@ Label label = new Label(container, SWT.NULL); label .setText(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin - .getResourceString("page3.output.caption")); + .getResourceString("page3.output.caption")); outputLocation = new Text(container, SWT.BORDER); outputLocation.setLayoutData(gd); @@ -87,7 +83,7 @@ browseButton = new Button(container, SWT.PUSH); browseButton .setText(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin - .getResourceString("page3.outselection.browse")); + .getResourceString("page3.outselection.browse")); browseButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { handleBrowse(); @@ -102,8 +98,8 @@ /* * Update the buttons, in case this was restored from an earlier setting */ - if (restoredFromPreviousSettings){ - handleModifyEvent(); + if (restoredFromPreviousSettings) { + handleModifyEvent(); } } @@ -118,23 +114,21 @@ /** * Worker method for handling modifications to the textbox - * */ private void handleModifyEvent() { String text = this.outputLocation.getText(); if ((text == null) || (text.trim().equals(""))) { updateStatus(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin - .getResourceString("page3.error.nolocation")); + .getResourceString("page3.error.nolocation")); return; } updateStatus(null); } - + /** * Handle the browse button events: opens a dialog where the user can choose * an external directory location - * */ private void handleBrowse() { boolean location = false;// locationSelectCheckBox.getSelection(); @@ -145,12 +139,11 @@ outputLocation.setText(returnString); } } else { - ContainerSelectionDialog dialog = new ContainerSelectionDialog( - getShell(), - ResourcesPlugin.getWorkspace().getRoot(), - false, - org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin - .getResourceString("page3.containerbox.title")); + ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), + ResourcesPlugin.getWorkspace().getRoot(), + false, + org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin + .getResourceString("page3.containerbox.title")); if (dialog.open() == ContainerSelectionDialog.OK) { Object[] result = dialog.getResult(); if (result.length == 1) { Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/ToolSelectionPage.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/ToolSelectionPage.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/ToolSelectionPage.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/ToolSelectionPage.java Mon Jul 11 08:49:30 2005 @@ -28,19 +28,20 @@ /** * @author Ajith - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates + *

+ * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates */ public class ToolSelectionPage extends AbstractWizardPage { - + private Button java2WSDLRadioButton; private Button wsdl2JavaRadioButton; + public ToolSelectionPage() { super("page0"); - + } - + /** * Creates a default value for the settings on this page */ @@ -52,8 +53,8 @@ /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ -public void createControl(Composite parent) { - + public void createControl(Composite parent) { + Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); container.setLayout(layout); @@ -61,57 +62,55 @@ layout.verticalSpacing = 9; GridData gd = new GridData(GridData.FILL_HORIZONTAL); - + Label label = new Label(container, SWT.NULL); label.setText(CodegenWizardPlugin.getResourceString("page0.options.desc")); - - wsdl2JavaRadioButton = new Button(container,SWT.RADIO); + + wsdl2JavaRadioButton = new Button(container, SWT.RADIO); wsdl2JavaRadioButton.setText(CodegenWizardPlugin.getResourceString("page0.wsdl2java.caption")); wsdl2JavaRadioButton.setToolTipText(CodegenWizardPlugin.getResourceString("page0.wsdl2java.desc")); wsdl2JavaRadioButton.setSelection(settings.getBoolean(PREF_TOOL_SELECTION_WSDL2JAVA)); - wsdl2JavaRadioButton.addSelectionListener(new SelectionAdapter(){ - public void widgetSelected(SelectionEvent e) - { - handleCheckboxSelection(); - } + wsdl2JavaRadioButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleCheckboxSelection(); + } }); - - java2WSDLRadioButton = new Button(container,SWT.RADIO); + + java2WSDLRadioButton = new Button(container, SWT.RADIO); java2WSDLRadioButton.setText(CodegenWizardPlugin.getResourceString("page0.java2wsdl.caption")); java2WSDLRadioButton.setToolTipText(CodegenWizardPlugin.getResourceString("page0.java2wsdl.desc")); java2WSDLRadioButton.setSelection(settings.getBoolean(PREF_TOOL_SELECTION_JAVA2WSDL)); - java2WSDLRadioButton.addSelectionListener(new SelectionAdapter(){ - public void widgetSelected(SelectionEvent e) - { - handleCheckboxSelection(); - } + java2WSDLRadioButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleCheckboxSelection(); + } }); - + handleCheckboxSelection(); setControl(container); } - private void handleCheckboxSelection(){ - CodeGenWizard wizard = (CodeGenWizard)this.getWizard(); - if (wsdl2JavaRadioButton.getSelection()){ - settings.put(PREF_TOOL_SELECTION_WSDL2JAVA,true); - settings.put(PREF_TOOL_SELECTION_JAVA2WSDL,false); - wizard.setSelectedWizardType(WSDL_2_JAVA_TYPE); - }else if (java2WSDLRadioButton.getSelection()){ - settings.put(PREF_TOOL_SELECTION_WSDL2JAVA,false); - settings.put(PREF_TOOL_SELECTION_JAVA2WSDL,true); - wizard.setSelectedWizardType(JAVA_2_WSDL_TYPE); - } - } - - + private void handleCheckboxSelection() { + CodeGenWizard wizard = (CodeGenWizard) this.getWizard(); + if (wsdl2JavaRadioButton.getSelection()) { + settings.put(PREF_TOOL_SELECTION_WSDL2JAVA, true); + settings.put(PREF_TOOL_SELECTION_JAVA2WSDL, false); + wizard.setSelectedWizardType(WSDL_2_JAVA_TYPE); + } else if (java2WSDLRadioButton.getSelection()) { + settings.put(PREF_TOOL_SELECTION_WSDL2JAVA, false); + settings.put(PREF_TOOL_SELECTION_JAVA2WSDL, true); + wizard.setSelectedWizardType(JAVA_2_WSDL_TYPE); + } + } + + /* (non-Javadoc) * @see org.apache.axis.tool.codegen.eclipse.ui.CodegenPage#getPageType() */ public int getPageType() { - return UNSPECIFIED_TYPE; + return UNSPECIFIED_TYPE; } - - + + } Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java Mon Jul 11 08:49:30 2005 @@ -10,11 +10,7 @@ import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; +import org.eclipse.swt.widgets.*; /** * The first page of the code generator wizrad. Asks for the WSDL file Name @@ -26,14 +22,13 @@ private ISelection selection; - + /** - * * @param pageName */ public WSDLFileSelectionPage() { super("page1"); - + } @@ -59,7 +54,7 @@ GridData gd = new GridData(GridData.FILL_HORIZONTAL); Label label = new Label(container, SWT.NULL); label.setText(CodegenWizardPlugin - .getResourceString("page1.fileselection.label")); + .getResourceString("page1.fileselection.label")); fileText = new Text(container, SWT.BORDER | SWT.SINGLE); fileText.setLayoutData(gd); @@ -73,13 +68,13 @@ Button button = new Button(container, SWT.PUSH); button.setText(CodegenWizardPlugin - .getResourceString("page1.fileselection.browse")); + .getResourceString("page1.fileselection.browse")); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { handleBrowse(); } }); - + setPageComplete(false); setControl(container); @@ -87,7 +82,7 @@ * Validate this dialog, because we could have got valid values from the * settings already. */ - if (restoredFromPreviousSettings){ + if (restoredFromPreviousSettings) { dialogChanged(); } } @@ -101,13 +96,13 @@ if (fileName.length() == 0) { updateStatus(CodegenWizardPlugin - .getResourceString("page1.error.filemissingerror")); + .getResourceString("page1.error.filemissingerror")); return; } if (!fileName.matches(".*\\.wsdl")) { updateStatus(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin - .getResourceString("page1.error.wrongextension")); + .getResourceString("page1.error.wrongextension")); return; } @@ -117,11 +112,10 @@ /** * Pops up the file browse dialog box - * */ private void handleBrowse() { FileDialog fileDialog = new FileDialog(this.getShell()); - fileDialog.setFilterExtensions(new String[] { "*.wsdl" }); + fileDialog.setFilterExtensions(new String[]{"*.wsdl"}); String fileName = fileDialog.open(); if (fileName != null) { fileText.setText(fileName); @@ -129,10 +123,10 @@ } - + /** * Get the file name - * + * * @return */ public String getFileName() { Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/SettingsConstants.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/SettingsConstants.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/SettingsConstants.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/SettingsConstants.java Mon Jul 11 08:49:30 2005 @@ -35,7 +35,6 @@ // Output selection page /** * The key to store the output location in the settings - * */ static final String PREF_OUTPUT_LOCATION = "PREF_OUTPUT_LOCATION"; @@ -85,36 +84,36 @@ static final String JAVA_CLASS_NAME = "JAVA_CLASS_NAME"; static final String JAVA_CLASS_LOCATION_NAME = "JAVA_CLASS_LOCATION_NAME"; - + // ################################################################################## // Java2wsdl options selection page static final String PREF_JAVA_INPUT_WSDL_NAME = "INPUT_WSDL"; - + static final String PREF_JAVA_LOCATION = "LOCATION_URL"; static final String PREF_JAVA_BINDING_NAME = "BINDING_NAME"; static final String PREF_JAVA_MODE_INDEX = "MODE_INDEX"; static final String PREF_JAVA_STYLE_INDEX = "STYLE_INDEX"; static final String PREF_JAVA_PORTYPE_NAME = "PORTYPE_NAME"; - + // ################################################################################## //output page static final String JAVA_OUTPUT_WSDL_NAME = "OUTPUT_WSDL"; static final String PREF_JAVA_OUTPUT_WSDL_LOCATION = "OUTPUT_WSDL_LOCATION"; // ################################################################################## // Page constants - static final int WSDL_2_JAVA_TYPE = 1; - static final int JAVA_2_WSDL_TYPE = 2; - static final int UNSPECIFIED_TYPE = 3; - + static final int WSDL_2_JAVA_TYPE = 1; + static final int JAVA_2_WSDL_TYPE = 2; + static final int UNSPECIFIED_TYPE = 3; + // ################################################################################## // WSDL Mode constants - static final String WSDL_ALL = "All"; - static final String WSDL_INTERFACE_ONLY = "Interface only"; - static final String WSDL_IMPLEMENTATION_ONLY = "Implementation only"; - - // ########################################################### - static final String WSDL_STYLE_DOCUMENT="Document"; - static final String WSDL_STYLE_RPC="rpc"; - static final String WSDL_STYLE_WRAPPED="wrapped"; - + static final String WSDL_ALL = "All"; + static final String WSDL_INTERFACE_ONLY = "Interface only"; + static final String WSDL_IMPLEMENTATION_ONLY = "Implementation only"; + + // ########################################################### + static final String WSDL_STYLE_DOCUMENT = "Document"; + static final String WSDL_STYLE_RPC = "rpc"; + static final String WSDL_STYLE_WRAPPED = "wrapped"; + } Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/UIConstants.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/UIConstants.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/UIConstants.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/UIConstants.java Mon Jul 11 08:49:30 2005 @@ -16,8 +16,8 @@ package org.apache.axis.tool.codegen.eclipse.util; public interface UIConstants { - public static final String JAVA = "Java" ; - public static final String C_SHARP = "C#" ; - public static final String C_PLUS_PLUS = "C++" ; + public static final String JAVA = "Java"; + public static final String C_SHARP = "C#"; + public static final String C_PLUS_PLUS = "C++"; } Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/ClassFileHandler.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/ClassFileHandler.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/ClassFileHandler.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/ClassFileHandler.java Mon Jul 11 08:49:30 2005 @@ -1,5 +1,7 @@ package org.apache.axis.tool.core; +import sun.misc.URLClassPath; + import java.io.File; import java.io.IOException; import java.lang.reflect.Method; @@ -8,7 +10,6 @@ import java.util.ArrayList; import java.util.Enumeration; -import sun.misc.URLClassPath; /* * Copyright 2004,2005 The Apache Software Foundation. * @@ -24,15 +25,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + public class ClassFileHandler { /** - * @deprecated - * This needs to be written in a functional manner * @param location * @return * @throws IOException + * @deprecated This needs to be written in a functional manner */ //todo see whether this is possible public ArrayList getClassesAtLocation(String location) throws IOException { @@ -44,14 +45,14 @@ Enumeration enum = classLoader.getResources(""); while (enum.hasMoreElements()) { - Object o = enum.nextElement(); + Object o = enum.nextElement(); System.out.println("o = " + o); } return null; } - public ArrayList getMethodNamesFromClass(String classFileName,String location) throws IOException, ClassNotFoundException{ + public ArrayList getMethodNamesFromClass(String classFileName, String location) throws IOException, ClassNotFoundException { ArrayList returnList = new ArrayList(); File fileEndpoint = new File(location); if (!fileEndpoint.exists()) Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/FileCopier.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/FileCopier.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/FileCopier.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/FileCopier.java Mon Jul 11 08:49:30 2005 @@ -1,11 +1,11 @@ package org.apache.axis.tool.core; -import java.io.File; - import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.Copy; import org.apache.tools.ant.types.FileSet; +import java.io.File; + /* * Copyright 2004,2005 The Apache Software Foundation. * @@ -22,7 +22,7 @@ * limitations under the License. */ -public class FileCopier extends Copy{ +public class FileCopier extends Copy { public FileCopier() { this.setProject(new Project()); this.getProject().init(); @@ -31,7 +31,7 @@ this.setOwningTarget(new org.apache.tools.ant.Target()); } - public void copyFiles(File sourceFile,File destinationDirectory){ + public void copyFiles(File sourceFile, File destinationDirectory) { this.filesets.clear(); Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/JarFileWriter.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/JarFileWriter.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/JarFileWriter.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/JarFileWriter.java Mon Jul 11 08:49:30 2005 @@ -1,11 +1,11 @@ package org.apache.axis.tool.core; -import java.io.File; -import java.io.IOException; - import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.Jar; +import java.io.File; +import java.io.IOException; + /* * Copyright 2004,2005 The Apache Software Foundation. * @@ -21,7 +21,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -public class JarFileWriter extends Jar{ + +public class JarFileWriter extends Jar { public JarFileWriter() { @@ -32,16 +33,16 @@ this.setOwningTarget(new org.apache.tools.ant.Target()); } - public void writeJarFile(File outputFolder,String outputFileName,File inputFileFolder) throws IOException,Exception { + public void writeJarFile(File outputFolder, String outputFileName, File inputFileFolder) throws IOException, Exception { - if (!outputFolder.exists()){ + if (!outputFolder.exists()) { outputFolder.mkdir(); //create the output path - }else{ + } else { if (!outputFolder.isDirectory()) return; } - File targetFile = new File(outputFolder,outputFileName); + File targetFile = new File(outputFolder, outputFileName); this.setBasedir(inputFileFolder); this.setDestFile(targetFile); Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/ServiceFileCreator.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/ServiceFileCreator.java?rev=210150&r1=210149&r2=210150&view=diff ============================================================================== --- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/ServiceFileCreator.java (original) +++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/ServiceFileCreator.java Mon Jul 11 08:49:30 2005 @@ -21,10 +21,10 @@ */ public class ServiceFileCreator { - public File createServiceFile(String providerClassName,String serviceClass,ArrayList methodList) throws Exception { - + public File createServiceFile(String providerClassName, String serviceClass, ArrayList methodList) throws Exception { - String content = this.getFileString(providerClassName,serviceClass,methodList); + + String content = this.getFileString(providerClassName, serviceClass, methodList); File serviceFile = new File("service.xml"); FileWriter fileWriter = new FileWriter(serviceFile); @@ -34,16 +34,14 @@ return serviceFile; - - } - private String getFileString(String providerClassName,String serviceClass,ArrayList methodList){ + private String getFileString(String providerClassName, String serviceClass, ArrayList methodList) { String str = "" + " \n" ; + "xmlns:java=\"http://ws.apache.org/axis2/deployment/java\"/>\n"; for (int i = 0; i < methodList.size(); i++) { str = str + "