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 2005/08/15 11:44:03 UTC
svn commit: r232780 [3/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...
Added: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceArchiveOutputLocationPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceArchiveOutputLocationPage.java?rev=232780&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceArchiveOutputLocationPage.java (added)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceArchiveOutputLocationPage.java Mon Aug 15 02:39:26 2005
@@ -0,0 +1,150 @@
+ /*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ package org.apache.axis2.tool.service.eclipse.ui;
+
+ import org.apache.axis2.tool.service.bean.Page3Bean;
+import org.apache.axis2.tool.service.eclipse.plugin.ServiceArchiver;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+ public class ServiceArchiveOutputLocationPage extends AbstractServiceWizardPage {
+
+ private static final String DEFAULT_JAR_NAME = "my_service.jar";
+ private Text outputFileLocationTextBox;
+ private Button browseButton;
+ private Text outputFileNameTextbox;
+
+ public ServiceArchiveOutputLocationPage(){
+ super("page4");
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.tool.service.eclipse.ui.AbstractServiceWizardPage#initializeDefaultSettings()
+ */
+ protected void initializeDefaultSettings() {
+ settings.put(PREF_OUTPUT_LOCATION,System.getProperty("user.dir"));
+ settings.put(PREF_OUTPUT_NAME,DEFAULT_JAR_NAME);
+
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.numColumns=3;
+ container.setLayout(layout);
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.grabExcessHorizontalSpace = true;
+
+ Label lable = new Label(container,SWT.NULL);
+ lable.setText(ServiceArchiver.getResourceString("page4.outputlocation.label"));
+
+ outputFileLocationTextBox = new Text(container,SWT.BORDER);
+ outputFileLocationTextBox.setLayoutData(gd);
+ outputFileLocationTextBox.setText(settings.get(PREF_OUTPUT_LOCATION));
+ outputFileLocationTextBox.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e){
+ handleLocationModification();
+ }
+ });
+
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
+
+ browseButton = new Button(container,SWT.PUSH);
+ browseButton.setText(ServiceArchiver.getResourceString("general.browse"));
+ browseButton.setLayoutData(gd);
+ browseButton.addMouseListener(new MouseAdapter(){
+ public void mouseUp(MouseEvent e) {
+ handleBrowse();
+ }
+ });
+
+ lable = new Label(container,SWT.NULL);
+ lable.setText(ServiceArchiver.getResourceString("page4.outputname.label"));
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+
+ outputFileNameTextbox = new Text(container,SWT.BORDER);
+ outputFileNameTextbox.setLayoutData(gd);
+ outputFileNameTextbox.setText(settings.get(PREF_OUTPUT_NAME));
+ outputFileNameTextbox.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e){
+ handleFileNameModification();
+ }
+ });
+
+ if (restoredFromPreviousSettings) {
+ handleFileNameModification();
+ handleLocationModification();
+ } else {
+ //nothing yet
+ }
+
+ setControl(container);
+
+ }
+
+ private void handleBrowse(){
+ DirectoryDialog dirDialog = new DirectoryDialog(this.getShell());
+ dirDialog.setMessage(ServiceArchiver.getResourceString("page4.dirdialog.caption"));
+ String returnText = dirDialog.open();
+ if (returnText!=null){
+ this.outputFileLocationTextBox.setText(returnText);
+ this.outputFileLocationTextBox.setToolTipText(returnText);
+ }
+ }
+
+ private void handleLocationModification(){
+ String outputLocationText = outputFileLocationTextBox.getText();
+ settings.put(PREF_OUTPUT_LOCATION,outputLocationText);
+ if (outputLocationText==null ||"".equals(outputLocationText.trim())){
+ this.updateStatus(ServiceArchiver.getResourceString("page4.error.location"));
+ }else{
+ updateStatus(null);
+ }
+ }
+ private void handleFileNameModification(){
+ String outputFilenameText = outputFileNameTextbox.getText();
+ settings.put(PREF_OUTPUT_NAME,outputFilenameText);
+ if (outputFilenameText==null || "".equals(outputFilenameText.trim())){
+ this.updateStatus(ServiceArchiver.getResourceString("page4.error.filename"));
+ }else{
+ updateStatus(null);
+ }
+ }
+
+
+
+ public Page3Bean getBean(){
+ Page3Bean pageBean = new Page3Bean();
+ pageBean.setOutputFolderName(this.outputFileLocationTextBox.getText().trim());
+ pageBean.setOutputFileName(this.outputFileNameTextbox.getText().trim());
+ return pageBean;
+ }
+ }
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceArchiveWizard.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceArchiveWizard.java?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceArchiveWizard.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceArchiveWizard.java Mon Aug 15 02:39:26 2005
@@ -13,16 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.axis.tool.service.eclipse.ui;
+package org.apache.axis2.tool.service.eclipse.ui;
-import org.apache.axis.tool.service.bean.WizardBean;
-import org.apache.axis.tool.service.control.Controller;
-import org.apache.axis.tool.service.control.ProcessException;
-import org.apache.axis.tool.service.eclipse.plugin.ServiceArchiver;
+import org.apache.axis2.tool.service.bean.WizardBean;
+import org.apache.axis2.tool.service.control.Controller;
+import org.apache.axis2.tool.service.control.ProcessException;
+import org.apache.axis2.tool.service.eclipse.plugin.ServiceArchiver;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
@@ -36,12 +35,40 @@
*/
public class ServiceArchiveWizard extends Wizard implements INewWizard {
- private WizardPane1 wizardPane1;
- private WizardPane2 wizardPane2;
- private WizardPane3 wizardPane3;
- private WizardPane4 wizardPane4;
-
-
+ private ClassFileLocationPage classFileLocationPage;
+ private WSDLFileSelectionPage wsdlFileSelectionPage;
+ private ServiceXMLFileSelectionPage serviceXMLFileSelectionPage;
+ private ServiceXMLGenerationPage serviceXMLGenerationPage;
+ private ServiceArchiveOutputLocationPage serviceArchiveOutputLocationPage;
+
+ private boolean updateServiceGenerationStatus;
+ private String classFileLocation;
+ private String wsdlFileGenerationStatus;
+
+
+ /**
+ * @return Returns the wsdlFileGenerationStatus.
+ */
+ public String getWsdlFileGenerationStatus() {
+ return wsdlFileGenerationStatus;
+ }
+ /**
+ * @param message The wsdlFileGenerationStatus to set.
+ */
+ public void updateWsdlFileGenerationStatus(String message) {
+ this.wsdlFileGenerationStatus = message;
+ }
+ public String getClassFileLocation(){
+ return classFileLocation;
+ }
+
+ public void setClassFileLocation(String location){
+ this.classFileLocation = location;
+ }
+
+ public void updateServiceGeneration(boolean status){
+ updateServiceGenerationStatus = status;
+ }
/**
*
*/
@@ -54,28 +81,33 @@
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#getNextPage(org.eclipse.jface.wizard.IWizardPage)
*/
- public IWizardPage getNextPage(IWizardPage page) {
- IWizardPage pageout = super.getNextPage(page);
- if (page.equals(wizardPane2)) {
- if (((WizardPane2) page).isSkipNextPage()) {
- pageout = super.getNextPage(pageout);
- }
- }
- return pageout;
- }
+// public IWizardPage getNextPage(IWizardPage page) {
+//
+// AbstractServiceWizardPage thisPage = (AbstractServiceWizardPage)page.getNextPage();
+// while (thisPage!=null && thisPage.isSkipNext()) {
+// if (thisPage.getNextPage()!=null) {
+// thisPage = (AbstractServiceWizardPage)thisPage.getNextPage();
+// }else{
+// break;
+// }
+// }
+// return thisPage;
+// }
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#addPages()
*/
public void addPages() {
- wizardPane1 = new WizardPane1();
- this.addPage(wizardPane1);
- wizardPane2 = new WizardPane2();
- this.addPage(wizardPane2);
- wizardPane3 = new WizardPane3();
- this.addPage(wizardPane3);
- wizardPane4 = new WizardPane4();
- this.addPage(wizardPane4);
+ classFileLocationPage = new ClassFileLocationPage();
+ this.addPage(classFileLocationPage);
+ wsdlFileSelectionPage = new WSDLFileSelectionPage();
+ this.addPage(wsdlFileSelectionPage);
+ serviceXMLFileSelectionPage = new ServiceXMLFileSelectionPage();
+ this.addPage(serviceXMLFileSelectionPage);
+// serviceXMLGenerationPage = new ServiceXMLGenerationPage();
+// this.addPage(serviceXMLGenerationPage);
+ serviceArchiveOutputLocationPage = new ServiceArchiveOutputLocationPage();
+ this.addPage(serviceArchiveOutputLocationPage);
}
/* (non-Javadobc)
@@ -84,9 +116,12 @@
public boolean performFinish() {
//create a wizard bean
WizardBean wizBean = new WizardBean();
- wizBean.setPage1bean(wizardPane1.getBean());
- wizBean.setPage2bean(wizardPane2.getBean());
- wizBean.setPage3bean(wizardPane4.getBean());
+ wizBean.setPage1bean(classFileLocationPage.getBean());
+ wizBean.setWsdlBean(wsdlFileSelectionPage.getBean());
+ wizBean.setPage2bean(serviceXMLFileSelectionPage.getBean());
+ wizBean.setPage3bean(serviceArchiveOutputLocationPage.getBean());
+
+
try {
new Controller().process(wizBean);
showSuccessMessage(" jar file creation successful! ");
Added: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceXMLFileSelectionPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceXMLFileSelectionPage.java?rev=232780&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceXMLFileSelectionPage.java (added)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceXMLFileSelectionPage.java Mon Aug 15 02:39:26 2005
@@ -0,0 +1,197 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.axis2.tool.service.eclipse.ui;
+
+import org.apache.axis2.tool.service.bean.Page2Bean;
+import org.apache.axis2.tool.service.eclipse.plugin.ServiceArchiver;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+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.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+public class ServiceXMLFileSelectionPage extends AbstractServiceWizardPage {
+
+ private Text serviceXMLText;
+ private Label manualSelectionLabel;
+ private Label recommendationTextLable;
+ private Button browseButton;
+ private Button selectAutoFileGenerationCheckBox;
+
+
+ private boolean skipNextPage=true;
+ private boolean pageComplete;
+
+ public ServiceXMLFileSelectionPage(){
+ super("page2");
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.tool.service.eclipse.ui.AbstractServiceWizardPage#initializeDefaultSettings()
+ */
+ protected void initializeDefaultSettings() {
+ settings.put(PREF_SERVICE_XML_FILE,"");
+ settings.put(PREF_CHECK_AUTO_GEN_SERVICE_XML,false);
+
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.numColumns=3;
+ container.setLayout(layout);
+
+ manualSelectionLabel = new Label(container,SWT.NULL);
+ manualSelectionLabel.setText(ServiceArchiver.getResourceString("page2.selectservicexml.caption"));
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ serviceXMLText = new Text(container,SWT.BORDER);
+ serviceXMLText.setLayoutData(gd);
+ serviceXMLText.setText(settings.get(PREF_SERVICE_XML_FILE));
+ serviceXMLText.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e){
+ handleModify();
+ }
+ });
+
+ browseButton = new Button(container,SWT.PUSH);
+ browseButton.setText(ServiceArchiver.getResourceString("general.browse"));
+ browseButton.addMouseListener(new MouseAdapter(){
+ public void mouseUp(MouseEvent e) {
+ handleBrowse();
+ }
+ });
+
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ selectAutoFileGenerationCheckBox = new Button(container,SWT.CHECK);
+ selectAutoFileGenerationCheckBox.setLayoutData(gd);
+ selectAutoFileGenerationCheckBox.setText(ServiceArchiver.getResourceString("page2.generateauto.caption"));
+ selectAutoFileGenerationCheckBox.setSelection(settings.getBoolean(PREF_CHECK_AUTO_GEN_SERVICE_XML));
+ selectAutoFileGenerationCheckBox.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e){
+ handleSelection();
+ }
+ public void widgetDefaultSelected(SelectionEvent e){}
+ });
+ /////////////////////////////////////////
+ //disable the selection combo for now
+ selectAutoFileGenerationCheckBox.setEnabled(false);
+ selectAutoFileGenerationCheckBox.setToolTipText(ServiceArchiver.getResourceString("page2.autogen.tooltip"));
+ ////////////////////////////////////////////
+
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ gd.verticalSpan =2;
+ recommendationTextLable = new Label(container,SWT.NULL);
+ recommendationTextLable.setLayoutData(gd);
+ //recommendationTextLable.setForeground()));
+
+ setControl(container);
+
+ if (restoredFromPreviousSettings){
+ handleModify();
+ handleSelection();
+ }else{
+ setPageComplete(false);
+ }
+
+
+ }
+
+ private void handleBrowse(){
+ FileDialog fileDialog = new FileDialog(this.getShell());
+ fileDialog.setFilterExtensions(new String[]{"service.xml"});
+ String returnFileName = fileDialog.open() ;
+ if (returnFileName!=null){
+ this.serviceXMLText.setText(returnFileName);
+ }
+ }
+
+ private void handleSelection(){
+ boolean selection = this.selectAutoFileGenerationCheckBox.getSelection();
+ settings.put(PREF_CHECK_AUTO_GEN_SERVICE_XML,selection);
+ if (selection){
+ changeManualSelectionStatus(false);
+ this.skipNextPage = false;
+ updateStatus(null);
+ updateGenerationPage(false);
+ }else{
+ changeManualSelectionStatus(true);
+ this.skipNextPage = true;
+ handleModify();
+ updateGenerationPage(true);
+ }
+ }
+
+ private void updateGenerationPage(boolean status){
+ ServiceArchiveWizard wizard = (ServiceArchiveWizard)this.getWizard();
+ wizard.updateServiceGeneration(status);
+
+ }
+
+ private void changeManualSelectionStatus(boolean state){
+ this.serviceXMLText.setEnabled(state);
+ this.browseButton.setEnabled(state);
+ this.manualSelectionLabel.setEnabled(state);
+ }
+
+ private void handleModify(){
+ String serviceXMLString =serviceXMLText.getText().trim().toLowerCase();
+ settings.put(PREF_SERVICE_XML_FILE,serviceXMLString);
+ if (serviceXMLString.equals("")){
+ this.updateStatus(ServiceArchiver.getResourceString("page2.error.servicenameempty"));
+ }else if(!serviceXMLString.endsWith("service.xml")){
+ this.updateStatus(ServiceArchiver.getResourceString("page2.error.servicenamewrong"));
+ }else{
+ this.updateStatus(null);
+ }
+ }
+
+
+ public void updateRecommendation(String message){
+ if (recommendationTextLable!=null)
+ recommendationTextLable.setText(message);
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.tool.service.eclipse.ui.AbstractServiceWizardPage#isSkipNext()
+ */
+ public boolean isSkipNext() {
+ return this.skipNextPage;
+ }
+ public Page2Bean getBean(){
+ Page2Bean pageBean = new Page2Bean();
+ pageBean.setManual(!this.selectAutoFileGenerationCheckBox.getSelection());
+ pageBean.setManualFileName(this.serviceXMLText.getText());
+ return pageBean;
+ }
+}
Added: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceXMLGenerationPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceXMLGenerationPage.java?rev=232780&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceXMLGenerationPage.java (added)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/ServiceXMLGenerationPage.java Mon Aug 15 02:39:26 2005
@@ -0,0 +1,260 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.tool.service.eclipse.ui;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+import org.apache.axis2.tool.service.bean.Page2Bean;
+import org.apache.axis2.tool.service.bean.WSDLAutoGenerateOptionBean;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.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 ServiceXMLGenerationPage extends AbstractServiceWizardPage{
+
+ private Text classNameTextBox;
+ private Text serviceNameTextBox;
+ private Button searchDeclaredMethodsCheckBox;
+ Button loadButton;
+ private Table table;
+
+ private boolean dirty = false;
+
+ public ServiceXMLGenerationPage(){
+ super("page3");
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.tool.service.eclipse.ui.AbstractServiceWizardPage#initializeDefaultSettings()
+ */
+ protected void initializeDefaultSettings() {
+ // TODO Auto-generated method stub
+
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.numColumns=3;
+ container.setLayout(layout);
+
+
+
+
+ Label label = new Label(container,SWT.NULL);
+ label.setText("Service name");
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ serviceNameTextBox = new Text(container,SWT.BORDER);
+ serviceNameTextBox.setLayoutData(gd);
+ serviceNameTextBox.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e){
+ //updateDirtyStatus(true);
+ }
+ });
+
+
+ label = new Label(container,SWT.NULL);
+ label.setText("Class Name");
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ classNameTextBox = new Text(container,SWT.BORDER);
+ classNameTextBox.setLayoutData(gd);
+ classNameTextBox.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e){
+ updateDirtyStatus(true);
+ }
+ });
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ loadButton = new Button(container,SWT.PUSH);
+ loadButton.setText("Load");
+ loadButton.setLayoutData(gd);
+ loadButton.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e){
+ updateTable();
+ }
+ public void widgetDefaultSelected(SelectionEvent e){}
+ });
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 3;
+
+ searchDeclaredMethodsCheckBox = new Button(container,SWT.CHECK);
+ searchDeclaredMethodsCheckBox.setLayoutData(gd);
+ searchDeclaredMethodsCheckBox.setText("List Declared Methods Only");
+ searchDeclaredMethodsCheckBox.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e){
+ updateDirtyStatus(true);//dirty
+ }
+ public void widgetDefaultSelected(SelectionEvent e){}
+ });
+
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ gd.verticalSpan = 5;
+
+ table = new Table(container,SWT.SINGLE|SWT.FULL_SELECTION|SWT.CHECK);
+ table.setLinesVisible(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");
+
+ table.setVisible(false);
+
+ setControl(container);
+
+ }
+
+ /**
+ * if the user has already filled the data, this page needs to be
+ * unchangeable
+ *
+ */
+ public void fillDatafromPrevious(WSDLAutoGenerateOptionBean bean) {
+ //set class name
+ String automaticClassName = bean.getClassFileName();
+ this.classNameTextBox.setText(automaticClassName);
+ this.classNameTextBox.setEnabled(false);
+ //set service name
+ String[] classnameParts = automaticClassName.split("\\.");
+ if (classnameParts.length == 0) {
+ this.serviceNameTextBox.setText(automaticClassName);
+ } else {
+ this.serviceNameTextBox
+ .setText(classnameParts[classnameParts.length - 1]);
+ }
+ //load the classes
+ updateTable();
+ //check the correct ones
+
+ //disbale the table
+ table.setEnabled(false);
+ loadButton.setEnabled(false);
+ }
+
+ public void clearPreviousData(){
+ this.classNameTextBox.setText("");
+ this.classNameTextBox.setEnabled(true);
+ //set service name
+ this.serviceNameTextBox.setText("");
+ if (table.isVisible()){
+ table.setVisible(false);
+ }
+ loadButton.setEnabled(true);
+ }
+ private void updateDirtyStatus(boolean status){
+ dirty = status;
+ if (table.isVisible()){
+ table.setEnabled(!status);
+ }
+ setPageComplete(!status);
+ }
+
+ private void declareColumn(Table table, int width,String colName){
+ TableColumn column = new TableColumn(table,SWT.NONE);
+ column.setWidth(width);
+ column.setText(colName);
+ }
+
+ private void updateTable() {
+ //get a URL from the class file location
+ try {
+ String classFileLocation = getClassFileLocation();
+ URL classFileURL = new File(classFileLocation).toURL();
+ ClassLoader loader = new URLClassLoader(new URL[] { classFileURL });
+
+ Class clazz = loader.loadClass(classNameTextBox.getText());
+ Method[] methods = null;
+
+ if (searchDeclaredMethodsCheckBox.getSelection()){
+ methods = clazz.getDeclaredMethods();
+ }else{
+ methods = clazz.getMethods();
+ }
+
+ int methodCount = methods.length;
+ 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
+ }
+ table.setVisible(true);
+
+ //update the dirty variable
+ updateDirtyStatus(false);
+ updateStatus(null);
+ }
+
+ } catch (MalformedURLException e) {
+ updateStatus("Error : invalid location " +e.getMessage());
+ } catch (ClassNotFoundException e) {
+ updateStatus("Error : Class not found " + e.getMessage());
+ }
+ }
+
+ public boolean isDirty(){
+ return dirty;
+ }
+ private String getClassFileLocation(){
+ ServiceArchiveWizard wizard = (ServiceArchiveWizard)getWizard();
+ return wizard.getClassFileLocation();
+ }
+
+ public Page2Bean getBean(Page2Bean previousBean){
+ //previousBean.setAutomatic(true);
+ previousBean.setAutomaticClassName(classNameTextBox.getText());
+ ArrayList list = new ArrayList();
+ 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
+ }
+ }
+ previousBean.setSelectedMethodNames(list);
+ previousBean.setServiceName(this.serviceNameTextBox.getText());
+ return previousBean;
+ }
+}
Added: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WSDLFileSelectionPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WSDLFileSelectionPage.java?rev=232780&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WSDLFileSelectionPage.java (added)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WSDLFileSelectionPage.java Mon Aug 15 02:39:26 2005
@@ -0,0 +1,221 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.tool.service.eclipse.ui;
+
+import org.apache.axis2.tool.service.bean.WSDLFileLocationBean;
+import org.apache.axis2.tool.service.eclipse.plugin.ServiceArchiver;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+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.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+public class WSDLFileSelectionPage extends AbstractServiceWizardPage {
+
+ private boolean skipNextPage = true;
+
+ private Text wsdlTextBox;
+ private Label selectionLabel;
+ private Button browseButton;
+ private Button autoGenerateWSDLCheckButton;
+ private Button skipWSDLCheckButton;
+
+ public WSDLFileSelectionPage(){
+ super("page5");
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.tool.service.eclipse.ui.AbstractServiceWizardPage#initializeDefaultSettings()
+ */
+ protected void initializeDefaultSettings() {
+ settings.put(PREF_WSDL_FILE_NAME,"");
+ settings.put(PREF_CHECK_WSDL_GENERATE,false);
+ settings.put(PREF_CHECK_SKIP_WSDL,false);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.numColumns=3;
+ container.setLayout(layout);
+
+ selectionLabel= new Label(container,SWT.NULL);
+ selectionLabel.setText(ServiceArchiver.getResourceString("page5.selectwsdl.caption"));
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ wsdlTextBox = new Text(container,SWT.BORDER);
+ wsdlTextBox.setLayoutData(gd);
+ wsdlTextBox.setText(settings.get(PREF_WSDL_FILE_NAME));
+ wsdlTextBox.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e){
+ handleModify();
+ }
+ });
+
+ browseButton = new Button(container,SWT.PUSH);
+ browseButton.setText(ServiceArchiver.getResourceString("general.browse"));
+ browseButton.addMouseListener(new MouseAdapter(){
+ public void mouseUp(MouseEvent e) {
+ handleBrowse();
+ }
+ });
+
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ autoGenerateWSDLCheckButton = new Button(container,SWT.CHECK);
+ autoGenerateWSDLCheckButton.setLayoutData(gd);
+ autoGenerateWSDLCheckButton.setText(ServiceArchiver.getResourceString("page5.generateauto.caption"));
+ autoGenerateWSDLCheckButton.setSelection(settings.getBoolean(PREF_CHECK_WSDL_GENERATE));
+ autoGenerateWSDLCheckButton.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e){
+ handleSelection();
+ }
+ public void widgetDefaultSelected(SelectionEvent e){}
+ });
+ autoGenerateWSDLCheckButton.setToolTipText(ServiceArchiver.getResourceString("page5.autogen.tooltip"));
+ ////////////////////////////////////////
+ // Disable the automatic generation box
+ autoGenerateWSDLCheckButton.setEnabled(false);
+ ///////////////////////////////////////
+
+ //add an empty lable
+ new Label(container,SWT.NONE);
+
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ skipWSDLCheckButton = new Button(container,SWT.CHECK);
+ skipWSDLCheckButton.setText(ServiceArchiver.getResourceString("page5.skipWSDL.caption"));
+ skipWSDLCheckButton.setLayoutData(gd);
+ skipWSDLCheckButton.setSelection(settings.getBoolean(PREF_CHECK_SKIP_WSDL));
+ skipWSDLCheckButton.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e){
+ handleSkip();
+ }
+ public void widgetDefaultSelected(SelectionEvent e){}
+
+ });
+
+ setControl(container);
+
+ if (restoredFromPreviousSettings){
+ if (!skipWSDLCheckButton.getSelection()){
+ handleSelection();
+ }
+ }
+ }
+
+ private void handleSkip(){
+ if (skipWSDLCheckButton.getSelection()){
+ //disable other widgtets
+ setStatus(false);
+ //enable next
+ this.updateStatus(null);
+ settings.put(PREF_CHECK_SKIP_WSDL,true);
+
+ }else{
+ setStatus(true);
+ //call this to update the status
+ handleModify();
+ settings.put(PREF_CHECK_SKIP_WSDL,false);
+ }
+ }
+
+ private void setStatus(boolean b){
+ this.selectionLabel.setEnabled(b);
+ this.browseButton.setEnabled(b);
+ this.wsdlTextBox.setEnabled(b);
+ }
+ private void handleBrowse(){
+ FileDialog fileDialog = new FileDialog(this.getShell());
+ fileDialog.setFilterExtensions(new String[]{"*.wsdl"});
+ String returnFileName = fileDialog.open() ;
+ if (returnFileName!=null){
+ this.wsdlTextBox.setText(returnFileName);
+ }
+ }
+
+ private void handleSelection(){
+ boolean selection = this.autoGenerateWSDLCheckButton.getSelection();
+ settings.put(PREF_CHECK_WSDL_GENERATE,selection);
+ if (selection){
+ changeManualSelectionStatus(false);
+ this.skipNextPage = false;
+ updateStatus(null);
+ updateRecommendation(ServiceArchiver.getResourceString("page5.recommendation"));
+ }else{
+ changeManualSelectionStatus(true);
+ this.skipNextPage = true;
+ handleModify();
+ updateRecommendation("");
+ }
+ }
+
+ private void handleModify(){
+ String text = wsdlTextBox.getText();
+ settings.put(PREF_WSDL_FILE_NAME,text);
+ //validate
+ if ("".equals(text)){
+ this.updateStatus(ServiceArchiver.getResourceString("page5.error.wsdlnameempty"));
+ }else if(!text.endsWith(".wsdl")){
+ this.updateStatus(ServiceArchiver.getResourceString("page5.error.wsdlnamewrong"));
+ }else{
+ this.updateStatus(null);
+ }
+
+ }
+ private void updateRecommendation(String message){
+ ServiceArchiveWizard wizard = (ServiceArchiveWizard)this.getWizard();
+ wizard.updateWsdlFileGenerationStatus(message);
+
+ }
+ private void changeManualSelectionStatus(boolean state){
+ this.wsdlTextBox.setEnabled(state);
+ this.browseButton.setEnabled(state);
+ this.selectionLabel.setEnabled(state);
+ }
+
+ public boolean isAutoGenerate(){
+ return autoGenerateWSDLCheckButton.getSelection();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.tool.service.eclipse.ui.AbstractServiceWizardPage#isSkipNext()
+ */
+ public boolean isSkipNext() {
+ return this.skipNextPage;
+ }
+
+ public WSDLFileLocationBean getBean(){
+ WSDLFileLocationBean locationBean = new WSDLFileLocationBean();
+ locationBean.setManual(!autoGenerateWSDLCheckButton.getSelection());
+ locationBean.setWSDLFileName(wsdlTextBox.getText());
+ locationBean.setSkip(skipWSDLCheckButton.getSelection());
+ return locationBean;
+ }
+}
Added: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WSDLOptionsPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WSDLOptionsPage.java?rev=232780&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WSDLOptionsPage.java (added)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WSDLOptionsPage.java Mon Aug 15 02:39:26 2005
@@ -0,0 +1,285 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.tool.service.eclipse.ui;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.apache.axis2.tool.service.bean.WSDLAutoGenerateOptionBean;
+import org.apache.axis2.tool.service.eclipse.plugin.ServiceArchiver;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author Ajith
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class WSDLOptionsPage extends AbstractServiceWizardPage {
+
+ private static final String SERVICE_WSDL_DEFAULT_NAME = "service.wsdl";
+ private Text classNameTextBox;
+ private Text outputFileNameTextBox;
+ private Combo styleSelectionCombo;
+ private Button searchDeclaredMethodsCheckBox;
+ private Table table;
+
+ private boolean dirty = false;
+
+ public WSDLOptionsPage(){
+ super("page6");
+ }
+ /* (non-Javadoc)
+ * @see org.apache.axis2.tool.service.eclipse.ui.AbstractServiceWizardPage#initializeDefaultSettings()
+ */
+ protected void initializeDefaultSettings() {
+ settings.put(PREF_WSDL_FILE_NAME,SERVICE_WSDL_DEFAULT_NAME);
+ settings.put(PREF_WSDL_CLASS_NAME,"");
+ settings.put(PREF_WSDL_STYLE_INDEX,0);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 3;
+ layout.verticalSpacing = 9;
+
+ // #########################################################
+
+ Label label = new Label(container, SWT.NULL);
+ label
+ .setText(ServiceArchiver
+ .getResourceString("page6.fileName.label"));
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ outputFileNameTextBox = new Text(container, SWT.BORDER);
+ outputFileNameTextBox.setLayoutData(gd);
+ outputFileNameTextBox.setText(settings.get(PREF_WSDL_FILE_NAME));
+ //###########################################################
+ outputFileNameTextBox.setEnabled(false);//this text box is disbaled for
+ // now
+ //########################################################
+ outputFileNameTextBox.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ handlFileNameModification();
+ }
+ });
+
+// ########################################################
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ label = new Label(container, SWT.NULL);
+ label.setText(ServiceArchiver.getResourceString("page6.class.label"));
+
+ classNameTextBox = new Text(container, SWT.BORDER);
+ classNameTextBox.setLayoutData(gd);
+ classNameTextBox.setText(settings.get(PREF_WSDL_CLASS_NAME));
+ classNameTextBox.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ handleClassNameModification();
+ }
+ });
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ Button loadButton = new Button(container, SWT.PUSH);
+ loadButton.setText("Load");
+ loadButton.setLayoutData(gd);
+ loadButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ updateTable();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 3;
+
+ searchDeclaredMethodsCheckBox = new Button(container,SWT.CHECK);
+ searchDeclaredMethodsCheckBox.setLayoutData(gd);
+ searchDeclaredMethodsCheckBox.setText("List Declared Methods Only");
+ searchDeclaredMethodsCheckBox.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e){
+ updateDirtyStatus(true);//dirty
+ }
+ public void widgetDefaultSelected(SelectionEvent e){}
+ });
+
+ // #####################################################
+ label = new Label(container, SWT.NULL);
+ label.setText(ServiceArchiver.getResourceString("page6.style.label"));
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ 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_WSDL_STYLE_INDEX, styleSelectionCombo
+ .getSelectionIndex());
+ }
+
+ 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);
+ table.setLinesVisible(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");
+
+ table.setVisible(false);
+
+ setControl(container);
+
+ }
+
+ private void declareColumn(Table table, int width,String colName){
+ TableColumn column = new TableColumn(table,SWT.NONE);
+ column.setWidth(width);
+ column.setText(colName);
+ }
+
+
+ private void populateStyleCombo() {
+ styleSelectionCombo.add("Document");
+ styleSelectionCombo.add("rpc");
+ styleSelectionCombo.add("Wrapped");
+
+ styleSelectionCombo.select(settings.getInt(PREF_WSDL_STYLE_INDEX));
+
+ }
+
+ private void updateTable() {
+ //get a URL from the class file location
+ try {
+ String classFileLocation = getClassFileLocation();
+ URL classFileURL = new File(classFileLocation).toURL();
+ ClassLoader loader = new URLClassLoader(new URL[] { classFileURL });
+
+ Class clazz = loader.loadClass(classNameTextBox.getText());
+ Method[] methods = null;
+
+ if (searchDeclaredMethodsCheckBox.getSelection()){
+ methods = clazz.getDeclaredMethods();
+ }else{
+ methods = clazz.getMethods();
+ }
+
+ int methodCount = methods.length;
+ 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
+ }
+ table.setVisible(true);
+
+ //update the dirty variable
+ updateDirtyStatus(false);
+ updateStatus(null);
+ }
+
+ } catch (MalformedURLException e) {
+ updateStatus("Error : invalid location " +e.getMessage());
+ } catch (ClassNotFoundException e) {
+ updateStatus("Error : Class not found " + e.getMessage());
+ }
+ }
+ private void handleClassNameModification(){
+ String className = classNameTextBox.getText();
+ settings.put(PREF_WSDL_CLASS_NAME, className);
+
+ if (className==null || "".equals(className.trim())){
+ updateStatus(ServiceArchiver.getResourceString("page6.error.classname1"));
+ }else if (className.endsWith(".")){
+ updateStatus(ServiceArchiver.getResourceString("page6.error.classname2"));
+ }else{
+ updateStatus(null);
+ }
+
+ }
+
+ private void handlFileNameModification(){
+ String wsdlFileName = outputFileNameTextBox.getText();
+ settings.put(PREF_WSDL_FILE_NAME, wsdlFileName);
+
+ if (wsdlFileName==null || "".equals(wsdlFileName.trim())){
+ updateStatus(ServiceArchiver.getResourceString("page6.error.fileName1"));
+ }else if (wsdlFileName.endsWith(".wsdl")){
+ updateStatus(ServiceArchiver.getResourceString("page6.error.fileName2"));
+ }else{
+ updateStatus(null);
+ }
+
+ }
+ private String getClassFileLocation(){
+ ServiceArchiveWizard wizard = (ServiceArchiveWizard)getWizard();
+ return wizard.getClassFileLocation();
+ }
+
+ public WSDLAutoGenerateOptionBean getBean(){
+ WSDLAutoGenerateOptionBean optionBean = new WSDLAutoGenerateOptionBean();
+ optionBean.setClassFileName(classNameTextBox.getText());
+ optionBean.setOutputFileName(outputFileNameTextBox.getText());
+ optionBean.setStyle(styleSelectionCombo.getItem(styleSelectionCombo.getSelectionIndex()));
+ return optionBean;
+ }
+
+ private void updateDirtyStatus(boolean status){
+ dirty = status;
+ if (table.isVisible()){
+ table.setEnabled(!status);
+ }
+ setPageComplete(!status);
+ }
+}
Added: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/util/SettingsConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/util/SettingsConstants.java?rev=232780&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/util/SettingsConstants.java (added)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/util/SettingsConstants.java Mon Aug 15 02:39:26 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.tool.service.eclipse.util;
+
+/**
+ * @author Ajith
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public interface SettingsConstants {
+ //#####################################################
+ static final String PREF_CLASS_FILE_LOCATION = "CLASS_FILE_LOCATION" ;
+ static final String PREF_FILTER_BY_CLASSES = "FILTER_BY_CLASSES" ;
+ //#####################################################
+ static final String PREF_SERVICE_XML_FILE = "SERVICE_XML" ;
+ static final String PREF_CHECK_AUTO_GEN_SERVICE_XML = "AUTO_GEN" ;
+ //#####################################################
+ static final String PREF_WSDL_FILE_NAME="WSDL_FILE_NAME";
+ static final String PREF_CHECK_WSDL_GENERATE="WSDL_GEN";
+ static final String PREF_CHECK_SKIP_WSDL="SKIP_WSDL";
+ // ####################################################
+ static final String PREF_WSDL_CLASS_NAME="WSDL_CLASS_NAME";
+ static final String PREF_WSDL_STYLE_INDEX="WSDL_STYLE";
+ //#######################################################
+ static final String PREF_OUTPUT_LOCATION="OUT_LOCATION";
+ static final String PREF_OUTPUT_NAME="OUT_NAME";
+
+
+
+}
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/resource/ServiceResources.properties
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/resource/ServiceResources.properties?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/resource/ServiceResources.properties (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/resource/ServiceResources.properties Mon Aug 15 02:39:26 2005
@@ -1,6 +1,6 @@
################################################################
################## Resources for the interface ###############
-###################### Default en_us ##########################
+##################### Default en_us ###########################
#
# Main page title
main.title=Apache Axis Service Archiver
@@ -9,7 +9,7 @@
#Ok button caption
general.ok=Ok
#Cancle button caption
-general.cancle=Cancel
+general.cancel=Cancel
#Next button caption
general.next=Next
#Previous button caption
@@ -20,29 +20,47 @@
general.browse=Browse...
###############################################################################
#Firstpage title
+page1.name=page1
page1.title=Service Archiver
-# First page welcome text
-page1.welcometext=Welcome to the new AXIS Service packager Wizard Interface.Insert the location for the class files here.This should be a folder with the compiled classes
+page1.desc=Welcome to the new AXIS Service packager Wizard Interface.Insert the location for the class files here.This should be a folder with the compiled classes
# First page
page1.fileLocationLabel=Class File Location
page1.filedialogTitle=Browse for the class file location
-
-
+page1.filter.caption=Include .class files only
+page1.filedialogTitle=Browse for a location
+page1.error.filemissing=The specified file is missing
+################################################################################
# second page
+page2.name=page2
page2.title=Service Archiver
-page2.welcometext=Select the Service XML file to be included in the Service archive
+page2.desc=Select the Service XML file to be included in the Service archive
page2.selectservicexml.caption=Set the service XML file
page2.generateauto.caption=Generate the service xml automatically
page2.error.servicenameempty=Service XML should not be empty
page2.error.servicenamewrong=Please select a file named service.xml
+###############################################################################
#third page
+page3.name=page3
page3.title=Service Archiver
-page3.welcometext=Generate the Service XML file
-
+page3.desc=Generate the Service XML file
+################################################################################
#Fourth page
+page4.name=page4
page4.title=Service Archiver
-page4.welcometext=Set the output loacation and the output file name
+page4.desc=Set the output loacation and the output file name
page4.outputlocation.label=Output file location
page4.outputname.label=Output File Name
page4.dirdialog.caption=Browse for the output location
-
+#################################################################################
+#Fifth page
+page5.name=page5
+page5.title=Service Archiver
+page5.desc=Add the WSDL File
+page5.selectwsdl.caption=Select a WSDL file
+page5.generateauto.caption=Generate a WSDL file
+page5.autogen.tooltip=Tick this to generate a WSDL file automatically
+page5.recommendation=Since you generated the service.XML it is recommended that the WSDL is auto generated
+page5.error.wsdlnameempty=WSDL file name is empty
+page5.error.wsdlnamewrong=WSDL file name is invalid
+page5.skipWSDL.caption=Skip WSDL
+##################################################################################
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/MainWindow.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/MainWindow.java?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/MainWindow.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/MainWindow.java Mon Aug 15 02:39:26 2005
@@ -1,8 +1,8 @@
-package org.apache.axis.tool.service.swing.ui;
+package org.apache.axis2.tool.service.swing.ui;
-import org.apache.axis.tool.service.bean.WizardBean;
-import org.apache.axis.tool.service.control.Controller;
-import org.apache.axis.tool.service.control.ProcessException;
+import org.apache.axis2.tool.service.bean.WizardBean;
+import org.apache.axis2.tool.service.control.Controller;
+import org.apache.axis2.tool.service.control.ProcessException;
import javax.swing.*;
import java.awt.*;
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane.java?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane.java Mon Aug 15 02:39:26 2005
@@ -1,4 +1,4 @@
-package org.apache.axis.tool.service.swing.ui;
+package org.apache.axis2.tool.service.swing.ui;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane1.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane1.java?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane1.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane1.java Mon Aug 15 02:39:26 2005
@@ -1,8 +1,8 @@
-package org.apache.axis.tool.service.swing.ui;
+package org.apache.axis2.tool.service.swing.ui;
-import org.apache.axis.tool.service.bean.Page1Bean;
-import org.apache.axis.tool.service.bean.WizardBean;
-import org.apache.axis.tool.util.Constants;
+import org.apache.axis2.tool.service.bean.ClassFileSelectionBean;
+import org.apache.axis2.tool.service.bean.WizardBean;
+import org.apache.axis2.tool.util.Constants;
import javax.swing.*;
import java.awt.event.ActionEvent;
@@ -28,7 +28,7 @@
public class WizardPane1 extends WizardPane {
- private Page1Bean myBean = null;
+ private ClassFileSelectionBean myBean = null;
private JLabel classFileLocationLabel;
private JTextField classFileLocationTextBox;
@@ -44,7 +44,7 @@
myBean = wizardBean.getPage1bean();
this.classFileLocationTextBox.setText(myBean.getFileLocation());
} else {
- myBean = new Page1Bean();
+ myBean = new ClassFileSelectionBean();
wizardBean.setPage1bean(myBean);
}
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane2.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane2.java?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane2.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane2.java Mon Aug 15 02:39:26 2005
@@ -1,10 +1,10 @@
-package org.apache.axis.tool.service.swing.ui;
+package org.apache.axis2.tool.service.swing.ui;
-import org.apache.axis.tool.service.bean.Page2Bean;
-import org.apache.axis.tool.service.bean.WizardBean;
-import org.apache.axis.tool.service.control.Controller;
-import org.apache.axis.tool.service.control.ProcessException;
-import org.apache.axis.tool.util.Constants;
+import org.apache.axis2.tool.service.bean.Page2Bean;
+import org.apache.axis2.tool.service.bean.WizardBean;
+import org.apache.axis2.tool.service.control.Controller;
+import org.apache.axis2.tool.service.control.ProcessException;
+import org.apache.axis2.tool.util.Constants;
import javax.swing.*;
import java.awt.*;
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane3.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane3.java?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane3.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/swing/ui/WizardPane3.java Mon Aug 15 02:39:26 2005
@@ -1,8 +1,8 @@
-package org.apache.axis.tool.service.swing.ui;
+package org.apache.axis2.tool.service.swing.ui;
-import org.apache.axis.tool.service.bean.Page3Bean;
-import org.apache.axis.tool.service.bean.WizardBean;
-import org.apache.axis.tool.util.Constants;
+import org.apache.axis2.tool.service.bean.Page3Bean;
+import org.apache.axis2.tool.service.bean.WizardBean;
+import org.apache.axis2.tool.util.Constants;
import javax.swing.*;
import java.awt.event.ActionEvent;
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/util/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/util/Constants.java?rev=232780&r1=232779&r2=232780&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/util/Constants.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/util/Constants.java Mon Aug 15 02:39:26 2005
@@ -15,15 +15,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
public class Constants {
- public class UIConstants {
- public static final int LABEL_WIDTH = 100;
- public static final int RADIO_BUTTON_WIDTH = 200;
- public static final int TEXT_BOX_WIDTH = 250;
- public static final int BROWSE_BUTTON_WIDTH = 20;
- public static final int GENERAL_BUTTON_WIDTH = 80;
+ public class UIConstants{
+ public static final int LABEL_WIDTH=100;
+ public static final int RADIO_BUTTON_WIDTH=200;
+ public static final int TEXT_BOX_WIDTH=250;
+ public static final int BROWSE_BUTTON_WIDTH=20;
+ public static final int GENERAL_BUTTON_WIDTH=80;
- public static final int GENERAL_COMP_HEIGHT = 20;
+ public static final int GENERAL_COMP_HEIGHT=20;
}
}