You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/09/15 21:07:03 UTC
svn commit: r289289 [100/134] - in /webservices/axis2/trunk/java: ./ etc/
modules/addressing/ modules/addressing/src/META-INF/
modules/addressing/src/org/apache/axis2/handlers/addressing/
modules/addressing/test-resources/ modules/addressing/test/org/a...
Modified: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOptionsPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOptionsPage.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOptionsPage.java (original)
+++ webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOptionsPage.java Thu Sep 15 11:52:11 2005
@@ -1,282 +1,282 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis2.tool.codegen.eclipse.ui;
-
-import org.apache.axis.wsdl.fromJava.Emitter;
-import org.apache.axis2.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.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * -I, --input <argument>input WSDL filename -o, --output <argument>output
- * WSDL filename -l, --location <argument>service location url -P,
- * --portTypeName <argument>portType name (obtained from class-of-portType if
- * not specif ied) -b, --bindingName <argument>binding name (--servicePortName
- * value + "SOAPBinding" if not specified) -S, --serviceElementName <argument>
- * service element name (defaults to --servicePortName value + "Service") -s,
- * --servicePortName <argument>service port name (obtained from --location if
- * not specified ) -n, --namespace <argument>target namespace -p, --PkgtoNS
- * <argument>= <value>package=namespace, name value pairs -m, --methods
- * <argument>space or comma separated list of methods to export -a, --all look
- * for allowed methods in inherited class -w, --outputWsdlMode <argument>output
- * WSDL mode: All, Interface, Implementation -L, --locationImport <argument>
- * location of interface wsdl -N, --namespaceImpl <argument>target namespace
- * for implementation wsdl -O, --outputImpl <argument>output Implementation
- * WSDL filename, setting this causes --o utputWsdlMode to be ignored -i,
- * --implClass <argument>optional class that contains implementation of methods
- * in cl ass-of-portType. The debug information in the class is used to obtain
- * the method parameter names, which are used to set the WSDL part names. -x,
- * --exclude <argument>space or comma separated list of methods not to export
- * -c, --stopClasses <argument>space or comma separated list of class names
- * which will stop inheritance search if --all switch is given -T,
- * --typeMappingVersion <argument>indicate 1.1 or 1.2. The default is 1.1 (SOAP
- * 1.1 JAX-RPC c ompliant 1.2 indicates SOAP 1.1 encoded.) -A, --soapAction
- * <argument>value of the operation's soapAction field. Values are DEFAUL T,
- * OPERATION or NONE. OPERATION forces soapAction to the nam e of the operation.
- * DEFAULT causes the soapAction to be set according to the operation's meta
- * data (usually ""). NONE forces the soapAction to "". The default is DEFAULT.
- * -y, --style <argument>The style of binding in the WSDL, either DOCUMENT,
- * RPC, or W RAPPED. -u, --use <argument>The use of items in the binding,
- * either LITERAL or ENCODED -e, --extraClasses <argument>A space or comma
- * separated list of class names to be added t o the type section. -C,
- * --importSchema A file or URL to an XML Schema that should be physically imp
- * orted into the generated WSDL -X, --classpath additional classpath elements
- */
-public class JavaWSDLOptionsPage extends AbstractWizardPage {
-
- private Text inputWSDLNameTextBox;
-
- private Text serviceLocationURLTextBox;
-
- private Text portTypeNameTextBox;
-
- private Text bindingTextBox;
-
- private Combo modeSelectionCombo;
-
- private Combo styleSelectionCombo;
-
-
- //TODO need more here
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.axis2.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);
- }
-
- /**
- * @param pageName
- */
- public JavaWSDLOptionsPage() {
- super("page5");
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.axis2.tool.codegen.eclipse.ui.CodegenPage#getPageType()
- */
- public int getPageType() {
- return JAVA_2_WSDL_TYPE;
- }
-
- /*
- * (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 = 2;
- layout.verticalSpacing = 9;
-
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- Label label = new Label(container, SWT.NULL);
- label.setText(CodegenWizardPlugin
- .getResourceString("page5.inputwsdl.label"));
-
- inputWSDLNameTextBox = new Text(container, SWT.BORDER | SWT.SINGLE);
- inputWSDLNameTextBox.setLayoutData(gd);
- inputWSDLNameTextBox.setText(settings.get(PREF_JAVA_INPUT_WSDL_NAME));
- inputWSDLNameTextBox.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- settings.put(PREF_JAVA_INPUT_WSDL_NAME, inputWSDLNameTextBox.getText());
- //dialogChanged();
- }
- });
-
- label = new Label(container, SWT.NULL);
- label.setText(CodegenWizardPlugin
- .getResourceString("page5.servicelocation.label"));
-
- gd = new GridData(GridData.FILL_HORIZONTAL);
- serviceLocationURLTextBox = new Text(container, SWT.BORDER);
- serviceLocationURLTextBox.setLayoutData(gd);
- serviceLocationURLTextBox.setText(settings.get(PREF_JAVA_LOCATION));
- serviceLocationURLTextBox.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- settings.put(PREF_JAVA_LOCATION, serviceLocationURLTextBox.getText());
- //dialogChanged();
- }
- });
-
- label = new Label(container, SWT.NULL);
- label.setText(CodegenWizardPlugin
- .getResourceString("page5.binding.label"));
-
- gd = new GridData(GridData.FILL_HORIZONTAL);
- bindingTextBox = new Text(container, SWT.BORDER);
- bindingTextBox.setLayoutData(gd);
- bindingTextBox.setText(settings.get(PREF_JAVA_BINDING_NAME));
- bindingTextBox.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- settings.put(PREF_JAVA_BINDING_NAME, bindingTextBox.getText());
- //dialogChanged();
- }
- });
-
- label = new Label(container, SWT.NULL);
- label.setText(CodegenWizardPlugin
- .getResourceString("page5.porttype.label"));
-
- gd = new GridData(GridData.FILL_HORIZONTAL);
- portTypeNameTextBox = new Text(container, SWT.BORDER);
- portTypeNameTextBox.setLayoutData(gd);
- portTypeNameTextBox.setText(settings.get(PREF_JAVA_PORTYPE_NAME));
- portTypeNameTextBox.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- settings.put(PREF_JAVA_PORTYPE_NAME, portTypeNameTextBox.getText());
- //dialogChanged();
- }
- });
-
- // #####################################################
- label = new Label(container, SWT.NULL);
- label
- .setText(CodegenWizardPlugin
- .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.
- populateModeCombo();
- modeSelectionCombo.addSelectionListener(new SelectionListener(){
- public void widgetSelected(SelectionEvent e){
- settings.put(PREF_JAVA_MODE_INDEX,modeSelectionCombo.getSelectionIndex());
- }
- public void widgetDefaultSelected(SelectionEvent e){}
- });
-
- // #####################################################
- label = new Label(container, SWT.NULL);
- label
- .setText(CodegenWizardPlugin
- .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());
- }
- public void widgetDefaultSelected(SelectionEvent e){}
- });
-
-
- setControl(container);
-
- }
-
- private void populateModeCombo() {
- modeSelectionCombo.add(WSDL_ALL);
- modeSelectionCombo.add(WSDL_INTERFACE_ONLY);
- modeSelectionCombo.add(WSDL_IMPLEMENTATION_ONLY);
-
- modeSelectionCombo.select(settings.getInt(PREF_JAVA_MODE_INDEX));
- }
-
- private void populateStyleCombo() {
- styleSelectionCombo.add(WSDL_STYLE_DOCUMENT);
- styleSelectionCombo.add(WSDL_STYLE_RPC);
- styleSelectionCombo.add(WSDL_STYLE_WRAPPED);
-
- styleSelectionCombo.select(settings.getInt(PREF_JAVA_STYLE_INDEX));
- }
- public int getMode(){
- String selectedOption = modeSelectionCombo.getItem(modeSelectionCombo.getSelectionIndex());
- if (WSDL_ALL.equals(selectedOption)){
- return Emitter.MODE_ALL;
- }else if (WSDL_INTERFACE_ONLY.equals(selectedOption)){
- return Emitter.MODE_INTERFACE;
- }else if (WSDL_IMPLEMENTATION_ONLY.equals(selectedOption)){
- return Emitter.MODE_IMPLEMENTATION;
- }else{
- throw new RuntimeException("Unknown Exception");
- }
- }
-
-
-
- public String getStyle(){
- return this.styleSelectionCombo.getItem(styleSelectionCombo.getSelectionIndex()).toUpperCase();
- }
- public String getLocationURL() {
- return this.serviceLocationURLTextBox.getText();
- }
-
- public String getInputWSDLName() {
- return this.inputWSDLNameTextBox.getText();
- }
-
- public String getPortypeName() {
- return this.portTypeNameTextBox.getText();
- }
-
- public String getBindingName() {
- return this.bindingTextBox.getText();
- }
-
- private String getgetClassFileLocation(){
- return null;
- }
-
-
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.tool.codegen.eclipse.ui;
+
+import org.apache.axis.wsdl.fromJava.Emitter;
+import org.apache.axis2.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.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * -I, --input <argument>input WSDL filename -o, --output <argument>output
+ * WSDL filename -l, --location <argument>service location url -P,
+ * --portTypeName <argument>portType name (obtained from class-of-portType if
+ * not specif ied) -b, --bindingName <argument>binding name (--servicePortName
+ * value + "SOAPBinding" if not specified) -S, --serviceElementName <argument>
+ * service element name (defaults to --servicePortName value + "Service") -s,
+ * --servicePortName <argument>service port name (obtained from --location if
+ * not specified ) -n, --namespace <argument>target namespace -p, --PkgtoNS
+ * <argument>= <value>package=namespace, name value pairs -m, --methods
+ * <argument>space or comma separated list of methods to export -a, --all look
+ * for allowed methods in inherited class -w, --outputWsdlMode <argument>output
+ * WSDL mode: All, Interface, Implementation -L, --locationImport <argument>
+ * location of interface wsdl -N, --namespaceImpl <argument>target namespace
+ * for implementation wsdl -O, --outputImpl <argument>output Implementation
+ * WSDL filename, setting this causes --o utputWsdlMode to be ignored -i,
+ * --implClass <argument>optional class that contains implementation of methods
+ * in cl ass-of-portType. The debug information in the class is used to obtain
+ * the method parameter names, which are used to set the WSDL part names. -x,
+ * --exclude <argument>space or comma separated list of methods not to export
+ * -c, --stopClasses <argument>space or comma separated list of class names
+ * which will stop inheritance search if --all switch is given -T,
+ * --typeMappingVersion <argument>indicate 1.1 or 1.2. The default is 1.1 (SOAP
+ * 1.1 JAX-RPC c ompliant 1.2 indicates SOAP 1.1 encoded.) -A, --soapAction
+ * <argument>value of the operation's soapAction field. Values are DEFAUL T,
+ * OPERATION or NONE. OPERATION forces soapAction to the nam e of the operation.
+ * DEFAULT causes the soapAction to be set according to the operation's meta
+ * data (usually ""). NONE forces the soapAction to "". The default is DEFAULT.
+ * -y, --style <argument>The style of binding in the WSDL, either DOCUMENT,
+ * RPC, or W RAPPED. -u, --use <argument>The use of items in the binding,
+ * either LITERAL or ENCODED -e, --extraClasses <argument>A space or comma
+ * separated list of class names to be added t o the type section. -C,
+ * --importSchema A file or URL to an XML Schema that should be physically imp
+ * orted into the generated WSDL -X, --classpath additional classpath elements
+ */
+public class JavaWSDLOptionsPage extends AbstractWizardPage {
+
+ private Text inputWSDLNameTextBox;
+
+ private Text serviceLocationURLTextBox;
+
+ private Text portTypeNameTextBox;
+
+ private Text bindingTextBox;
+
+ private Combo modeSelectionCombo;
+
+ private Combo styleSelectionCombo;
+
+
+ //TODO need more here
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.axis2.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);
+ }
+
+ /**
+ * @param pageName
+ */
+ public JavaWSDLOptionsPage() {
+ super("page5");
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.axis2.tool.codegen.eclipse.ui.CodegenPage#getPageType()
+ */
+ public int getPageType() {
+ return JAVA_2_WSDL_TYPE;
+ }
+
+ /*
+ * (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 = 2;
+ layout.verticalSpacing = 9;
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ Label label = new Label(container, SWT.NULL);
+ label.setText(CodegenWizardPlugin
+ .getResourceString("page5.inputwsdl.label"));
+
+ inputWSDLNameTextBox = new Text(container, SWT.BORDER | SWT.SINGLE);
+ inputWSDLNameTextBox.setLayoutData(gd);
+ inputWSDLNameTextBox.setText(settings.get(PREF_JAVA_INPUT_WSDL_NAME));
+ inputWSDLNameTextBox.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ settings.put(PREF_JAVA_INPUT_WSDL_NAME, inputWSDLNameTextBox.getText());
+ //dialogChanged();
+ }
+ });
+
+ label = new Label(container, SWT.NULL);
+ label.setText(CodegenWizardPlugin
+ .getResourceString("page5.servicelocation.label"));
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ serviceLocationURLTextBox = new Text(container, SWT.BORDER);
+ serviceLocationURLTextBox.setLayoutData(gd);
+ serviceLocationURLTextBox.setText(settings.get(PREF_JAVA_LOCATION));
+ serviceLocationURLTextBox.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ settings.put(PREF_JAVA_LOCATION, serviceLocationURLTextBox.getText());
+ //dialogChanged();
+ }
+ });
+
+ label = new Label(container, SWT.NULL);
+ label.setText(CodegenWizardPlugin
+ .getResourceString("page5.binding.label"));
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ bindingTextBox = new Text(container, SWT.BORDER);
+ bindingTextBox.setLayoutData(gd);
+ bindingTextBox.setText(settings.get(PREF_JAVA_BINDING_NAME));
+ bindingTextBox.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ settings.put(PREF_JAVA_BINDING_NAME, bindingTextBox.getText());
+ //dialogChanged();
+ }
+ });
+
+ label = new Label(container, SWT.NULL);
+ label.setText(CodegenWizardPlugin
+ .getResourceString("page5.porttype.label"));
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ portTypeNameTextBox = new Text(container, SWT.BORDER);
+ portTypeNameTextBox.setLayoutData(gd);
+ portTypeNameTextBox.setText(settings.get(PREF_JAVA_PORTYPE_NAME));
+ portTypeNameTextBox.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ settings.put(PREF_JAVA_PORTYPE_NAME, portTypeNameTextBox.getText());
+ //dialogChanged();
+ }
+ });
+
+ // #####################################################
+ label = new Label(container, SWT.NULL);
+ label
+ .setText(CodegenWizardPlugin
+ .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.
+ populateModeCombo();
+ modeSelectionCombo.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e){
+ settings.put(PREF_JAVA_MODE_INDEX,modeSelectionCombo.getSelectionIndex());
+ }
+ public void widgetDefaultSelected(SelectionEvent e){}
+ });
+
+ // #####################################################
+ label = new Label(container, SWT.NULL);
+ label
+ .setText(CodegenWizardPlugin
+ .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());
+ }
+ public void widgetDefaultSelected(SelectionEvent e){}
+ });
+
+
+ setControl(container);
+
+ }
+
+ private void populateModeCombo() {
+ modeSelectionCombo.add(WSDL_ALL);
+ modeSelectionCombo.add(WSDL_INTERFACE_ONLY);
+ modeSelectionCombo.add(WSDL_IMPLEMENTATION_ONLY);
+
+ modeSelectionCombo.select(settings.getInt(PREF_JAVA_MODE_INDEX));
+ }
+
+ private void populateStyleCombo() {
+ styleSelectionCombo.add(WSDL_STYLE_DOCUMENT);
+ styleSelectionCombo.add(WSDL_STYLE_RPC);
+ styleSelectionCombo.add(WSDL_STYLE_WRAPPED);
+
+ styleSelectionCombo.select(settings.getInt(PREF_JAVA_STYLE_INDEX));
+ }
+ public int getMode(){
+ String selectedOption = modeSelectionCombo.getItem(modeSelectionCombo.getSelectionIndex());
+ if (WSDL_ALL.equals(selectedOption)){
+ return Emitter.MODE_ALL;
+ }else if (WSDL_INTERFACE_ONLY.equals(selectedOption)){
+ return Emitter.MODE_INTERFACE;
+ }else if (WSDL_IMPLEMENTATION_ONLY.equals(selectedOption)){
+ return Emitter.MODE_IMPLEMENTATION;
+ }else{
+ throw new RuntimeException("Unknown Exception");
+ }
+ }
+
+
+
+ public String getStyle(){
+ return this.styleSelectionCombo.getItem(styleSelectionCombo.getSelectionIndex()).toUpperCase();
+ }
+ public String getLocationURL() {
+ return this.serviceLocationURLTextBox.getText();
+ }
+
+ public String getInputWSDLName() {
+ return this.inputWSDLNameTextBox.getText();
+ }
+
+ public String getPortypeName() {
+ return this.portTypeNameTextBox.getText();
+ }
+
+ public String getBindingName() {
+ return this.bindingTextBox.getText();
+ }
+
+ private String getgetClassFileLocation(){
+ return null;
+ }
+
+
+
+}
Propchange: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOptionsPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOutputLocationPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOutputLocationPage.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOutputLocationPage.java (original)
+++ webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOutputLocationPage.java Thu Sep 15 11:52:11 2005
@@ -1,172 +1,172 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis2.tool.codegen.eclipse.ui;
-
-import java.io.File;
-
-import org.apache.axis2.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.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.Text;
-
-/**
- * @author Ajith
- *
- * 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;
-
- /**
- * @param pageName
- */
- public JavaWSDLOutputLocationPage() {
- super("page6");
- }
- /* (non-Javadoc)
- * @see org.apache.axis2.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");
-
- }
-
- /* (non-Javadoc)
- * @see org.apache.axis2.tool.codegen.eclipse.ui.AbstractWizardPage#getPageType()
- */
- public int getPageType() {
- return JAVA_2_WSDL_TYPE;
- }
-
- /* (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);
- Label label = new Label(container, SWT.NULL);
- label.setText(CodegenWizardPlugin
- .getResourceString("page6.output.label"));
-
- 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){
- handleFolderTextChange();
- }
- });
-
- Button browseButton = new Button(container,SWT.PUSH);
- browseButton.setText(CodegenWizardPlugin
- .getResourceString("general.browse"));
- browseButton.addSelectionListener(new SelectionListener(){
- public void widgetSelected(SelectionEvent e){
- handleBrowse();
- }
- public void widgetDefaultSelected(SelectionEvent e){}
- });
-
- label = new Label(container, SWT.NULL);
- label.setText(CodegenWizardPlugin
- .getResourceString("page6.outputname.label"));
-
- gd = new GridData(GridData.FILL_HORIZONTAL);
- 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();
- }
- });
-
- if(restoredFromPreviousSettings){
- handleFolderTextChange();
- handleFolderTextChange();
- }
-
- setControl(container);
-
- }
-
- private void handleFolderTextChange(){
- String outputFolder = outputFolderTextBox.getText();
- settings.put(PREF_JAVA_OUTPUT_WSDL_LOCATION,outputFolder);
- if ("".equals(outputFolder.trim())){
- updateStatus("Input a proper location for the output");
- }else{
- updateStatus(null);
- }
- }
-
- 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")){
- updateStatus("Input a valid file name");
- }else{
- updateStatus(null);
- }
- }
-
- private void handleBrowse(){
- DirectoryDialog fileDialog = new DirectoryDialog(this.getShell());
- String dirName = fileDialog.open();
- if (dirName != null) {
- outputFolderTextBox.setText(dirName);
- }
-
- }
-
- public String getFullFileName(){
- String folder =this.outputFolderTextBox.getText();
- String fileName = this.outputFileNameTextBox.getText();
- if (!fileName.endsWith(".wsdl")){
- fileName = fileName + ".wsdl";
- }
- return folder + File.separator +fileName;
- }
-
- public String getOutputWSDLName(){
- return this.outputFileNameTextBox.getText();
- }
-
- public String getOutputLocation(){
- return this.outputFolderTextBox.getText();
- }
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.tool.codegen.eclipse.ui;
+
+import java.io.File;
+
+import org.apache.axis2.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.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.Text;
+
+/**
+ * @author Ajith
+ *
+ * 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;
+
+ /**
+ * @param pageName
+ */
+ public JavaWSDLOutputLocationPage() {
+ super("page6");
+ }
+ /* (non-Javadoc)
+ * @see org.apache.axis2.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");
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.tool.codegen.eclipse.ui.AbstractWizardPage#getPageType()
+ */
+ public int getPageType() {
+ return JAVA_2_WSDL_TYPE;
+ }
+
+ /* (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);
+ Label label = new Label(container, SWT.NULL);
+ label.setText(CodegenWizardPlugin
+ .getResourceString("page6.output.label"));
+
+ 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){
+ handleFolderTextChange();
+ }
+ });
+
+ Button browseButton = new Button(container,SWT.PUSH);
+ browseButton.setText(CodegenWizardPlugin
+ .getResourceString("general.browse"));
+ browseButton.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e){
+ handleBrowse();
+ }
+ public void widgetDefaultSelected(SelectionEvent e){}
+ });
+
+ label = new Label(container, SWT.NULL);
+ label.setText(CodegenWizardPlugin
+ .getResourceString("page6.outputname.label"));
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ 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();
+ }
+ });
+
+ if(restoredFromPreviousSettings){
+ handleFolderTextChange();
+ handleFolderTextChange();
+ }
+
+ setControl(container);
+
+ }
+
+ private void handleFolderTextChange(){
+ String outputFolder = outputFolderTextBox.getText();
+ settings.put(PREF_JAVA_OUTPUT_WSDL_LOCATION,outputFolder);
+ if ("".equals(outputFolder.trim())){
+ updateStatus("Input a proper location for the output");
+ }else{
+ updateStatus(null);
+ }
+ }
+
+ 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")){
+ updateStatus("Input a valid file name");
+ }else{
+ updateStatus(null);
+ }
+ }
+
+ private void handleBrowse(){
+ DirectoryDialog fileDialog = new DirectoryDialog(this.getShell());
+ String dirName = fileDialog.open();
+ if (dirName != null) {
+ outputFolderTextBox.setText(dirName);
+ }
+
+ }
+
+ public String getFullFileName(){
+ String folder =this.outputFolderTextBox.getText();
+ String fileName = this.outputFileNameTextBox.getText();
+ if (!fileName.endsWith(".wsdl")){
+ fileName = fileName + ".wsdl";
+ }
+ return folder + File.separator +fileName;
+ }
+
+ public String getOutputWSDLName(){
+ return this.outputFileNameTextBox.getText();
+ }
+
+ public String getOutputLocation(){
+ return this.outputFolderTextBox.getText();
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOutputLocationPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OptionsPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OptionsPage.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OptionsPage.java (original)
+++ webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OptionsPage.java Thu Sep 15 11:52:11 2005
@@ -1,403 +1,403 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-
-package org.apache.axis2.tool.codegen.eclipse.ui;
-
-import org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
-import org.apache.axis2.tool.codegen.eclipse.util.UIConstants;
-import org.apache.axis2.wsdl.util.URLProcessor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * 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;
- private Button enableDataBindingButton;
- private Combo databindingTypeCombo;
-
- /**
- * 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.axis2.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.axis2.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)
- {
- }
- });
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- serverXMLCheckBoxButton = new Button(container, SWT.CHECK);
- serverXMLCheckBoxButton.setLayoutData(gd);
- 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)
- {
- }
- });
-
- enableDataBindingButton = new Button(container, SWT.CHECK);
- enableDataBindingButton.setText(CodegenWizardPlugin.getResourceString("page2.databindingCheck.caption"));
- //this button is disabled
- enableDataBindingButton.setEnabled(false);
-
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- databindingTypeCombo = new Combo(container, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY);
- databindingTypeCombo.setLayoutData(gd);
- //this combo is also disabled
- databindingTypeCombo.setEnabled(false);
- /*
- * 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.axis2.tool.codegen.eclipse.ui.CodegenPage#getPageType()
- */
- public int getPageType() {
- return WSDL_2_JAVA_TYPE;
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+package org.apache.axis2.tool.codegen.eclipse.ui;
+
+import org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
+import org.apache.axis2.tool.codegen.eclipse.util.UIConstants;
+import org.apache.axis2.wsdl.util.URLProcessor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+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.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * 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;
+ private Button enableDataBindingButton;
+ private Combo databindingTypeCombo;
+
+ /**
+ * 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.axis2.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.axis2.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)
+ {
+ }
+ });
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ serverXMLCheckBoxButton = new Button(container, SWT.CHECK);
+ serverXMLCheckBoxButton.setLayoutData(gd);
+ 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)
+ {
+ }
+ });
+
+ enableDataBindingButton = new Button(container, SWT.CHECK);
+ enableDataBindingButton.setText(CodegenWizardPlugin.getResourceString("page2.databindingCheck.caption"));
+ //this button is disabled
+ enableDataBindingButton.setEnabled(false);
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ databindingTypeCombo = new Combo(container, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY);
+ databindingTypeCombo.setLayoutData(gd);
+ //this combo is also disabled
+ databindingTypeCombo.setEnabled(false);
+ /*
+ * 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.axis2.tool.codegen.eclipse.ui.CodegenPage#getPageType()
+ */
+ public int getPageType() {
+ return WSDL_2_JAVA_TYPE;
+ }
+}
Propchange: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OptionsPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OutputPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OutputPage.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OutputPage.java (original)
+++ webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OutputPage.java Thu Sep 15 11:52:11 2005
@@ -1,171 +1,171 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package org.apache.axis2.tool.codegen.eclipse.ui;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-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.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.ui.dialogs.ContainerSelectionDialog;
-
-public class OutputPage extends AbstractWizardPage {
-
- private Text outputLocation;
-
- private Button browseButton;
-
- private Button locationSelectCheckBox;
-
-
- /**
- *
- */
- public OutputPage() {
- super("page3");
- }
-
- /**
- * Creates some initial values for the settings. On the output page, this is
- * not very much.
- */
- protected void initializeDefaultSettings() {
- settings.put(PREF_OUTPUT_LOCATION, "");
- }
-
- /*
- * (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);
- Label label = new Label(container, SWT.NULL);
- label
- .setText(org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin
- .getResourceString("page3.output.caption"));
-
- outputLocation = new Text(container, SWT.BORDER);
- outputLocation.setLayoutData(gd);
- outputLocation.setText(settings.get(PREF_OUTPUT_LOCATION));
- outputLocation.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- settings.put(PREF_OUTPUT_LOCATION, outputLocation.getText());
- handleModifyEvent();
- }
- });
-
- browseButton = new Button(container, SWT.PUSH);
- browseButton
- .setText(org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin
- .getResourceString("page3.outselection.browse"));
- browseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleBrowse();
- }
- });
-
- // locationSelectCheckBox = new Button(container, SWT.CHECK);
- // locationSelectCheckBox.setText("Workspace projects only");
-
- setControl(container);
-
- /*
- * Update the buttons, in case this was restored from an earlier setting
- */
- if (restoredFromPreviousSettings){
- handleModifyEvent();
- }
- }
-
- /**
- * get the output location
- *
- * @return a string containing the full pathname of the output location
- */
- public String getOutputLocation() {
- return outputLocation.getText();
- }
-
- /**
- * 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.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin
- .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();
- if (!location) {
- DirectoryDialog dialog = new DirectoryDialog(this.getShell());
- String returnString = dialog.open();
- if (returnString != null) {
- outputLocation.setText(returnString);
- }
- } else {
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(
- getShell(),
- ResourcesPlugin.getWorkspace().getRoot(),
- false,
- org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin
- .getResourceString("page3.containerbox.title"));
- if (dialog.open() == ContainerSelectionDialog.OK) {
- Object[] result = dialog.getResult();
- if (result.length == 1) {
- outputLocation.setText(((Path) result[0]).toOSString());
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.axis2.tool.codegen.eclipse.ui.CodegenPage#getPageType()
- */
- public int getPageType() {
- return WSDL_2_JAVA_TYPE;
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.axis2.tool.codegen.eclipse.ui;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+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.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.ui.dialogs.ContainerSelectionDialog;
+
+public class OutputPage extends AbstractWizardPage {
+
+ private Text outputLocation;
+
+ private Button browseButton;
+
+ private Button locationSelectCheckBox;
+
+
+ /**
+ *
+ */
+ public OutputPage() {
+ super("page3");
+ }
+
+ /**
+ * Creates some initial values for the settings. On the output page, this is
+ * not very much.
+ */
+ protected void initializeDefaultSettings() {
+ settings.put(PREF_OUTPUT_LOCATION, "");
+ }
+
+ /*
+ * (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);
+ Label label = new Label(container, SWT.NULL);
+ label
+ .setText(org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin
+ .getResourceString("page3.output.caption"));
+
+ outputLocation = new Text(container, SWT.BORDER);
+ outputLocation.setLayoutData(gd);
+ outputLocation.setText(settings.get(PREF_OUTPUT_LOCATION));
+ outputLocation.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ settings.put(PREF_OUTPUT_LOCATION, outputLocation.getText());
+ handleModifyEvent();
+ }
+ });
+
+ browseButton = new Button(container, SWT.PUSH);
+ browseButton
+ .setText(org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin
+ .getResourceString("page3.outselection.browse"));
+ browseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleBrowse();
+ }
+ });
+
+ // locationSelectCheckBox = new Button(container, SWT.CHECK);
+ // locationSelectCheckBox.setText("Workspace projects only");
+
+ setControl(container);
+
+ /*
+ * Update the buttons, in case this was restored from an earlier setting
+ */
+ if (restoredFromPreviousSettings){
+ handleModifyEvent();
+ }
+ }
+
+ /**
+ * get the output location
+ *
+ * @return a string containing the full pathname of the output location
+ */
+ public String getOutputLocation() {
+ return outputLocation.getText();
+ }
+
+ /**
+ * 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.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin
+ .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();
+ if (!location) {
+ DirectoryDialog dialog = new DirectoryDialog(this.getShell());
+ String returnString = dialog.open();
+ if (returnString != null) {
+ outputLocation.setText(returnString);
+ }
+ } else {
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(
+ getShell(),
+ ResourcesPlugin.getWorkspace().getRoot(),
+ false,
+ org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin
+ .getResourceString("page3.containerbox.title"));
+ if (dialog.open() == ContainerSelectionDialog.OK) {
+ Object[] result = dialog.getResult();
+ if (result.length == 1) {
+ outputLocation.setText(((Path) result[0]).toOSString());
+ }
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.axis2.tool.codegen.eclipse.ui.CodegenPage#getPageType()
+ */
+ public int getPageType() {
+ return WSDL_2_JAVA_TYPE;
+ }
+}
Propchange: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OutputPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/ToolSelectionPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/ToolSelectionPage.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/ToolSelectionPage.java (original)
+++ webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/ToolSelectionPage.java Thu Sep 15 11:52:11 2005
@@ -1,122 +1,122 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis2.tool.codegen.eclipse.ui;
-
-import org.apache.axis2.tool.codegen.eclipse.CodeGenWizard;
-import org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-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.Label;
-
-/**
- * @author Ajith
- *
- * 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
- */
- protected void initializeDefaultSettings() {
- settings.put(PREF_TOOL_SELECTION_JAVA2WSDL, false);
- settings.put(PREF_TOOL_SELECTION_WSDL2JAVA, true);
- }
-
- /* (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 = 1;
- 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.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();
- }
- });
-
- 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();
- }
- });
-
- ///////////////////////////////////////
- /// The java2WSDL is disabled ///
- java2WSDLRadioButton.setEnabled(false);
- //////////////////////////////////////
-
- 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);
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.apache.axis2.tool.codegen.eclipse.ui.CodegenPage#getPageType()
- */
- public int getPageType() {
- return UNSPECIFIED_TYPE;
- }
-
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.tool.codegen.eclipse.ui;
+
+import org.apache.axis2.tool.codegen.eclipse.CodeGenWizard;
+import org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+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.Label;
+
+/**
+ * @author Ajith
+ *
+ * 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
+ */
+ protected void initializeDefaultSettings() {
+ settings.put(PREF_TOOL_SELECTION_JAVA2WSDL, false);
+ settings.put(PREF_TOOL_SELECTION_WSDL2JAVA, true);
+ }
+
+ /* (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 = 1;
+ 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.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();
+ }
+ });
+
+ 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();
+ }
+ });
+
+ ///////////////////////////////////////
+ /// The java2WSDL is disabled ///
+ java2WSDLRadioButton.setEnabled(false);
+ //////////////////////////////////////
+
+ 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);
+ }
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.tool.codegen.eclipse.ui.CodegenPage#getPageType()
+ */
+ public int getPageType() {
+ return UNSPECIFIED_TYPE;
+ }
+
+
+}
Propchange: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/ToolSelectionPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java
------------------------------------------------------------------------------
svn:eol-style = native