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 gd...@apache.org on 2005/07/11 17:49:55 UTC
svn commit: r210150 [21/35] - in /webservices/axis/trunk/java: ./ etc/
modules/addressing/
modules/addressing/src/org/apache/axis2/handlers/addressing/
modules/addressing/test-resources/
modules/addressing/test/org/apache/axis2/handlers/addressing/ mod...
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/control/Controller.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/control/Controller.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/control/Controller.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/control/Controller.java Mon Jul 11 08:49:30 2005
@@ -1,18 +1,18 @@
package org.apache.axis.tool.service.control;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-
-
-import org.apache.axis.tool.service.bean.Page1Bean;
-import org.apache.axis.tool.service.bean.Page2Bean;
-import org.apache.axis.tool.service.bean.Page3Bean;
-import org.apache.axis.tool.service.bean.WizardBean;
import org.apache.axis.tool.core.ClassFileHandler;
import org.apache.axis.tool.core.FileCopier;
import org.apache.axis.tool.core.JarFileWriter;
import org.apache.axis.tool.core.ServiceFileCreator;
+import org.apache.axis.tool.service.bean.Page1Bean;
+import org.apache.axis.tool.service.bean.Page2Bean;
+import org.apache.axis.tool.service.bean.Page3Bean;
+import org.apache.axis.tool.service.bean.WizardBean;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -28,25 +28,26 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
public class Controller {
- public ArrayList getMethodList(WizardBean bean) throws ProcessException{
+ public ArrayList getMethodList(WizardBean bean) throws ProcessException {
ArrayList returnList = null;
try {
returnList = new ClassFileHandler().getMethodNamesFromClass(bean.getPage2bean().getAutomaticClassName(),
- bean.getPage1bean().getFileLocation());
+ bean.getPage1bean().getFileLocation());
} catch (IOException e) {
- throw new ProcessException("IO Error, The class file location may be faulty!",e);
+ throw new ProcessException("IO Error, The class file location may be faulty!", e);
} catch (ClassNotFoundException e) {
- throw new ProcessException(" The specified class does not exist!!!");
- } catch (Exception e){
+ throw new ProcessException(" The specified class does not exist!!!");
+ } catch (Exception e) {
throw new ProcessException("Unknown Error! See whether all parameters are available");
}
- return returnList;
+ return returnList;
}
- public void process(WizardBean bean) throws ProcessException,Exception{
+ public void process(WizardBean bean) throws ProcessException, Exception {
Page1Bean page1Bean = bean.getPage1bean();
Page2Bean page2Bean = bean.getPage2bean();
@@ -54,56 +55,56 @@
File serviceFile = null;
File classFileFolder = null;
- File outputFolder =null;
+ File outputFolder = null;
String outputFileName = null;
boolean isServiceCreated = false;
//see if the class file location is valid
classFileFolder = new File(page1Bean.getFileLocation());
- if (!classFileFolder.exists()){
+ if (!classFileFolder.exists()) {
throw new ProcessException("Specified Class file location is empty!!");
}
- if (!classFileFolder.isDirectory()){
+ if (!classFileFolder.isDirectory()) {
throw new ProcessException("The class file location must be a folder!");
}
- //see if the service.xml file is valid
- if (page2Bean.isManual()){
+ //see if the service.xml file is valid
+ if (page2Bean.isManual()) {
serviceFile = new File(page2Bean.getManualFileName());
- if (!serviceFile.exists()){
+ if (!serviceFile.exists()) {
throw new ProcessException("Specified Service XML file is missing!");
}
- }else{
+ } else {
ArrayList methodList = page2Bean.getSelectedMethodNames();
- if (methodList.isEmpty()){
+ if (methodList.isEmpty()) {
throw new ProcessException("There are no methods selected to generate the service!!");
}
- serviceFile=new ServiceFileCreator().createServiceFile(page2Bean.getProviderClassName(),
- page2Bean.getAutomaticClassName(),
- page2Bean.getSelectedMethodNames());//create the file here
+ serviceFile = new ServiceFileCreator().createServiceFile(page2Bean.getProviderClassName(),
+ page2Bean.getAutomaticClassName(),
+ page2Bean.getSelectedMethodNames());//create the file here
isServiceCreated = true;
}
outputFolder = new File(page3Bean.getOutputFolderName());
outputFileName = page3Bean.getOutputFileName();
- if (!outputFileName.toLowerCase().endsWith(".jar")){
+ if (!outputFileName.toLowerCase().endsWith(".jar")) {
outputFileName = outputFileName + ".jar";
}
- File tempFileFolder =null;
+ File tempFileFolder = null;
try {
//create a temporary directory and copy the files
tempFileFolder = new File("Service-copy");
tempFileFolder.mkdir();
- File metaInfFolder = new File(tempFileFolder,"META-INF");
+ File metaInfFolder = new File(tempFileFolder, "META-INF");
metaInfFolder.mkdir();
- new FileCopier().copyFiles(classFileFolder,tempFileFolder);
- new FileCopier().copyFiles(serviceFile,metaInfFolder);
+ new FileCopier().copyFiles(classFileFolder, tempFileFolder);
+ new FileCopier().copyFiles(serviceFile, metaInfFolder);
//jar the temp directory. the output folder will be created if missing
- new JarFileWriter().writeJarFile(outputFolder,outputFileName,tempFileFolder);
+ new JarFileWriter().writeJarFile(outputFolder, outputFileName, tempFileFolder);
} catch (Exception e) {
throw new ProcessException(e);
} finally {
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/control/ProcessException.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/control/ProcessException.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/control/ProcessException.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/control/ProcessException.java Mon Jul 11 08:49:30 2005
@@ -15,7 +15,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-public class ProcessException extends Exception{
+
+public class ProcessException extends Exception {
public ProcessException() {
}
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/plugin/ServiceArchiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/plugin/ServiceArchiver.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/plugin/ServiceArchiver.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/plugin/ServiceArchiver.java Mon Jul 11 08:49:30 2005
@@ -1,4 +1,4 @@
- /**
+/**
* Copyright 2004,2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,80 +15,81 @@
*/
package org.apache.axis.tool.service.eclipse.plugin;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
/**
* The main plugin class to be used in the desktop.
*/
public class ServiceArchiver extends AbstractUIPlugin {
- //The shared instance.
- private static ServiceArchiver plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
- private static ImageDescriptor wizardImageDescriptor;
- /**
- * The constructor.
- */
- public ServiceArchiver() {
- super();
- plugin = this;
- try {
- resourceBundle = ResourceBundle.getBundle("org.apache.axis.tool.service.resource.ServiceResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-
- /**
- * Returns the shared instance.
- */
- public static ServiceArchiver getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = ServiceArchiver.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- public static ImageDescriptor getWizardImageDescriptor(){
- if (wizardImageDescriptor==null){
- wizardImageDescriptor =ServiceArchiver.imageDescriptorFromPlugin("Axis_Service_Archiver","icons/asf-feather.gif");
- }
- return wizardImageDescriptor;
- }
+ //The shared instance.
+ private static ServiceArchiver plugin;
+ //Resource bundle.
+ private ResourceBundle resourceBundle;
+ private static ImageDescriptor wizardImageDescriptor;
+
+ /**
+ * The constructor.
+ */
+ public ServiceArchiver() {
+ super();
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle("org.apache.axis.tool.service.resource.ServiceResources");
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static ServiceArchiver getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = ServiceArchiver.getDefault().getResourceBundle();
+ try {
+ return (bundle != null) ? bundle.getString(key) : key;
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ public static ImageDescriptor getWizardImageDescriptor() {
+ if (wizardImageDescriptor == null) {
+ wizardImageDescriptor = ServiceArchiver.imageDescriptorFromPlugin("Axis_Service_Archiver", "icons/asf-feather.gif");
+ }
+ return wizardImageDescriptor;
+ }
}
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=210150&r1=210149&r2=210150&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 Jul 11 08:49:30 2005
@@ -30,9 +30,9 @@
/**
* @author Ajith
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
+ * <p/>
+ * TODO To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Style - Code Templates
*/
public class ServiceArchiveWizard extends Wizard implements INewWizard {
@@ -40,8 +40,8 @@
private WizardPane2 wizardPane2;
private WizardPane3 wizardPane3;
private WizardPane4 wizardPane4;
-
-
+
+
/**
*
*/
@@ -49,23 +49,21 @@
super();
setWindowTitle(ServiceArchiver.getResourceString("main.title"));
}
-
-
-
-
+
+
/* (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;
+ IWizardPage pageout = super.getNextPage(page);
+ if (page.equals(wizardPane2)) {
+ if (((WizardPane2) page).isSkipNextPage()) {
+ pageout = super.getNextPage(pageout);
+ }
+ }
+ return pageout;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#addPages()
*/
@@ -79,6 +77,7 @@
wizardPane4 = new WizardPane4();
this.addPage(wizardPane4);
}
+
/* (non-Javadobc)
* @see org.eclipse.jface.wizard.IWizard#performFinish()
*/
@@ -96,15 +95,14 @@
showErrorMessage(e.getMessage());
return false;
} catch (Exception e) {
- showErrorMessage("Unknown Error! " +e.getMessage() );
+ showErrorMessage("Unknown Error! " + e.getMessage());
return false;
}
-
-
-
+
+
}
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
*/
@@ -112,12 +110,12 @@
// TODO Auto-generated method stub
}
-
- private void showErrorMessage(String message){
- MessageDialog.openError(this.getShell(),"Error",message);
- }
-
- private void showSuccessMessage(String message){
- MessageDialog.openInformation(this.getShell(),"Success",message);
+
+ private void showErrorMessage(String message) {
+ MessageDialog.openError(this.getShell(), "Error", message);
+ }
+
+ private void showSuccessMessage(String message) {
+ MessageDialog.openInformation(this.getShell(), "Success", message);
}
}
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane1.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane1.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane1.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane1.java Mon Jul 11 08:49:30 2005
@@ -26,27 +26,23 @@
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;
+import org.eclipse.swt.widgets.*;
public class WizardPane1 extends WizardPage {
private Text classFileLocationText;
private Button browseButton;
-
+
private boolean pageComplete;
-
- public WizardPane1(){
+
+ public WizardPane1() {
super("page1");
this.setTitle(ServiceArchiver.getResourceString("page1.title"));
this.setDescription(ServiceArchiver.getResourceString("page1.welcometext"));
this.setImageDescriptor(ServiceArchiver.getWizardImageDescriptor());
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
@@ -54,58 +50,58 @@
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
- layout.numColumns=3;
+ layout.numColumns = 3;
container.setLayout(layout);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- Label lable = new Label(container,SWT.NULL);
- lable.setText(ServiceArchiver.getResourceString("page1.fileLocationLabel"));
-
- classFileLocationText = new Text(container,SWT.BORDER);
- classFileLocationText.setLayoutData(gd);
- classFileLocationText.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();
- }
- });
-
- setControl(container);
- setPageComplete(false);
+ Label lable = new Label(container, SWT.NULL);
+ lable.setText(ServiceArchiver.getResourceString("page1.fileLocationLabel"));
+
+ classFileLocationText = new Text(container, SWT.BORDER);
+ classFileLocationText.setLayoutData(gd);
+ classFileLocationText.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();
+ }
+ });
+
+ setControl(container);
+ setPageComplete(false);
}
-
-
- private void handleBrowse(){
- DirectoryDialog dirDialog = new DirectoryDialog(this.getShell());
- dirDialog.setMessage(ServiceArchiver.getResourceString("page1.filedialogTitle"));
- String returnText = dirDialog.open();
- if (returnText!=null){
- this.classFileLocationText.setText(returnText);
- }
+
+
+ private void handleBrowse() {
+ DirectoryDialog dirDialog = new DirectoryDialog(this.getShell());
+ dirDialog.setMessage(ServiceArchiver.getResourceString("page1.filedialogTitle"));
+ String returnText = dirDialog.open();
+ if (returnText != null) {
+ this.classFileLocationText.setText(returnText);
+ }
}
-
- private void handleModify(){
+
+ private void handleModify() {
String classLocationText = this.classFileLocationText.getText().trim();
- if (classLocationText.equals("")){
+ if (classLocationText.equals("")) {
updateMessage("Filename should not be empty");
return;
- }else{
+ } else {
updateMessage(null);
}
}
-
- private void updateMessage(String str){
+
+ private void updateMessage(String str) {
this.setErrorMessage(str);
- setPageComplete(str==null);
+ setPageComplete(str == null);
}
-
- public Page1Bean getBean(){
+
+ public Page1Bean getBean() {
Page1Bean pageBean = new Page1Bean();
pageBean.setFileLocation(this.classFileLocationText.getText());
return pageBean;
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane2.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane2.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane2.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane2.java Mon Jul 11 08:49:30 2005
@@ -19,137 +19,130 @@
import org.apache.axis.tool.service.eclipse.plugin.ServiceArchiver;
import org.eclipse.jface.wizard.WizardPage;
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.events.*;
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;
+import org.eclipse.swt.widgets.*;
public class WizardPane2 extends WizardPage {
-
+
private Text serviceXMLText;
private Label manualSelectionLabel;
private Button browseButton;
private Button selectAutoFileGenerationCheckBox;
-
- private boolean skipNextPage=true;
+
+ private boolean skipNextPage = true;
private boolean pageComplete;
-
- public WizardPane2(){
+
+ public WizardPane2() {
super("page2");
this.setTitle(ServiceArchiver.getResourceString("page2.title"));
this.setDescription(ServiceArchiver.getResourceString("page2.welcometext"));
this.setImageDescriptor(ServiceArchiver.getWizardImageDescriptor());
}
-
+
/* (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;
+ layout.numColumns = 3;
container.setLayout(layout);
-
- manualSelectionLabel = new Label(container,SWT.NULL);
+
+ 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.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.addSelectionListener(new SelectionListener(){
- public void widgetSelected(SelectionEvent e){
- handleSelection();
- }
- public void widgetDefaultSelected(SelectionEvent e){}
- });
- /////////////////////////////////////////
- //disable the selection combo for now
- selectAutoFileGenerationCheckBox.setEnabled(false);
- ////////////////////////////////////////////
- setControl(container);
- setPageComplete(false);
+ serviceXMLText = new Text(container, SWT.BORDER);
+ serviceXMLText.setLayoutData(gd);
+ 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.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ handleSelection();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ /////////////////////////////////////////
+ //disable the selection combo for now
+ selectAutoFileGenerationCheckBox.setEnabled(false);
+ ////////////////////////////////////////////
+ setControl(container);
+ setPageComplete(false);
}
-
- private void handleBrowse(){
+
+ private void handleBrowse() {
FileDialog fileDialog = new FileDialog(this.getShell());
fileDialog.setFilterExtensions(new String[]{"service.xml"});
- String returnFileName = fileDialog.open() ;
- if (returnFileName!=null){
+ String returnFileName = fileDialog.open();
+ if (returnFileName != null) {
this.serviceXMLText.setText(returnFileName);
}
}
-
- private void handleSelection(){
- if (this.selectAutoFileGenerationCheckBox.getSelection()){
- changeManualSelectionStatus(false);
+
+ private void handleSelection() {
+ if (this.selectAutoFileGenerationCheckBox.getSelection()) {
+ changeManualSelectionStatus(false);
this.skipNextPage = false;
updateMessage(null);
- }else{
+ } else {
changeManualSelectionStatus(true);
this.skipNextPage = true;
handleModify();
-
+
}
}
-
- private void changeManualSelectionStatus(boolean state){
+
+ 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();
- if (serviceXMLString.equals("")){
- this.updateMessage(ServiceArchiver.getResourceString("page2.error.servicenameempty"));
- }else if(!serviceXMLString.endsWith("service.xml")){
- this.updateMessage(ServiceArchiver.getResourceString("page2.error.servicenamewrong"));
- }else{
+
+ private void handleModify() {
+ String serviceXMLString = serviceXMLText.getText().trim().toLowerCase();
+ if (serviceXMLString.equals("")) {
+ this.updateMessage(ServiceArchiver.getResourceString("page2.error.servicenameempty"));
+ } else if (!serviceXMLString.endsWith("service.xml")) {
+ this.updateMessage(ServiceArchiver.getResourceString("page2.error.servicenamewrong"));
+ } else {
this.updateMessage(null);
}
}
-
- private void updateMessage(String str){
+
+ private void updateMessage(String str) {
this.setErrorMessage(str);
- setPageComplete(str==null);
+ setPageComplete(str == null);
}
-
+
/**
* @return Returns the skipNextPage.
*/
public boolean isSkipNextPage() {
return skipNextPage;
}
-
- public Page2Bean getBean(){
+
+ public Page2Bean getBean() {
Page2Bean pageBean = new Page2Bean();
pageBean.setManual(true);
pageBean.setManualFileName(this.serviceXMLText.getText());
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane3.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane3.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane3.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane3.java Mon Jul 11 08:49:30 2005
@@ -24,35 +24,34 @@
import org.eclipse.swt.widgets.Label;
-public class WizardPane3 extends WizardPage{
-
- public WizardPane3(){
+public class WizardPane3 extends WizardPage {
+
+ public WizardPane3() {
super("page3");
this.setTitle(ServiceArchiver.getResourceString("page2.title"));
this.setDescription(ServiceArchiver.getResourceString("Generate the service XML file"));
this.setImageDescriptor(ServiceArchiver.getWizardImageDescriptor());
}
-
+
/* (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;
+ layout.numColumns = 3;
container.setLayout(layout);
-
- Label manualSelectionLabel = new Label(container,SWT.NULL);
+
+ Label manualSelectionLabel = new Label(container, SWT.NULL);
manualSelectionLabel.setText("Make the service XML file");
-
+
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-
- setControl(container);
+
+ setControl(container);
}
-
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardPage#canFlipToNextPage()
*/
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane4.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane4.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane4.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/service/eclipse/ui/WizardPane4.java Mon Jul 11 08:49:30 2005
@@ -1,135 +1,132 @@
- /*
- * 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.service.eclipse.ui;
-
- import org.apache.axis.tool.service.bean.Page3Bean;
- import org.apache.axis.tool.service.eclipse.plugin.ServiceArchiver;
- import org.eclipse.jface.wizard.WizardPage;
- 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 WizardPane4 extends WizardPage {
-
- private Text outputFileLocationTextBox;
- private Button browseButton;
- private Text outputFileNameTextbox;
-
- public WizardPane4(){
- super("Page4");
- this.setTitle(ServiceArchiver.getResourceString("page4.title"));
- this.setDescription(ServiceArchiver.getResourceString("page4.welcometext"));
- this.setImageDescriptor(ServiceArchiver.getWizardImageDescriptor());
-
- }
- /* (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.addModifyListener(new ModifyListener(){
- public void modifyText(ModifyEvent e){
- handleModify();
- }
- });
-
- 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);
- gd.horizontalSpan = 2;
-
- outputFileNameTextbox = new Text(container,SWT.BORDER);
- outputFileNameTextbox.setLayoutData(gd);
- outputFileNameTextbox.addModifyListener(new ModifyListener(){
- public void modifyText(ModifyEvent e){
- handleModify();
- }
- });
-
- //Fill the name with the default name
- outputFileNameTextbox.setText("my_service.jar");
- 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 handleModify(){
- String outputLocationText = outputFileLocationTextBox.getText();
- String outputFilenameText = outputFileNameTextbox.getText();
- if (outputLocationText==null ||outputLocationText.trim().equals("")){
- this.updateMessage("");
- }else if (outputLocationText==null ||outputLocationText.trim().equals("")){
- this.updateMessage("");
- }else{
- updateMessage(null);
- }
- }
-
- private void updateMessage(String str){
- this.setErrorMessage(str);
- setPageComplete(str==null);
- }
-
- public Page3Bean getBean(){
- Page3Bean pageBean = new Page3Bean();
- pageBean.setOutputFolderName(this.outputFileLocationTextBox.getText().trim());
- pageBean.setOutputFileName(this.outputFileNameTextbox.getText().trim());
- return pageBean;
- }
- }
+/*
+ * 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.service.eclipse.ui;
+
+import org.apache.axis.tool.service.bean.Page3Bean;
+import org.apache.axis.tool.service.eclipse.plugin.ServiceArchiver;
+import org.eclipse.jface.wizard.WizardPage;
+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.*;
+
+public class WizardPane4 extends WizardPage {
+
+ private Text outputFileLocationTextBox;
+ private Button browseButton;
+ private Text outputFileNameTextbox;
+
+ public WizardPane4() {
+ super("Page4");
+ this.setTitle(ServiceArchiver.getResourceString("page4.title"));
+ this.setDescription(ServiceArchiver.getResourceString("page4.welcometext"));
+ this.setImageDescriptor(ServiceArchiver.getWizardImageDescriptor());
+
+ }
+
+ /* (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.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ handleModify();
+ }
+ });
+
+ 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);
+ gd.horizontalSpan = 2;
+
+ outputFileNameTextbox = new Text(container, SWT.BORDER);
+ outputFileNameTextbox.setLayoutData(gd);
+ outputFileNameTextbox.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ handleModify();
+ }
+ });
+
+ //Fill the name with the default name
+ outputFileNameTextbox.setText("my_service.jar");
+ 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 handleModify() {
+ String outputLocationText = outputFileLocationTextBox.getText();
+ String outputFilenameText = outputFileNameTextbox.getText();
+ if (outputLocationText == null || outputLocationText.trim().equals("")) {
+ this.updateMessage("");
+ } else if (outputLocationText == null || outputLocationText.trim().equals("")) {
+ this.updateMessage("");
+ } else {
+ updateMessage(null);
+ }
+ }
+
+ private void updateMessage(String str) {
+ this.setErrorMessage(str);
+ setPageComplete(str == 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/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=210150&r1=210149&r2=210150&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 Jul 11 08:49:30 2005
@@ -1,19 +1,14 @@
package org.apache.axis.tool.service.swing.ui;
-import java.awt.HeadlessException;
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-
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 javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -40,9 +35,9 @@
private int currentPage;
private WizardPane currentWizardPane;
- private static final int PAGE_1=1;
- private static final int PAGE_2=2;
- private static final int PAGE_3=3;
+ private static final int PAGE_1 = 1;
+ private static final int PAGE_2 = 2;
+ private static final int PAGE_3 = 3;
//private static final int PAGE_4=4;
@@ -54,12 +49,12 @@
}
- private void init(){
+ private void init() {
this.getContentPane().setLayout(null);
- this.setBounds((int)Toolkit.getDefaultToolkit().getScreenSize().getWidth()/2 - 400/2,
- (int)Toolkit.getDefaultToolkit().getScreenSize().getHeight()/2 - 360/2,
- 400,360);
+ this.setBounds((int) Toolkit.getDefaultToolkit().getScreenSize().getWidth() / 2 - 400 / 2,
+ (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight() / 2 - 360 / 2,
+ 400, 360);
this.setResizable(false);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
@@ -70,120 +65,120 @@
this.wizardPaneContainer = new JPanel(null);
this.getContentPane().add(this.wizardPaneContainer);
- this.wizardPaneContainer.setBounds(0,0,400,300);
+ this.wizardPaneContainer.setBounds(0, 0, 400, 300);
this.previousButton = new JButton("Previous");
this.getContentPane().add(this.previousButton);
- this.previousButton.setBounds(hgap,300+vgap,bWidth,bHeight);
- this.previousButton.addActionListener(new ActionListener(){
+ this.previousButton.setBounds(hgap, 300 + vgap, bWidth, bHeight);
+ this.previousButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
moveBackWard();
}
});
//
- this.nextButton= new JButton("Next");
+ this.nextButton = new JButton("Next");
this.getContentPane().add(this.nextButton);
- this.nextButton.setBounds(hgap +bWidth + hgap,300 + vgap,bWidth,bHeight);
- this.nextButton.addActionListener(new ActionListener(){
+ this.nextButton.setBounds(hgap + bWidth + hgap, 300 + vgap, bWidth, bHeight);
+ this.nextButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
moveForward();
}
});
- this.cancelButton= new JButton("Close");
- this.getContentPane().add(this.cancelButton) ;
- this.cancelButton.setBounds(hgap + (bWidth + hgap)*2,300 + vgap,bWidth,bHeight);
- this.cancelButton.addActionListener(new ActionListener(){
+ this.cancelButton = new JButton("Close");
+ this.getContentPane().add(this.cancelButton);
+ this.cancelButton.setBounds(hgap + (bWidth + hgap) * 2, 300 + vgap, bWidth, bHeight);
+ this.cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (confirmExit())
System.exit(0);
}
});
- this.finishButton= new JButton("Finish");
- this.getContentPane().add(this.finishButton) ;
- this.finishButton.setBounds(hgap + (bWidth + hgap)*3,300 + vgap,bWidth,bHeight);
- this.finishButton.addActionListener(new ActionListener(){
+ this.finishButton = new JButton("Finish");
+ this.getContentPane().add(this.finishButton);
+ this.finishButton.setBounds(hgap + (bWidth + hgap) * 3, 300 + vgap, bWidth, bHeight);
+ this.finishButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
processFinish();
}
});
-
this.currentPage = PAGE_1;
moveToPage(currentPage); //add the first page as default
}
- private void showErrorMessage(){
- JOptionPane.showMessageDialog(this,"Required Value Not set!!!","Error",JOptionPane.ERROR_MESSAGE);
+ private void showErrorMessage() {
+ JOptionPane.showMessageDialog(this, "Required Value Not set!!!", "Error", JOptionPane.ERROR_MESSAGE);
}
- private void showErrorMessage(String message){
- JOptionPane.showMessageDialog(this,message,"Error",JOptionPane.ERROR_MESSAGE);
+ private void showErrorMessage(String message) {
+ JOptionPane.showMessageDialog(this, message, "Error", JOptionPane.ERROR_MESSAGE);
}
- private void showSuccessMessage(String message){
- JOptionPane.showMessageDialog(this,message,"Error",JOptionPane.INFORMATION_MESSAGE);
+ private void showSuccessMessage(String message) {
+ JOptionPane.showMessageDialog(this, message, "Error", JOptionPane.INFORMATION_MESSAGE);
}
- private boolean confirmExit(){
+ private boolean confirmExit() {
int returnType = JOptionPane.showOptionDialog(this,
- "Are you sure you want to exit?",
- "Exit service builder",
- JOptionPane.YES_NO_OPTION,
- JOptionPane.WARNING_MESSAGE,
- null,null,null);
- return (returnType==JOptionPane.YES_OPTION);
+ "Are you sure you want to exit?",
+ "Exit service builder",
+ JOptionPane.YES_NO_OPTION,
+ JOptionPane.WARNING_MESSAGE,
+ null, null, null);
+ return (returnType == JOptionPane.YES_OPTION);
}
- private void moveForward(){
- if (currentWizardPane.validateValues()){
- this.currentPage ++;
+ private void moveForward() {
+ if (currentWizardPane.validateValues()) {
+ this.currentPage++;
moveToPage(this.currentPage);
- }else{
+ } else {
showErrorMessage();
}
}
- private void moveBackWard(){
- this.currentPage --;
- moveToPage(this.currentPage);
+ private void moveBackWard() {
+ this.currentPage--;
+ moveToPage(this.currentPage);
}
- private void moveToPage(int page){
- switch(page){
+ private void moveToPage(int page) {
+ switch (page) {
case PAGE_1:
- processPage(new WizardPane1(this.wizardBean, this),false,true,false);
+ processPage(new WizardPane1(this.wizardBean, this), false, true, false);
break;
case PAGE_2:
- processPage(new WizardPane2(this.wizardBean, this),true,true,false);
+ processPage(new WizardPane2(this.wizardBean, this), true, true, false);
break;
case PAGE_3:
- processPage(new WizardPane3(this.wizardBean, this),true,false,true);
+ processPage(new WizardPane3(this.wizardBean, this), true, false, true);
break;
default:
return;
}
}
- private void processFinish(){
- if (currentWizardPane.validateValues()){
+
+ private void processFinish() {
+ if (currentWizardPane.validateValues()) {
try {
new Controller().process(wizardBean);
showSuccessMessage(" jar file creation successful! ");
} catch (ProcessException e) {
showErrorMessage(e.getMessage());
} catch (Exception e) {
- showErrorMessage("Unknown Error! " +e.getMessage() );
+ showErrorMessage("Unknown Error! " + e.getMessage());
}
- }else{
+ } else {
showErrorMessage();
}
}
- private void processPage(WizardPane pane,boolean prevButtonState,boolean nextButtonState,boolean finishButtonState){
+ private void processPage(WizardPane pane, boolean prevButtonState, boolean nextButtonState, boolean finishButtonState) {
this.wizardPaneContainer.removeAll();
currentWizardPane = pane;
this.wizardPaneContainer.add(pane);
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=210150&r1=210149&r2=210150&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 Jul 11 08:49:30 2005
@@ -1,14 +1,9 @@
package org.apache.axis.tool.service.swing.ui;
-import java.awt.LayoutManager;
-import java.io.File;
-
-import javax.swing.JFileChooser;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTextArea;
+import javax.swing.*;
import javax.swing.filechooser.FileFilter;
+import java.awt.*;
+import java.io.File;
/*
* Copyright 2004,2005 The Apache Software Foundation.
@@ -25,16 +20,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
public abstract class WizardPane extends JPanel {
protected JTextArea descriptionLabel;
protected JFrame ownerFrame;
- protected int descWidth=400;
- protected int descHeight=100;
- protected int width=400;
- protected int height=300;
- protected int hgap=5;
- protected int vgap=5;
+ protected int descWidth = 400;
+ protected int descHeight = 100;
+ protected int width = 400;
+ protected int height = 300;
+ protected int hgap = 5;
+ protected int vgap = 5;
protected WizardPane() {
}
@@ -55,32 +51,32 @@
super(layout, isDoubleBuffered);
}
- protected void initDescription(String desc){
+ protected void initDescription(String desc) {
this.descriptionLabel = new JTextArea(desc);
this.descriptionLabel.setOpaque(false);
this.descriptionLabel.setEditable(false);
this.descriptionLabel.setAutoscrolls(true);
- this.descriptionLabel.setBounds(0,0,descWidth,descHeight);
+ this.descriptionLabel.setBounds(0, 0, descWidth, descHeight);
this.add(this.descriptionLabel);
}
public abstract boolean validateValues();
- protected void showErrorMessage(String message){
- JOptionPane.showMessageDialog(this,message,"Error",JOptionPane.ERROR_MESSAGE);
+ protected void showErrorMessage(String message) {
+ JOptionPane.showMessageDialog(this, message, "Error", JOptionPane.ERROR_MESSAGE);
}
- protected String browseForAFile(final String extension){
- String str="";
- JFileChooser fc=new JFileChooser();
+ protected String browseForAFile(final String extension) {
+ String str = "";
+ JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
- fc.addChoosableFileFilter(new FileFilter(){
+ fc.addChoosableFileFilter(new FileFilter() {
public boolean accept(File f) {
- if (f.getName().endsWith(extension) || f.isDirectory())
- return true;
- else
- return false;
+ if (f.getName().endsWith(extension) || f.isDirectory())
+ return true;
+ else
+ return false;
}
public String getDescription() {
@@ -89,19 +85,19 @@
});
int returnVal = fc.showOpenDialog(this);
- if(returnVal == JFileChooser.APPROVE_OPTION) {
- str=fc.getSelectedFile().getAbsolutePath().trim();
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ str = fc.getSelectedFile().getAbsolutePath().trim();
}
return str;
}
- protected String browseForAFolder(){
- String str="";
- JFileChooser fc=new JFileChooser();
+ protected String browseForAFolder() {
+ String str = "";
+ JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int returnVal = fc.showOpenDialog(this);
- if(returnVal == JFileChooser.APPROVE_OPTION) {
- str=fc.getSelectedFile().getAbsolutePath().trim();
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ str = fc.getSelectedFile().getAbsolutePath().trim();
}
return str;
}
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=210150&r1=210149&r2=210150&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 Jul 11 08:49:30 2005
@@ -1,19 +1,15 @@
package org.apache.axis.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 javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JTextField;
-
-import org.apache.axis.tool.service.bean.Page1Bean;
-import org.apache.axis.tool.service.bean.WizardBean;
-import org.apache.axis.tool.util.Constants;
-
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -29,7 +25,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-public class WizardPane1 extends WizardPane{
+
+public class WizardPane1 extends WizardPane {
private Page1Bean myBean = null;
@@ -43,10 +40,10 @@
init();
- if (wizardBean.getPage1bean()!= null){
+ if (wizardBean.getPage1bean() != null) {
myBean = wizardBean.getPage1bean();
this.classFileLocationTextBox.setText(myBean.getFileLocation());
- }else{
+ } else {
myBean = new Page1Bean();
wizardBean.setPage1bean(myBean);
}
@@ -56,12 +53,12 @@
public boolean validateValues() {
String text = myBean.getFileLocation();
- return (text!=null && text.trim().length()>0);
+ return (text != null && text.trim().length() > 0);
}
- private void init(){
+ private void init() {
this.setLayout(null);
- this.setSize(width,height);
+ this.setSize(width, height);
initDescription("Welcome to the new AXIS Service packager Wizard Interface.\n\n " +
"Insert the location for the class files here.This should be a folder with \n" +
@@ -70,26 +67,32 @@
this.classFileLocationLabel = new JLabel("class file location");
this.add(this.classFileLocationLabel);
- this.classFileLocationLabel.setBounds(hgap,descHeight,Constants.UIConstants.LABEL_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.classFileLocationLabel.setBounds(hgap, descHeight, Constants.UIConstants.LABEL_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
this.classFileLocationTextBox = new JTextField();
this.add(this.classFileLocationTextBox);
- this.classFileLocationTextBox.setBounds(Constants.UIConstants.LABEL_WIDTH + 2*hgap ,descHeight,Constants.UIConstants.TEXT_BOX_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
- this.classFileLocationTextBox.addActionListener(new ActionListener(){
+ this.classFileLocationTextBox.setBounds(Constants.UIConstants.LABEL_WIDTH + 2 * hgap, descHeight, Constants.UIConstants.TEXT_BOX_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.classFileLocationTextBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
handleTextBoxChange();
}
});
- this.classFileLocationTextBox.addKeyListener(new KeyListener(){
- public void keyTyped(KeyEvent e) { }
- public void keyPressed(KeyEvent e) { }
- public void keyReleased(KeyEvent e) { handleTextBoxChange();}
+ this.classFileLocationTextBox.addKeyListener(new KeyListener() {
+ public void keyTyped(KeyEvent e) {
+ }
+
+ public void keyPressed(KeyEvent e) {
+ }
+
+ public void keyReleased(KeyEvent e) {
+ handleTextBoxChange();
+ }
});
this.browseButton = new JButton(".");
this.add(this.browseButton);
- this.browseButton.setBounds(Constants.UIConstants.LABEL_WIDTH + 2*hgap +Constants.UIConstants.TEXT_BOX_WIDTH,descHeight,Constants.UIConstants.BROWSE_BUTTON_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
- this.browseButton.addActionListener(new ActionListener(){
+ this.browseButton.setBounds(Constants.UIConstants.LABEL_WIDTH + 2 * hgap + Constants.UIConstants.TEXT_BOX_WIDTH, descHeight, Constants.UIConstants.BROWSE_BUTTON_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.browseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
classFileLocationTextBox.setText(browseForAFolder());
handleTextBoxChange();
@@ -100,7 +103,7 @@
private void handleTextBoxChange() {
String text = classFileLocationTextBox.getText();
- if (text!=null){
+ if (text != null) {
this.myBean.setFileLocation(text);
}
}
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=210150&r1=210149&r2=210150&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 Jul 11 08:49:30 2005
@@ -1,28 +1,19 @@
package org.apache.axis.tool.service.swing.ui;
-import java.awt.HeadlessException;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.util.ArrayList;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JDialog;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JRadioButton;
-import javax.swing.JTextField;
-
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 javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.util.ArrayList;
+
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -38,6 +29,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
public class WizardPane2 extends WizardPane {
private WizardBean parentBean;
@@ -55,12 +47,12 @@
parentBean = wizardBean;
- if (wizardBean.getPage2bean()!=null){
+ if (wizardBean.getPage2bean() != null) {
myBean = wizardBean.getPage2bean();
//set the initial settings from the bean
setBeanValues();
- }else{
+ } else {
myBean = new Page2Bean();
wizardBean.setPage2bean(myBean);
setDefaultValues();
@@ -68,11 +60,11 @@
}
- public void setBeanValues(){
- if (myBean.isManual()){
+ public void setBeanValues() {
+ if (myBean.isManual()) {
this.selectManualFileRadioButton.setSelected(true);
loadScreen(new ManualSelectionPanel(true));
- }else{
+ } else {
this.createAutomaticFileRadioButton.setSelected(true);
loadScreen(new AutomaticSelectionPanel(true));
}
@@ -81,46 +73,46 @@
public boolean validateValues() {
String text = "";
- String text2="";
+ String text2 = "";
boolean returnValue = false;
- if (myBean.isManual()){
+ if (myBean.isManual()) {
text = myBean.getManualFileName();
- returnValue = (text!=null && text.trim().length()>0);
- }else{
+ returnValue = (text != null && text.trim().length() > 0);
+ } else {
text = myBean.getAutomaticClassName();
text2 = myBean.getProviderClassName();
- returnValue = (text!=null && text.trim().length()>0) &&
- (text2!=null && text2.trim().length()>0) ;
+ returnValue = (text != null && text.trim().length() > 0) &&
+ (text2 != null && text2.trim().length() > 0);
}
return returnValue;
}
- private void init(){
+ private void init() {
this.setLayout(null);
- this.setSize(width,height);
+ this.setSize(width, height);
initDescription("\n Select either the service xml file or the class that you want to \n " +
- " expose as the service to auto generate a service.xml. \n " +
- " Only the class files that are in the previously selected location can\n" +
- " be laded from here");
+ " expose as the service to auto generate a service.xml. \n " +
+ " Only the class files that are in the previously selected location can\n" +
+ " be laded from here");
ButtonGroup group = new ButtonGroup();
this.selectManualFileRadioButton = new JRadioButton("Select a file manually");
- this.selectManualFileRadioButton.setBounds(hgap,descHeight,Constants.UIConstants.RADIO_BUTTON_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.selectManualFileRadioButton.setBounds(hgap, descHeight, Constants.UIConstants.RADIO_BUTTON_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
this.add(this.selectManualFileRadioButton);
group.add(selectManualFileRadioButton);
- this.selectManualFileRadioButton.addActionListener(new ActionListener(){
+ this.selectManualFileRadioButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
changeSelectionScreen();
}
});
this.createAutomaticFileRadioButton = new JRadioButton("Create a file automatically");
- this.createAutomaticFileRadioButton.setBounds(hgap,descHeight+vgap +Constants.UIConstants.GENERAL_COMP_HEIGHT ,Constants.UIConstants.RADIO_BUTTON_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.createAutomaticFileRadioButton.setBounds(hgap, descHeight + vgap + Constants.UIConstants.GENERAL_COMP_HEIGHT, Constants.UIConstants.RADIO_BUTTON_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
this.add(this.createAutomaticFileRadioButton);
group.add(createAutomaticFileRadioButton);
- this.createAutomaticFileRadioButton.addActionListener(new ActionListener(){
+ this.createAutomaticFileRadioButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
changeSelectionScreen();
}
@@ -128,41 +120,43 @@
this.selectionPanel = new JPanel();
this.selectionPanel.setLayout(null);
- this.selectionPanel.setBounds(0,descHeight + 2*Constants.UIConstants.GENERAL_COMP_HEIGHT +2*vgap,width,100);
+ this.selectionPanel.setBounds(0, descHeight + 2 * Constants.UIConstants.GENERAL_COMP_HEIGHT + 2 * vgap, width, 100);
this.add(this.selectionPanel);
//select manual option by default
-
}
- private void setDefaultValues(){
+
+ private void setDefaultValues() {
this.selectManualFileRadioButton.setSelected(true);
loadScreen(new ManualSelectionPanel());
updateBeanFlags(true);
}
- private void changeSelectionScreen(){
- if (selectManualFileRadioButton.isSelected()){
+
+ private void changeSelectionScreen() {
+ if (selectManualFileRadioButton.isSelected()) {
loadScreen(new ManualSelectionPanel(true));
updateBeanFlags(true);
- } else{
+ } else {
loadScreen(new AutomaticSelectionPanel(true));
updateBeanFlags(false);
}
}
- private void updateBeanFlags(boolean flag){
- myBean.setManual(flag);myBean.setAutomatic(!flag);
+
+ private void updateBeanFlags(boolean flag) {
+ myBean.setManual(flag);
+ myBean.setAutomatic(!flag);
}
- private void loadScreen(JPanel panel){
+ private void loadScreen(JPanel panel) {
this.selectionPanel.removeAll();
this.selectionPanel.add(panel);
this.repaint();
}
-
- private class ManualSelectionPanel extends JPanel{
+ private class ManualSelectionPanel extends JPanel {
private JLabel serverXMLFileLocationLabel;
private JTextField serverXMLFileLocationTextBox;
@@ -174,37 +168,43 @@
public ManualSelectionPanel(boolean loadVals) {
init();
- if (loadVals){
+ if (loadVals) {
this.serverXMLFileLocationTextBox.setText(myBean.getManualFileName());
}
}
- private void init(){
+ private void init() {
this.setLayout(null);
- this.setSize(width,100);
+ this.setSize(width, 100);
this.serverXMLFileLocationLabel = new JLabel("Service File");
this.add(this.serverXMLFileLocationLabel);
- this.serverXMLFileLocationLabel.setBounds(hgap,vgap,Constants.UIConstants.LABEL_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.serverXMLFileLocationLabel.setBounds(hgap, vgap, Constants.UIConstants.LABEL_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
this.serverXMLFileLocationTextBox = new JTextField();
this.add(this.serverXMLFileLocationTextBox);
- this.serverXMLFileLocationTextBox.setBounds(Constants.UIConstants.LABEL_WIDTH + 2*hgap ,vgap,Constants.UIConstants.TEXT_BOX_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
- this.serverXMLFileLocationTextBox.addActionListener(new ActionListener(){
+ this.serverXMLFileLocationTextBox.setBounds(Constants.UIConstants.LABEL_WIDTH + 2 * hgap, vgap, Constants.UIConstants.TEXT_BOX_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.serverXMLFileLocationTextBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setOutFileName();
}
});
- this.serverXMLFileLocationTextBox.addKeyListener(new KeyListener(){
- public void keyTyped(KeyEvent e) { }
- public void keyPressed(KeyEvent e) {}
- public void keyReleased(KeyEvent e) { setOutFileName();}
+ this.serverXMLFileLocationTextBox.addKeyListener(new KeyListener() {
+ public void keyTyped(KeyEvent e) {
+ }
+
+ public void keyPressed(KeyEvent e) {
+ }
+
+ public void keyReleased(KeyEvent e) {
+ setOutFileName();
+ }
});
this.browseButton = new JButton(".");
this.add(this.browseButton);
- this.browseButton.setBounds(Constants.UIConstants.LABEL_WIDTH + 2*hgap +Constants.UIConstants.TEXT_BOX_WIDTH,vgap,Constants.UIConstants.BROWSE_BUTTON_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
- this.browseButton.addActionListener(new ActionListener(){
+ this.browseButton.setBounds(Constants.UIConstants.LABEL_WIDTH + 2 * hgap + Constants.UIConstants.TEXT_BOX_WIDTH, vgap, Constants.UIConstants.BROWSE_BUTTON_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.browseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
serverXMLFileLocationTextBox.setText(browseForAFile("xml"));
setOutFileName();
@@ -213,12 +213,12 @@
}
- private void setOutFileName(){
+ private void setOutFileName() {
myBean.setManualFileName(serverXMLFileLocationTextBox.getText());
}
}
- private class AutomaticSelectionPanel extends JPanel{
+ private class AutomaticSelectionPanel extends JPanel {
private JLabel classFileListLable;
private JLabel providerClassLable;
@@ -233,57 +233,70 @@
public AutomaticSelectionPanel(boolean loadVals) {
init();
- if (loadVals){
+ if (loadVals) {
this.classFileNameTextBox.setText(myBean.getAutomaticClassName());
this.providerClassNameTextBox.setText(myBean.getProviderClassName());
}
}
- private void init(){
+
+ private void init() {
this.setLayout(null);
- this.setSize(width,100);
+ this.setSize(width, 100);
this.classFileListLable = new JLabel("Class Name");
this.add(this.classFileListLable);
- this.classFileListLable.setBounds(hgap,vgap,Constants.UIConstants.LABEL_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.classFileListLable.setBounds(hgap, vgap, Constants.UIConstants.LABEL_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
this.classFileNameTextBox = new JTextField();
this.add(this.classFileNameTextBox);
- this.classFileNameTextBox.setBounds(Constants.UIConstants.LABEL_WIDTH + 2*hgap ,vgap,Constants.UIConstants.TEXT_BOX_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
- this.classFileNameTextBox.addActionListener(new ActionListener(){
+ this.classFileNameTextBox.setBounds(Constants.UIConstants.LABEL_WIDTH + 2 * hgap, vgap, Constants.UIConstants.TEXT_BOX_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.classFileNameTextBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setClassName();
}
});
- this.classFileNameTextBox.addKeyListener(new KeyListener(){
- public void keyTyped(KeyEvent e) {}
- public void keyPressed(KeyEvent e) {}
- public void keyReleased(KeyEvent e) {setClassName();}
+ this.classFileNameTextBox.addKeyListener(new KeyListener() {
+ public void keyTyped(KeyEvent e) {
+ }
+
+ public void keyPressed(KeyEvent e) {
+ }
+
+ public void keyReleased(KeyEvent e) {
+ setClassName();
+ }
});
this.providerClassLable = new JLabel("Provider Class Name");
this.add(this.providerClassLable);
- this.providerClassLable.setBounds(hgap,(Constants.UIConstants.GENERAL_COMP_HEIGHT+vgap),Constants.UIConstants.LABEL_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.providerClassLable.setBounds(hgap, (Constants.UIConstants.GENERAL_COMP_HEIGHT + vgap), Constants.UIConstants.LABEL_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
this.providerClassNameTextBox = new JTextField();
this.add(this.providerClassNameTextBox);
- this.providerClassNameTextBox.setBounds(Constants.UIConstants.LABEL_WIDTH + 2*hgap ,(Constants.UIConstants.GENERAL_COMP_HEIGHT+vgap*2),Constants.UIConstants.TEXT_BOX_WIDTH,Constants.UIConstants.GENERAL_COMP_HEIGHT);
- this.providerClassNameTextBox.addActionListener(new ActionListener(){
+ this.providerClassNameTextBox.setBounds(Constants.UIConstants.LABEL_WIDTH + 2 * hgap, (Constants.UIConstants.GENERAL_COMP_HEIGHT + vgap * 2), Constants.UIConstants.TEXT_BOX_WIDTH, Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.providerClassNameTextBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setProviderClassName();
}
});
- this.providerClassNameTextBox.addKeyListener(new KeyListener(){
- public void keyTyped(KeyEvent e) {}
- public void keyPressed(KeyEvent e) {}
- public void keyReleased(KeyEvent e) {setProviderClassName();}
+ this.providerClassNameTextBox.addKeyListener(new KeyListener() {
+ public void keyTyped(KeyEvent e) {
+ }
+
+ public void keyPressed(KeyEvent e) {
+ }
+
+ public void keyReleased(KeyEvent e) {
+ setProviderClassName();
+ }
});
this.loadButton = new JButton("Load");
this.add(this.loadButton);
- this.loadButton.setBounds(hgap,(Constants.UIConstants.GENERAL_COMP_HEIGHT+vgap)*2 + vgap,
- Constants.UIConstants.GENERAL_BUTTON_WIDTH,
- Constants.UIConstants.GENERAL_COMP_HEIGHT);
- this.loadButton.addActionListener(new ActionListener(){
+ this.loadButton.setBounds(hgap, (Constants.UIConstants.GENERAL_COMP_HEIGHT + vgap) * 2 + vgap,
+ Constants.UIConstants.GENERAL_BUTTON_WIDTH,
+ Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.loadButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
loadAllMethods();
}
@@ -292,11 +305,11 @@
this.advancedButton = new JButton("Advanced");
this.add(this.advancedButton);
- this.advancedButton.setBounds(2*hgap +Constants.UIConstants.GENERAL_BUTTON_WIDTH
- ,(Constants.UIConstants.GENERAL_COMP_HEIGHT+vgap)*2 + vgap,
- Constants.UIConstants.GENERAL_BUTTON_WIDTH,
- Constants.UIConstants.GENERAL_COMP_HEIGHT);
- this.advancedButton.addActionListener(new ActionListener(){
+ this.advancedButton.setBounds(2 * hgap + Constants.UIConstants.GENERAL_BUTTON_WIDTH
+ , (Constants.UIConstants.GENERAL_COMP_HEIGHT + vgap) * 2 + vgap,
+ Constants.UIConstants.GENERAL_BUTTON_WIDTH,
+ Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.advancedButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
openDialog();
}
@@ -304,9 +317,9 @@
this.advancedButton.setEnabled(false);
}
- private void loadAllMethods(){
+ private void loadAllMethods() {
try {
- ArrayList methodList = new Controller().getMethodList(parentBean);
+ ArrayList methodList = new Controller().getMethodList(parentBean);
myBean.setSelectedMethodNames(methodList);
loadButton.setEnabled(false);
advancedButton.setEnabled(true);
@@ -315,31 +328,31 @@
}
}
- private void openDialog(){
+ private void openDialog() {
try {
new AdvancedSelectionDialog().show();
} catch (ProcessException e) {
showErrorMessage(e.getMessage());
}
}
- private void setClassName(){
+
+ private void setClassName() {
loadButton.setEnabled(true);
advancedButton.setEnabled(false);
myBean.setAutomaticClassName(classFileNameTextBox.getText());
}
- private void setProviderClassName(){
+ private void setProviderClassName() {
//loadButton.setEnabled(true);
//advancedButton.setEnabled(false);
myBean.setProviderClassName(providerClassNameTextBox.getText());
}
-
}
- private class AdvancedSelectionDialog extends JDialog{
+ private class AdvancedSelectionDialog extends JDialog {
private JPanel lablePanel;
private JButton okButton;
@@ -348,7 +361,7 @@
private ArrayList completeMethodList;
- public AdvancedSelectionDialog() throws HeadlessException,ProcessException {
+ public AdvancedSelectionDialog() throws HeadlessException, ProcessException {
super();
super.setModal(true);
super.setTitle("Select Methods");
@@ -356,15 +369,15 @@
init();
}
- private void init() throws ProcessException{
+ private void init() throws ProcessException {
//load the class file list
- this.completeMethodList = new Controller().getMethodList(parentBean);
+ this.completeMethodList = new Controller().getMethodList(parentBean);
int methodCount = this.completeMethodList.size();
- int panelHeight = methodCount*(Constants.UIConstants.GENERAL_COMP_HEIGHT + vgap);
+ int panelHeight = methodCount * (Constants.UIConstants.GENERAL_COMP_HEIGHT + vgap);
this.lablePanel = new JPanel();
this.lablePanel.setLayout(null);
- this.lablePanel.setBounds(0,0,width,panelHeight);
+ this.lablePanel.setBounds(0, 0, width, panelHeight);
this.getContentPane().add(this.lablePanel);
ArrayList currentSelectedList = myBean.getSelectedMethodNames();
@@ -378,20 +391,20 @@
currentSelection = currentSelectedList.contains(this.completeMethodList.get(i));
tempCheckBox.setSelected(currentSelection);
selectedValues[i] = currentSelection;
- tempCheckBox.setBounds(hgap,vgap + (Constants.UIConstants.GENERAL_COMP_HEIGHT+vgap)*i,
- Constants.UIConstants.LABEL_WIDTH*3,
- Constants.UIConstants.GENERAL_COMP_HEIGHT);
- tempCheckBox.addActionListener(new CheckBoxActionListner(tempCheckBox,i));
+ tempCheckBox.setBounds(hgap, vgap + (Constants.UIConstants.GENERAL_COMP_HEIGHT + vgap) * i,
+ Constants.UIConstants.LABEL_WIDTH * 3,
+ Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ tempCheckBox.addActionListener(new CheckBoxActionListner(tempCheckBox, i));
this.lablePanel.add(tempCheckBox);
}
okButton = new JButton("OK");
- this.getContentPane().add (this.okButton);
- this.okButton.setBounds(hgap,panelHeight+vgap,
- Constants.UIConstants.GENERAL_BUTTON_WIDTH,
- Constants.UIConstants.GENERAL_COMP_HEIGHT);
- this.okButton.addActionListener(new ActionListener(){
+ this.getContentPane().add(this.okButton);
+ this.okButton.setBounds(hgap, panelHeight + vgap,
+ Constants.UIConstants.GENERAL_BUTTON_WIDTH,
+ Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
loadValuesToBean();
closeMe();
@@ -399,53 +412,54 @@
});
cancelButton = new JButton("Cancel");
- this.getContentPane().add (this.cancelButton);
- this.cancelButton.setBounds(hgap*2 +Constants.UIConstants.GENERAL_BUTTON_WIDTH ,panelHeight+vgap,
- Constants.UIConstants.GENERAL_BUTTON_WIDTH,
- Constants.UIConstants.GENERAL_COMP_HEIGHT);
- this.cancelButton.addActionListener(new ActionListener(){
+ this.getContentPane().add(this.cancelButton);
+ this.cancelButton.setBounds(hgap * 2 + Constants.UIConstants.GENERAL_BUTTON_WIDTH, panelHeight + vgap,
+ Constants.UIConstants.GENERAL_BUTTON_WIDTH,
+ Constants.UIConstants.GENERAL_COMP_HEIGHT);
+ this.cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
closeMe();
}
});
- this.setSize(width,panelHeight+2*Constants.UIConstants.GENERAL_COMP_HEIGHT + 30);
+ this.setSize(width, panelHeight + 2 * Constants.UIConstants.GENERAL_COMP_HEIGHT + 30);
this.setResizable(false);
}
- private void updateSelection(JCheckBox checkBox,int index){
- if (checkBox.isSelected()){
+ private void updateSelection(JCheckBox checkBox, int index) {
+ if (checkBox.isSelected()) {
selectedValues[index] = true;
- }else{
+ } else {
selectedValues[index] = false;
}
}
- private void loadValuesToBean(){
+ private void loadValuesToBean() {
ArrayList modifiedMethodList = new ArrayList();
for (int i = 0; i < selectedValues.length; i++) {
- if( selectedValues[i])
+ if (selectedValues[i])
modifiedMethodList.add(completeMethodList.get(i));
}
myBean.setSelectedMethodNames(modifiedMethodList);
}
- private void closeMe(){
+
+ private void closeMe() {
this.dispose();
}
- private class CheckBoxActionListner implements ActionListener{
+ private class CheckBoxActionListner implements ActionListener {
private JCheckBox checkBox;
private int index;
- public CheckBoxActionListner(JCheckBox checkBox,int index) {
+ public CheckBoxActionListner(JCheckBox checkBox, int index) {
this.index = index;
this.checkBox = checkBox;
}
public void actionPerformed(ActionEvent e) {
- updateSelection(checkBox,index);
+ updateSelection(checkBox, index);
}
}