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 aj...@apache.org on 2005/08/15 11:44:03 UTC
svn commit: r232780 [1/3] - in /webservices/axis/trunk/java/modules/tool:
conf/codegen/ conf/service/ src/org/apache/axis2/tool/codegen/
src/org/apache/axis2/tool/codegen/eclipse/
src/org/apache/axis2/tool/codegen/eclipse/plugin/ src/org/apache/axis2/t...
Author: ajith
Date: Mon Aug 15 02:39:26 2005
New Revision: 232780
URL: http://svn.apache.org/viewcvs?rev=232780&view=rev
Log:
Commiting code for the tools change.
Added:
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/bean/ClassFileSelectionBean.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/bean/WSDLAutoGenerateOptionBean.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/bean/WSDLFileLocationBean.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/AbstractServiceWizardPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ClassFileLocationPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceArchiveOutputLocationPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceXMLFileSelectionPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceXMLGenerationPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WSDLFileSelectionPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WSDLOptionsPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/util/
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/util/SettingsConstants.java
Removed:
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/bean/Page1Bean.java
Modified:
webservices/axis/trunk/java/modules/tool/conf/codegen/build.properties
webservices/axis/trunk/java/modules/tool/conf/codegen/plugin.xml
webservices/axis/trunk/java/modules/tool/conf/service/plugin.xml
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/Java2WSDLGenerator.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/AbstractWizardPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaSourceSelectionPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOptionsPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/JavaWSDLOutputLocationPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OptionsPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OutputPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/ToolSelectionPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/SettingsConstants.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/UIConstants.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/resource/Codegen.properties
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/ClassFileHandler.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/FileCopier.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/JarFileWriter.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/core/ServiceFileCreator.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/bean/Page2Bean.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/bean/Page3Bean.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/bean/WizardBean.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/control/Controller.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/control/ProcessException.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/plugin/ServiceArchiver.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceArchiveWizard.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/resource/ServiceResources.properties
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/MainWindow.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane1.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane2.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane3.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/util/Constants.java
Modified: webservices/axis/trunk/java/modules/tool/conf/codegen/build.properties
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/conf/codegen/build.properties?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/conf/codegen/build.properties (original)
+++ webservices/axis/trunk/java/modules/tool/conf/codegen/build.properties Mon Aug 15 02:39:26 2005
@@ -1,6 +1,5 @@
-source.Axis2CodegenWizard.jar = src/
-output.Axis2CodegenWizard.jar = bin/
+source.Axis_Service_Archiver.jar = src/
+output.Axis_Service_Archiver.jar = bin/
bin.includes = plugin.xml,\
- Axis2CodegenWizard.jar,\
- icons/,\
- lib/
+ Axis_Service_Archiver.jar,\
+ icons/
Modified: webservices/axis/trunk/java/modules/tool/conf/codegen/plugin.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/conf/codegen/plugin.xml?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/conf/codegen/plugin.xml (original)
+++ webservices/axis/trunk/java/modules/tool/conf/codegen/plugin.xml Mon Aug 15 02:39:26 2005
@@ -1,50 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
- id="Axis2_Codegen_Wizard"
- name="Axis2 Codegen Wizard Plug-in"
- version="1.0.0"
- provider-name="Apache Software Foundation"
- class="org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin">
+ id="Axis2_Codegen_Wizard"
+ name="Axis2 Codegen Wizard Plug-in"
+ version="1.0.0"
+ provider-name="Apache Software Foundation"
+ class="org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin">
- <runtime>
- <library name="Axis2CodegenWizard.jar">
- <export name="*"/>
- </library>
- <library name="lib/axis2-wsdl-M1.jar">
- <export name="*"/>
- </library>
- <library name="lib/axis2-xml-M1.jar">
- <export name="*"/>
- </library>
- <library name="lib/axis-wsdl4j-1.2-RC3.jar">
- <export name="*"/>
- </library>
- <library name="lib/stax-api-1.0.jar">
- <export name="*"/>
- </library>
- </runtime>
+ <runtime>
+ <library name="Axis2CodegenWizard.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/xbean-2.0.0-beta1.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/axis2-0.91.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/axis-wsdl4j-1.2.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/stax-api-1.0.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/axis.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/commons-discovery.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/commons-logging.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/jaxrpc.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/log4j-1.2.8.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/saaj.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/stax-1.1.1-dev.jar">
+ <export name="*"/>
+ </library>
+ </runtime>
- <requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui.ide"/>
- </requires>
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ </requires>
- <extension
- point="org.eclipse.ui.newWizards">
- <category
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
name="Axis2 Wizards"
id="Axis2_Wizards">
- </category>
- <wizard
+ </category>
+ <wizard
name="Axis2 Code Generator"
icon="icons/icon.gif"
category="Axis2_Wizards"
- class="org.apache.axis.tool.codegen.eclipse.CodeGenWizard"
- id="org.apache.axis.tool.codegen.eclipse.CodeGenWizard">
- </wizard>
- </extension>
+ class="org.apache.axis2.tool.codegen.eclipse.CodeGenWizard"
+ id="org.apache.axis2.tool.codegen.eclipse.CodeGenWizard">
+ </wizard>
+ </extension>
</plugin>
Modified: webservices/axis/trunk/java/modules/tool/conf/service/plugin.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/conf/service/plugin.xml?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/conf/service/plugin.xml (original)
+++ webservices/axis/trunk/java/modules/tool/conf/service/plugin.xml Mon Aug 15 02:39:26 2005
@@ -1,37 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
- id="Axis_Service_Archiver"
- name="Axis Service Maker"
- version="1.0.0"
- provider-name="Apache Software Foundation"
- class="org.apache.axis.tool.service.eclipse.plugin.ServiceArchiver">
+ id="Axis_Service_Archiver"
+ name="Axis Service Maker"
+ version="1.0.0"
+ provider-name="Apache Software Foundation"
+ class="org.apache.axis2.tool.service.eclipse.plugin.ServiceArchiver">
- <runtime>
- <library name="Axis_Service_Archiver.jar">
- <export name="*"/>
- </library>
- </runtime>
+ <runtime>
+ <library name="Axis_Service_Archiver.jar">
+ <export name="*"/>
+ </library>
+ </runtime>
- <requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.apache.ant"/>
- <import plugin="org.eclipse.jface.text"/>
- </requires>
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.apache.ant"/>
+ <import plugin="org.eclipse.jface.text"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ <import plugin="Axis2_Codegen_Wizard"/>
+ </requires>
- <extension
- point="org.eclipse.ui.newWizards">
- <category
+<extension
+ point="org.eclipse.ui.newWizards">
+ <category
name="Axis2 Wizards"
id="Axis2_Wizards">
- </category>
- <wizard
+ </category>
+ <wizard
name="Axis2 Service Archiver"
icon="icons/sample.gif"
category="Axis2_Wizards"
- class="org.apache.axis.tool.service.eclipse.ui.ServiceArchiveWizard"
- id="org.apache.axis.tool.service.serviceWizard">
- </wizard>
- </extension>
+ class="org.apache.axis2.tool.service.eclipse.ui.ServiceArchiveWizard"
+ id="org.apache.axis2.tool.service.serviceWizard">
+ </wizard>
+ </extension>
</plugin>
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/Java2WSDLGenerator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/Java2WSDLGenerator.java?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/Java2WSDLGenerator.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/Java2WSDLGenerator.java Mon Aug 15 02:39:26 2005
@@ -13,37 +13,36 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.axis.tool.codegen;
+package org.apache.axis2.tool.codegen;
+import java.util.Vector;
+
import org.apache.axis.utils.ClassUtils;
import org.apache.axis.wsdl.fromJava.Emitter;
-import java.util.Vector;
-
/**
* @author Ajith
- * <p/>
- * 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 Java2WSDLGenerator {
- public void emit(String classPath,
- String implementationClassName,
- String serviceLocationUrl,
- String inputWsdlName,
- String bindingName,
- String portypeName,
- String style,
- String outputFileName,
- int mode,
- Vector listOfIncludedMethods) throws Throwable {
+ public void emit(String classPath,
+ String implementationClassName,
+ String serviceLocationUrl,
+ String inputWsdlName,
+ String bindingName,
+ String portypeName,
+ String style,
+ String outputFileName,
+ int mode,
+ Vector listOfIncludedMethods) throws Throwable{
try {
- ClassUtils.setDefaultClassLoader(
- ClassUtils.createClassLoader(classPath,
- this.getClass().getClassLoader()));
+ ClassUtils.setDefaultClassLoader(ClassUtils.createClassLoader(
+ classPath, this.getClass().getClassLoader()));
// Instantiate the emitter
Emitter emitter = new Emitter();
@@ -52,8 +51,7 @@
emitter.setCls(implementationClassName);
//service location
- if (serviceLocationUrl != null &&
- !serviceLocationUrl.trim().equals(""))
+ if (serviceLocationUrl !=null && !serviceLocationUrl.trim().equals(""))
emitter.setLocationUrl(serviceLocationUrl);
//input wsdl
@@ -61,21 +59,21 @@
emitter.setInputWSDL(inputWsdlName);
//portype name
- if (portypeName != null && !portypeName.trim().equals(""))
+ if (portypeName!=null && !portypeName.trim().equals(""))
emitter.setPortTypeName(portypeName);
//Style
- if (style != null && !style.trim().equals(""))
+ if (style!=null && !style.trim().equals(""))
emitter.setStyle(style);
- if (listOfIncludedMethods != null)
+ if (listOfIncludedMethods!=null)
emitter.setAllowedMethods(listOfIncludedMethods);
-
- if (mode != Emitter.MODE_ALL &&
- mode != Emitter.MODE_IMPLEMENTATION &&
- mode != Emitter.MODE_INTERFACE)
+
+ if (mode!= Emitter.MODE_ALL &&
+ mode!= Emitter.MODE_IMPLEMENTATION &&
+ mode!= Emitter.MODE_INTERFACE)
mode = Emitter.MODE_ALL; // Default to all in unknown case
-
- emitter.emit(outputFileName, mode);
+
+ emitter.emit(outputFileName,mode);
} catch (Throwable t) {
throw t;
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java Mon Aug 15 02:39:26 2005
@@ -13,15 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.axis.tool.codegen;
+package org.apache.axis2.tool.codegen;
-import org.apache.axis.tool.codegen.eclipse.util.UIConstants;
-import org.apache.axis.wsdl.builder.WOMBuilderFactory;
-import org.apache.axis.wsdl.codegen.CommandLineOption;
-import org.apache.axis.wsdl.codegen.CommandLineOptionConstants;
-import org.apache.wsdl.WSDLDescription;
-
-import javax.wsdl.WSDLException;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -29,27 +22,42 @@
import java.util.HashMap;
import java.util.Map;
+import javax.wsdl.WSDLException;
-public class WSDL2JavaGenerator {
+import org.apache.axis2.tool.codegen.eclipse.util.UIConstants;
+import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
+import org.apache.axis2.wsdl.codegen.CommandLineOption;
+import org.apache.axis2.wsdl.codegen.CommandLineOptionConstants;
+import org.apache.wsdl.WSDLDescription;
+
+public class WSDL2JavaGenerator {
+
/**
* Maps a string containing the name of a language to a constant defined in CommandLineOptionConstants.LanguageNames
*
* @param UILangValue a string containg a language, e.g. "java", "cs", "cpp" or "vb"
* @return a normalized string constant
*/
- private String mapLanguagesWithCombo(String UILangValue) {
- if (UIConstants.JAVA.equals(UILangValue)) {
- return CommandLineOptionConstants.LanguageNames.JAVA;
- } else if (UIConstants.C_SHARP.equals(UILangValue)) {
- return CommandLineOptionConstants.LanguageNames.C_SHARP;
- } else if (UIConstants.C_PLUS_PLUS.equals(UILangValue)) {
- return CommandLineOptionConstants.LanguageNames.C_PLUS_PLUS;
- } else {
- return null;
- }
+ private String mapLanguagesWithCombo(String UILangValue)
+ {
+ if (UIConstants.JAVA.equals(UILangValue))
+ {
+ return CommandLineOptionConstants.LanguageNames.JAVA;
+ }
+ else if (UIConstants.C_SHARP.equals(UILangValue))
+ {
+ return CommandLineOptionConstants.LanguageNames.C_SHARP;
+ }
+ else if (UIConstants.C_PLUS_PLUS.equals(UILangValue))
+ {
+ return CommandLineOptionConstants.LanguageNames.C_PLUS_PLUS;
+ }
+ else
+ {
+ return null;
+ }
}
-
/**
* Creates a list of parameters for the code generator based on the decisions made by the user on the OptionsPage
* (page2). For each setting, there is a Command-Line option for the Axis2 code generator.
@@ -57,89 +65,81 @@
* @return a Map with keys from CommandLineOptionConstants with the values entered by the user on the Options Page.
*/
public Map fillOptionMap(boolean isAyncOnly,
- boolean isSyncOnly,
- boolean isServerSide,
- boolean isServerXML,
- boolean isTestCase,
- String WSDLFileName,
- String packageName,
- String selectedLanguage,
- String outputLocation) {
- Map optionMap = new HashMap();
- //WSDL file name
- optionMap.put(CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION,
- getStringArray(WSDLFileName)));
-
- //Async only
- if (isAyncOnly) {
- optionMap.put(CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION,
- new String[0]));
- }
- //sync only
- if (isSyncOnly) {
- optionMap.put(CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION,
- new String[0]));
- }
- //serverside
- if (isServerSide) {
- optionMap.put(CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION,
- new String[0]));
- //server xml
- if (isServerXML) {
- optionMap.put(
- CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
- new String[0]));
- }
- }
- //test case
- if (isTestCase) {
- optionMap.put(CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION,
- new String[0]));
- }
- //package name
- optionMap.put(CommandLineOptionConstants.PACKAGE_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.PACKAGE_OPTION,
- getStringArray(packageName)));
- //selected language
- optionMap.put(CommandLineOptionConstants.STUB_LANGUAGE_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.STUB_LANGUAGE_OPTION,
- getStringArray(mapLanguagesWithCombo(selectedLanguage))));
- //output location
- optionMap.put(CommandLineOptionConstants.OUTPUT_LOCATION_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.OUTPUT_LOCATION_OPTION,
- getStringArray(outputLocation)));
-
- // System.out.println(page3.getOutputLocation());
- return optionMap;
+ boolean isSyncOnly,
+ boolean isServerSide,
+ boolean isServerXML,
+ boolean isTestCase,
+ String WSDLFileName,
+ String packageName,
+ String selectedLanguage,
+ String outputLocation
+ )
+ {
+ Map optionMap = new HashMap();
+ //WSDL file name
+ optionMap.put(CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION, getStringArray(WSDLFileName)));
+
+ //Async only
+ if (isAyncOnly)
+ {
+ optionMap.put(CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION, new String[0]));
+ }
+ //sync only
+ if (isSyncOnly)
+ {
+ optionMap.put(CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION, new String[0]));
+ }
+ //serverside
+ if (isServerSide)
+ {
+ optionMap.put(CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION, new String[0]));
+ //server xml
+ if (isServerXML)
+ {
+ optionMap.put(CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION, new String[0]));
+ }
+ }
+ //test case
+ if (isTestCase)
+ {
+ optionMap.put(CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION, new String[0]));
+ }
+ //package name
+ optionMap.put(CommandLineOptionConstants.PACKAGE_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.PACKAGE_OPTION, getStringArray(packageName)));
+ //selected language
+ optionMap.put(CommandLineOptionConstants.STUB_LANGUAGE_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.STUB_LANGUAGE_OPTION, getStringArray(mapLanguagesWithCombo(selectedLanguage))));
+ //output location
+ optionMap.put(CommandLineOptionConstants.OUTPUT_LOCATION_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.OUTPUT_LOCATION_OPTION, getStringArray(outputLocation)));
+
+ //data binding constant
+ // #########################################################################################
+ // This is set to the default NONE option since eclipse cannot load the XBeans thingy
+ //###########################################################################################
+ optionMap.put(CommandLineOptionConstants.DATA_BINDING_TYPE_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.DATA_BINDING_TYPE_OPTION, getStringArray(0+"")));
+ return optionMap;
}
-
/**
* Reads the WSDL Object Model from the given location.
- *
+ *
* @param wsdlLocation the filesystem location (full path) of the WSDL file to read in.
* @return the WSDLDescription object containing the WSDL Object Model of the given WSDL file
* @throws WSDLException when WSDL File is invalid
- * @throws IOException on errors reading the WSDL file
+ * @throws IOException on errors reading the WSDL file
*/
- public WSDLDescription getWOM(String wsdlLocation) throws WSDLException,
- IOException {
- InputStream in = new FileInputStream(new File(wsdlLocation));
- return WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11).build(in);
+ public WSDLDescription getWOM(String wsdlLocation) throws WSDLException, IOException
+ {
+ InputStream in = new FileInputStream(new File(wsdlLocation));
+ return WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11).build(in).getDescription();
}
/**
@@ -148,9 +148,10 @@
* @param value a single string
* @return an array containing only one element
*/
- private String[] getStringArray(String value) {
- String[] values = new String[1];
- values[0] = value;
- return values;
+ private String[] getStringArray(String value)
+ {
+ String[] values = new String[1];
+ values[0] = value;
+ return values;
}
}
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java Mon Aug 15 02:39:26 2005
@@ -1,15 +1,23 @@
-package org.apache.axis.tool.codegen.eclipse;
+package org.apache.axis2.tool.codegen.eclipse;
-import org.apache.axis.tool.codegen.Java2WSDLGenerator;
-import org.apache.axis.tool.codegen.WSDL2JavaGenerator;
-import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
-import org.apache.axis.tool.codegen.eclipse.ui.*;
-import org.apache.axis.tool.codegen.eclipse.util.SettingsConstants;
-import org.apache.axis.wsdl.codegen.CodeGenConfiguration;
-import org.apache.axis.wsdl.codegen.CodeGenerationEngine;
-import org.apache.wsdl.WSDLDescription;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Map;
+
+import org.apache.axis2.tool.codegen.Java2WSDLGenerator;
+import org.apache.axis2.tool.codegen.WSDL2JavaGenerator;
+import org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
+import org.apache.axis2.tool.codegen.eclipse.ui.AbstractWizardPage;
+import org.apache.axis2.tool.codegen.eclipse.ui.JavaSourceSelectionPage;
+import org.apache.axis2.tool.codegen.eclipse.ui.JavaWSDLOptionsPage;
+import org.apache.axis2.tool.codegen.eclipse.ui.JavaWSDLOutputLocationPage;
+import org.apache.axis2.tool.codegen.eclipse.ui.OptionsPage;
+import org.apache.axis2.tool.codegen.eclipse.ui.OutputPage;
+import org.apache.axis2.tool.codegen.eclipse.ui.ToolSelectionPage;
+import org.apache.axis2.tool.codegen.eclipse.ui.WSDLFileSelectionPage;
+import org.apache.axis2.tool.codegen.eclipse.util.SettingsConstants;
import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
import org.apache.axis2.wsdl.codegen.CodeGenerationEngine;
+import org.apache.wsdl.WSDLDescription;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -22,273 +30,286 @@
import org.eclipse.ui.IWorkbenchWizard;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-
/**
* The main wizard for the codegen wizard
*/
-public class CodeGenWizard extends Wizard implements INewWizard {
- private ToolSelectionPage toolSelectionPage;
- private WSDLFileSelectionPage wsdlSelectionPage;
- private OptionsPage optionsPage;
- private OutputPage outputPage;
- private JavaWSDLOptionsPage java2wsdlOptionsPage;
- private JavaSourceSelectionPage javaSourceSelectionPage;
- private JavaWSDLOutputLocationPage java2wsdlOutputLocationPage;
-
- private int selectedWizardType = SettingsConstants.WSDL_2_JAVA_TYPE;//TODO change this
- private ISelection selection;
- private boolean canFinish = false;
+public class CodeGenWizard extends Wizard implements INewWizard
+{
+ private ToolSelectionPage toolSelectionPage;
+ private WSDLFileSelectionPage wsdlSelectionPage;
+ private OptionsPage optionsPage;
+ private OutputPage outputPage;
+ private JavaWSDLOptionsPage java2wsdlOptionsPage;
+ private JavaSourceSelectionPage javaSourceSelectionPage;
+ private JavaWSDLOutputLocationPage java2wsdlOutputLocationPage;
+
+ private int selectedWizardType=SettingsConstants.WSDL_2_JAVA_TYPE;//TODO change this
+ private ISelection selection;
+ private boolean canFinish = false;
+
+ /**
+ * Constructor for CodeGenWizard.
+ */
+ public CodeGenWizard()
+ {
+ super();
+ setNeedsProgressMonitor(true);
+ this.setWindowTitle(org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin
+ .getResourceString("general.name"));
+ }
+
+ /**
+ * Adding the page to the wizard.
+ */
+
+ public void addPages()
+ {
+ toolSelectionPage = new ToolSelectionPage();
+ addPage(toolSelectionPage);
+
+ //add the wsdl2java wizard pages
+ wsdlSelectionPage = new WSDLFileSelectionPage();
+ addPage(wsdlSelectionPage);
+ optionsPage = new OptionsPage();
+ addPage(optionsPage);
+ outputPage = new OutputPage();
+ addPage(outputPage);
+
+ //add java2wsdl wizard pages
+ javaSourceSelectionPage = new JavaSourceSelectionPage();
+ addPage(javaSourceSelectionPage);
+ java2wsdlOptionsPage = new JavaWSDLOptionsPage();
+ addPage(java2wsdlOptionsPage);
+ java2wsdlOutputLocationPage = new JavaWSDLOutputLocationPage();
+ addPage(java2wsdlOutputLocationPage);
+
- /**
- * Constructor for CodeGenWizard.
- */
- public CodeGenWizard() {
- super();
- setNeedsProgressMonitor(true);
- this.setWindowTitle(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin
- .getResourceString("general.name"));
- }
-
- /**
- * Adding the page to the wizard.
- */
-
- public void addPages() {
- toolSelectionPage = new ToolSelectionPage();
- addPage(toolSelectionPage);
-
- //add the wsdl2java wizard pages
- wsdlSelectionPage = new WSDLFileSelectionPage();
- addPage(wsdlSelectionPage);
- optionsPage = new OptionsPage();
- addPage(optionsPage);
- outputPage = new OutputPage();
- addPage(outputPage);
-
- //add java2wsdl wizard pages
- javaSourceSelectionPage = new JavaSourceSelectionPage();
- addPage(javaSourceSelectionPage);
- java2wsdlOptionsPage = new JavaWSDLOptionsPage();
- addPage(java2wsdlOptionsPage);
- java2wsdlOutputLocationPage = new JavaWSDLOutputLocationPage();
- addPage(java2wsdlOutputLocationPage);
-
-
- }
+
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#canFinish()
*/
public boolean canFinish() {
- IWizardPage[] pages = getPages();
- AbstractWizardPage wizardPage = null;
- for (int i = 0; i < pages.length; i++) {
- wizardPage = (AbstractWizardPage) pages[i];
- if (wizardPage.getPageType() == this.selectedWizardType) {
- if (!(wizardPage.isPageComplete()))
- return false;
- }
- }
- return true;
+ IWizardPage[] pages = getPages();
+ AbstractWizardPage wizardPage = null;
+ for (int i = 0; i < pages.length; i++) {
+ wizardPage = (AbstractWizardPage)pages[i];
+ if (wizardPage.getPageType()==this.selectedWizardType){
+ if (!(wizardPage.isPageComplete()))
+ return false;
+ }
+ }
+ return true;
}
-
- public IWizardPage getNextPage(IWizardPage page) {
- AbstractWizardPage currentPage = (AbstractWizardPage) page;
- AbstractWizardPage pageout = (AbstractWizardPage) super.getNextPage(
- page);
-
- while (pageout != null && selectedWizardType != pageout.getPageType()) {
- AbstractWizardPage temp = pageout;
- pageout = (AbstractWizardPage) super.getNextPage(currentPage);
- currentPage = temp;
-
- }
- return pageout;
+ public IWizardPage getNextPage(IWizardPage page) {
+ AbstractWizardPage currentPage=(AbstractWizardPage)page;
+ AbstractWizardPage pageout = (AbstractWizardPage)super.getNextPage(page);
+
+ while (pageout!=null && selectedWizardType!=pageout.getPageType()){
+ AbstractWizardPage temp = pageout;
+ pageout = (AbstractWizardPage)super.getNextPage(currentPage);
+ currentPage = temp;
+
+ }
+ return pageout;
}
-
- /**
- * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using
- * wizard as execution context.
- */
- public boolean performFinish() {
- try {
- switch (selectedWizardType) {
- case SettingsConstants.WSDL_2_JAVA_TYPE:
- doFinishWSDL2Java();
- break;
- case SettingsConstants.JAVA_2_WSDL_TYPE:
- doFinishJava2WSDL();
- break;
- case SettingsConstants.UNSPECIFIED_TYPE:
- break; //Do nothing
- default:
- throw new RuntimeException("Invalid state!");
- }
- } catch (Exception e) {
- MessageDialog.openError(getShell(),
- CodegenWizardPlugin.getResourceString("general.Error"),
- e.getMessage());
- return false;
+
+ /**
+ * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using
+ * wizard as execution context.
+ */
+ public boolean performFinish()
+ {
+ try
+ {
+ switch (selectedWizardType){
+ case SettingsConstants.WSDL_2_JAVA_TYPE:doFinishWSDL2Java();break;
+ case SettingsConstants.JAVA_2_WSDL_TYPE:doFinishJava2WSDL();break;
+ case SettingsConstants.UNSPECIFIED_TYPE:break; //Do nothing
+ default:throw new RuntimeException("Invalid state!");
}
- MessageDialog.openInformation(this.getShell(), CodegenWizardPlugin.getResourceString(
- "general.name"),
- CodegenWizardPlugin.getResourceString("wizard.success"));
- return true;
- }
-
- /**
- * The worker method, generates the code itself.
- */
- private void doFinishWSDL2Java() {
-
- WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
- protected void execute(IProgressMonitor monitor) {
- if (monitor == null)
- monitor = new NullProgressMonitor();
-
- /*
- * "3" is the total amount of steps, see below monitor.worked(amount)
- */
- monitor.beginTask(
- CodegenWizardPlugin.getResourceString(
- "generator.generating"),
- 3);
-
- try {
- /*
- * TODO: Introduce a progress monitor interface for CodeGenerationEngine.
- * Since this monitor here doesn't make much sense, we
- * should either remove the progress monitor from the CodeGenWizard,
- * or give a (custom) progress monitor to the generate() method, so
- * we will be informed by Axis2 about the progress of code generation.
- */
- WSDL2JavaGenerator generator = new WSDL2JavaGenerator();
- monitor.subTask(
- CodegenWizardPlugin.getResourceString(
- "generator.readingWOM"));
- WSDLDescription wom = generator.getWOM(
- wsdlSelectionPage.getFileName());
- monitor.worked(1);
-
- Map optionsMap = generator.fillOptionMap(
- optionsPage.isAsyncOnlyOn(),
- optionsPage.isSyncOnlyOn(),
- optionsPage.isServerside(),
- optionsPage.isServerXML(),
- optionsPage.isGenerateTestCase(),
- wsdlSelectionPage.getFileName(),
- optionsPage.getPackageName(),
- optionsPage.getSelectedLanguage(),
- outputPage.getOutputLocation());
- CodeGenConfiguration codegenConfig = new CodeGenConfiguration(
- wom, optionsMap);
- monitor.worked(1);
-
- monitor.subTask(
- CodegenWizardPlugin.getResourceString(
- "generator.generating"));
- new CodeGenerationEngine(codegenConfig).generate();
- monitor.worked(1);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- monitor.done();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ MessageDialog.openError(getShell(), CodegenWizardPlugin.getResourceString("general.Error"), e.getMessage());
+ return false;
+ }
+ MessageDialog.openInformation(this.getShell(), CodegenWizardPlugin.getResourceString("general.name"),
+ CodegenWizardPlugin.getResourceString("wizard.success"));
+ return true;
+ }
+
+ /**
+ * The worker method, generates the code itself.
+ */
+ private void doFinishWSDL2Java()
+ {
+
+ WorkspaceModifyOperation op = new WorkspaceModifyOperation()
+ {
+ protected void execute(IProgressMonitor monitor)
+ {
+ if (monitor == null)
+ monitor = new NullProgressMonitor();
+
+ /*
+ * "3" is the total amount of steps, see below monitor.worked(amount)
+ */
+ monitor.beginTask(CodegenWizardPlugin.getResourceString("generator.generating"), 3);
+
+ try
+ {
+ /*
+ * TODO: Introduce a progress monitor interface for CodeGenerationEngine.
+ * Since this monitor here doesn't make much sense, we
+ * should either remove the progress monitor from the CodeGenWizard,
+ * or give a (custom) progress monitor to the generate() method, so
+ * we will be informed by Axis2 about the progress of code generation.
+ */
+ WSDL2JavaGenerator generator = new WSDL2JavaGenerator();
+ monitor.subTask(CodegenWizardPlugin.getResourceString("generator.readingWOM"));
+ WSDLDescription wom = generator.getWOM(wsdlSelectionPage.getFileName());
+ monitor.worked(1);
+
+ Map optionsMap = generator.fillOptionMap(optionsPage.isAsyncOnlyOn(),
+ optionsPage.isSyncOnlyOn(),
+ optionsPage.isServerside(),
+ optionsPage.isServerXML(),
+ optionsPage.isGenerateTestCase(),
+ wsdlSelectionPage.getFileName(),
+ optionsPage.getPackageName(),
+ optionsPage.getSelectedLanguage(),
+ outputPage.getOutputLocation());
+ CodeGenConfiguration codegenConfig = new CodeGenConfiguration(wom, optionsMap);
+ monitor.worked(1);
+
+ monitor.subTask(CodegenWizardPlugin.getResourceString("generator.generating"));
+ new CodeGenerationEngine(codegenConfig).generate();
+ monitor.worked(1);
+ }
+ catch (Exception e)
+ {
+
+ throw new RuntimeException(e);
}
- };
-
-
- /*
- * Start the generation as new Workbench Operation, so the user
- * can see the progress and, if needed, can stop the operation.
- */
- try {
- getContainer().run(false, true, op);
- } catch (InvocationTargetException e1) {
- throw new RuntimeException(e1);
- } catch (InterruptedException e1) {
- throw new RuntimeException("User Aborted!");
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- private void doFinishJava2WSDL() throws Exception {
- WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
- protected void execute(IProgressMonitor monitor) {
- if (monitor == null)
+ monitor.done();
+ }
+ };
+
+
+ /*
+ * Start the generation as new Workbench Operation, so the user
+ * can see the progress and, if needed, can stop the operation.
+ */
+ try
+ {
+ getContainer().run(false, true, op);
+ }
+ catch (InvocationTargetException e1)
+ {
+ throw new RuntimeException(e1);
+ }
+ catch (InterruptedException e1)
+ {
+ throw new RuntimeException("User Aborted!");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void doFinishJava2WSDL() throws Exception{
+
+ WorkspaceModifyOperation op = new WorkspaceModifyOperation()
+ {
+ protected void execute(IProgressMonitor monitor)
+ {
+ if (monitor == null)
monitor = new NullProgressMonitor();
- /*
- * "2" is the total amount of steps, see below monitor.worked(amount)
- */
- monitor.beginTask(
- CodegenWizardPlugin.getResourceString(
- "generator.generating"),
- 2);
-
- try {
- monitor.worked(1);
-
- new Java2WSDLGenerator().emit(
- javaSourceSelectionPage.getClassLocation(),
- javaSourceSelectionPage.getClassName(),
- java2wsdlOptionsPage.getLocationURL(),
- java2wsdlOptionsPage.getInputWSDLName(),
- java2wsdlOptionsPage.getBindingName(),
- java2wsdlOptionsPage.getPortypeName(),
- java2wsdlOptionsPage.getStyle(),
- java2wsdlOutputLocationPage.getFullFileName(),
- java2wsdlOptionsPage.getMode(),
- javaSourceSelectionPage.getSelectedMethods());
- monitor.worked(1);
- } catch (Throwable e) {
+ /*
+ * "2" is the total amount of steps, see below monitor.worked(amount)
+ */
+ monitor.beginTask(CodegenWizardPlugin.getResourceString("generator.generating"), 2);
+
+ try
+ {
+ monitor.worked(1);
+
+ new Java2WSDLGenerator().emit(
+ javaSourceSelectionPage.getClassLocation(),
+ javaSourceSelectionPage.getClassName(),
+ java2wsdlOptionsPage.getLocationURL(),
+ java2wsdlOptionsPage.getInputWSDLName(),
+ java2wsdlOptionsPage.getBindingName(),
+ java2wsdlOptionsPage.getPortypeName(),
+ java2wsdlOptionsPage.getStyle(),
+ java2wsdlOutputLocationPage.getFullFileName(),
+ java2wsdlOptionsPage.getMode(),
+ javaSourceSelectionPage.getSelectedMethods()
+ );
+ monitor.worked(1);
+ }
+ catch (Throwable e)
+ {
throw new RuntimeException(e);
- }
-
- monitor.done();
- }
- };
-
- try {
- getContainer().run(false, true, op);
- } catch (InvocationTargetException e1) {
- throw new RuntimeException(e1);
- } catch (InterruptedException e1) {
- throw new RuntimeException("User Aborted!");
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- }
+ }
-
- /**
- * We will accept the selection in the workbench to see if we can initialize from it.
- *
- * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.selection = selection;
- }
-
-
- /**
- * @return Returns the selectedWizardType.
- */
- public int getSelectedWizardType() {
- return selectedWizardType;
- }
-
- /**
- * @param selectedWizardType The selectedWizardType to set.
- */
- public void setSelectedWizardType(int selectedWizardType) {
- this.selectedWizardType = selectedWizardType;
- }
+ monitor.done();
+ }
+ };
+
+ try
+ {
+ getContainer().run(false, true, op);
+ }
+ catch (InvocationTargetException e1)
+ {
+ throw new RuntimeException(e1);
+ }
+ catch (InterruptedException e1)
+ {
+ throw new RuntimeException("User Aborted!");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ }
+
+
+
+ /**
+ * We will accept the selection in the workbench to see if we can initialize from it.
+ *
+ * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection)
+ {
+ this.selection = selection;
+ }
+
+
+
+
+/**
+ * @return Returns the selectedWizardType.
+ */
+public int getSelectedWizardType() {
+ return selectedWizardType;
+}
+/**
+ * @param selectedWizardType The selectedWizardType to set.
+ */
+public void setSelectedWizardType(int selectedWizardType) {
+ this.selectedWizardType = selectedWizardType;
+}
}
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java Mon Aug 15 02:39:26 2005
@@ -1,86 +1,81 @@
-package org.apache.axis.tool.codegen.eclipse.plugin;
+package org.apache.axis2.tool.codegen.eclipse.plugin;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
/**
* The main plugin class to be used in the desktop.
*/
public class CodegenWizardPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static CodegenWizardPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
- private static ImageDescriptor wizardImageDescriptor;
-
- /**
- * The constructor.
- */
- public CodegenWizardPlugin() {
- super();
- plugin = this;
- try {
- resourceBundle =
- ResourceBundle.getBundle(
- "org.apache.axis.tool.codegen.resource.Codegen");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-
- /**
- * Returns the shared instance.
- */
- public static CodegenWizardPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = CodegenWizardPlugin.getDefault()
- .getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- public static ImageDescriptor getWizardImageDescriptor() {
- if (wizardImageDescriptor == null) {
- wizardImageDescriptor =
- CodegenWizardPlugin.imageDescriptorFromPlugin(
- "Axis2_Codegen_Wizard", "icons/asf-feather.gif");
- }
- return wizardImageDescriptor;
- }
-
+ //The shared instance.
+ private static CodegenWizardPlugin plugin;
+ //Resource bundle.
+ private ResourceBundle resourceBundle;
+ private static ImageDescriptor wizardImageDescriptor;
+
+ /**
+ * The constructor.
+ */
+ public CodegenWizardPlugin() {
+ super();
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle("org.apache.axis2.tool.codegen.resource.Codegen");
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static CodegenWizardPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = CodegenWizardPlugin.getDefault().getResourceBundle();
+ try {
+ return (bundle != null) ? bundle.getString(key) : key;
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ public static ImageDescriptor getWizardImageDescriptor(){
+ if (wizardImageDescriptor==null){
+ wizardImageDescriptor =CodegenWizardPlugin.imageDescriptorFromPlugin("Axis2_Codegen_Wizard","icons/asf-feather.gif");
+ }
+ return wizardImageDescriptor;
+ }
+
}
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=232780&r1=232779&r2=232780&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 Aug 15 02:39:26 2005
@@ -13,27 +13,26 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.axis.tool.codegen.eclipse.ui;
+package org.apache.axis2.tool.codegen.eclipse.ui;
-import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
-import org.apache.axis.tool.codegen.eclipse.util.SettingsConstants;
+import org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
+import org.apache.axis2.tool.codegen.eclipse.util.SettingsConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
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());
/*
@@ -49,7 +48,7 @@
restoredFromPreviousSettings = false;
initializeDefaultSettings();
} else {
- restoredFromPreviousSettings = true;
+ restoredFromPreviousSettings=true;
settings = section;
}
}
@@ -59,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=232780&r1=232779&r2=232780&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 Aug 15 02:39:26 2005
@@ -13,14 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-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.*;
+package org.apache.axis2.tool.codegen.eclipse.ui;
import java.io.File;
import java.lang.reflect.Method;
@@ -29,18 +22,36 @@
import java.net.URLClassLoader;
import java.util.Vector;
-public class JavaSourceSelectionPage extends AbstractWizardPage {
+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.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{
+
private Text javaClassFileLocationBox;
private Text javaClassNameBox;
private Button searchDeclaredMethodsCheckBox;
-
+
private Table table;
-
+
private boolean dirty;
- public JavaSourceSelectionPage() {
+ public JavaSourceSelectionPage() {
super("page4");
}
@@ -52,7 +63,7 @@
/*
* (non-Javadoc)
*
- * @see org.apache.axis.tool.codegen.eclipse.ui.CodegenPage#getPageType()
+ * @see org.apache.axis2.tool.codegen.eclipse.ui.CodegenPage#getPageType()
*/
public int getPageType() {
return JAVA_2_WSDL_TYPE;
@@ -78,14 +89,13 @@
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.setText(settings.get(JAVA_CLASS_LOCATION_NAME));
+ javaClassFileLocationBox.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e){
+ handleLocationTextChange();
}
});
-
+
Button browseButton = new Button(container, SWT.PUSH);
browseButton.setText(CodegenWizardPlugin
@@ -95,21 +105,21 @@
handleDirectoryBrowse();
}
});
-
+
label = new Label(container, SWT.NULL);
label.setText(CodegenWizardPlugin
.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"));
@@ -121,53 +131,49 @@
//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());
@@ -177,62 +183,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 < itemLength; i++) {
- if (items[i].getChecked()) {
- list.add(items[i].getText(1));//get the selected method name only
- }
+ for(int i=0;i<itemLength;i++){
+ if(items[i].getChecked()){
+ list.add(items[i].getText(1));//get the selected method name only
+ }
}
return list;
}
-
+
private void updateTable() {
//get a URL from the class file location
try {
String classFileLocation = this.getClassLocation();
URL classFileURL = new File(classFileLocation).toURL();
- ClassLoader loader = new URLClassLoader(new URL[]{classFileURL});
+ ClassLoader loader = new URLClassLoader(new URL[] { classFileURL },Thread.currentThread().getContextClassLoader());
Class clazz = loader.loadClass(getClassName());
Method[] methods = null;
-
- if (searchDeclaredMethodsCheckBox.getSelection()) {
+
+ if (searchDeclaredMethodsCheckBox.getSelection()){
methods = clazz.getDeclaredMethods();
- } else {
+ }else{
methods = clazz.getMethods();
}
@@ -240,31 +246,30 @@
if (methodCount > 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=232780&r1=232779&r2=232780&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 Aug 15 02:39:26 2005
@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.axis.tool.codegen.eclipse.ui;
+package org.apache.axis2.tool.codegen.eclipse.ui;
-import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
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;
@@ -75,7 +75,7 @@
private Text bindingTextBox;
private Combo modeSelectionCombo;
-
+
private Combo styleSelectionCombo;
@@ -84,15 +84,15 @@
/*
* (non-Javadoc)
*
- * @see org.apache.axis.tool.codegen.eclipse.ui.AbstractWizardPage#initializeDefaultSettings()
+ * @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);
+ 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);
}
/**
@@ -106,7 +106,7 @@
/*
* (non-Javadoc)
*
- * @see org.apache.axis.tool.codegen.eclipse.ui.CodegenPage#getPageType()
+ * @see org.apache.axis2.tool.codegen.eclipse.ui.CodegenPage#getPageType()
*/
public int getPageType() {
return JAVA_2_WSDL_TYPE;
@@ -134,8 +134,7 @@
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());
+ settings.put(PREF_JAVA_INPUT_WSDL_NAME, inputWSDLNameTextBox.getText());
//dialogChanged();
}
});
@@ -150,12 +149,11 @@
serviceLocationURLTextBox.setText(settings.get(PREF_JAVA_LOCATION));
serviceLocationURLTextBox.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- settings.put(PREF_JAVA_LOCATION,
- serviceLocationURLTextBox.getText());
+ settings.put(PREF_JAVA_LOCATION, serviceLocationURLTextBox.getText());
//dialogChanged();
}
});
-
+
label = new Label(container, SWT.NULL);
label.setText(CodegenWizardPlugin
.getResourceString("page5.binding.label"));
@@ -170,7 +168,7 @@
//dialogChanged();
}
});
-
+
label = new Label(container, SWT.NULL);
label.setText(CodegenWizardPlugin
.getResourceString("page5.porttype.label"));
@@ -181,8 +179,7 @@
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());
+ settings.put(PREF_JAVA_PORTYPE_NAME, portTypeNameTextBox.getText());
//dialogChanged();
}
});
@@ -191,48 +188,38 @@
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 = 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());
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
+ 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"));
+ .getResourceString("page5.style.label"));
gd = new GridData(GridData.FILL_HORIZONTAL);
- styleSelectionCombo =
- new Combo(container,
- SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY);
+ 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) {
+ styleSelectionCombo.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e){
+ settings.put(PREF_JAVA_STYLE_INDEX,styleSelectionCombo.getSelectionIndex());
}
+ public void widgetDefaultSelected(SelectionEvent e){}
});
-
-
+
+
setControl(container);
}
@@ -252,28 +239,24 @@
styleSelectionCombo.select(settings.getInt(PREF_JAVA_STYLE_INDEX));
}
-
- public int getMode() {
- String selectedOption = modeSelectionCombo.getItem(
- modeSelectionCombo.getSelectionIndex());
- if (WSDL_ALL.equals(selectedOption)) {
+ 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)) {
+ }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() {
- return this.styleSelectionCombo.getItem(
- styleSelectionCombo.getSelectionIndex())
- .toUpperCase();
+
+ public String getStyle(){
+ return this.styleSelectionCombo.getItem(styleSelectionCombo.getSelectionIndex()).toUpperCase();
}
-
public String getLocationURL() {
return this.serviceLocationURLTextBox.getText();
}
@@ -289,10 +272,11 @@
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=232780&r1=232779&r2=232780&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 Aug 15 02:39:26 2005
@@ -13,9 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.axis.tool.codegen.eclipse.ui;
+package org.apache.axis2.tool.codegen.eclipse.ui;
-import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
+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;
@@ -23,18 +25,20 @@
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-
-import java.io.File;
+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
- * <p/>
- * 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;
@@ -44,22 +48,20 @@
public JavaWSDLOutputLocationPage() {
super("page6");
}
-
/* (non-Javadoc)
- * @see org.apache.axis.tool.codegen.eclipse.ui.AbstractWizardPage#initializeDefaultSettings()
+ * @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");
+ settings.put(PREF_JAVA_OUTPUT_WSDL_LOCATION,System.getProperty("user.dir"));
+ settings.put(JAVA_OUTPUT_WSDL_NAME,"service.wsdl");
}
/* (non-Javadoc)
- * @see org.apache.axis.tool.codegen.eclipse.ui.AbstractWizardPage#getPageType()
+ * @see org.apache.axis2.tool.codegen.eclipse.ui.AbstractWizardPage#getPageType()
*/
public int getPageType() {
- return JAVA_2_WSDL_TYPE;
+ return JAVA_2_WSDL_TYPE;
}
/* (non-Javadoc)
@@ -77,74 +79,71 @@
label.setText(CodegenWizardPlugin
.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.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);
+
+ 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) {
+ 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 = 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) {
@@ -152,21 +151,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();
}