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/06/20 05:29:06 UTC
svn commit: r191384 [2/2] - in
/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen:
./ eclipse/ eclipse/plugin/ eclipse/ui/ eclipse/util/ resource/
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java?rev=191384&r1=191383&r2=191384&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java Sun Jun 19 20:29:04 2005
@@ -1,11 +1,8 @@
-
package org.apache.axis.tool.codegen.eclipse.ui;
import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
import org.eclipse.jface.dialogs.IDialogPage;
-import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -23,166 +20,131 @@
* The first page of the code generator wizrad. Asks for the WSDL file Name
*/
-public class WSDLFileSelectionPage extends WizardPage
-{
+public class WSDLFileSelectionPage extends AbstractWizardPage {
+
+ private Text fileText;
+
+ private ISelection selection;
- /**
- * The key for storing the WSDL location in the dialog settings of the
- * WSDLFileSelectionPage
- */
- private static final String PREF_WSDL_LOCATION = "PREF_WSDL_LOCATION";
- private Text fileText;
- private ISelection selection;
- /**
- * The store where the settings are saved to, in the plugin meta folder.
- */
- private IDialogSettings settings;
-
- /**
- *
- * @param pageName
- */
- public WSDLFileSelectionPage(ISelection selection)
- {
- super(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin.getResourceString("page1.name"));
- setTitle(CodegenWizardPlugin.getResourceString("page1.title"));
- setDescription(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin.getResourceString("page1.desc"));
- this.selection = selection;
- setImageDescriptor(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin.getWizardImageDescriptor());
- // set the page complete status to false at initiation
- setPageComplete(false);
-
- /*
- * Get the settings for this page. If there is no section in the Plugin's settings for this OptionsPage, create a
- * new section
- */
- IDialogSettings rootSettings = CodegenWizardPlugin.getDefault().getDialogSettings();
- IDialogSettings section = rootSettings.getSection(this.getClass().getName());
- if (section == null)
- {
- settings = rootSettings.addNewSection(this.getClass().getName());
- initializeDefaultSettings();
- }
- else
- {
- settings = section;
- }
-
- }
-
- /**
- * Creates a default value for the settings on this page. For WSDLFileSelection, this is not very much.
- */
- private void initializeDefaultSettings()
- {
- settings.put(PREF_WSDL_LOCATION,"");
- }
-
- /**
- * @see IDialogPage#createControl(Composite)
- */
- public void createControl(Composite parent)
- {
-
- Composite container = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- container.setLayout(layout);
- layout.numColumns = 3;
- layout.verticalSpacing = 9;
-
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- Label label = new Label(container, SWT.NULL);
- label.setText(CodegenWizardPlugin.getResourceString("page1.fileselection.label"));
-
- fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
- fileText.setLayoutData(gd);
- fileText.setText(settings.get(PREF_WSDL_LOCATION));
- fileText.addModifyListener(new ModifyListener()
- {
- public void modifyText(ModifyEvent e)
- {
- settings.put(PREF_WSDL_LOCATION,fileText.getText());
+ /**
+ *
+ * @param pageName
+ */
+ public WSDLFileSelectionPage() {
+ super("page1");
+
+
+ }
+
+ /**
+ * Creates a default value for the settings on this page. For
+ * WSDLFileSelection, this is not very much.
+ */
+ protected void initializeDefaultSettings() {
+ settings.put(PREF_WSDL_LOCATION, "");
+ }
+
+ /**
+ * @see IDialogPage#createControl(Composite)
+ */
+ public void createControl(Composite parent) {
+
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 3;
+ layout.verticalSpacing = 9;
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ Label label = new Label(container, SWT.NULL);
+ label.setText(CodegenWizardPlugin
+ .getResourceString("page1.fileselection.label"));
+
+ fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ fileText.setLayoutData(gd);
+ fileText.setText(settings.get(PREF_WSDL_LOCATION));
+ fileText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ settings.put(PREF_WSDL_LOCATION, fileText.getText());
+ dialogChanged();
+ }
+ });
+
+ Button button = new Button(container, SWT.PUSH);
+ button.setText(CodegenWizardPlugin
+ .getResourceString("page1.fileselection.browse"));
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleBrowse();
+ }
+ });
+
+ setPageComplete(false);
+ setControl(container);
+
+ /*
+ * Validate this dialog, because we could have got valid values from the
+ * settings already.
+ */
+ if (restoredFromPreviousSettings){
dialogChanged();
- }
- });
+ }
+ }
- Button button = new Button(container, SWT.PUSH);
- button.setText(CodegenWizardPlugin.getResourceString("page1.fileselection.browse"));
- button.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- handleBrowse();
- }
- });
- setControl(container);
-
- /*
- * Validate this dialog, because we could have got valid values from the
- * settings already.
- */
- dialogChanged();
- }
-
- /**
- * Handle the dialog change event. Basically evaluates the file name and sets the error message accordingly
- */
- private void dialogChanged()
- {
- String fileName = getFileName();
-
- if (fileName.length() == 0)
- {
- updateStatus(CodegenWizardPlugin.getResourceString("page1.error.filemissingerror"));
- return;
- }
-
- if (!fileName.matches(".*\\.wsdl"))
- {
- updateStatus(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin
- .getResourceString("page1.error.wrongextension"));
- return;
- }
-
- updateStatus(null);
-
- }
-
- /**
- * Pops up the file browse dialog box
- *
- */
- private void handleBrowse()
- {
- FileDialog fileDialog = new FileDialog(this.getShell());
- fileDialog.setFilterExtensions(new String[] {"*.wsdl"});
- String fileName = fileDialog.open();
- if (fileName != null)
- {
- fileText.setText(fileName);
- }
-
- }
-
- /**
- * Updates the wizard page messages
- *
- * @param message
- */
- private void updateStatus(String message)
- {
- setErrorMessage(message);
- setPageComplete(message == null);
- }
-
- /**
- * Get the file name
- *
- * @return
- */
- public String getFileName()
- {
- return fileText.getText();
- }
+ /**
+ * Handle the dialog change event. Basically evaluates the file name and
+ * sets the error message accordingly
+ */
+ private void dialogChanged() {
+ String fileName = getFileName();
+
+ if (fileName.length() == 0) {
+ updateStatus(CodegenWizardPlugin
+ .getResourceString("page1.error.filemissingerror"));
+ return;
+ }
+
+ if (!fileName.matches(".*\\.wsdl")) {
+ updateStatus(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin
+ .getResourceString("page1.error.wrongextension"));
+ return;
+ }
+
+ updateStatus(null);
+
+ }
+
+ /**
+ * Pops up the file browse dialog box
+ *
+ */
+ private void handleBrowse() {
+ FileDialog fileDialog = new FileDialog(this.getShell());
+ fileDialog.setFilterExtensions(new String[] { "*.wsdl" });
+ String fileName = fileDialog.open();
+ if (fileName != null) {
+ fileText.setText(fileName);
+ }
+
+ }
+
+
+ /**
+ * Get the file name
+ *
+ * @return
+ */
+ public String getFileName() {
+ return fileText.getText();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.axis.tool.codegen.eclipse.ui.CodegenPage#getPageType()
+ */
+ public int getPageType() {
+ return WSDL_2_JAVA_TYPE;
+ }
}
Added: webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/util/SettingsConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/util/SettingsConstants.java?rev=191384&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/util/SettingsConstants.java (added)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/util/SettingsConstants.java Sun Jun 19 20:29:04 2005
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.axis.tool.codegen.eclipse.util;
+
+public interface SettingsConstants {
+
+ // ######################################################################
+ //WSDL Selection page constants
+ /**
+ * The key for storing the WSDL location in the dialog settings of the
+ * WSDLFileSelectionPage
+ */
+ static final String PREF_WSDL_LOCATION = "PREF_WSDL_LOCATION";
+
+ // ######################################################################
+ // Tools selection page
+ static final String PREF_TOOL_SELECTION_WSDL2JAVA = "PREF_TOOL_SELECTION_WSDL2JAVA";
+
+ static final String PREF_TOOL_SELECTION_JAVA2WSDL = "PREF_TOOL_SELECTION_JAVA2WSDL";
+
+ // ######################################################################
+ // Output selection page
+ /**
+ * The key to store the output location in the settings
+ *
+ */
+ static final String PREF_OUTPUT_LOCATION = "PREF_OUTPUT_LOCATION";
+
+ //Options page constants
+ /**
+ * Position in the combox for choosing the target programming language. Default is 0
+ */
+ static final String PREF_LANGUAGE_INDEX = "PREF_LANGUAGE_INDEX";
+
+ /**
+ * Three radio buttons: Generate Code for Sync calls, Async and Both. Both is default.
+ */
+ static final String PREF_RADIO_SYNC_AND_ASYNC = "PREF_RADIO_SYNC_AND_ASYNC";
+
+ /**
+ * Three radio buttons: Generate Code for Sync calls, Async and Both. Both is default.
+ */
+ static final String PREF_RADIO_SYNC_ONLY = "PREF_RADIO_SYNC_ONLY";
+
+ /**
+ * Three radio buttons: Generate Code for Sync calls, Async and Both. Both is default.
+ */
+ static final String PREF_RADIO_ASYNC_ONLY = "PREF_RADIO_ASYNC_ONLY";
+
+ /**
+ * Specifies the full qualified package name for the generated source code.
+ */
+ static final String PREF_PACKAGE_NAME = "PREF_PACKAGE_NAME";
+
+ /**
+ * A boolean value whether JUnit test classes are generated or not.
+ */
+ static final String PREF_CHECK_GENERATE_TESTCASE = "PREF_CHECK_GENERATE_TESTCASE";
+
+ /**
+ * A boolean value whether the server-side skeletons are generated or not
+ */
+ static final String PREF_CHECK_GENERATE_SERVERSIDE = "PREF_CHECK_GENERATE_SERVERSIDE";
+
+ /**
+ * 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";
+
+ // ##################################################################################
+ // Java source file selection page
+ static final String JAVA_CLASS_NAME = "JAVA_CLASS_NAME";
+
+ static final String JAVA_CLASS_LOCATION_NAME = "JAVA_CLASS_LOCATION_NAME";
+
+ // ##################################################################################
+ // Java2wsdl options selection page
+ static final String PREF_JAVA_INPUT_WSDL_NAME = "INPUT_WSDL";
+
+ static final String PREF_JAVA_LOCATION = "LOCATION_URL";
+ static final String PREF_JAVA_BINDING_NAME = "BINDING_NAME";
+ static final String PREF_JAVA_MODE_INDEX = "MODE_INDEX";
+ static final String PREF_JAVA_STYLE_INDEX = "STYLE_INDEX";
+ static final String PREF_JAVA_PORTYPE_NAME = "PORTYPE_NAME";
+
+ // ##################################################################################
+ //output page
+ static final String JAVA_OUTPUT_WSDL_NAME = "OUTPUT_WSDL";
+ static final String PREF_JAVA_OUTPUT_WSDL_LOCATION = "OUTPUT_WSDL_LOCATION";
+ // ##################################################################################
+ // Page constants
+ static final int WSDL_2_JAVA_TYPE = 1;
+ static final int JAVA_2_WSDL_TYPE = 2;
+ static final int UNSPECIFIED_TYPE = 3;
+
+ // ##################################################################################
+ // WSDL Mode constants
+ static final String WSDL_ALL = "All";
+ static final String WSDL_INTERFACE_ONLY = "Interface only";
+ static final String WSDL_IMPLEMENTATION_ONLY = "Implementation only";
+
+ // ###########################################################
+ static final String WSDL_STYLE_DOCUMENT="Document";
+ static final String WSDL_STYLE_RPC="rpc";
+ static final String WSDL_STYLE_WRAPPED="wrapped";
+
+}
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/resource/Codegen.properties
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/resource/Codegen.properties?rev=191384&r1=191383&r2=191384&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/resource/Codegen.properties (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/resource/Codegen.properties Sun Jun 19 20:29:04 2005
@@ -5,10 +5,25 @@
#General
general.Error=Error
general.name=Axis2 Codegen Wizard
+general.browse=Browse...
+general.search=Search..
+############################################################################
+# Initial tool selection page - Page0
+# Tool selection
+page0.name=Axis2 Code generation wizard
+page0.title=Select the wizard
+page0.desc=Welcome to the Axis2 code generator wizard.
+#
+page0.options.desc=Please specify what you want to do. You can generate java code from a WSDL or WSDL from a Java source file
+page0.java2wsdl.desc=Select this option if you already have a java source file and need to generate a WSDL
+page0.java2wsdl.caption=Generate a WSDL from a Java source file
+#
+page0.wsdl2java.desc=Select this option if you need to generate stubs/skeletons from a WSDL
+page0.wsdl2java.caption=Generate Java source code from a WSDL file
############################################################################
#WSDL selection page - Page1
#WSDL selection page name
-page1.name=Axis2 Code generation wizard
+page1.name=page1
page1.title=WSDL selection page
page1.desc=Welcome to the Axis2 code generator wizard. Select the WSDL file
#labels
@@ -20,7 +35,7 @@
#
###################################################################
#Options - Page2
-page2.name=Axis2 Code generation wizard
+page2.name=page2
page2.title=Options
page2.desc=Set the options for the code generator
#labels
@@ -34,7 +49,7 @@
page2.testcase.caption=Generate a test case
#######################################################################
#Output location selection - Page3
-page3.name=Axis2 Code generation wizard
+page3.name=page3
page3.title=Output
page3.desc=Set the output project for the generated code
#lables
@@ -45,6 +60,34 @@
page3.error.nolocation=output location needs to be specified
#
##########################################################################
+#java source file selection = page 4
+page4.name=page4
+page4.title=Java source selection
+page4.desc=Set the output project for the generated code
+#labels
+page4.javafilelocation.label=Java class file location
+page4.classname.label=Class name
+###############################################################
+#java2wsdl options = page 5
+page5.name=page5
+page5.title=Java to WSDL Options
+page5.desc=Set the Options for the generator
+#####
+page5.inputwsdl.label=Input WSDL name
+page5.outputwsdl.label=Output WSDL name
+page5.servicelocation.label=Service Location
+page5.porttype.label=Port type name
+page5.binding.label=Binding
+page5.mode.label=Mode
+page5.style.label=Style
+###############################################################
+#java2wsdl output location - page 6
+page6.name=page6
+page6.title=WSDL file output location
+page6.desc=Select the location for the generated WSDL.
+####
+page6.output.label=Output Location
+page6.outputname.label=Output File Name
#Wizard
generator.generating=Generating code...
generator.readingWOM=Reading WSDL file...