You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by aj...@apache.org on 2006/01/10 12:44:45 UTC
svn commit: r367572 - in
/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen:
./ eclipse/ eclipse/ui/ eclipse/util/ resource/
Author: ajith
Date: Tue Jan 10 03:44:30 2006
New Revision: 367572
URL: http://svn.apache.org/viewcvs?rev=367572&view=rev
Log:
Updated the Eclipse codegen wizard
Modified:
webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java
webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/ui/OptionsPage.java
webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/SettingsConstants.java
webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/UIConstants.java
webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/resource/Codegen.properties
Modified: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java?rev=367572&r1=367571&r2=367572&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java (original)
+++ webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java Tue Jan 10 03:44:30 2006
@@ -41,7 +41,7 @@
*/
private String mapLanguagesWithCombo(String UILangValue)
{
- return UILangValue; // TODO : Ajith please fix this.
+ return UILangValue;
}
/**
* Creates a list of parameters for the code generator based on the decisions made by the user on the OptionsPage
@@ -54,6 +54,10 @@
boolean isServerSide,
boolean isServerXML,
boolean isTestCase,
+ boolean isGenerateAll,
+ String serviceName,
+ String portName,
+ String databindingName,
String WSDLURI,
String packageName,
String selectedLanguage,
@@ -88,6 +92,10 @@
optionMap.put(CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION, new CommandLineOption(
CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION, new String[0]));
}
+ if (isGenerateAll){
+ optionMap.put(CommandLineOptionConstants.GENERATE_ALL_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.GENERATE_ALL_OPTION, new String[0]));
+ }
}
//test case
if (isTestCase)
@@ -105,13 +113,22 @@
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
- //###########################################################################################
+ //databinding
optionMap.put(CommandLineOptionConstants.DATA_BINDING_TYPE_OPTION, new CommandLineOption(
- CommandLineOptionConstants.DATA_BINDING_TYPE_OPTION, getStringArray("none")));
+ CommandLineOptionConstants.DATA_BINDING_TYPE_OPTION, getStringArray(databindingName)));
+
+ //port name
+ if (portName!=null){
+ optionMap.put(CommandLineOptionConstants.PORT_NAME_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.PORT_NAME_OPTION, getStringArray(portName)));
+ }
+ //service name
+ if (serviceName!= null){
+ optionMap.put(CommandLineOptionConstants.SERVICE_NAME_OPTION, new CommandLineOption(
+ CommandLineOptionConstants.SERVICE_NAME_OPTION, getStringArray(serviceName)));
+ }
return optionMap;
+
}
/**
* Reads the WSDL Object Model from the given location.
Modified: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java?rev=367572&r1=367571&r2=367572&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java (original)
+++ webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java Tue Jan 10 03:44:30 2006
@@ -1,5 +1,9 @@
package org.apache.axis2.tool.codegen.eclipse;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Map;
+import java.util.Vector;
+
import org.apache.axis2.tool.codegen.Java2WSDLGenerator;
import org.apache.axis2.tool.codegen.WSDL2JavaGenerator;
import org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
@@ -27,229 +31,249 @@
import org.eclipse.ui.IWorkbenchWizard;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-import java.util.Vector;
-
/**
* 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;
-
- /**
- * 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);
-
+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;
-
- /* (non-Javadoc)
+ 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);
+
+ }
+
+ /*
+ * (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;
- }
- 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;
+ 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;
}
-
- /**
- * 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!");
+
+ 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;
+
}
- }
- catch (Exception e)
- {
- 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)
- {
- e.printStackTrace();
- throw new RuntimeException(e);
+ 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"),
+ CodegenWizardPlugin.getResourceString("general.Error.prefix") +
+ e.getMessage());
+ return false;
+ }
+ MessageDialog.openInformation(this.getShell(),
+ CodegenWizardPlugin
+ .getResourceString("general.name"), CodegenWizardPlugin
+ .getResourceString("wizard.success"));
+ return true;
+ }
- 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()
+ /**
+ * The worker method, generates the code itself.
+ */
+ private void doFinishWSDL2Java() {
+ WorkspaceModifyOperation op = new WorkspaceModifyOperation()
+ {
+ protected void execute(IProgressMonitor monitor)
{
- protected void execute(IProgressMonitor monitor)
- {
- if (monitor == null)
- monitor = new NullProgressMonitor();
+ 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
+ {
/*
- * "2" is the total amount of steps, see below monitor.worked(amount)
+ * 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.
*/
- monitor.beginTask(CodegenWizardPlugin.getResourceString("generator.generating"), 2);
+ 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(),
+ optionsPage.getGenerateAll(),
+ optionsPage.getServiceName(),
+ optionsPage.getPortName(),
+ optionsPage.getDatabinderName(),
+ wsdlSelectionPage.getFileName(),
+ optionsPage.getPackageName(),
+ optionsPage.getSelectedLanguage(),
+ outputPage.getOutputLocation());
+ CodeGenConfiguration codegenConfig = new CodeGenConfiguration(wom, optionsMap);
+ monitor.worked(1);
+
+ monitor.subTask(CodegenWizardPlugin.getResourceString("generator.generating"));
+ try {
+ new CodeGenerationEngine(codegenConfig).generate();
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ monitor.worked(1);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
- try
- {
- monitor.worked(1);
- String classLocation = javaSourceSelectionPage.getClassLocation();
+ 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);
+ String classLocation = javaSourceSelectionPage
+ .getClassLocation();
monitor.worked(1);
String className = javaSourceSelectionPage.getClassName();
monitor.worked(1);
String locationURL = java2wsdlOptionsPage.getLocationURL();
monitor.worked(1);
- String inputWSDLName = java2wsdlOptionsPage.getInputWSDLName();
+ String inputWSDLName = java2wsdlOptionsPage
+ .getInputWSDLName();
monitor.worked(1);
String bindingName = java2wsdlOptionsPage.getBindingName();
monitor.worked(1);
@@ -257,79 +281,61 @@
monitor.worked(1);
String style = java2wsdlOptionsPage.getStyle();
monitor.worked(1);
- String fullFileName = java2wsdlOutputLocationPage.getFullFileName();
+ String fullFileName = java2wsdlOutputLocationPage
+ .getFullFileName();
monitor.worked(1);
int mode = java2wsdlOptionsPage.getMode();
monitor.worked(1);
- Vector selectedMethods = javaSourceSelectionPage.getSelectedMethods();
+ Vector selectedMethods = javaSourceSelectionPage
+ .getSelectedMethods();
+ monitor.worked(1);
+ new Java2WSDLGenerator().emit(classLocation, className,
+ locationURL, inputWSDLName, bindingName,
+ portypeName, style, fullFileName, mode,
+ selectedMethods);
monitor.worked(1);
- new Java2WSDLGenerator().emit(
- classLocation,
- className,
- locationURL,
- inputWSDLName,
- bindingName,
- portypeName,
- style,
- fullFileName,
- mode,
- selectedMethods
- );
- monitor.worked(1);
- }
- catch (Throwable e)
- {
+ } 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/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=367572&r1=367571&r2=367572&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 Tue Jan 10 03:44:30 2006
@@ -77,8 +77,22 @@
* Checkbox to enable the generation of a default server.xml configuration file
*/
private Button serverXMLCheckBoxButton;
- private Button enableDataBindingButton;
+ /**
+ * Checkbox to enable the generate all classes
+ */
+ private Button generateAllCheckBoxButton;
+
private Combo databindingTypeCombo;
+
+ /**
+ * Text box to have the portname
+ */
+ private Text portNameText;
+
+ /**
+ * Text box to have the service name
+ */
+ private Text serviceNameText;
/**
* Creates the page and initialize some settings
@@ -103,6 +117,10 @@
settings.put(PREF_RADIO_ASYNC_ONLY, false);
settings.put(PREF_RADIO_SYNC_AND_ASYNC, true);
settings.put(PREF_RADIO_SYNC_ONLY, false);
+ settings.put(PREF_TEXT_PORTNAME, "");
+ settings.put(PREF_TEXT_SERVICENAME, "");
+ settings.put(PREF_DATABINDER_INDEX,0);
+ settings.put(PREF_GEN_ALL,false);
}
/*
@@ -187,10 +205,38 @@
{
}
});
-
+
+// service name
+ label = new Label(container, SWT.NULL);
+ label.setText(CodegenWizardPlugin.getResourceString("page2.serviceName.caption"));
+ serviceNameText = new Text(container, SWT.BORDER);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ serviceNameText.setLayoutData(gd);
+ serviceNameText.setText(settings.get(PREF_TEXT_SERVICENAME));
+ serviceNameText.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e){
+ settings.put(PREF_TEXT_SERVICENAME,serviceNameText.getText());
+ }
+ });
+
+ //port name
+ label = new Label(container, SWT.NULL);
+ label.setText(CodegenWizardPlugin.getResourceString("page2.portName.caption"));
+ portNameText = new Text(container, SWT.BORDER);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ portNameText.setLayoutData(gd);
+ portNameText.setText(settings.get(PREF_TEXT_PORTNAME));
+ portNameText.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e){
+ settings.put(PREF_TEXT_PORTNAME,portNameText.getText());
+ }
+ });
+
+ //package name
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;
@@ -234,7 +280,7 @@
{
}
});
-
+ // Server side check box
serverSideCheckBoxButton = new Button(container, SWT.CHECK);
serverSideCheckBoxButton.setText(CodegenWizardPlugin.getResourceString("page2.serverside.caption"));
serverSideCheckBoxButton.setSelection(settings.getBoolean(PREF_CHECK_GENERATE_SERVERSIDE));
@@ -250,8 +296,10 @@
{
}
});
+
+ //Server side services xml
gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
+ gd.horizontalSpan = 1;
serverXMLCheckBoxButton = new Button(container, SWT.CHECK);
serverXMLCheckBoxButton.setLayoutData(gd);
serverXMLCheckBoxButton.setSelection(settings.getBoolean(PREF_CHECK_GENERATE_SERVERCONFIG));
@@ -267,18 +315,45 @@
{
}
});
+ //generate all
+ generateAllCheckBoxButton = new Button(container, SWT.CHECK);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ generateAllCheckBoxButton.setLayoutData(gd);
+ generateAllCheckBoxButton.setSelection(settings.getBoolean(PREF_GEN_ALL));
+ generateAllCheckBoxButton.setText(CodegenWizardPlugin.getResourceString("page2.genAll.caption"));
+ generateAllCheckBoxButton.addSelectionListener(new SelectionListener()
+ {
+ public void widgetSelected(SelectionEvent e)
+ {
+ settings.put(PREF_GEN_ALL, 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);
+ // Databinding
+ label = new Label(container, SWT.NULL);
+ label.setText(CodegenWizardPlugin.getResourceString("page2.databindingCheck.caption"));
+
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);
+ fillDatabinderCombo();
+ databindingTypeCombo.select(settings.getInt(PREF_DATABINDER_INDEX));
+ databindingTypeCombo.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e){
+ settings.put(PREF_DATABINDER_INDEX,databindingTypeCombo.getSelectionIndex());
+
+ };
+ public void widgetDefaultSelected(SelectionEvent e){};
+ });
+
+
/*
* Check the state of server-side selection, so we can enable/disable
* the serverXML checkbox button.
@@ -295,13 +370,24 @@
* Fill the combo with proper language names
*
*/
+ private void fillDatabinderCombo()
+ {
+
+ databindingTypeCombo.add(DATA_BINDING_ADB);
+ databindingTypeCombo.add(DATA_BINDING_NONE);
+
+
+ }
+ /**
+ * 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);
}
@@ -314,10 +400,12 @@
if (this.serverSideCheckBoxButton.getSelection())
{
this.serverXMLCheckBoxButton.setEnabled(true);
+ this.generateAllCheckBoxButton.setEnabled(true);
}
else
{
this.serverXMLCheckBoxButton.setEnabled(false);
+ this.generateAllCheckBoxButton.setEnabled(false);
}
}
@@ -398,5 +486,44 @@
*/
public int getPageType() {
return WSDL_2_JAVA_TYPE;
+ }
+
+ /**
+ *
+ * @return null if portname is empty
+ */
+ public String getPortName(){
+ String text = this.portNameText.getText();
+ if (text==null || text.trim().equals("")){
+ return null;
+ }
+ return text;
+
+ }
+
+ /**
+ * @return null if the text is empty
+ *
+ */
+ public String getServiceName(){
+ String text = this.serviceNameText.getText();
+ if (text==null || text.trim().equals("")){
+ return null;
+ }
+ return text;
+
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getDatabinderName(){
+ return this.databindingTypeCombo.getItem(databindingTypeCombo.getSelectionIndex());
+
+ }
+
+ public boolean getGenerateAll(){
+ return this.generateAllCheckBoxButton.getSelection();
}
}
Modified: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/SettingsConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/SettingsConstants.java?rev=367572&r1=367571&r2=367572&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/SettingsConstants.java (original)
+++ webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/SettingsConstants.java Tue Jan 10 03:44:30 2006
@@ -79,6 +79,14 @@
* A boolean value whether the server-side configuration file for Axis2 (server.xml) will be generated or not.
*/
static final String PREF_CHECK_GENERATE_SERVERCONFIG = "PREF_CHECK_GENERATE_SERVERCONFIG";
+
+ static final String PREF_TEXT_PORTNAME = "PREF_TEXT_PORTNAME";
+
+ static final String PREF_TEXT_SERVICENAME = "PREF_TEXT_SERVICENAME";
+
+ static final String PREF_DATABINDER_INDEX = "PREF_DATABINDER_INDEX";
+
+ static final String PREF_GEN_ALL = "PREF_GEN_ALL";
// ##################################################################################
// Java source file selection page
Modified: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/UIConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/UIConstants.java?rev=367572&r1=367571&r2=367572&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/UIConstants.java (original)
+++ webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/util/UIConstants.java Tue Jan 10 03:44:30 2006
@@ -16,8 +16,13 @@
package org.apache.axis2.tool.codegen.eclipse.util;
public interface UIConstants {
- public static final String JAVA = "Java" ;
- public static final String C_SHARP = "C#" ;
+ public static final String JAVA = "java" ;
+ public static final String C_SHARP = "c-sharp" ;
public static final String C_PLUS_PLUS = "C++" ;
+
+ public static final String DATA_BINDING_NONE = "none" ;
+ public static final String DATA_BINDING_ADB = "adb" ;
+
+
}
Modified: webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/resource/Codegen.properties
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/resource/Codegen.properties?rev=367572&r1=367571&r2=367572&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/resource/Codegen.properties (original)
+++ webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/resource/Codegen.properties Tue Jan 10 03:44:30 2006
@@ -4,6 +4,7 @@
##
#General
general.Error=Error
+general.Error.prefix=An error occured while code generating
general.name=Axis2 Codegen Wizard
general.browse=Browse...
general.search=Search..
@@ -43,11 +44,14 @@
page2.syncAsync.caption=Generate both sync and async
page2.sync.caption=Generate sync style only
page2.async.caption=Generate async style only
-page2.package.caption=Set the package name
+page2.package.caption=Custom package name
page2.serverside.caption=Generate serverside code
-page2.serviceXML.caption=Generate a default server.xml
+page2.serviceXML.caption=Generate a default services.xml
page2.testcase.caption=Generate a test case
-page2.databindingCheck.caption=Enable Databinding
+page2.databindingCheck.caption=Databinding Name
+page2.serviceName.caption=Service Name
+page2.portName.caption=Port Name
+page2.genAll.caption=Generate all
#######################################################################
#Output location selection - Page3
page3.name=page3