This commit was manufactured by cvs2svn to create tag 'v20050215_1740'.
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/.classpath b/bundles/org.eclipse.jst.ws.axis.consumption.core/.classpath
deleted file mode 100644
index 275b34c..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/.cvsignore b/bundles/org.eclipse.jst.ws.axis.consumption.core/.cvsignore
deleted file mode 100644
index 60463af..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-build.xml
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/.project b/bundles/org.eclipse.jst.ws.axis.consumption.core/.project
deleted file mode 100644
index 93d0c2b..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/.project
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.ws.axis.consumption.core</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.wst.command.env.core</project>
- <project>org.eclipse.wst.ws.apache.axis</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/build.properties b/bundles/org.eclipse.jst.ws.axis.consumption.core/build.properties
deleted file mode 100644
index 645df18..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-source.wsc-axis.jar = src/
-bin.includes = wsc-axis.jar,\
- plugin.properties,\
- plugin.xml,\
- readme.html
-src.includes = build.properties,\
- plugin.properties,\
- plugin.xml,\
- readme.html,\
- src/
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/plugin.properties b/bundles/org.eclipse.jst.ws.axis.consumption.core/plugin.properties
deleted file mode 100644
index 5e9ff7c..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Web service Axis Consumption Core
-PLUGIN_PROVIDER=Eclipse.org
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/plugin.xml b/bundles/org.eclipse.jst.ws.axis.consumption.core/plugin.xml
deleted file mode 100644
index b69e19d..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/plugin.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id="org.eclipse.jst.ws.axis.consumption.core"
- version="1.0.0"
- name="%PLUGIN_NAME"
- provider-name="%PLUGIN_PROVIDER">
-
- <requires>
- <import plugin="org.eclipse.wst.ws.apache.axis"/>
- <import plugin="org.apache.ant"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <import plugin="org.eclipse.jst.ws"/>
- <import plugin="org.eclipse.jst.ws.consumption"/>
- <import plugin="org.eclipse.jst.j2ee.web"/>
- </requires>
-
- <runtime>
- <library name="wsc-axis.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <extension point="org.eclipse.jst.ws.consumption.wsfinder">
- <wsfinder
- id="org.eclipse.jst.ws.internal.axis.consumption.core.wsfinder.WSFinderAxis"
- name="org.eclipse.jst.ws.internal.axis.consumption.core.wsfinder.WSFinderAxis"
- description="org.eclipse.jst.ws.internal.axis.consumption.core.wsfinder.WSFinderAxis"
- class="org.eclipse.jst.ws.internal.axis.consumption.core.wsfinder.WSFinderAxis">
- </wsfinder>
- </extension>
-
-</plugin>
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/axis/consumption/core/consumption.properties b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/axis/consumption/core/consumption.properties
deleted file mode 100644
index 0038ec5..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/axis/consumption/core/consumption.properties
+++ /dev/null
@@ -1,46 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages for AxisDeployCommand
-#
-MSG_ERROR_PROJECT_URL_PARAM_NOT_SET=IWAB0054E Web project URL for deployment of Web service is not set in AxisDeployCommand
-MSG_ERROR_DEPLOY_FILE_PARAM_NOT_SET=IWAB0488E Location of Axis deployment file is not set in AxisDeployCommand
-MSG_ERROR_AXIS_DEPLOY=IWAB0489E Error when deploying Web service to Axis runtime
-MSG_AXIS_DEPLOY=Deploying Web service to Axis run-time environment
-MSG_AXIS_DEPLOY_OK=Web service successfuly deployed to Axis run-time environment
-
-TASK_LABEL_WSDL_JAVA_COMMAND=WSDL2JavaCommand
-TASK_DESC_WSDL_JAVA_COMMAND=Calls to AXIS WSDL2JavaCommand.
-#
-# Messages for Java2WSDLCommand
-#
-TASK_LABEL_JAVA_WSDL_COMMAND=Java2WSDLCommand
-TASK_DESC_JAVA_WSDL_COMMAND=Calls to AXIS Java2WSDLCommand.
-MSG_GENERATE_WSDL=Generating WSDL file: {0}
-MSG_ERROR_JAVA_WSDL_GENERATE=IWAB0398E Error in generating WSDL from Java
-
-#
-# Messages for WSDL2JavaCommand
-#
-TASK_LABEL_WSDL_JAVA_COMMAND=WSDL2JavaCommand
-TASK_DESC_WSDL_JAVA_COMMAND=Calls to AXIS WSDL2JavaCommand.
-MSG_PARSING_WSDL=Parsing WSDL file: {0}
-MSG_ERROR_WSDL_JAVA_GENERATE=IWAB0399E Error in generating Java from WSDL
-
-#
-# Messages common for all
-#
-MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET=IWAB0397E JavaWSDLParam not set
-
-#
-# Messages common for Java2WSDLCommand and WSDL2JavaCommand
-#
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/AxisDeployCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/AxisDeployCommand.java
deleted file mode 100644
index 79da633..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/AxisDeployCommand.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.command;
-
-
-import java.io.File;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
-
-import org.apache.axis.tools.ant.axis.AdminClientTask;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Target;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-/**
- * Commands are executable, undoable, redoable objects. Every Command has a name and a description.
- */
-
-public class AxisDeployCommand extends SimpleCommand
-{
- private static final String SERVICE_EXT = "/services/AdminService"; //$NON-NLS-1$
-
- private JavaWSDLParameter javaWSDLParam;
- private ResourceBundle resource = ResourceBundle.getBundle("org.eclipse.jst.ws.axis.consumption.core.consumption"); //$NON-NLS-1$
-
- /**
- * Constructor for AxisDeployCommand.
- * @param String description
- * @param String name
- *
- */
- public AxisDeployCommand()
- {
- super("org.eclipse.jst.ws.internal.axis.consumption.core.command.AxisDeployCommand", "org.eclipse.jst.ws.internal.axis.consumption.core.command.AxisDeployCommand");
- }
-
- public Status execute(Environment environment)
- {
- if (javaWSDLParam == null)
- {
- return new SimpleStatus("Java2WSDLCommand", //$NON-NLS-1$
- getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR);
- }
-
- if (javaWSDLParam.getProjectURL() == null || javaWSDLParam.getProjectURL().equals(""))
- { //$NON-NLS-1$
- return new SimpleStatus("Java2WSDLCommand", //$NON-NLS-1$
- getMessage("MSG_ERROR_PROJECT_URL_PARAM_NOT_SET"), Status.ERROR);
- }
-
- if (javaWSDLParam.getDeploymentFiles() == null || javaWSDLParam.getDeploymentFiles().length == 0)
- {
- return new SimpleStatus("Java2WSDLCommand", //$NON-NLS-1$
- getMessage("MSG_ERROR_DEPLOY_FILE_PARAM_NOT_SET"), Status.ERROR);
- }
-
- environment.getProgressMonitor().report(getMessage("MSG_AXIS_DEPLOY"));
-
- Status status = executeAntTask();
- if (status.getSeverity() == Status.ERROR)
- {
- environment.getStatusHandler().reportError(status);
- }
-
- return status;
- }
-
- protected Status executeAntTask()
- {
- final class DeployTask extends AdminClientTask
- {
- public DeployTask()
- {
- project = new Project();
- project.init();
- taskType = "axis"; //$NON-NLS-1$
- taskName = "axis-admin"; //$NON-NLS-1$
- target = new Target();
- }
- }
-
- DeployTask adminClient = new DeployTask();
- String url = javaWSDLParam.getProjectURL() + SERVICE_EXT;
- adminClient.setUrl(url);
- adminClient.setXmlFile(new File(javaWSDLParam.getDeploymentFiles()[0]));
-
- try
- {
- adminClient.execute();
- }
- catch (BuildException e)
- {
- e.printStackTrace();
- String message = e.getMessage();
- if (e.getCause() != null)
- {
- message = e.getCause().toString();
- }
-
- Status[] childStatus = new Status[1];
- childStatus[0] = new SimpleStatus("AxisDeployCommand", message, Status.ERROR);
- return new SimpleStatus("AxisDeployCommand", //$NON-NLS-1$
- getMessage("MSG_ERROR_AXIS_DEPLOY"), childStatus);
- }
- return new SimpleStatus("AxisDeployCommand", //$NON-NLS-1$
- getMessage("MSG_AXIS_DEPLOY_OK"), Status.OK);
-
- }
-
- private String getMessage(String messageId, String parm1)
- {
- String message = resource.getString(messageId);
- return MessageFormat.format(message, new String[] { parm1 });
- }
-
- /**
- * Returns the message string identified by the given key from plugin.properties.
- *
- * @return The String message.
- */
- public String getMessage(String key)
- {
- return resource.getString(key);
- }
-
- /**
- * @param javaWSDLParam The javaWSDLParam to set.
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam)
- {
- this.javaWSDLParam = javaWSDLParam;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/Java2WSDLCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/Java2WSDLCommand.java
deleted file mode 100644
index 680d3de..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/Java2WSDLCommand.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.command;
-
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.ResourceBundle;
-
-import org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask;
-import org.apache.axis.tools.ant.wsdl.NamespaceMapping;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Target;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
- * Commands are executable, undoable, redoable objects.
- * Every Command has a name and a description.
- */
-
-public class Java2WSDLCommand extends SimpleCommand {
-
- private JavaWSDLParameter javaWSDLParam_;
- private ResourceBundle resource = ResourceBundle.getBundle("org.eclipse.jst.ws.axis.consumption.core.consumption"); //$NON-NLS-1$
-
- private String LABEL = "TASK_LABEL_JAVA_WSDL_COMMAND";
- private String DESCRIPTION = "TASK_DESC_JAVA_WSDL_COMMAND";
-
- public Java2WSDLCommand() {
- super();
- setName (getMessage(LABEL));
- setDescription(getMessage(DESCRIPTION));
- }
- /**
- * Constructor for Java2WSDLCommand.
- */
- public Java2WSDLCommand(JavaWSDLParameter javaWSDLParam) {
- super();
- setName (getMessage(LABEL));
- setDescription(getMessage(DESCRIPTION));
- this.javaWSDLParam_ = javaWSDLParam;
- }
-
- public Status execute(Environment environment) {
- Status status;
- if (javaWSDLParam_ == null) {
- status = new SimpleStatus("Java2WSDLCommand", //$NON-NLS-1$
- getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR);
- environment.getStatusHandler().reportError(status);
- return status;
- }
-
- if (javaWSDLParam_.getBeanName() == null) {
- status = new SimpleStatus("Java2WSDLCommand", //$NON-NLS-1$
- getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR);
- environment.getStatusHandler().reportError(status);
- return status;
- }
-
- environment.getProgressMonitor().report(
- getMessage("MSG_GENERATE_WSDL", javaWSDLParam_.getBeanName() ) );
-
- return executeAntTask(environment);
- }
-
- protected Status executeAntTask(Environment environment) {
-
- final class Emitter extends Java2WsdlAntTask {
- public Emitter() {
- project = new Project();
- project.init();
- taskType = "axis"; //$NON-NLS-1$
- taskName = "axis-java2wsdl"; //$NON-NLS-1$
- target = new Target();
- }
- }
-
- Emitter emitter = new Emitter();
- emitter.createClasspath().setPath(javaWSDLParam_.getClasspath());
- environment.getLog().log(Log.INFO, 5008, this, "executeAntTask", "Class Path = "+ javaWSDLParam_.getClasspath());
-
- emitter.setPortTypeName(javaWSDLParam_.getPortTypeName());
- environment.getLog().log(Log.INFO, 5009, this, "executeAntTask", "Port Type Name = "+ javaWSDLParam_.getPortTypeName());
-
- emitter.setServiceElementName(javaWSDLParam_.getServiceName());
- environment.getLog().log(Log.INFO, 5010, this, "executeAntTask", "Service Name = "+ javaWSDLParam_.getServiceName());
-
- emitter.setLocation(javaWSDLParam_.getUrlLocation());
- environment.getLog().log(Log.INFO, 5011, this, "executeAntTask", "URL Location = "+ javaWSDLParam_.getUrlLocation());
-
- emitter.setMethods(javaWSDLParam_.getMethodString());
- environment.getLog().log(Log.INFO, 5012, this, "executeAntTask", "Methods = "+ javaWSDLParam_.getMethodString());
-
- emitter.setStyle(javaWSDLParam_.getStyle());
- environment.getLog().log(Log.INFO, 5013, this, "executeAntTask", "Style = "+ javaWSDLParam_.getStyle());
-
- emitter.setUse(javaWSDLParam_.getUse());
- environment.getLog().log(Log.INFO, 5014, this, "executeAntTask", "Use = "+ javaWSDLParam_.getUse());
-
- emitter.setOutput(new File(javaWSDLParam_.getOutputWsdlLocation()));
- environment.getLog().log(Log.INFO, 5015, this, "executeAntTask", "WSDL Location = "+ javaWSDLParam_.getOutputWsdlLocation());
-
- emitter.setNamespace(javaWSDLParam_.getNamespace());
- environment.getLog().log(Log.INFO, 5016, this, "executeAntTask", "Name Space = "+ javaWSDLParam_.getNamespace());
-
- emitter.setClassName(javaWSDLParam_.getBeanName());
- environment.getLog().log(Log.INFO, 5017, this, "executeAntTask", "Bean name = "+ javaWSDLParam_.getBeanName());
-
- emitter.setImplClass(javaWSDLParam_.getBeanName());
-
- HashMap mappings = javaWSDLParam_.getMappings();
- if(mappings != null){
- Iterator keys = mappings.keySet().iterator();
- while(keys.hasNext()){
- String pakage = (String)keys.next();
- String namespace = (String)mappings.get(pakage);
- NamespaceMapping map = new NamespaceMapping();
- map.setPackage(pakage);
- map.setNamespace(namespace);
- emitter.addMapping(map);
- }
- }
-
-
- try {
- emitter.execute();
- } catch (BuildException e) {
- environment.getLog().log(Log.ERROR, 5018, this, "executeAntTask", e);
- Status status = new SimpleStatus("Java2WSDLCommand", //$NON-NLS-1$
- getMessage("MSG_ERROR_JAVA_WSDL_GENERATE") + " " //$NON-NLS-1$
- +e.getCause().toString(), Status.ERROR);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- return new SimpleStatus( "" );
-
- }
-
- public Status undo(Environment environment) {
- return null;
- }
-
- public Status redo(Environment environment) {
- return null;
- }
-
- /**
- * Returns the javaWSDLParam.
- * @return JavaWSDLParameter
- */
- public JavaWSDLParameter getJavaWSDLParam() {
- return javaWSDLParam_;
- }
-
- private String getMessage(String messageId, String parm1) {
- String message = resource.getString(messageId);
- return MessageFormat.format(message, new String[] { parm1 });
- }
-
- /**
- * Returns the message string identified by the given key from
- * plugin.properties.
- * @return The String message.
- */
- public String getMessage(String key) {
- return resource.getString(key);
- }
-
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParm) {
- this.javaWSDLParam_ = javaWSDLParm;
- }
-
- public String getWsdlURI()
- {
- File file = new File(getJavaWSDLParam().getOutputWsdlLocation());
- String url = "";
- try {
- url = file.toURL().toString();
- }
- catch(MalformedURLException mue){}
- return url;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/WSDL2JavaCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/WSDL2JavaCommand.java
deleted file mode 100644
index d2b5265..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/WSDL2JavaCommand.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.command;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ResourceBundle;
-
-import org.apache.axis.wsdl.toJava.Emitter;
-import org.apache.axis.wsdl.toJava.GeneratedFileInfo;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class WSDL2JavaCommand extends SimpleCommand {
-
- private final String DEPLOY_TYPE = "deploy"; //$NON-NLS-1$
- private final String UNDEPLOY_TYPE = "undeploy"; //$NON-NLS-1$
- private JavaWSDLParameter javaWSDLParam;
- private String wsdlURI;
- private String httpBasicAuthUsername;
- private String httpBasicAuthPassword;
- private ResourceBundle resource = ResourceBundle.getBundle("org.eclipse.jst.ws.axis.consumption.core.consumption"); //$NON-NLS-1$
- private String LABEL = "TASK_LABEL_WSDL_JAVA_COMMAND";
- private String DESCRIPTION = "TASK_DESC_WSDL_JAVA_COMMAND";
-
-
- public WSDL2JavaCommand() {
- super();
- setName(getMessage(LABEL));
- setDescription(getMessage(DESCRIPTION));
- }
-
- public Status execute(Environment environment) {
- Status status;
- if (javaWSDLParam == null) {
- status = new SimpleStatus("WSDL2JavaCommand", //$NON-NLS-1$
- getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR);
- environment.getStatusHandler().reportError(status);
- return status;
- }
-
- if (wsdlURI != null) //bottom up case has already has the correct WSDL on javaWSDLParam
- {
- javaWSDLParam.setInputWsdlLocation(wsdlURI);
- }
- javaWSDLParam.setHTTPUsername(httpBasicAuthUsername);
- javaWSDLParam.setHTTPPassword(httpBasicAuthPassword);
-
- Emitter wsdl2Java = new Emitter();
- if (environment.getLog().isEnabled("emitter")) {
- wsdl2Java.setVerbose(true);
- } else {
- wsdl2Java.setVerbose(false);
- }
- boolean serverSide = javaWSDLParam.getServerSide() == JavaWSDLParameter.SERVER_SIDE_BEAN;
- wsdl2Java.setServerSide(serverSide);
- if (serverSide) {
- wsdl2Java.setSkeletonWanted(javaWSDLParam.isSkeletonDeploy());
- }
- if (javaWSDLParam.isMetaInfOnly()) {
- // for the case Java2WSDL-WSDL2Java
- wsdl2Java.setOutputDir(removeFileProtocol(javaWSDLParam.getOutput()));
- HashMap pck2nsMap = javaWSDLParam.getMappings();
- if (pck2nsMap != null) {
- HashMap ns2pckMap = new HashMap();
- Iterator keys = pck2nsMap.keySet().iterator();
- while (keys.hasNext()) {
- String pakage = (String) keys.next();
- String namespace = (String) pck2nsMap.get(pakage);
- ns2pckMap.put(namespace, pakage);
- }
- wsdl2Java.setNamespaceMap(ns2pckMap);
- }
- } else {
- // for the case WSDL2Java
- wsdl2Java.setOutputDir(removeFileProtocol(javaWSDLParam.getJavaOutput()));
- if (javaWSDLParam.getMappings() != null) {
- wsdl2Java.setNamespaceMap(javaWSDLParam.getMappings());
- }
- }
- environment.getLog().log(Log.INFO, 5019, this, "execute", "Java output = " + javaWSDLParam.getJavaOutput());
- if (javaWSDLParam.getHTTPPassword() != null) {
- wsdl2Java.setPassword(javaWSDLParam.getHTTPPassword());
- environment.getLog().log(Log.INFO, 5081, this, "execute", "password: " + javaWSDLParam.getHTTPPassword());
- }
- if (javaWSDLParam.getHTTPUsername() != null) {
- wsdl2Java.setUsername(javaWSDLParam.getHTTPUsername());
- environment.getLog().log(Log.INFO, 5082, this, "execute", "username: " + javaWSDLParam.getHTTPUsername());
- }
- environment.getLog().log(Log.INFO, 5020, this, "execute", "WSDL Location = " + javaWSDLParam.getInputWsdlLocation());
- environment.getProgressMonitor().report(getMessage("MSG_PARSING_WSDL", javaWSDLParam.getInputWsdlLocation() ) );
- try {
- wsdl2Java.run(javaWSDLParam.getInputWsdlLocation());
- if (serverSide) {
- // set deployment files
- List deploymentFiles1 = wsdl2Java.getGeneratedFileInfo().findType(DEPLOY_TYPE);
- List deploymentFiles2 = wsdl2Java.getGeneratedFileInfo().findType(UNDEPLOY_TYPE);
- ArrayList deplFiles = new ArrayList();
- if (deploymentFiles1 != null && deploymentFiles2 != null) {
- deploymentFiles1.addAll(deploymentFiles2);
- for (int i = 0; i < deploymentFiles1.size(); i++) {
- GeneratedFileInfo.Entry entry = (GeneratedFileInfo.Entry) deploymentFiles1.get(i);
- deplFiles.add(entry.fileName);
- }
- String[] deplFilesArray = new String[deplFiles.size()];
- deplFiles.toArray(deplFilesArray);
- javaWSDLParam.setDeploymentFiles(deplFilesArray);
- }
- // set java files
- List javaFiles = wsdl2Java.getGeneratedFileNames();
- javaFiles.removeAll(deplFiles);
- String[] javaFileNames = new String[javaFiles.size()];
- javaFiles.toArray(javaFileNames);
- javaWSDLParam.setJavaFiles(javaFileNames);
- }
-
- } catch (Exception e) {
- environment.getLog().log(Log.ERROR, 5021, this, "execute", e);
- status = new SimpleStatus("Java2WSDLCommand", //$NON-NLS-1$
- getMessage("MSG_ERROR_WSDL_JAVA_GENERATE") + " " //$NON-NLS-1$
- + e.toString(), Status.ERROR);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- return new SimpleStatus("");
- }
-
- /*
- * Hack: Axis doesn't like file URLs
- */
- private String removeFileProtocol(String s) {
- if (s.startsWith("file:")) {
- String newS = s.substring(5, s.length());
- int i = newS.indexOf(':');
- if (i != -1) {
- String protocol = newS.substring(0, i);
- int j = protocol.indexOf('/');
- int k = protocol.indexOf('\\');
- int max = Math.max(j, k);
- if (max != -1)
- newS = newS.substring(max + 1, newS.length());
- }
- return newS;
- }
- return s;
- }
-
- public Status undo(Environment environment) {
- return null;
- }
-
- public Status redo(Environment environment) {
- return null;
- }
-
- private String getMessage(String messageId, String parm1) {
- String message = resource.getString(messageId);
- return MessageFormat.format(message, new String[]{parm1});
- }
-
- /**
- * Returns the message string identified by the given key from
- * plugin.properties.
- *
- * @return The String message.
- */
- public String getMessage(String key) {
- return resource.getString(key);
- }
-
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) {
- this.javaWSDLParam = javaWSDLParam;
- }
-
- public JavaWSDLParameter getJavaWSDLParam() {
- return javaWSDLParam;
- }
-
- /**
- * @param httpBasicAuthPassword
- * The httpBasicAuthPassword to set.
- */
- public void setHttpBasicAuthPassword(String httpBasicAuthPassword) {
- this.httpBasicAuthPassword = httpBasicAuthPassword;
- }
-
- /**
- * @param httpBasicAuthUsername
- * The httpBasicAuthUsername to set.
- */
- public void setHttpBasicAuthUsername(String httpBasicAuthUsername) {
- this.httpBasicAuthUsername = httpBasicAuthUsername;
- }
-
- public void setWsdlURI(String wsdlURI) {
- this.wsdlURI = wsdlURI;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/JavaWSDLParameter.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/JavaWSDLParameter.java
deleted file mode 100644
index c3da781..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/JavaWSDLParameter.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.common;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-
-
-public class JavaWSDLParameter {
-
- public static final byte SERVER_SIDE_NONE = 0;
- public static final byte SERVER_SIDE_BEAN = 1;
- public static final byte SERVER_SIDE_EJB = 2;
-
- public static final String STYLE_RPC = "RPC"; //$NON-NLS-1$
- public static final String STYLE_DOCUMENT = "DOCUMENT"; //$NON-NLS-1$
- public static final String STYLE_WRAPPED = "WRAPPED"; //$NON-NLS-1$
-
- public static final String USE_LITERAL = "LITERAL"; //$NON-NLS-1$
- public static final String USE_ENCODED = "ENCODED"; //$NON-NLS-1$
-
- private String beanName = null; // The name of the Java bean
- private String classpath = null;
- // The class path for loading the bean and command execution
- private String beanPackage = null; // The package location of the bean
- private String portTypeName = null; // The name of the port type element
- private String serviceName = null; // The name of the service element
- private String outputWsdlLocation = null;
- // The output location of the WSDL file
- private String inputWsdlLocation = null;
- // The input location of the WSDL file
- private String urlLocation = null; // The URL location of the web service
- private Hashtable methods = null; // The array of method names
- private String style = null;
- // The style (RPC | DOCUMENT | WRAPPED) attribute for the generated WSDL
- private String use = null;
- // The use (LITERAL | ENCODED) attribtue for the generated WSDL
- private String output = null;
- // The output location for deployment descriptors & Java code (output from WSDL2Java command)
- private String javaOutput = null;
- // The output location for Java code (output from WSDL2Java command)
- private boolean metaInfOnly = false; // META-INF-ONLY flag
- private byte serverSide = SERVER_SIDE_NONE;
- // server-side flag (SERVER_SIDE_NONE | SERVER_SIDE_BEAN | SERVER_SIDE_EJB)
- private String namespace = null;
- private boolean skeletonDeploy = true;
- private String container = null;
- private String[] deploymentFiles = null;
- private String[] javaFiles = null;
- private String projectURL = null;
- private HashMap mappingPairs;
- private String httpUsername_ = null;
- private String httpPassword_ = null;
-
- public void setContainer(String container) {
- this.container = container;
- }
-
- public String getContainer() {
- return container;
- }
-
- /**
- * Constructor for JavaWSDLParameter.
- */
- public JavaWSDLParameter() {
- }
-
- /**
- * Returns the beanName.
- * @return String
- */
- public String getBeanName() {
- return beanName;
- }
-
- public String getBeanPackage() {
- return beanPackage;
- }
-
- /**
- * Returns the portTypeName.
- * @return String
- */
- public String getPortTypeName() {
- return portTypeName;
- }
-
- /**
- * Returns the serviceName.
- * @return String
- */
- public String getServiceName() {
- return serviceName;
- }
-
- /**
- * Returns the output.
- * @return String
- */
- public String getOutput() {
- return output;
- }
-
- /**
- * Returns the methods.
- * @return String[]
- */
- public Hashtable getMethods() {
- return methods;
- }
-
- /**
- * Returns the comma seperated string represetation of the methods.
- * @return String
- */
- public String getMethodString() {
- String methodString = ""; //$NON-NLS-1$
- Enumeration e = methods.keys();
- for (int i=0; e.hasMoreElements(); i++)
- {
-
- String signature = (String) e.nextElement();
- if (((Boolean) methods.get(signature)).booleanValue()){
- int index = signature.indexOf('(');
- String name = signature.substring(0, index);
- methodString += name;
- }
- if (i != methods.size() -1) // this is not the last array item
- {
- methodString += ",";
- }
- }
- return methodString;
- }
-
- /**
- * Returns the style attribute.
- * @return String
- */
- public String getStyle() {
- return style;
- }
-
- /**
- * Returns the urlLocation.
- * @return String
- */
- public String getUrlLocation() {
- return urlLocation;
- }
-
- /**
- * Returns the use attribute.
- * @return String
- */
- public String getUse() {
- return use;
- }
-
- /**
- * Returns the outputWsdlLocation.
- * @return String
- */
- public String getOutputWsdlLocation() {
- return outputWsdlLocation;
- }
-
- /**
- * Sets the beanName.
- * @param beanName The beanName to set
- */
- public void setBeanName(String beanName) {
- this.beanName = beanName;
- }
-
- public void setBeanPackage(String beanPackage) {
- this.beanPackage = beanPackage;
- }
-
- /**
- * Sets the portTypeName.
- * @param portTypeName The portTypeName to set
- */
- public void setPortTypeName(String portTypeName) {
- this.portTypeName = portTypeName;
- }
-
- /**
- * Sets the serviceName.
- * @param serviceName The serviceName to set
- */
- public void setServiceName(String serviceName) {
- this.serviceName = serviceName;
- }
-
- /**
- * Sets the output.
- * @param output The output to set
- */
- public void setOutput(String output) {
- this.output = output;
- }
-
- /**
- * Sets the methods.
- * @param methods The methods to set
- */
- public void setMethods(Hashtable methods) {
- this.methods = methods;
- }
-
- /**
- * Sets the style.
- * @param style The style to set
- */
- public void setStyle(String style) {
- this.style = style;
- }
-
- /**
- * Sets the urlLocation.
- * @param urlLocation The urlLocation to set
- */
- public void setUrlLocation(String urlLocation) {
- this.urlLocation = urlLocation;
- }
-
- /**
- * Sets the use.
- * @param use The use to set
- */
- public void setUse(String use) {
- this.use = use;
- }
-
- /**
- * Sets the outputWsdlLocation.
- * @param outputWsdlLocation The outputWsdlLocation to set
- */
- public void setOutputWsdlLocation(String wsdlLocation) {
- this.outputWsdlLocation = wsdlLocation;
- }
-
- /**
- * Returns the metaInfOnly.
- * @return boolean
- */
- public boolean isMetaInfOnly() {
- return metaInfOnly;
- }
-
- /**
- * Sets the metaInfOnly.
- * @param metaInfOnly The metaInfOnly to set
- */
- public void setMetaInfOnly(boolean metaInfOnly) {
- this.metaInfOnly = metaInfOnly;
- }
-
- /**
- * Returns the serverSide.
- * @return byte
- */
- public byte getServerSide() {
- return serverSide;
- }
-
- /**
- * Sets the serverSide.
- * @param serverSide The serverSide to set
- */
- public void setServerSide(byte serverSide) {
- this.serverSide = serverSide;
- }
-
- /**
- * Returns the inputWsdlLocation.
- * @return String
- */
- public String getInputWsdlLocation() {
- return inputWsdlLocation;
- }
-
- /**
- * Sets the inputWsdlLocation.
- * @param inputWsdlLocation The inputWsdlLocation to set
- */
- public void setInputWsdlLocation(String inputWsdlLocation) {
- this.inputWsdlLocation = inputWsdlLocation;
- }
-
- /**
- * Returns the namespace.
- * @return String
- */
- public String getNamespace() {
- return namespace;
- }
-
- /**
- * Sets the namespace.
- * @param namespace The namespace to set
- */
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- /**
- * Returns the Java output.
- * @return String
- */
- public String getJavaOutput() {
- return javaOutput;
- }
-
- /**
- * Sets the javaOutput.
- * @param javaOutput The Java output to set
- */
- public void setJavaOutput(String javaOutput) {
- this.javaOutput = javaOutput;
- }
-
- /**
- * @return
- */
- public String getClasspath() {
- return classpath;
- }
-
- /**
- * @param string
- */
- public void setClasspath(String string) {
- classpath = string;
- }
-
- /**
- * @return
- */
- public boolean isSkeletonDeploy() {
- return skeletonDeploy;
- }
-
- /**
- * @param b
- */
- public void setSkeletonDeploy(boolean b) {
- skeletonDeploy = b;
- }
-
- /**
- * @return
- */
- public String[] getDeploymentFiles() {
- return deploymentFiles;
- }
-
- /**
- * @param strings
- */
- public void setDeploymentFiles(String[] strings) {
- deploymentFiles = strings;
- }
-
- /**
- * @return
- */
- public String[] getJavaFiles() {
- return javaFiles;
- }
-
- /**
- * @param strings
- */
- public void setJavaFiles(String[] strings) {
- javaFiles = strings;
- }
-
- /**
- * @return
- */
- public String getProjectURL() {
- return projectURL;
- }
-
- /**
- * @param string
- */
- public void setProjectURL(String string) {
- projectURL = string;
- }
-
- public HashMap getMappings()
- {
- return mappingPairs;
- }
-
- public void setMappings(HashMap map)
- {
- mappingPairs = map;
- }
-
- /**
- * Returns the user name for HTTP basic authentication
- * @return String
- */
- public String getHTTPUsername()
- {
- return httpUsername_;
- }
-
- /**
- * Sets the user name for HTTP basic authentication
- * @param String
- */
- public void setHTTPUsername(String httpUsername)
- {
- httpUsername_ = httpUsername;
- }
-
- /**
- * Returns the password for HTTP basic authentication
- * @return String
- */
- public String getHTTPPassword()
- {
- return httpPassword_;
- }
-
- /**
- * @param string
- */
- public void setHTTPPassword(String httpPassword) {
- httpPassword_ = httpPassword;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/wsfinder/WSFinderAxis.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/wsfinder/WSFinderAxis.java
deleted file mode 100644
index 84cd5f4..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/wsfinder/WSFinderAxis.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.axis.consumption.core.wsfinder;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.wsfinder.LiveWSDLFilter;
-import org.eclipse.jst.ws.internal.consumption.wsfinder.WSFinderCommon;
-
-public class WSFinderAxis extends WSFinderCommon
-{
- public WSFinderAxis()
- {
- super();
- }
-
- public List find()
- {
- final Vector wsdlURLs = new Vector();
- IProject[] projects = getWorkspaceProjects();
- for (int i = 0; i < projects.length; i++)
- {
- J2EEWebNatureRuntime webNature = getWebNature(projects[i]);
- if (webNature != null)
- {
- final String webProjectURL = ResourceUtils.getWebProjectURL(projects[i]);
- if (webProjectURL != null && webProjectURL.length() > 0)
- {
- final IFolder folderWSDL = getFolderRootPublishable(webNature).getFolder("wsdl");
- try
- {
- folderWSDL.accept(
- new IResourceVisitor()
- {
- public boolean visit(IResource resource)
- {
- if (resource.getType() == IResource.FILE)
- {
- String ext = resource.getFileExtension();
- if (ext != null && ext.equalsIgnoreCase("wsdl"))
- {
- String resPath = resource.getFullPath().toString();
- String folderPath = folderWSDL.getFullPath().toString();
- int index = resPath.indexOf(folderPath);
- if (index != -1)
- resPath = resPath.substring(index+folderPath.length(), resPath.length());
- StringBuffer sb = new StringBuffer(webProjectURL);
- sb.append("/wsdl");
- sb.append(resPath);
- wsdlURLs.add(sb.toString());
- }
- }
- return true;
- }
- }
- );
- }
- catch (CoreException ce)
- {
- }
- }
- }
- }
- LiveWSDLFilter[] filters = new LiveWSDLFilter[wsdlURLs.size()];
- for (int i = 0; i < filters.length; i++)
- {
- filters[i] = new LiveWSDLFilter((String)wsdlURLs.get(i));
- filters[i].start();
- }
- for (int i = 0; i < filters.length; i++)
- {
- if (!filters[i].isFinish())
- {
- Thread.yield();
- i = -1;
- }
- }
- for (int i = 0; i < filters.length; i++)
- {
- if (!filters[i].isWSDLLive())
- wsdlURLs.remove(filters[i].getWSDLURL());
- }
- return wsdlURLs;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/.classpath b/bundles/org.eclipse.jst.ws.axis.consumption.ui/.classpath
deleted file mode 100644
index 275b34c..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/.cvsignore b/bundles/org.eclipse.jst.ws.axis.consumption.ui/.cvsignore
deleted file mode 100644
index 60463af..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-build.xml
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/.project b/bundles/org.eclipse.jst.ws.axis.consumption.ui/.project
deleted file mode 100644
index cb0ee10..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/.project
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.ws.axis.consumption.ui</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.wst.command.env</project>
- <project>org.eclipse.wst.command.env.core</project>
- <project>org.eclipse.jst.ws</project>
- <project>org.eclipse.jst.ws.axis.consumption.core</project>
- <project>org.eclipse.jst.ws.consumption</project>
- <project>org.eclipse.jst.ws.consumption.ui</project>
- <project>org.eclipse.jst.ws.discovery.core</project>
- <project>org.eclipse.jst.ws.ui</project>
- <project>org.eclipse.wst.wsdl</project>
- <project>org.eclipse.wst.ws.parser</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/build.properties b/bundles/org.eclipse.jst.ws.axis.consumption.ui/build.properties
deleted file mode 100644
index 3df487d..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.wsc-axis-ui.jar = src/
-bin.includes = wsc-axis-ui.jar,\
- plugin.properties,\
- plugin.xml
-src.includes = build.properties,\
- plugin.properties,\
- plugin.xml,\
- src/
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/plugin.properties b/bundles/org.eclipse.jst.ws.axis.consumption.ui/plugin.properties
deleted file mode 100644
index 8c617ae..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/plugin.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Webservice Axis Consumption UI
-PLUGIN_PROVIDER=Eclipse.org
-
-WEBSERVICECLIENTTYPE_NAME_JAVA_AXIS=Java proxy
-LABEL_RUNTIME_AXIS_11=Apache Axis 1.0
-DESC_RUNTIME_AXIS_11=Apache Axis 1.0
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/plugin.xml b/bundles/org.eclipse.jst.ws.axis.consumption.ui/plugin.xml
deleted file mode 100644
index a2dfa26..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/plugin.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id="org.eclipse.jst.ws.axis.consumption.ui"
- version="1.0.0"
- name="%PLUGIN_NAME"
- provider-name="%PLUGIN_PROVIDER"
- class="org.eclipse.jst.ws.internal.axis.consumption.ui.plugin.WebServiceAxisConsumptionUIPlugin">
-
- <runtime>
- <library name="wsc-axis-ui.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.emf.common"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jem"/>
- <import plugin="org.eclipse.jem.workbench"/>
- <import plugin="org.eclipse.wst.ws.parser"/>
- <import plugin="org.eclipse.jst.ws.consumption.ui"/>
- <import plugin="org.eclipse.jst.ws"/>
- <import plugin="org.eclipse.jst.ws.axis.consumption.core"/>
- <import plugin="org.eclipse.jst.ws.ui"/>
- <import plugin="org.eclipse.jst.ws.consumption"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <import plugin="org.eclipse.wst.command.env"/>
- <import plugin="org.eclipse.wst.command.env.ui"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.wst.wsdl"/>
- <import plugin="org.eclipse.jst.j2ee"/>
- <import plugin="org.eclipse.jst.j2ee.web"/>
- <import plugin="org.eclipse.wst.common.emfworkbench.integration"/>
- <import plugin="com.ibm.wtp.emf.workbench"/>
- <import plugin="org.eclipse.wst.web"/>
- </requires>
-
- <!-- Web Service Client Types -->
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.webServiceClientType">
-
- <webServiceServer
- factoryId="org.eclipse.jst.server.tomcat.32"
- isDefault="false"
- runtimeTypeIds="org.eclipse.jst.server.tomcat.32.runtime"
- id="SERVER_ID_TOMCAT32_LOCAL">
- </webServiceServer>
-
- <webServiceServer
- factoryId="org.eclipse.jst.server.tomcat.40"
- isDefault="false"
- runtimeTypeIds="org.eclipse.jst.server.tomcat.40.runtime"
- id="SERVER_ID_TOMCAT40_LOCAL">
- </webServiceServer>
-
- <webServiceServer
- factoryId="org.eclipse.jst.server.tomcat.41"
- isDefault="false"
- runtimeTypeIds="org.eclipse.jst.server.tomcat.41.runtime"
- id="SERVER_ID_TOMCAT41_LOCAL">
- </webServiceServer>
-
- <webServiceServer
- factoryId="org.eclipse.jst.server.tomcat.50"
- isDefault="false"
- runtimeTypeIds="org.eclipse.jst.server.tomcat.50.runtime"
- id="SERVER_ID_TOMCAT50_LOCAL">
- </webServiceServer>
-
- <webServiceRuntime
- label="%LABEL_RUNTIME_AXIS_11"
- description="%DESC_RUNTIME_AXIS_11"
- isDefault="false"
- j2eeversion="13 14"
- id="org.eclipse.jst.ws.runtime.axis11">
- </webServiceRuntime>
-
- <webServiceClientType
- name="%WEBSERVICECLIENTTYPE_NAME_JAVA_AXIS"
- runtime="org.eclipse.jst.ws.runtime.axis11"
- clientType="org.eclipse.jst.ws.client.type.java"
- assemblyBinding="org.eclipse.jst.ws.internal.axis.consumption.ui.wizard.client.WebServiceClientAxisType"
- server="SERVER_ID_TOMCAT32_LOCAL"
- id="org.eclipse.jst.ws.internal.axis.consumption.ui.wizard.client.WebServiceClientAxisType.axis11.Tomcat32Local">
- </webServiceClientType>
-
- <webServiceClientType
- name="%WEBSERVICECLIENTTYPE_NAME_JAVA_AXIS"
- runtime="org.eclipse.jst.ws.runtime.axis11"
- clientType="org.eclipse.jst.ws.client.type.java"
- assemblyBinding="org.eclipse.jst.ws.internal.axis.consumption.ui.wizard.client.WebServiceClientAxisType"
- server="SERVER_ID_TOMCAT40_LOCAL"
- id="org.eclipse.jst.ws.internal.axis.consumption.ui.wizard.client.WebServiceClientAxisType.axis11.Tomcat40Local">
- </webServiceClientType>
-
- <webServiceClientType
- name="%WEBSERVICECLIENTTYPE_NAME_JAVA_AXIS"
- runtime="org.eclipse.jst.ws.runtime.axis11"
- clientType="org.eclipse.jst.ws.client.type.java"
- assemblyBinding="org.eclipse.jst.ws.internal.axis.consumption.ui.wizard.client.WebServiceClientAxisType"
- server="SERVER_ID_TOMCAT41_LOCAL"
- id="org.eclipse.jst.ws.internal.axis.consumption.ui.wizard.client.WebServiceClientAxisType.axis11.Tomcat41Local">
- </webServiceClientType>
-
- <webServiceClientType
- name="%WEBSERVICECLIENTTYPE_NAME_JAVA_AXIS"
- runtime="org.eclipse.jst.ws.runtime.axis11"
- clientType="org.eclipse.jst.ws.client.type.java"
- assemblyBinding="org.eclipse.jst.ws.internal.axis.consumption.ui.wizard.client.WebServiceClientAxisType"
- server="SERVER_ID_TOMCAT50_LOCAL"
- id="org.eclipse.jst.ws.internal.axis.consumption.ui.wizard.client.WebServiceClientAxisType.axis11.Tomcat50Local">
- </webServiceClientType>
-
- </extension>
-
- <!-- J2EE Service Reference Generator -->
-
- <extension
- point="org.eclipse.jst.j2ee.WebServiceClientGenerator">
- <generator
- className="org.eclipse.jst.ws.internal.axis.consumption.ui.command.AxisClientGenerator">
- <runtime
- serverTarget="Generic J2EE Container">
- </runtime>
- </generator>
- </extension>
-
-</plugin>
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/axis/consumption/ui/plugin.properties b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/axis/consumption/ui/plugin.properties
deleted file mode 100644
index 8c2d9c2..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/axis/consumption/ui/plugin.properties
+++ /dev/null
@@ -1,109 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-
-MSG_ERROR_DEFAULT_BEAN=IWAB0491E Error encountered while setting up default values for Java bean
-MSG_ERROR_READ_WSDL=IWAB0494E Error in reading WSDL file {0}
-MSG_ERROR_WSDL_NO_DEFINITION=IWAB0495E WSDL file at {0} has no definition element
-MSG_ERROR_WSDL_NO_PORT=IWAB0496E WSDL file at {0} has no port element
-MSG_ERROR_WRITE_WSDL=IWAB0497E Error in writing WSDL file {0}
-
-
-
-#
-# Messages for CopyClientWSDLTask
-#
-MSG_ERROR_IMPORT_WSDL=IWAB0531E Error in resolving WSDL file {0}, import WSDL file must have absolute URL or relative URL in the same directory
-
-
-#
-#DefaultsForClientJavaWSDLCommand
-#
-TASK_LABEL_CLIENT_JAVA_WSDL_DEFAULTS=DefaultsForClientJavaWSDL
-TASK_DESC_CLIENT_JAVA_WSDL_DEFAULTS=Builds the JavaWSDLParameter for client side.
-MSG_ERROR_WSDL_LOCATION_NOT_SET=IWAB0501E WSDL location not set.
-
-#
-#AddJarsToProjectBuildPathTask
-#
-TASK_LABEL_JARS_TO_PROJECT=AddJarsToProjectBuildPathTask
-TASK_DESC_JARS_TO_PROJECT=Add Jars to project build path.
-MSG_WARN_NO_JAVA_NATURE=IWAB0502W The project is not a Java project.
-MSG_ERROR_BAD_BUILDPATH=IWAB0503E Unable to update Java build path. Please check your system environment.
-
-#
-#CopyAxisJarCommand
-#
-TASK_DESC_COPY_JARS_TO_PROJECT=CopyAxisJarCommand
-TASK_LABEL_COPY_JARS_TO_PROJECT=Copy required Axis runtime jars from plugin to web project.
-PROGRESS_INFO_COPY_AXIS_CFG=IWAB0505I Copying Axis jar files to web project.
-MSG_ERROR_FILECOPY=IWAB0506E Error when copying Axis jar files to web project
-
-#
-#RefreshProjectTask
-#
-TASK_LABEL_REFESH_PROJECT=RefreshProjectTask
-TASK_DESC_REFESH_PROJECT=Refresh the files on the project with the local file system.
-MSG_ERROR_REFRESH_PROJECT=IWAB0508E Unable to refresh project.
-
-
-#
-#WebServiceAxisProxyFragment
-#
-
-#
-#WebServiceAxisProxyPage
-#
-TOOLTIP_PWJB_PAGE=Page
-TOOLTIP_PWJB_TEXT_FOLDER=Folder for proxy to be generated for the selected binding.
-TOOLTIP_PWJB_CHECKBOX_GENPROXY=Check to enable/disable the generation of a proxy.
-
-PAGE_TITLE_WS_AXIS_PROXY=Web Service Proxy Page
-PAGE_DESC_WS_AXIS_PROXY=Select generate proxy if you want to generate proxy for your service.
-CHECKBOX_GENPROXY=Generate proxy
-LABEL_FOLDER_NAME=Output folder
-
-#
-# CheckAxisDeploymentDescriptorsTask
-#
-CHECK_WS_DD_TASK_DESCRIPTION=CheckAxisDeploymentDescriptorsTask
-CHECK_WS_DD_TASK_LABEL=CheckAxisDeploymentDescriptorsTask
-
-#
-#ClasspathUtils
-#
-MSG_ERROR_CLASSPATH_UTILS_IOEXCEPTION=IWAB0509E IOException in ClasspathUtils
-
-#
-# Messages for WebSerivceAxisMappingsPage
-#
-PAGE_TITLE_WS_BEAN2XML=Web Service package to namespace mapping
-PAGE_TITLE_WS_XML2PROXY=Web Service Client namespace to package mapping
-PAGE_DESC_P2N_MAPPINGS=Define custom mapping for package to namespace.
-LABEL_MAPPING_PAIRS=Mapping pairs
-TABLE_COLUMN_LABEL_PACKAGE=package
-TABLE_COLUMN_LABEL_NAMESPACE=namespace
-LABEL_EXPLORE_MAPPINGS_XML2BEAN=Define custom mapping for namespace to package.
-TOOLTIP_N2P_SHOW_MAPPINGS=Define namespace to package mapping for customization.
-
-#
-# Messages for CheckAxisDeploymentDescriptorsTask
-#
-MSG_ERROR_XML_FILE_OVERWRITE_DISABLED=IWAB0532E Do you want to overwrite the Apache Axis deployment descriptor?
-
-#
-#Messages for CopyClientWSDLCommand
-#
-TASK_DESC_COPY_CLIENT_WSDL=Copies WSDL to Client project
-TASK_LABEL_COPY_CLIENT_WSDL=Copy WSDL to Client project
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/AddAxisJARToBuildPathCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/AddAxisJARToBuildPathCommand.java
deleted file mode 100644
index ee71e13..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/AddAxisJARToBuildPathCommand.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Command to add axis.jar to the build path of a project as an external variable
- */
-package org.eclipse.jst.ws.internal.axis.consumption.ui.command;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
- * @author rsinha
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class AddAxisJARToBuildPathCommand extends SimpleCommand
-{
- private String pluginId_ = "org.eclipse.jst.ws.axis.consumption.ui";
- private MessageUtils msgUtils;
- private String jarPluginId = "org.eclipse.wst.ws.apache.axis";
- private String jarPluginRelPath = "lib";
- private String jarName = "axis.jar";
- private IProject project;
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.Command#execute(org.eclipse.wst.command.env.core.common.Environment)
- */
- public Status execute(Environment environment)
- {
- msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- Status status = new SimpleStatus("");
-
- //Add JARs to the classpath
- IClasspathEntry[] oldClasspath;
- IClasspathEntry[] newClasspath;
- IJavaProject javaProject;
-
- //Get the old classpath
- try
- {
- javaProject = JavaCore.create(project);
- if (javaProject == null)
- {
- Status wStatus = new SimpleStatus("", msgUtils.getMessage("MSG_WARNING_NOT_COMPILE"), Status.WARNING);
- return wStatus;
- }
-
- oldClasspath = javaProject.getRawClasspath();
- }
- catch (JavaModelException e)
- {
- Status wStatus = new SimpleStatus("", msgUtils.getMessage("MSG_WARNING_NOT_COMPILE"), Status.WARNING);
- return wStatus;
- }
-
- //Check if the axis.jar is already on the build path
- boolean found = false;
- for (int i=0; i<oldClasspath.length; i++)
- {
- found = found || oldClasspath[i].getPath().toString().toLowerCase().endsWith(jarName.toLowerCase());
- }
-
- if (found)
- {
- return status;
- }
-
- //Add axis.jar to the build path
- newClasspath = new IClasspathEntry[oldClasspath.length + 1];
- int i = 0;
- for (i=0 ; i < oldClasspath.length; i++)
- {
- newClasspath[i] = oldClasspath[i];
- }
-
- IClasspathEntry newEntry = getClasspathEntry();
- if (newEntry==null)
- {
- Status wStatus = new SimpleStatus("", msgUtils.getMessage("MSG_WARNING_NOT_COMPILE"), Status.WARNING);
- return wStatus;
- }
- newClasspath[i] = newEntry;
-
- try
- {
- javaProject.setRawClasspath(newClasspath,null);
- }
- catch (JavaModelException e)
- {
- Status wStatus = new SimpleStatus("", msgUtils.getMessage("MSG_WARNING_NOT_COMPILE"), Status.WARNING);
- return wStatus;
- }
-
-
- return status;
-
- }
-
- private IClasspathEntry getClasspathEntry()
- {
- try
- {
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- IPluginDescriptor pluginDescriptor = pluginRegistry.getPluginDescriptor(jarPluginId);
-
- StringBuffer theJar = new StringBuffer();
- theJar.append(jarPluginRelPath);
-
- if (jarPluginRelPath.length()>0)
- theJar.append(IPath.SEPARATOR);
-
- theJar.append(jarName);
-
- URL localURL = Platform.asLocalURL(new URL(pluginDescriptor.getInstallURL(),theJar.toString()));
- Path jarPath = new Path(localURL.getFile());
- IClasspathEntry cpEntry = JavaCore.newLibraryEntry(jarPath, null, null);
- return cpEntry;
- }
- catch (MalformedURLException e)
- {
- return null;
- }
- catch (IOException e)
- {
- return null;
- }
-
- }
-
-
- /**
- * @param project The project to set.
- */
- public void setProject(IProject project)
- {
- this.project = project;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/AxisClientDefaultingCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/AxisClientDefaultingCommand.java
deleted file mode 100644
index 0ef1f50..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/AxisClientDefaultingCommand.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.command;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-/**
- *
- * AxisClientDefaultingCommand
- *
- */
-public class AxisClientDefaultingCommand extends SimpleCommand
-{
- private boolean isClientScenario_ = true;
- private boolean customizeMappings_ = false;
- private boolean generateProxy_ = true;
- private String clientRuntimeId_;
- private JavaWSDLParameter javaWSDLParam_;
- private IProject proxyProject_ = null;
- private IProject clientProjectEAR_ = null;
- private String wsdlURL_;
- private boolean testProxySelected_;
- private IServer clientExistingServer_;
- private String clientServer_;
- private String clientServerTypeId_;
- private boolean clientIsExistingServer_;
- private String proxyProjectFolder_;
- private WebServicesParser webServicesParser_;
-
-
- public AxisClientDefaultingCommand() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.core.Command#execute(org.eclipse.wst.command.env.core.common.Environment)
- */
- public Status execute(Environment environment) {
- Status status = new SimpleStatus("");
-
- clientExistingServer_ = getServerFromServerLabel();
- if (clientExistingServer_ != null) {
- clientServerTypeId_ = clientExistingServer_.getServerType().getId();
- } else {
- //TODO get the factory id for the type.
- }
- //javaWSDLParam
- javaWSDLParam_ = new JavaWSDLParameter();
-
- // proxyProjectFolber_
-
- return status;
- }
-
- public void setClientRuntimeID(String clientRuntimeId) {
- clientRuntimeId_ = clientRuntimeId;
- }
-
- public String getClientRuntimeID() {
- return this.clientRuntimeId_;
- }
-
- /**
- * @return Returns the javaWSDLParam.
- */
- public JavaWSDLParameter getJavaWSDLParam() {
- return javaWSDLParam_;
- }
-
- /**
- * @return Returns the clientProject.
- */
- public IProject getClientProject() {
- return proxyProject_;
- }
-
- /**
- * @param clientProject
- * The clientProject to set.
- */
- public void setClientProject(IProject clientProject) {
- this.proxyProject_ = clientProject;
- }
-
- /**
- * @return Returns the clientProjectEAR.
- */
- public IProject getClientProjectEAR() {
- return clientProjectEAR_;
- }
-
- /**
- * @param clientProjectEAR
- * The clientProjectEAR to set.
- */
- public void setClientProjectEAR(IProject clientProjectEAR) {
- this.clientProjectEAR_ = clientProjectEAR;
- }
-
- /**
- * @return Returns the testProxySelected.
- */
- public boolean getTestProxySelected() {
- return testProxySelected_;
- }
-
- /**
- * @param testProxySelected
- * The testProxySelected to set.
- */
- public void setTestProxySelected(boolean testProxySelected) {
- this.testProxySelected_ = testProxySelected;
- }
-
- /**
- * @return Returns the wsdlURL.
- */
- public String getWsdlURL() {
- return wsdlURL_;
- }
-
- /**
- * @param wsdlURL
- * The wsdlURL to set.
- */
- public void setWsdlURL(String wsdlURL) {
- this.wsdlURL_ = wsdlURL;
- }
-
- /**
- * @return Returns the clientServer.
- */
- public IServer getClientExistingServer() {
- return clientExistingServer_;
- }
-
- /**
- * @param clientServer
- * The clientServer to set.
- */
- public void setClientServer(String clientServer) {
- this.clientServer_ = clientServer;
- }
-
- /**
- * @return Returns the clientIsExistingServer.
- */
- public boolean isClientIsExistingServer() {
- return clientIsExistingServer_;
- }
-
- /**
- * @param clientIsExistingServer
- * The clientIsExistingServer to set.
- */
- public void setClientIsExistingServer(boolean clientIsExistingServer) {
- this.clientIsExistingServer_ = clientIsExistingServer;
- }
-
- public boolean getCustomizeClientMappings() {
- return customizeMappings_;
- }
-
- public void setCustomizeClientMappings(boolean value) {
- customizeMappings_ = value;
- }
-
- private IServer getServerFromServerLabel() {
- if (true)
- // rsk revisit if (clientIsExistingServer_)
- {
- // Maybe this should be in WebServiceServerRuntimeTypeRegistry
- Vector serverIds = new Vector();
- {
- IServer[] servers = ServerCore.getServers();
- if (servers != null && servers.length!=0) {
- for (int i = 0; i < servers.length; i++) {
- IServer server = (IServer) servers[i];
- if ((server.getName()).equals(clientServer_))
- return server;
- }
- }
- }
- //
- } else {
- //TODO create the server
- }
- return null;
- }
- /**
- * @return Returns the proxyProjectFolder.
- */
- public String getProxyProjectFolder() {
- if (proxyProject_!=null) {
- proxyProjectFolder_ = ResourceUtils.getJavaSourceLocation(proxyProject_).toString();
- }
- return proxyProjectFolder_;
- }
-
- /**
- * @return Returns the webServicesParser.
- */
- public WebServicesParser getWebServicesParser() {
- return webServicesParser_;
- }
- /**
- * @param webServicesParser The webServicesParser to set.
- */
- public void setWebServicesParser(WebServicesParser webServicesParser) {
- this.webServicesParser_ = webServicesParser;
- }
- /**
- * @return Returns the generateProxy.
- */
- public boolean getGenerateProxy() {
- return generateProxy_;
- }
- /**
- * @param generateProxy The generateProxy to set.
- */
- public void setGenerateProxy(boolean generateProxy) {
- this.generateProxy_ = generateProxy;
- }
-
- /**
- * @return Returns the isClientScenario_.
- */
- public boolean getIsClientScenario()
- {
- return isClientScenario_;
- }
-
- /**
- * @param isClientScenario_ The isClientScenario_ to set.
- */
- public void setIsClientScenario(boolean isClientScenario)
- {
- isClientScenario_ = isClientScenario;
- }
-
- /**
- * @param setEndpointMethod The setEndpointMethod to set.
- */
- public String getSetEndpointMethod()
- {
- return "setEndpoint";
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/AxisClientGenerator.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/AxisClientGenerator.java
deleted file mode 100644
index 381f3ff..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/AxisClientGenerator.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.command;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.j2ee.internal.webservices.WebServiceClientGenerator;
-import org.eclipse.jst.j2ee.internal.webservices.WebServicesClientDataHelper;
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.env.J2EEEnvironment;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.AddJarsToProjectBuildPathTask;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CopyAxisJarCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.DefaultsForHTTPBasicAuthCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.RefreshProjectCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.Stub2BeanCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.ValidateWSDLCommand;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.util.WSDLUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-/**
- *
- */
-public class AxisClientGenerator extends WebServiceClientGenerator
-{
- private String pluginId_ = "org.eclipse.jst.ws.axis.consumption.ui";
-
- public IStatus genWebServiceClientArtifacts(WebServicesClientDataHelper dataModel)
- {
- //get info from the model
- String wsdlURL = dataModel.getWSDLUrl();
- String project = dataModel.getProjectName();
- String outputWSDLFilePathName = dataModel.getOutputWSDLFileName();
- String serviceQName = dataModel.getServiceQName();
- boolean shouldDeploy = dataModel.shouldDeploy();
-
-
- //Generate the artifacts
- Status status = new SimpleStatus("");
- //AxisClientDefaultingCommand
- AxisClientDefaultingCommand axisClientDefaultingCommand = new AxisClientDefaultingCommand();
- axisClientDefaultingCommand.setWsdlURL(wsdlURL);
- axisClientDefaultingCommand.setWebServicesParser(new WebServicesParserExt());
- axisClientDefaultingCommand.setClientProject((IProject)(new StringToIProjectTransformer().transform(project)));
- axisClientDefaultingCommand.setTestProxySelected(false);
- axisClientDefaultingCommand.setIsClientScenario(true);
- axisClientDefaultingCommand.setGenerateProxy(true);
- J2EEEnvironment j2eeEnvironment = new J2EEEnvironment();
- status = axisClientDefaultingCommand.execute(j2eeEnvironment);
- if (status.getSeverity()!=Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
-
-// Figure out if this is a Web, EJB, or AppClient project
- boolean isWebProject = ResourceUtils.isWebProject(axisClientDefaultingCommand.getClientProject());
-
- //DefaultsForHTTPBasicAuthCommand
- DefaultsForHTTPBasicAuthCommand httpCommand = new DefaultsForHTTPBasicAuthCommand();
- httpCommand.setJavaWSDLParam(axisClientDefaultingCommand.getJavaWSDLParam());
- httpCommand.setWsdlServiceURL(axisClientDefaultingCommand.getWsdlURL());
- httpCommand.setWebServicesParser(axisClientDefaultingCommand.getWebServicesParser());
- status = httpCommand.execute(j2eeEnvironment);
- if (status.getSeverity()!=Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
-
- //CopyAxisJarCommand
- //The code generated by the Axis WSDL2Java emitter requires axis.jar in order to compile.
- //In the case of a Web project, we add it to the lib directory.
- //In the case of an EJB or App Client project, we add it as an external JAR. This breaks
- //the team environment scenario. We will have to think of a better way to deal with this
- //in the future.
- if (isWebProject)
- {
- CopyAxisJarCommand axjCommand = new CopyAxisJarCommand();
- axjCommand.setProject(axisClientDefaultingCommand.getClientProject());
- status = axjCommand.execute(j2eeEnvironment);
- if (status.getSeverity()!=Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
- }
- else
- {
- AddAxisJARToBuildPathCommand addAxisCommand = new AddAxisJARToBuildPathCommand();
- addAxisCommand.setProject(axisClientDefaultingCommand.getClientProject());
- status = addAxisCommand.execute(j2eeEnvironment);
- if (status.getSeverity() != Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
- }
-
- //AddJarsToProjectBuildPathTask
- AddJarsToProjectBuildPathTask addJarsCommand = new AddJarsToProjectBuildPathTask();
- addJarsCommand.setProject(axisClientDefaultingCommand.getClientProject());
- status = addJarsCommand.execute(j2eeEnvironment);
- if (status.getSeverity()!=Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
-
- //DefaultsForClientJavaWSDLCommand
- DefaultsForClientJavaWSDLCommand defClientCommand = new DefaultsForClientJavaWSDLCommand();
- defClientCommand.setJavaWSDLParam(axisClientDefaultingCommand.getJavaWSDLParam());
- defClientCommand.setProxyProject(axisClientDefaultingCommand.getClientProject());
- defClientCommand.setWSDLServiceURL(axisClientDefaultingCommand.getWsdlURL());
- status = defClientCommand.execute(j2eeEnvironment);
- if (status.getSeverity()!=Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
-
- //ValidateWSDLCommand
- ValidateWSDLCommand valWSDLCommand = new ValidateWSDLCommand();
- valWSDLCommand.setWsdlURI(axisClientDefaultingCommand.getWsdlURL());
- valWSDLCommand.setWebServicesParser(axisClientDefaultingCommand.getWebServicesParser());
- status = valWSDLCommand.execute(j2eeEnvironment);
- if (status.getSeverity()!=Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
-
- //WSDL2JavaCommand
- WSDL2JavaCommand w2jCommand = new WSDL2JavaCommand();
- w2jCommand.setJavaWSDLParam(axisClientDefaultingCommand.getJavaWSDLParam());
- w2jCommand.setWsdlURI(axisClientDefaultingCommand.getWsdlURL());
- status = w2jCommand.execute(j2eeEnvironment);
- if (status.getSeverity()!=Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
-
- //RefreshProjectCommand
- RefreshProjectCommand refreshCommand = new RefreshProjectCommand();
- refreshCommand.setProject(axisClientDefaultingCommand.getClientProject());
- status = refreshCommand.execute(j2eeEnvironment);
- if (status.getSeverity()!=Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
-
- Stub2BeanCommand s2bCommand = new Stub2BeanCommand();
- s2bCommand.setJavaWSDLParam(axisClientDefaultingCommand.getJavaWSDLParam());
- s2bCommand.setWebServicesParser(axisClientDefaultingCommand.getWebServicesParser());
- s2bCommand.setClientProject(axisClientDefaultingCommand.getClientProject());
- status = s2bCommand.execute(j2eeEnvironment);
- if (status.getSeverity()!=Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
-
- //CopyClientWSDLCommand
- CopyClientWSDLCommand copyCommand = new CopyClientWSDLCommand();
- copyCommand.setWsdlURL(axisClientDefaultingCommand.getWsdlURL());
- copyCommand.setClientWSDLPathName(outputWSDLFilePathName);
- copyCommand.setWsParser(axisClientDefaultingCommand.getWebServicesParser());
- status = copyCommand.execute(j2eeEnvironment);
- if (status.getSeverity()!=Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
-
-
- //BuildProjectCommand
- BuildProjectCommand buildCommand = new BuildProjectCommand();
- buildCommand.setProject(axisClientDefaultingCommand.getClientProject());
- buildCommand.setForceBuild(true);
- status = buildCommand.execute(j2eeEnvironment);
- if (status.getSeverity()!=Status.OK)
- {
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
-
- //Calculate the service interface and service endpoint interface names
- InterfaceNames interfaceNames = calculateSIandSEIName(axisClientDefaultingCommand.getWsdlURL(), serviceQName, axisClientDefaultingCommand.getWebServicesParser());
- String siName = interfaceNames.getSiName();
- String[] seiNames = interfaceNames.getSeiNames();
- if (siName==null || siName.length()==0 || seiNames==null || seiNames.length==0)
- {
- return new org.eclipse.core.runtime.Status(IStatus.ERROR,pluginId_,0,"Problems!!",null);
- }
-
- //Set info on the dataModel
- dataModel.setServiceInterfaceName(siName);
- dataModel.setServiceEndpointInterfaceNames(seiNames);
- dataModel.setDidGenDescriptors(false);
-
- return EnvironmentUtils.convertStatusToIStatus(status, pluginId_);
- }
-
- private InterfaceNames calculateSIandSEIName(String wsdlURL, String serviceQName, WebServicesParser wsParser)
- {
- InterfaceNames iNames = new InterfaceNames();
- String serviceLocalPart = serviceQName.substring(serviceQName.lastIndexOf(':')+1);
- Map pkg2nsMapping = null;
- Definition def = wsParser.getWSDLDefinition(wsdlURL);
-
- Map services = def.getServices();
- Service service = null;
- for (Iterator it = services.values().iterator(); it.hasNext();)
- {
- service = (Service)it.next();
- if (serviceLocalPart.equals(service.getQName().getLocalPart()))
- break;
- }
-
- if (service!=null)
- {
- String servicePkgName = WSDLUtils.getPackageName(service, pkg2nsMapping);
- String serviceClassName = service.getQName().getLocalPart();
- String jndiName = serviceClassName;
- Map ports = service.getPorts();
- for (Iterator it2 = ports.values().iterator(); it2.hasNext();)
- {
- if (serviceClassName.equals(((Port)it2.next()).getBinding().getPortType().getQName().getLocalPart()))
- {
- serviceClassName = serviceClassName + "_Service";
- break;
- }
- }
- ArrayList seiNames = new ArrayList();
- for (Iterator it2 = ports.values().iterator(); it2.hasNext();)
- {
- Port port = (Port)it2.next();
- SOAPAddress soapAddress = null;
- List extensibilityElements = port.getExtensibilityElements();
- if (extensibilityElements != null)
- {
- for (Iterator it3 = extensibilityElements.iterator(); it3.hasNext();)
- {
- Object object = it3.next();
- if (object instanceof SOAPAddress)
- {
- soapAddress = (SOAPAddress)object;
- break;
- }
- }
- }
- if (soapAddress != null)
- {
- PortType portType = port.getBinding().getPortType();
- QName portTypeQName = portType.getQName();
- String portTypePkgName = WSDLUtils.getPackageName(portType, pkg2nsMapping);
- String portTypeClassName = portTypeQName.getLocalPart();
- if (jndiName.equals(portTypeClassName))
- portTypeClassName = portTypeClassName + "_Port";
- seiNames.add(portTypePkgName+"."+portTypeClassName);
- }
- }
- iNames.setSiName(servicePkgName+"."+serviceClassName);
- iNames.setSEINames(convertToStringArray(seiNames.toArray()));
- }
- return iNames;
- }
-
- private String[] convertToStringArray(Object[] a)
- {
- if (a==null) return new String[0];
-
- int length = a.length;
- String[] sa = new String[length];
- for (int i=0; i<length; i++)
- {
- Object obj = a[i];
- if (obj instanceof String)
- {
- sa[i] = (String)obj;
- }
- }
- return sa;
- }
- private class InterfaceNames
- {
- private String siName_;
- private String[] seiNames_;
-
- public String getSiName()
- {
- return siName_;
- }
-
- public String[] getSeiNames()
- {
- return seiNames_;
- }
-
-
- public void setSiName(String siName)
- {
- siName_ = siName;
- }
-
- public void setSEINames(String[] seiNames)
- {
- seiNames_ = seiNames;
- }
-
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/CopyClientWSDLCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/CopyClientWSDLCommand.java
deleted file mode 100644
index bb19c91..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/CopyClientWSDLCommand.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.command;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.xml.WSDLWriter;
-
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.common.FileResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-/**
- *
- */
-public class CopyClientWSDLCommand extends SimpleCommand
-{
- private String DESCRIPTION = "TASK_DESC_COPY_CLIENT_WSDL";
- private String LABEL = "TASK_LABEL_COPY_CLIENT_WSDL";
- private String pluginId_ = "org.eclipse.jst.ws.axis.consumption.ui";
- private MessageUtils msgUtils_;
- private String wsdlURL_;
- private String clientWSDLPathName_;
- private WebServicesParser wsParser_;
-
- public CopyClientWSDLCommand()
- {
- msgUtils_ = new MessageUtils(pluginId_ + ".plugin", this);
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
- }
-
- public Status execute(Environment env)
- {
- Status status = new SimpleStatus("");
- Definition def = wsParser_.getWSDLDefinition(wsdlURL_);
- if(def==null)
- {
- status = new SimpleStatus(pluginId_, msgUtils_.getMessage("MSG_ERROR_WSDL_NO_DEFINITION",new String[]{wsdlURL_}),Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
- IPath clientWSDLPath = new Path(clientWSDLPathName_);
- IWorkspaceRoot workspaceRoot = FileResourceUtils.getWorkspaceRoot();
- status = resolveWSDL(workspaceRoot, def, clientWSDLPath,env);
- return status;
- }
-
- private Status resolveWSDL(
- IWorkspaceRoot workspace,
- Definition wsdlDef,
- IPath wsdlPath,
- Environment env) {
- try {
- writeWSDLFile(workspace, wsdlDef, wsdlPath, env);
- Map importDefs = wsdlDef.getImports();
- Set keysSet = importDefs.keySet();
- for (Iterator e = keysSet.iterator(); e.hasNext();) {
- Object keyName = e.next();
- Vector vector = (Vector) importDefs.get(keyName);
- for (int i = 0; i < vector.size(); i++) {
- Import importDef = (Import) vector.get(i);
- Definition def = importDef.getDefinition();
- String newPathString =
- wsdlPath.toString().substring(
- 0,
- wsdlPath.toString().lastIndexOf("/") + 1); //$NON-NLS-1$
- if (isInvalidImportWSDL(importDef.getLocationURI())) {
- return new SimpleStatus(pluginId_, msgUtils_.getMessage("MSG_ERROR_IMPORT_WSDL",new String[]{importDef.getLocationURI()}), Status.ERROR);
- }
- IPath newPath =
- new Path(newPathString + importDef.getLocationURI());
- Status status = resolveWSDL(workspace, def, newPath, env);
- if (status != null
- && status.getSeverity() == Status.ERROR) {
- return status;
- }
- }
- }
- } catch (Exception e) {
- return new SimpleStatus(pluginId_, msgUtils_.getMessage("MSG_ERROR_WRITE_WSDL",new String[] { wsdlPath.toString() }), Status.ERROR, e);
- }
- return new SimpleStatus("");
- }
-
- private boolean isInvalidImportWSDL(String wsdlPath) {
-
- // relative url
- if (!wsdlPath.toLowerCase().startsWith("http://")) { //$NON-NLS-1$
-
- if (wsdlPath.indexOf("/") != -1) { //$NON-NLS-1$
- if (!wsdlPath.startsWith("./")) { //$NON-NLS-1$
- return true;
- }
- }
-
- }
- return false;
- }
-
- private void writeWSDLFile(
- IWorkspaceRoot workspace,
- Definition wsdlDef,
- IPath wsdlPath,
- Environment env)
- throws Exception {
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- //WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- //WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
- WSDLWriter wsdlWriter = (new org.eclipse.wst.wsdl.internal.impl.wsdl4j.WSDLFactoryImpl()).newWSDLWriter();
- wsdlWriter.writeWSDL(wsdlDef, baos);
- byte[] b = baos.toByteArray();
- ByteArrayInputStream bais = new ByteArrayInputStream(b);
-
- ResourceContext context =
- WebServicePlugin.getInstance().getResourceContext();
- FileResourceUtils.createFile(
- context,
- wsdlPath.makeAbsolute(),
- bais,
- env.getProgressMonitor(),
- env.getStatusHandler());
-
- baos.close();
- bais.close();
-
- }
-
- /**
- * @param clientWSDLPathName_ The clientWSDLPathName_ to set.
- */
- public void setClientWSDLPathName(String clientWSDLPathName)
- {
- this.clientWSDLPathName_ = clientWSDLPathName;
- }
- /**
- * @param wsdlURL_ The wsdlURL_ to set.
- */
- public void setWsdlURL(String wsdlURL)
- {
- this.wsdlURL_ = wsdlURL;
- }
- /**
- * @param wsParser_ The wsParser_ to set.
- */
- public void setWsParser(WebServicesParser wsParser)
- {
- this.wsParser_ = wsParser;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/DefaultsForClientJavaWSDLCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/DefaultsForClientJavaWSDLCommand.java
deleted file mode 100644
index c332d87..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/command/DefaultsForClientJavaWSDLCommand.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.command;
-
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.axis.consumption.util.PlatformUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class DefaultsForClientJavaWSDLCommand extends SimpleCommand {
-
- private JavaWSDLParameter javaWSDLParam_;
- private IProject proxyProject_;
- private String WSDLServiceURL_;
- private String WSDLServicePathname_;
- private MessageUtils msgUtils_;
- private MessageUtils coreMsgUtils_;
-
- private String LABEL = "TASK_LABEL_CLIENT_JAVA_WSDL_DEFAULTS";
- private String DESCRIPTION = "TASK_DESC_CLIENT_JAVA_WSDL_DEFAULTS";
-
- public DefaultsForClientJavaWSDLCommand() {
- String pluginId = "org.eclipse.jst.ws.axis.consumption.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- setName (msgUtils_.getMessage(LABEL));
- setDescription( msgUtils_.getMessage(DESCRIPTION));
- }
-
- /**
- * Constructor for DefaultsForClientJavaWSDLCommand.
- */
- public DefaultsForClientJavaWSDLCommand(
- JavaWSDLParameter javaWSDLParam,
- Model model) {
- //super();
- String pluginId = "org.eclipse.jst.ws.axis.consumption.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- setName (msgUtils_.getMessage(LABEL));
- setDescription( msgUtils_.getMessage(DESCRIPTION));
- this.javaWSDLParam_ = javaWSDLParam;
- }
-
- public Status execute(Environment environment) {
- Status status;
- if (javaWSDLParam_ == null) {
- status = new SimpleStatus("DefaultsForClientJavaWSDLCommand", //$NON-NLS-1$
- coreMsgUtils_.getMessage(
- "MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"),
- Status.ERROR);
- environment.getStatusHandler().reportError(status);
- return status;
- }
-
- javaWSDLParam_.setMetaInfOnly(false);
- javaWSDLParam_.setServerSide(JavaWSDLParameter.SERVER_SIDE_NONE);
-
- IPath webModuleServerRoot = ResourceUtils.getJavaSourceLocation(proxyProject_);
- //String output = PlatformUtils.getPlatformURL(webModuleServerRoot);
- String output = ResourceUtils.findResource(webModuleServerRoot).getLocation().toString();
-
- javaWSDLParam_.setJavaOutput(output);
-
-
- IContainer webModuleContainer = ResourceUtils.getWebModuleServerRoot(proxyProject_);
- if (webModuleContainer !=null)
- {
- IPath webModulePath = webModuleContainer.getFullPath();
- //output = PlatformUtils.getPlatformURL(webModulePath);
- output = ResourceUtils.findResource(webModulePath).getLocation().toString();
- javaWSDLParam_.setOutput(output);
- }
-
-
- if (WSDLServicePathname_ == null) {
-
- if (WSDLServiceURL_ == null) {
- status = new SimpleStatus("DefaultsForClientJavaWSDLCommand", //$NON-NLS-1$
- msgUtils_.getMessage(
- "MSG_ERROR_WSDL_LOCATION_NOT_SET"),
- Status.ERROR);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- } else {
- WSDLServiceURL_ = PlatformUtils.getFileFromPlatform(WSDLServicePathname_);
- }
-
- javaWSDLParam_.setInputWsdlLocation(WSDLServiceURL_);
-
- return new SimpleStatus( "" );
- }
-
- /**
- * Returns the javaWSDLParam.
- * @return JavaWSDLParameter
- */
- public JavaWSDLParameter getJavaWSDLParam() {
- return javaWSDLParam_;
- }
-
- /**
- * Sets the javaWSDLParam.
- * @param javaWSDLParam The javaWSDLParam to set
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) {
- this.javaWSDLParam_ = javaWSDLParam;
- }
-
- /**
- * @param proxyProject_ The proxyProject_ to set.
- */
- public void setProxyProject(IProject proxyProject) {
- this.proxyProject_ = proxyProject;
- }
- /**
- * @param serviceURL_ The wSDLServiceURL_ to set.
- */
- public void setWSDLServiceURL(String serviceURL) {
- WSDLServiceURL_ = serviceURL;
- }
- /**
- * @param servicePathname_ The wSDLServicePathname_ to set.
- */
- public void setWSDLServicePathname(String servicePathname) {
- WSDLServicePathname_ = servicePathname;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EECommandManager.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EECommandManager.java
deleted file mode 100644
index f64c1bd..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EECommandManager.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.env;
-
-import org.eclipse.wst.command.env.core.CommandManager;
-
-/**
- *
- */
-public class J2EECommandManager implements CommandManager
-{
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.CommandManager#isUndoEnabled()
- */
- public boolean isUndoEnabled()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EEEnvironment.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EEEnvironment.java
deleted file mode 100644
index f8b72a0..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EEEnvironment.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.env;
-
-import org.eclipse.wst.command.env.core.CommandManager;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.JavaCompiler;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.ProgressMonitor;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-import org.eclipse.wst.command.env.core.uri.SimpleURIFactory;
-import org.eclipse.wst.command.env.core.uri.URIFactory;
-
-
-/**
-*
-*/
-public class J2EEEnvironment implements Environment
-{
- J2EELog j2eeLog_;
- J2EEProgressMonitor j2eeProgressMonitor_;
- J2EEStatusHandler j2eeStatusHandler_;
- SimpleURIFactory simpleURIFactory_;
- J2EECommandManager j2eeCommandManager_;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getLog()
- */
- public Log getLog()
- {
- if (j2eeLog_ == null)
- {
- j2eeLog_ = new J2EELog();
- }
- return j2eeLog_;
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getProgressMonitor()
- */
- public ProgressMonitor getProgressMonitor()
- {
- if (j2eeProgressMonitor_==null)
- {
- j2eeProgressMonitor_ = new J2EEProgressMonitor();
-
- }
- return j2eeProgressMonitor_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getStatusHandler()
- */
- public StatusHandler getStatusHandler()
- {
- if (j2eeStatusHandler_==null)
- {
- j2eeStatusHandler_ = new J2EEStatusHandler();
- }
- return j2eeStatusHandler_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getURIFactory()
- */
- public URIFactory getURIFactory()
- {
- if (simpleURIFactory_ == null)
- {
- simpleURIFactory_ = new SimpleURIFactory();
- }
- return simpleURIFactory_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getJavaCompiler()
- */
- public JavaCompiler getJavaCompiler()
- {
- // TODO Auto-generated method stub
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getCommandManager()
- */
- public CommandManager getCommandManager()
- {
- if(j2eeCommandManager_ == null)
- {
- j2eeCommandManager_ = new J2EECommandManager();
- }
- return j2eeCommandManager_;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EELog.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EELog.java
deleted file mode 100644
index e97d6bc..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EELog.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.env;
-
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.Status;
-
-/**
-*
-*/
-public class J2EELog implements Log
-{
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Log#isEnabled()
- */
- public boolean isEnabled() {
- // TODO Auto-generated method stub
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Log#isEnabled(java.lang.String)
- */
- public boolean isEnabled(String option) {
- // TODO Auto-generated method stub
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, int, java.lang.Object, java.lang.String, java.lang.Object)
- */
- public void log(int severity, int messageNum, Object caller, String method,
- Object object) {
- // TODO Auto-generated method stub
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, int, java.lang.Object, java.lang.String, org.eclipse.wst.command.env.core.common.Status)
- */
- public void log(int severity, int messageNum, Object caller, String method,
- Status status) {
- // TODO Auto-generated method stub
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, int, java.lang.Object, java.lang.String, java.lang.Throwable)
- */
- public void log(int severity, int messageNum, Object caller, String method,
- Throwable throwable) {
- // TODO Auto-generated method stub
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, java.lang.String, int, java.lang.Object, java.lang.String, java.lang.Object)
- */
- public void log(int severity, String option, int messageNum, Object caller,
- String method, Object object) {
- // TODO Auto-generated method stub
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, java.lang.String, int, java.lang.Object, java.lang.String, org.eclipse.wst.command.env.core.common.Status)
- */
- public void log(int severity, String option, int messageNum, Object caller,
- String method, Status status) {
- // TODO Auto-generated method stub
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, java.lang.String, int, java.lang.Object, java.lang.String, java.lang.Throwable)
- */
- public void log(int severity, String option, int messageNum, Object caller,
- String method, Throwable throwable) {
- // TODO Auto-generated method stub
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EEProgressMonitor.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EEProgressMonitor.java
deleted file mode 100644
index 161a8db..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EEProgressMonitor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.env;
-
-import org.eclipse.wst.command.env.core.common.ProgressMonitor;
-
-/**
- * @author rsinha
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class J2EEProgressMonitor implements ProgressMonitor
-{
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.ProgressMonitor#report(java.lang.String)
- */
- public void report(String progress)
- {
- // TODO Auto-generated method stub
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.ProgressMonitor#getChildProgressMonitor()
- */
- public ProgressMonitor getChildProgressMonitor()
- {
- // TODO Auto-generated method stub
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.ProgressMonitor#isCancelRequested()
- */
- public boolean isCancelRequested()
- {
- // TODO Auto-generated method stub
- return false;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EEStatusHandler.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EEStatusHandler.java
deleted file mode 100644
index c2a9c9c..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/env/J2EEStatusHandler.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.env;
-
-import org.eclipse.wst.command.env.core.common.Choice;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusException;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-
-/**
- *
- */
-public class J2EEStatusHandler implements StatusHandler
-{
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.StatusHandler#report(org.eclipse.wst.command.env.core.common.Status, org.eclipse.wst.command.env.core.common.Choice[])
- */
- public Choice report(Status status, Choice[] choices)
- {
- // TODO Auto-generated method stub
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.StatusHandler#report(org.eclipse.wst.command.env.core.common.Status)
- */
- public void report(Status status) throws StatusException
- {
- // TODO Auto-generated method stub
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.StatusHandler#reportError(org.eclipse.wst.command.env.core.common.Status)
- */
- public void reportError(Status status)
- {
- // TODO Auto-generated method stub
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.StatusHandler#reportInfo(org.eclipse.wst.command.env.core.common.Status)
- */
- public void reportInfo(Status status)
- {
- // TODO Auto-generated method stub
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/plugin/WebServiceAxisConsumptionUIPlugin.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/plugin/WebServiceAxisConsumptionUIPlugin.java
deleted file mode 100644
index 252b931..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/plugin/WebServiceAxisConsumptionUIPlugin.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.axis.consumption.ui.plugin;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-
-
-/**
-* This is the plugin class for the Web Services plugin.
-* <p>
-* This plugin contains the graphic user interface to the
-* Web Services runtime found in org.eclipse.jst.ws.
-*/
-public class WebServiceAxisConsumptionUIPlugin extends Plugin
-{
-
- /**
- * The identifier of the descriptor of this plugin in plugin.xml.
- */
- public static final String ID =
- "org.eclipse.jst.ws.axis.consumption.ui";
-
- /**
- * The reference to the singleton instance of this plugin.
- */
- private static WebServiceAxisConsumptionUIPlugin instance_;
- private Log log_;
-
- /**
- * Constructs a runtime plugin object for this plugin.
- * The "plugin" element in plugin.xml should include the attribute
- * class = "org.eclipse.jst.ws.internal.ui.plugin.WebServicePlugin".
- * @param descriptor The descriptor of this plugin.
- */
- public WebServiceAxisConsumptionUIPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- if (instance_ == null) {
- instance_ = this;
- }
- log_ = new EclipseLog();
-
- }
-
- /**
- * Returns the singleton instance of this plugin. Equivalent to calling
- * (WebServiceWasConsumptionPlugin)Platform.getPlugin("org.eclipse.jst.ws.was.v5.tp");
- * @return The WebServiceWasConsumptionPlugin singleton.
- */
- static public WebServiceAxisConsumptionUIPlugin getInstance() {
- return instance_;
- }
-
- /**
- * Called once by the platform when this plugin is first loaded.
- * @throws CoreException If this plugin fails to start.
- */
- public void startup() throws CoreException {
- log_.log(Log.INFO, 5066, this, "startup", "Starting plugin org.eclipse.jst.ws.axis.consumption.ui");
- super.startup();
- }
-
- /**
- * Called once by the platform when this plugin is unloaded.
- * @throws CoreException If this plugin fails to shutdown.
- */
- public void shutdown() throws CoreException {
- log_.log(Log.INFO, 5067, this, "shutdown", "Shutting plugin org.eclipse.jst.ws.axis.consumption.ui");
- super.shutdown();
- }
-
- /**
- * Returns the message string identified by the given key from
- * the plugin.properties file for the appropriate locale.
- * @param key The message key string prefixed by a "%" symbol.
- * That is, the string passed in must be of the form "%KEY"
- * where the plugin.properties file contains a line of the
- * form: "KEY = value".
- * @return The locale-specific message.
- */
- public static String getMessage(String key) {
- return instance_.getDescriptor().getResourceString(key);
- }
-
- /**
- * Returns the message string identified by the given key from
- * the plugin.properties file for the appropriate locale.
- * Substitution sequences in the message string
- * are replaced by the given array of substitution objects (which
- * are most frequently strings). See java.text.MessageFormat for
- * further details on substitution.
- * @param key The message key string prefixed by a "%" symbol.
- * That is, the string passed in must be of the form "%KEY"
- * where the plugin.properties file contains a line of the
- * form: "KEY = value".
- * @param args The substitution values for the message
- * as required by the message in plugin.properties and
- * by the rules of class java.text.MessageFormat.
- * @return The locale-specific message.
- */
- public static String getMessage(String key, Object[] args) {
- return MessageFormat.format(getMessage(key), args);
- }
-
- public String getPluginStateLocation() {
- return Platform
- .getPluginStateLocation(this)
- .addTrailingSeparator()
- .toOSString();
- }
-
- public String getPluginInstallLocation() {
- try {
- return Platform.resolve(getDescriptor().getInstallURL()).getFile();
- } catch (Exception e) {
- return null;
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/AddJarsToProjectBuildPathTask.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/AddJarsToProjectBuildPathTask.java
deleted file mode 100644
index a76e9d1..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/AddJarsToProjectBuildPathTask.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.task;
-
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.plugin.WebServiceAxisConsumptionUIPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.ProgressMonitor;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusException;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseProgressMonitor;
-
-public class AddJarsToProjectBuildPathTask extends SimpleCommand {
-
- public static String AXIS_RUNTIME_PLUGIN_ID = "org.eclipse.jst.ws.axis.rt"; //$NON-NLS-1$
-
- private String DESCRIPTION = "TASK_DESC_JARS_TO_PROJECT";
- private String LABEL = "TASK_LABEL_JARS_TO_PROJECT";
-
- private IJavaProject javaProject_;
- private IClasspathEntry[] oldClasspath_;
- private IClasspathEntry[] newClasspath_;
- private JavaWSDLParameter javaWSDLParam_;
- private boolean isJ2EE_13 = true;
- private MessageUtils msgUtils_;
-
- private IProject project;
-
- public AddJarsToProjectBuildPathTask()
- {
- String pluginId = "org.eclipse.jst.ws.axis.consumption.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
- }
-
- /**
- * Execute AddJarsToProjectBuildPathTask
- */
- public Status execute(Environment environment) {
- try {
- if (project.hasNature(IWebNatureConstants.J2EE_NATURE_ID)) {
- J2EEWebNatureRuntime webNatureRuntime =
- (J2EEWebNatureRuntime) project.getNature(
- IWebNatureConstants.J2EE_NATURE_ID);
- isJ2EE_13 = webNatureRuntime.isJ2EE1_3();
- }
- } catch (Exception e) {
- }
- Status status = new SimpleStatus("");
- if (!isJ2EE_13)
- {
- // AddJar(project, null, "XERCES_API_JAR", status, environment);
- }
- return status;
- }
-
- private void AddJar(IProject webProject, String pluginId, String jarName, Status status, Environment env) {
- //
- // Get the current classpath.
- //
- javaProject_ = null;
- oldClasspath_ = null;
- try
- {
- javaProject_ = JavaCore.create(webProject);
- if (javaProject_ != null)
- {
- oldClasspath_ = javaProject_.getRawClasspath();
- }
- else
- {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_WARN_NO_JAVA_NATURE"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return;
- }
- }
- catch (JavaModelException e)
- {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_WARN_NO_JAVA_NATURE"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return;
- }
-
- boolean found = false;
- for (int i=0; i<oldClasspath_.length; i++)
- {
- found = found || oldClasspath_[i].getPath().toString().toLowerCase().endsWith(jarName.toLowerCase());
- }
-
- if (found)
- {
- return;
- }
-
- newClasspath_ = new IClasspathEntry[oldClasspath_.length + 1];
- int i=0;
- while (i<oldClasspath_.length)
- {
- newClasspath_[i] = oldClasspath_[i];
- i++;
- }
-
- try
- {
- if(pluginId!=null)
- {
- newClasspath_[i++] = JavaCore.newLibraryEntry(getTheJarPath(pluginId,jarName), null, null);
- }
- else
- {
- newClasspath_[i++] = JavaCore.newVariableEntry(getTheJarPath(pluginId,jarName), null, null);
- }
- }
- catch (CoreException e)
- {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_BAD_BUILDPATH"), Status.WARNING, e);
- try
- {
- env.getStatusHandler().report(status);
- }
- catch(StatusException se)
- {
- status = new SimpleStatus("","User aborted",Status.ERROR);
- }
- return;
- }
-
- //
- // Then update the project classpath.
- //
- try
- {
- ProgressMonitor monitor = env.getProgressMonitor();
- IProgressMonitor eclipseMonitor = null;
- if (monitor instanceof EclipseProgressMonitor)
- {
- eclipseMonitor = ((EclipseProgressMonitor)monitor).getMonitor();
- }
- javaProject_.setRawClasspath(newClasspath_,eclipseMonitor);
- }
- catch (JavaModelException e)
- {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_BAD_BUILDPATH"), Status.WARNING, e);
- try
- {
- env.getStatusHandler().report(status);
- }
- catch(StatusException se)
- {
- status = new SimpleStatus("", "User aborted", Status.ERROR);
- }
- return;
- }
- }
-
- //
- // Returns the local native pathname of the jar.
- //
- private IPath getTheJarPath(String pluginId, String theJar)
- throws CoreException {
- try {
- if (pluginId != null) {
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- IPluginDescriptor pluginDescriptor =
- pluginRegistry.getPluginDescriptor(pluginId);
- URL localURL =
- Platform.asLocalURL(
- new URL(pluginDescriptor.getInstallURL(), theJar));
- return new Path(localURL.getFile());
- } else {
- return new Path(theJar);
- }
- } catch (MalformedURLException e) {
- throw new CoreException(
- new org.eclipse.core.runtime.Status(
- IStatus.WARNING,
- WebServiceAxisConsumptionUIPlugin.ID,
- 0,
- msgUtils_.getMessage("MSG_BAD_AXIS_JAR_URL"),
- e));
- } catch (IOException e) {
- throw new CoreException(
- new org.eclipse.core.runtime.Status(
- IStatus.WARNING,
- WebServiceAxisConsumptionUIPlugin.ID,
- 0,
- msgUtils_.getMessage("MSG_BAD_AXIS_JAR_URL"),
- e));
- }
- }
-
- public void setProject(IProject project)
- {
- this.project = project;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CheckAxisDeploymentDescriptorsTask.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CheckAxisDeploymentDescriptorsTask.java
deleted file mode 100644
index 179a072..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CheckAxisDeploymentDescriptorsTask.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.task;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusException;
-
-public class CheckAxisDeploymentDescriptorsTask extends SimpleCommand {
-
- private MessageUtils msgUtils_;
- private MessageUtils coreMsgUtils_;
- private IProject serverProject;
-
- public CheckAxisDeploymentDescriptorsTask()
- {
- String pluginId = "org.eclipse.jst.ws.axis.consumption.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- setDescription(msgUtils_.getMessage("CHECK_WS_DD_TASK_DESCRIPTION"));
- setName(msgUtils_.getMessage("CHECK_WS_DD_TASK_LABEL"));
- }
-
- public Status execute(Environment env) {
- Status status = new SimpleStatus( "" );
- if(EnvironmentUtils.getResourceContext(env).isOverwriteFilesEnabled()) {
- return status;
- }
-
- IPath filePath = null;
- IProject project = serverProject;
- filePath = project.getFullPath();
- try {
- if (project.hasNature(IWebNatureConstants.J2EE_NATURE_ID)) {
- J2EEWebNatureRuntime webProject = (J2EEWebNatureRuntime) project.getNature(IWebNatureConstants.J2EE_NATURE_ID);
- filePath = filePath.append(webProject.getWEBINFPath());
- filePath = filePath.append("/server-config.wsdd");
- }
- } catch (CoreException e) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_DEFAULT_BEAN"), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- if(filePath==null || filePath.isEmpty())
- {
- status = new SimpleStatus("", coreMsgUtils_.getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
- if (file.exists() && !EnvironmentUtils.getResourceContext(env).isOverwriteFilesEnabled()) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_XML_FILE_OVERWRITE_DISABLED"), Status.WARNING);
- try
- {
- env.getStatusHandler().report(status);
- }
- catch(StatusException se)
- {
- status = new SimpleStatus("", "User aborted",Status.ERROR);
- }
-
- return status;
- }
- return status;
- }
-
- public void setServerProject(IProject serverProject)
- {
- this.serverProject = serverProject;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CopyAxisJarCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CopyAxisJarCommand.java
deleted file mode 100644
index 4cfedb5..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CopyAxisJarCommand.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.task;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.wst.command.env.common.FileResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.core.context.TransientResourceContext;
-
-
-public class CopyAxisJarCommand extends SimpleCommand {
-
- public static String AXIS_RUNTIME_PLUGIN_ID = "org.eclipse.wst.ws.apache.axis"; //$NON-NLS-1$
-
- private String DESCRIPTION = "TASK_DESC_COPY_JARS_TO_PROJECT";
- private String LABEL = "TASK_LABEL_COPY_JARS_TO_PROJECT";
-
- private MessageUtils msgUtils_;
- private MessageUtils baseConMsgUtils_;
- private IProject project;
- private Boolean projectRestartRequired_ = Boolean.FALSE;
-
- /**
- * Default CTOR;
- */
- public CopyAxisJarCommand() {
- String pluginId = "org.eclipse.jst.ws.axis.consumption.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- baseConMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.consumption.plugin", this );
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
- }
-
- /**
- * Execute the command
- */
- public Status execute(Environment env) {
- Status status = new SimpleStatus("");
- env.getProgressMonitor().report(msgUtils_.getMessage("PROGRESS_INFO_COPY_AXIS_CFG"));
- copyAxisJarsToProject(project, status, env);
- return status;
-
- }
-
- private void copyAxisJarsToProject(IProject project, Status status, Environment env) {
- IPath webModulePath = ResourceUtils.getWebModuleServerRoot(project).getFullPath();
- if (webModulePath == null) {
- status = new SimpleStatus("", baseConMsgUtils_.getMessage("MSG_ERROR_PROJECT_NOT_FOUND"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return;
- }
-
- copyIFile("lib/axis.jar", //$NON-NLS-1$
- webModulePath, "WEB-INF/lib/axis.jar", status, env); //$NON-NLS-1$
- if (status.getSeverity() == Status.ERROR)
- return;
- copyIFile("lib/log4j-1.2.8.jar", //$NON-NLS-1$
- webModulePath, "WEB-INF/lib/log4j-1.2.8.jar", status, env); //$NON-NLS-1$
- if (status.getSeverity() == Status.ERROR)
- return;
- copyIFile("lib/commons-discovery.jar", //$NON-NLS-1$
- webModulePath, "WEB-INF/lib/commons-discovery.jar", status, env); //$NON-NLS-1$
- if (status.getSeverity() == Status.ERROR)
- return;
- copyIFile("lib/commons-logging.jar", //$NON-NLS-1$
- webModulePath, "WEB-INF/lib/commons-logging.jar", status, env); //$NON-NLS-1$
- if (status.getSeverity() == Status.ERROR)
- return;
- copyIFile("lib/saaj.jar", //$NON-NLS-1$
- webModulePath, "WEB-INF/lib/saaj.jar", status, env); //$NON-NLS-1$
- if (status.getSeverity() == Status.ERROR)
- return;
- copyIFile("lib/jaxrpc.jar", //$NON-NLS-1$
- webModulePath, "WEB-INF/lib/jaxrpc.jar", status, env); //$NON-NLS-1$
- if (status.getSeverity() == Status.ERROR)
- return;
- copyIFile("lib/wsdl4j.jar", //$NON-NLS-1$
- webModulePath, "WEB-INF/lib/wsdl4j.jar", status, env); //$NON-NLS-1$
- if (status.getSeverity() == Status.ERROR)
- return;
- return;
- }
-
- /**
- *
- */
- private void copyIFile(String source, IPath targetPath, String targetFile, Status status, Environment env) {
- IPath target = targetPath.append(new Path(targetFile));
- env.getProgressMonitor().report(baseConMsgUtils_.getMessage("PROGRESS_INFO_COPYING_FILE"));
-
- try {
- ResourceContext context = new TransientResourceContext();
- context.setOverwriteFilesEnabled(true);
- context.setCreateFoldersEnabled(true);
- context.setCheckoutFilesEnabled(true);
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- IPluginDescriptor pluginDescriptor = pluginRegistry.getPluginDescriptor(AXIS_RUNTIME_PLUGIN_ID);
- Plugin axisrt_plugin = pluginDescriptor.getPlugin();
- IFile resource = ResourceUtils.getWorkspaceRoot().getFile(target);
- if (!resource.exists()) {
- IFile file = FileResourceUtils.createFile(context, target, axisrt_plugin.openStream(new Path(source)), env.getProgressMonitor(), env
- .getStatusHandler());
- if (projectRestartRequired_.booleanValue() == false && file.exists()) {
- projectRestartRequired_ = Boolean.TRUE;
- }
-
- }
- IFile file = FileResourceUtils.createFile(context, target, axisrt_plugin.openStream(new Path(source)), env.getProgressMonitor(), env
- .getStatusHandler());
- }
- catch (Exception e) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_FILECOPY"), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
-
- }
- }
-
- public void setProject(IProject project) {
- this.project = project;
- }
-
- public boolean getProjectRestartRequired() {
- return projectRestartRequired_.booleanValue();
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/DefaultsForHTTPBasicAuthCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/DefaultsForHTTPBasicAuthCommand.java
deleted file mode 100644
index 4dda7fa..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/DefaultsForHTTPBasicAuthCommand.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.task;
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.consumption.ui.wsil.DialogWWWAuthentication;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WWWAuthenticationException;
-import org.eclipse.wst.ws.parser.wsil.WebServiceEntity;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-
-public class DefaultsForHTTPBasicAuthCommand extends SimpleCommand
-{
- private WebServicesParser webServicesParser;
- private String wsdlServiceURL;
- private JavaWSDLParameter javaWSDLParam;
- private Model model;
-
- public DefaultsForHTTPBasicAuthCommand()
- {
- super("org.eclipse.jst.ws.internal.axis.consumption.ui.task.DefaultsForHTTPBasicAuthCommand", "org.eclipse.jst.ws.internal.axis.consumption.ui.task.DefaultsForHTTPBasicAuthCommand");
- }
-
- public Status execute(Environment env)
- {
- //WebServiceElement wse = WebServiceElement.getWebServiceElement(model);
- //setWebServicesParser((WebServicesParser)wse.getWSParser());
- //setWsdlServiceURL(wse.getWSDLServiceURL());
- //if (wsdlServiceURL == null || wsdlServiceURL.length() <= 0)
- // setWsdlServiceURL((new Utils()).toFileSystemURI(wse.getWSDLServicePathname()));
-
- if (wsdlServiceURL != null && wsdlServiceURL.length() > 0)
- {
- if (webServicesParser == null)
- {
- webServicesParser = new WebServicesParserExt();
- //wse.setWSParser(webServicesParser);
- }
- WebServiceEntity wsEntity = webServicesParser.getWebServiceEntityByURI(wsdlServiceURL);
- if (wsEntity == null || !wsEntity.isEntityResolved())
- {
- webServicesParser.setURI(wsdlServiceURL);
- try
- {
- webServicesParser.parse(WebServicesParser.PARSE_NONE);
- }
- catch (WWWAuthenticationException wwwae)
- {
- DialogWWWAuthentication dialog = new DialogWWWAuthentication(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
- dialog.handleWWWAuthentication(wwwae);
- String username = dialog.getUsername();
- String password = dialog.getPassword();
- if (username != null && password != null)
- {
- webServicesParser.setHTTPBasicAuthUsername(username);
- webServicesParser.setHTTPBasicAuthPassword(password);
- try
- {
- webServicesParser.parse(WebServicesParser.PARSE_NONE);
- }
- catch (Throwable t)
- {
- }
- webServicesParser.setHTTPBasicAuthUsername(null);
- webServicesParser.setHTTPBasicAuthPassword(null);
- }
- }
- catch (Throwable t)
- {
- }
- wsEntity = webServicesParser.getWebServiceEntityByURI(wsdlServiceURL);
- }
- if (wsEntity != null && wsEntity.getType() == WebServiceEntity.TYPE_WSDL)
- {
- String httpUsername = wsEntity.getHTTPUsername();
- String httpPassword = wsEntity.getHTTPPassword();
- if (httpUsername != null && httpPassword != null)
- {
- javaWSDLParam.setHTTPUsername(httpUsername);
- javaWSDLParam.setHTTPPassword(httpPassword);
- }
- }
- }
- return new SimpleStatus("");
- }
- /**
- * @param javaWSDLParam The javaWSDLParam to set.
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) {
- this.javaWSDLParam = javaWSDLParam;
- }
-
- /**
- * @param model The model to set.
- */
- public void setModel(Model model) {
- this.model = model;
- }
-
- /**
- * @param wsdlServiceURL The wsdlServiceURL to set.
- */
- public void setWsdlServiceURL(String wsdlServiceURL) {
- this.wsdlServiceURL = wsdlServiceURL;
- }
-
- /**
- * @return Returns the javaWSDLParam.
- */
- public JavaWSDLParameter getJavaWSDLParam() {
- return javaWSDLParam;
- }
-
- /**
- * @return Returns the webServicesParser.
- */
- public WebServicesParser getWebServicesParser() {
- return webServicesParser;
- }
-
- /**
- * @param webServicesParser The webServicesParser to set.
- */
- public void setWebServicesParser(WebServicesParser webServicesParser) {
- this.webServicesParser = webServicesParser;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/RefreshProjectCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/RefreshProjectCommand.java
deleted file mode 100644
index bb08800..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/RefreshProjectCommand.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.task;
-
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.plugin.WebServiceAxisConsumptionUIPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-public class RefreshProjectCommand extends SimpleCommand
-{
- private static final String LABEL = "TASK_LABEL_REFESH_PROJECT";
- private static final String DESCRIPTION = "TASK_DESC_REFESH_PROJECT";
-
- private IProject project;
- private MessageUtils msgUtils_;
-
- public RefreshProjectCommand()
- {
- msgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.ui.plugin", this );
- setName( msgUtils_.getMessage( LABEL ) );
- setDescription( msgUtils_.getMessage( DESCRIPTION ));
- }
-
- /**
- * Execute RefreshProjectTask
- */
- public Status execute(Environment env)
- {
- try
- {
- if (project!=null)
- project.refreshLocal(IProject.DEPTH_INFINITE, new NullProgressMonitor());
- }
- catch (CoreException e)
- {
- Status status = new SimpleStatus(WebServiceAxisConsumptionUIPlugin.ID, msgUtils_.getMessage("MSG_ERROR_REFRESH_PROJECT"), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return status;
- }
- return new SimpleStatus("");
- }
-
- public IProject getProject() {
- return project;
- }
-
- public void setProject(IProject project) {
- this.project = project;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/Stub2BeanCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/Stub2BeanCommand.java
deleted file mode 100644
index 1484fba..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/Stub2BeanCommand.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.axis.consumption.ui.task;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.consumption.util.WSDLUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-public class Stub2BeanCommand extends SimpleCommand
-{
- private WebServicesParser webServicesParser;
- private JavaWSDLParameter javaWSDLParam_;
- private String discoveredWsdlPortElementName;
- private Vector portTypes_;
- private String proxyBean_;
-
- private IProject clientProject_;
-
- public Stub2BeanCommand()
- {
- super("org.eclipse.jst.ws.was.creation.ui.task.Stub2BeanCommand", "org.eclipse.jst.ws.was.creation.ui.task.Stub2BeanCommand");
- portTypes_ = new Vector();
- //setRunInWorkspaceModifyOperation(false);
- }
-
- /**
- * Execute
- */
- public Status execute(Environment env)
- {
- String inputWsdlLocation = javaWSDLParam_.getInputWsdlLocation();
- Definition def = webServicesParser.getWSDLDefinition(inputWsdlLocation);
- /*
- * Hack: Axis is not using a proper java.net.URL as its inputWsdlLocation.
- * We need to convert it to a proper file URL.
- */
- if (def == null)
- {
- File file = new File(inputWsdlLocation);
- if (file.exists())
- {
- try
- {
- def = webServicesParser.getWSDLDefinition(file.toURL().toString());
- }
- catch (MalformedURLException murle)
- {
- }
- }
- }
- Map pkg2nsMapping = javaWSDLParam_.getMappings();
- Map services = def.getServices();
- for (Iterator it = services.values().iterator(); it.hasNext();)
- {
- Service service = (Service)it.next();
- String servicePkgName = WSDLUtils.getPackageName(service, pkg2nsMapping);
- String serviceClassName = computeClassName(service.getQName().getLocalPart());
- String jndiName = serviceClassName;
- Map ports = service.getPorts();
- for (Iterator it2 = ports.values().iterator(); it2.hasNext();)
- {
- if (serviceClassName.equals(computeClassName(((Port)it2.next()).getBinding().getPortType().getQName().getLocalPart())))
- {
- serviceClassName = serviceClassName + "_Service";
- break;
- }
- }
- for (Iterator it2 = ports.values().iterator(); it2.hasNext();)
- {
- Port port = (Port)it2.next();
- if (discoveredWsdlPortElementName != null && !discoveredWsdlPortElementName.equals(port.getName()))
- continue;
- SOAPAddress soapAddress = null;
- List extensibilityElements = port.getExtensibilityElements();
- if (extensibilityElements != null)
- {
- for (Iterator it3 = extensibilityElements.iterator(); it3.hasNext();)
- {
- Object object = it3.next();
- if (object instanceof SOAPAddress)
- {
- soapAddress = (SOAPAddress)object;
- break;
- }
- }
- }
- if (soapAddress != null)
- {
- PortType portType = port.getBinding().getPortType();
- QName portTypeQName = portType.getQName();
- StringBuffer portTypeID = new StringBuffer();
- portTypeID.append(portTypeQName.getNamespaceURI());
- portTypeID.append("#");
- portTypeID.append(portTypeQName.getLocalPart());
- if (!portTypes_.contains(portTypeID.toString()))
- {
- portTypes_.add(portTypeID.toString());
- Stub2BeanInfo stub2BeanInfo = new Stub2BeanInfo();
- stub2BeanInfo.setClientProject(clientProject_);
- String portTypePkgName = WSDLUtils.getPackageName(portType, pkg2nsMapping);
- String portTypeClassName = computeClassName(portTypeQName.getLocalPart());
- stub2BeanInfo.setPackage(portTypePkgName);
- stub2BeanInfo.setClass(portTypeClassName + "Proxy");
- proxyBean_ = portTypePkgName+"."+portTypeClassName+"Proxy";
- if (jndiName.equals(portTypeClassName))
- portTypeClassName = portTypeClassName + "_Port";
- stub2BeanInfo.addSEI(portTypePkgName, portTypeClassName, servicePkgName, serviceClassName, jndiName, port.getName());
- try
- {
- stub2BeanInfo.write( env.getProgressMonitor(), env.getStatusHandler() );
- if (discoveredWsdlPortElementName != null)
- {
- // The discovered port was processed. Ignore all other ports and services.
- return new SimpleStatus("");
- }
- }
- catch (CoreException ce)
- {
- }
- catch (IOException ioe)
- {
- }
- }
- }
- }
- }
- return new SimpleStatus("");
- }
-
- private final char UNDERSCORE = '_';
-
- private String computeClassName(String className)
- {
- String classNameCopy = className;
- int i = classNameCopy.indexOf(UNDERSCORE);
- while (i != -1)
- {
- char c = classNameCopy.charAt(i+1);
- if (Character.isLowerCase(c))
- {
- StringBuffer sb = new StringBuffer();
- sb.append(classNameCopy.substring(0, i+1));
- sb.append(Character.toUpperCase(c));
- sb.append(classNameCopy.substring(i+2, classNameCopy.length()));
- classNameCopy = sb.toString();
- }
- i = classNameCopy.indexOf(UNDERSCORE, i+1);
- }
- char[] cArray = new char[classNameCopy.length()];
- boolean foundDigit = false;
- for (int j = 0; j < cArray.length; j++)
- {
- char c = classNameCopy.charAt(j);
- if (Character.isDigit(c))
- {
- cArray[j] = c;
- foundDigit = true;
- }
- else
- {
- if (foundDigit)
- cArray[j] = Character.toUpperCase(c);
- else
- cArray[j] = c;
- foundDigit = false;
- }
- }
- return new String(cArray);
- }
-
- /**
- * Returns the javaWSDLParam.
- * @return JavaWSDLParameter
- */
- public JavaWSDLParameter getJavaWSDLParam()
- {
- return javaWSDLParam_;
- }
-
- /**
- * Sets the javaWSDLParam.
- * @param javaWSDLParam The javaWSDLParam to set
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam)
- {
- javaWSDLParam_ = javaWSDLParam;
- }
- /**
- * @return Returns the webServicesParser.
- */
- public WebServicesParser getWebServicesParser() {
- return webServicesParser;
- }
-
- /**
- * @param webServicesParser The webServicesParser to set.
- */
- public void setWebServicesParser(WebServicesParser webServicesParser) {
- this.webServicesParser = webServicesParser;
- }
-
-
- /**
- * @param discoveredWsdlPortElementName The discoveredWsdlPortElementName to set.
- */
- public void setDiscoveredWsdlPortElementName(String discoveredWsdlPortElementName) {
- this.discoveredWsdlPortElementName = discoveredWsdlPortElementName;
- }
-
- /**
- * @param clientProject The clientProject to set.
- */
- public void setClientProject(IProject clientProject) {
- this.clientProject_ = clientProject;
- }
-
- /**
- * @return Returns the proxyBean.
- */
- public String getProxyBean() {
- return proxyBean_;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/Stub2BeanInfo.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/Stub2BeanInfo.java
deleted file mode 100644
index 351f4a8..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/Stub2BeanInfo.java
+++ /dev/null
@@ -1,672 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.axis.consumption.ui.task;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jem.internal.plugin.JavaEMFNature;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.JavaParameter;
-import org.eclipse.jem.java.JavaVisibilityKind;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jem.java.impl.JavaClassImpl;
-import org.eclipse.jst.ws.internal.consumption.util.WSDLUtils;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.common.FileResourceUtils;
-import org.eclipse.wst.command.env.core.common.ProgressMonitor;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-
-import com.ibm.wtp.emf.workbench.ProjectUtilities;
-
-public class Stub2BeanInfo
-{
- private final String NEW_LINE = System.getProperty("line.separator");
-
- private int indentCount;
-
- private String package_;
- private StringBuffer imports_;
- private StringBuffer seis_;
- private StringBuffer services_;
- private StringBuffer jndiNames_;
- private StringBuffer ports_;
- private String class_;
- private Vector usedNames;
-
- private IProject clientProject_;
-
- public Stub2BeanInfo()
- {
- indentCount = 0;
- package_ = null;
- imports_ = new StringBuffer();
- seis_ = new StringBuffer();
- services_ = new StringBuffer();
- jndiNames_ = new StringBuffer();
- ports_ = new StringBuffer();
- class_ = "SEIBean";
- usedNames = new Vector();
- }
-
- public void setClientProject(IProject clientProject) {
- this.clientProject_ = clientProject;
- }
-
-
- public void setPackage(String pkgName)
- {
- if (pkgName != null && pkgName.length() > 0)
- package_ = manglePackageName(pkgName);
- }
-
- public void addImports(String pkgName, String className)
- {
- imports_.append(toFullyQualifiedClassName(pkgName, className));
- imports_.append(";");
- }
-
- public void addSEI(String seiPkgName, String seiClassName, String servicePkgName, String serviceClassName, String portName)
- {
- addSEI(seiPkgName, seiClassName, servicePkgName, serviceClassName, serviceClassName, portName);
- }
-
- public void addSEI(String seiPkgName, String seiClassName, String servicePkgName, String serviceClassName, String jndiName, String portName)
- {
- seis_.append(toFullyQualifiedClassName(seiPkgName, seiClassName));
- seis_.append(";");
- services_.append(toFullyQualifiedClassName(servicePkgName, serviceClassName));
- services_.append(";");
- jndiNames_.append(jndiName);
- jndiNames_.append(";");
- ports_.append(portName);
- ports_.append(";");
- }
-
- public void setClass(String className)
- {
- if (className != null && className.length() > 0)
- class_ = mangleClassName(className);
- }
-
- private String toFullyQualifiedClassName(String pkgName, String className)
- {
- StringBuffer sb = new StringBuffer();
- sb.append(manglePackageName(pkgName));
- sb.append(".");
- sb.append(mangleClassName(className));
- return sb.toString();
- }
-
- private String getPackageName(String qname)
- {
- int index = qname.lastIndexOf(".");
- if (index != -1)
- return qname.substring(0, index);
- else
- return qname;
- }
-
- private String getClassName(String qname)
- {
- int index = qname.lastIndexOf(".");
- if (index != -1)
- return qname.substring(index+1, qname.length());
- else
- return qname;
- }
-
- private String manglePackageName(String s)
- {
- return replaceInvalidJavaChars(s);
- }
-
- private String mangleClassName(String s)
- {
- s = firstCharToUpperCase(WSDLUtils.resolveDotInPortName(s));
- return replaceInvalidJavaChars(s);
- }
-
- private String replaceInvalidJavaChars(String s)
- {
- char[] c = s.toCharArray();
- for (int i = 0; i < c.length; i++)
- {
- if (!Character.isJavaIdentifierPart(c[i]))
- c[i] = '.';
- }
- return new String(c);
- }
-
- private String firstCharToUpperCase(String s)
- {
- StringBuffer sb = new StringBuffer();
- sb.append(s.substring(0, 1).toUpperCase());
- sb.append(s.substring(1, s.length()));
- return sb.toString();
- }
-
- private String firstCharToLowerCase(String s)
- {
- StringBuffer sb = new StringBuffer();
- sb.append(s.substring(0, 1).toLowerCase());
- sb.append(s.substring(1, s.length()));
- return sb.toString();
- }
-
- private String trimArraySymbol(String s)
- {
- int index = s.indexOf("[");
- if (index != -1)
- return s.substring(0, index);
- else
- return s;
- }
-
- private String getFullyQualifiedName(JavaHelpers javaHelpers)
- {
- if (javaHelpers.isPrimitive())
- return javaHelpers.getJavaName();
- else
- return javaHelpers.getQualifiedName();
- }
-
- public void write(ProgressMonitor progressMonitor, StatusHandler statusMonitor) throws CoreException, IOException
- {
- StringWriter sw = new StringWriter(2048);
- writePackage(sw);
- writeImports(sw);
- writeClass(sw);
- sw.close();
- byte[] bytes = sw.getBuffer().toString().getBytes();
- StringBuffer sb = new StringBuffer();
- if (package_ != null && package_.length() > 0)
- {
- sb.append(package_);
- sb.append(".");
- }
- sb.append(class_);
- sb = new StringBuffer(sb.toString().replace('.', '/'));
- sb.append(".java");
-// WebServiceElement wse = WebServiceElement.getWebServiceElement(model_);
-// IProject clientProject = wse.getProxyProject();
- JavaEMFNature javaMOF = (JavaEMFNature)JavaEMFNature.createRuntime(clientProject_);
- ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- FileResourceUtils.createFile(WebServicePlugin.getInstance().getResourceContext(), ProjectUtilities.getSourceFolderOrFirst(javaMOF.getProject(), null).getFile(new Path(sb.toString())).getFullPath(), bais, progressMonitor, statusMonitor);
- }
-
- private void writePackage(Writer w) throws IOException
- {
- if (package_ != null && package_.length() > 0)
- {
- w.write("package ");
- w.write(package_);
- w.write(";");
- newLine(w);
- }
- }
-
- private void writeImports(Writer w) throws IOException
- {
- StringTokenizer st = new StringTokenizer(imports_.toString(), ";");
- while (st.hasMoreTokens())
- {
- w.write("import ");
- w.write(st.nextToken());
- w.write(";");
- newLine(w);
- }
- }
-
- private void writeClass(Writer w) throws IOException, CoreException
- {
- newLine(w);
- w.write("public class ");
- w.write(class_);
- w.write(" ");
- StringTokenizer st = new StringTokenizer(seis_.toString(), ";");
- if (st.hasMoreTokens())
- w.write("implements ");
- while (st.hasMoreTokens())
- {
- w.write(st.nextToken());
- if (st.hasMoreTokens())
- w.write(", ");
- }
- w.write(" {");
- incrementIndent();
- newLine(w);
- writeFieldsDeclarations(w);
- writeConstructor(w);
- writeInit(w);
- /*
- * Cannot use JNDI lookup for AXIS
- *
- writeUseJNDI(w);
- */
- writeGetSetEndpoint(w);
- writeSEIGetters(w);
- writeSEIMethods(w);
- decrementIndent();
- newLine(w);
- w.write("}");
- }
-
- private void writeFieldsDeclarations(Writer w) throws IOException
- {
- /*
- * Cannot use JNDI lookup for AXIS
- *
- w.write("private boolean _useJNDI = true;");
- newLine(w);
- */
- w.write("private String _endpoint = null;");
- usedNames.add("_endpoint");
- newLine(w);
- StringTokenizer st = new StringTokenizer(seis_.toString(), ";");
- while (st.hasMoreTokens())
- {
- w.write("private ");
- String sei = st.nextToken();
- w.write(sei);
- w.write(" ");
- String stubName = firstCharToLowerCase(getClassName(sei));
- w.write(stubName);
- usedNames.add(stubName);
- w.write(" = null;");
- newLine(w);
- }
- }
-
- private void writeConstructor(Writer w) throws IOException
- {
- newLine(w);
- w.write("public ");
- w.write(class_);
- w.write("() {");
- incrementIndent();
- newLine(w);
- w.write("_init");
- w.write(class_);
- w.write("();");
- decrementIndent();
- newLine(w);
- w.write("}");
- newLine(w);
- }
-
- private void writeInit(Writer w) throws IOException
- {
- newLine(w);
- w.write("private void _init");
- w.write(class_);
- w.write("() {");
- incrementIndent();
- newLine(w);
- w.write("try {");
- incrementIndent();
- newLine(w);
- /*
- * Cannot use JNDI lookup for AXIS
- *
- w.write("if (_useJNDI) {");
- incrementIndent();
- newLine(w);
- */
- StringTokenizer st = new StringTokenizer(seis_.toString(), ";");
- StringTokenizer serviceTokens = new StringTokenizer(services_.toString(), ";");
- StringTokenizer jndiNameTokens = new StringTokenizer(jndiNames_.toString(), ";");
- StringTokenizer portTokens = new StringTokenizer(ports_.toString(), ";");
- /*
- if (st.hasMoreTokens())
- {
- w.write("javax.naming.InitialContext ctx = new javax.naming.InitialContext();");
- newLine(w);
- }
- while (st.hasMoreTokens())
- {
- w.write(firstCharToLowerCase(getClassName(st.nextToken())));
- w.write(" = ((");
- w.write(serviceTokens.nextToken());
- w.write(")ctx.lookup(\"java:comp/env/service/");
- w.write(jndiNameTokens.nextToken());
- w.write("\")).get");
- w.write(mangleClassName(portTokens.nextToken()));
- w.write("();");
- newLine(w);
- }
- decrementIndent();
- newLine(w);
- w.write("}");
- newLine(w);
- w.write("else {");
- incrementIndent();
- newLine(w);
- st = new StringTokenizer(seis_.toString(), ";");
- serviceTokens = new StringTokenizer(services_.toString(), ";");
- portTokens = new StringTokenizer(ports_.toString(), ";");
- */
- while (st.hasMoreTokens())
- {
- String seiName = firstCharToLowerCase(getClassName(st.nextToken()));
- w.write(seiName);
- w.write(" = (new ");
- w.write(serviceTokens.nextToken());
- w.write("Locator()).get");
- w.write(replaceInvalidJavaChars(WSDLUtils.resolveDotInPortName(portTokens.nextToken())));
- w.write("();");
- newLine(w);
- w.write("if (");
- w.write(seiName);
- w.write(" != null) {");
- incrementIndent();
- newLine(w);
- w.write("if (_endpoint != null)");
- incrementIndent();
- newLine(w);
- w.write("((javax.xml.rpc.Stub)");
- w.write(seiName);
- w.write(")._setProperty(\"javax.xml.rpc.service.endpoint.address\", _endpoint);");
- decrementIndent();
- newLine(w);
- w.write("else");
- incrementIndent();
- newLine(w);
- w.write("_endpoint = (String)((javax.xml.rpc.Stub)");
- w.write(seiName);
- w.write(")._getProperty(\"javax.xml.rpc.service.endpoint.address\");");
- decrementIndent();
- decrementIndent();
- newLine(w);
- w.write("}");
- newLine(w);
- }
- /*
- decrementIndent();
- newLine(w);
- w.write("}");
- */
- decrementIndent();
- newLine(w);
- w.write("}");
- newLine(w);
- /*
- w.write("catch (javax.naming.NamingException namingException) {}");
- newLine(w);
- */
- w.write("catch (javax.xml.rpc.ServiceException serviceException) {}");
- decrementIndent();
- newLine(w);
- w.write("}");
- newLine(w);
- }
-
- private void writeSetPropertyEndpoint(Writer w) throws IOException
- {
- StringTokenizer st = new StringTokenizer(seis_.toString(), ";");
- while (st.hasMoreTokens())
- {
- String seiName = firstCharToLowerCase(getClassName(st.nextToken()));
- w.write("if (");
- w.write(seiName);
- w.write(" != null)");
- incrementIndent();
- newLine(w);
- w.write("((javax.xml.rpc.Stub)");
- w.write(seiName);
- w.write(")._setProperty(\"javax.xml.rpc.service.endpoint.address\", _endpoint);");
- decrementIndent();
- newLine(w);
- }
- }
-
- private void writeUseJNDI(Writer w) throws IOException
- {
- newLine(w);
- w.write("public void useJNDI(boolean useJNDI) {");
- incrementIndent();
- newLine(w);
- w.write("_useJNDI = useJNDI;");
- newLine(w);
- StringTokenizer st = new StringTokenizer(seis_.toString(), ";");
- while (st.hasMoreTokens())
- {
- w.write(firstCharToLowerCase(getClassName(st.nextToken())));
- w.write(" = null;");
- newLine(w);
- }
- decrementIndent();
- newLine(w);
- w.write("}");
- newLine(w);
- }
-
- private void writeSEIGetters(Writer w) throws IOException
- {
- StringTokenizer st = new StringTokenizer(seis_.toString(), ";");
- while (st.hasMoreTokens())
- {
- String sei = st.nextToken();
- String seiClassName = getClassName(sei);
- String seiFieldName = firstCharToLowerCase(seiClassName);
- newLine(w);
- w.write("public ");
- w.write(sei);
- w.write(" get");
- w.write(seiClassName);
- w.write("() {");
- incrementIndent();
- newLine(w);
- w.write("if (");
- w.write(seiFieldName);
- w.write(" == null)");
- incrementIndent();
- newLine(w);
- w.write("_init");
- w.write(class_);
- w.write("();");
- decrementIndent();
- newLine(w);
- w.write("return ");
- w.write(seiFieldName);
- w.write(";");
- decrementIndent();
- newLine(w);
- w.write("}");
- newLine(w);
- }
- }
-
- private void writeSEIMethods(Writer w) throws IOException, CoreException
- {
- newLine(w);
- //WebServiceElement wse = WebServiceElement.getWebServiceElement(model_);
- if (clientProject_ == null) return;//wse.getProxyProject();
- JavaEMFNature javaMOF = (JavaEMFNature)JavaEMFNature.createRuntime(clientProject_);
- StringTokenizer st = new StringTokenizer(seis_.toString(), ";");
- while (st.hasMoreTokens())
- {
- String sei = st.nextToken();
- JavaClass javaClass = (JavaClass)JavaClassImpl.reflect(getPackageName(sei), getClassName(sei), javaMOF.getResourceSet());
- if (javaClass != null)
- {
- List methods = javaClass.getMethods();
- for (Iterator it = methods.iterator(); it.hasNext();)
- {
- Method method = (Method)it.next();
- if (!method.isConstructor() && !method.isNative() && method.getJavaVisibility().getValue() == JavaVisibilityKind.PUBLIC)
- writeSEIMethods(w, javaClass, method);
- }
- }
- }
- }
-
- private void writeSEIMethods(Writer w, JavaClass javaClass, Method method) throws IOException
- {
- w.write("public ");
- // isVoid
- if (method.isVoid())
- w.write("void ");
- else
- {
- w.write(getFullyQualifiedName(method.getReturnType()));
- w.write(" ");
- }
- // method name
- w.write(method.getName());
- w.write("(");
- // input parameters
- JavaParameter[] inputParams = method.listParametersWithoutReturn();
- for (int i = 0; i < inputParams.length; i++)
- {
- if (i > 0)
- w.write(", ");
- JavaHelpers javaHelpers = inputParams[i].getJavaType();
- w.write(getFullyQualifiedName(javaHelpers));
- w.write(" ");
- String paramName = getClassName(inputParams[i].getQualifiedName());
- w.write(getUnusedName(paramName));
- }
- w.write(")");
- // exceptions
- List exceptions = method.getJavaExceptions();
- if (!exceptions.isEmpty())
- w.write(" throws ");
- for (Iterator it = exceptions.iterator(); it.hasNext();)
- {
- JavaClass exception = (JavaClass)it.next();
- w.write(exception.getQualifiedNameForReflection());
- if (it.hasNext())
- w.write(", ");
- }
- // method body
- w.write("{");
- incrementIndent();
- newLine(w);
- String stubName = firstCharToLowerCase(javaClass.getName());
- w.write("if (");
- w.write(stubName);
- w.write(" == null)");
- incrementIndent();
- newLine(w);
- w.write("_init");
- w.write(class_);
- w.write("();");
- decrementIndent();
- newLine(w);
- if (!method.isVoid())
- w.write("return ");
- w.write(stubName);
- w.write(".");
- w.write(method.getName());
- w.write("(");
- for (int i = 0; i < inputParams.length; i++)
- {
- if (i > 0)
- w.write(", ");
- String paramName = getClassName(inputParams[i].getQualifiedName());
- w.write(getUnusedName(paramName));
- }
- w.write(");");
- decrementIndent();
- newLine(w);
- w.write("}");
- newLine(w);
- newLine(w);
- }
-
- private void writeGetSetEndpoint(Writer w) throws IOException
- {
- newLine(w);
- w.write("public String getEndpoint() {");
- incrementIndent();
- newLine(w);
- w.write("return _endpoint;");
- decrementIndent();
- newLine(w);
- w.write("}");
- newLine(w);
- newLine(w);
- w.write("public void setEndpoint(String endpoint) {");
- incrementIndent();
- newLine(w);
- w.write("_endpoint = endpoint;");
- newLine(w);
- writeSetPropertyEndpoint(w);
- decrementIndent();
- newLine(w);
- w.write("}");
- newLine(w);
- }
-
- private void createParentFolder(IResource res) throws CoreException
- {
- IResource parent = res.getParent();
- if (parent != null && parent != res && parent instanceof IFolder)
- {
- IFolder folder = (IFolder)parent;
- if (!folder.exists())
- {
- createParentFolder(folder);
- folder.create(true, true, null);
- }
- }
- }
-
- private void incrementIndent()
- {
- indentCount++;
- }
-
- private void decrementIndent()
- {
- indentCount--;
- }
-
- private void indent(Writer w) throws IOException
- {
- for (int i = 0; i < indentCount; i++)
- w.write(" ");
- }
-
- private void newLine(Writer w) throws IOException
- {
- w.write(NEW_LINE);
- indent(w);
- }
-
- private String getUnusedName(String name)
- {
- if (usedNames.contains(name))
- {
- for (int i = 0; i < 100; i++)
- {
- String newName = (new StringBuffer(name)).append(String.valueOf(i)).toString();
- if (!usedNames.contains(newName))
- return newName;
- }
- }
- return name;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/ValidateWSDLCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/ValidateWSDLCommand.java
deleted file mode 100644
index 8cd77ab..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/ValidateWSDLCommand.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.axis.consumption.ui.task;
-
-import javax.wsdl.Definition;
-
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-
-public class ValidateWSDLCommand extends SimpleCommand
-{
- private WebServicesParser webServicesParser;
- private String wsdlURI;
-
- public ValidateWSDLCommand()
- {
- super("org.eclipse.jst.ws.internal.axis.consumption.ui.task.ValidateWSDLCommand", "org.eclipse.jst.ws.internal.axis.consumption.ui.task.ValidateWSDLCommand");
- }
-
- public Status execute(Environment env)
- {
- MessageUtils msgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.ui.plugin", this );
-
- if (wsdlURI != null && wsdlURI.length() > 0)
- {
- Definition definition = webServicesParser.getWSDLDefinition(wsdlURI);
- if (definition != null)
- {
- int numServices = definition.getServices().size();
- if (numServices < 1)
- {
- Status status = new SimpleStatus(WebServiceConsumptionUIPlugin.ID, msgUtils_.getMessage("MSG_ERROR_WSDL_HAS_NO_SERVICE_ELEMENT", new Object[] {wsdlURI}), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
- }
- }
- return new SimpleStatus("");
- }
-
- /**
- * @param wsdlURI The wsdlURI to set.
- */
- public void setWsdlURI(String wsdlURI)
- {
- this.wsdlURI = wsdlURI;
- }
-
- /**
- * @param webServicesParser The webServicesParser to set.
- */
- public void setWebServicesParser(WebServicesParser webServicesParser)
- {
- this.webServicesParser = webServicesParser;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisClientCommandsFragment.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisClientCommandsFragment.java
deleted file mode 100644
index 5769346..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisClientCommandsFragment.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.widgets;
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.command.DefaultsForClientJavaWSDLCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.AddJarsToProjectBuildPathTask;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CopyAxisJarCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.DefaultsForHTTPBasicAuthCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.RefreshProjectCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.Stub2BeanCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.ValidateWSDLCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-
-
-public class AxisClientCommandsFragment extends BooleanFragment
-{
- private boolean genProxy_;
-
- public AxisClientCommandsFragment()
- {
- SequenceFragment root = new SequenceFragment();
-
- root.add(new SimpleFragment(new DefaultsForHTTPBasicAuthCommand(), ""));
- root.add(new SimpleFragment(new CopyAxisJarCommand(), ""));
- root.add(new SimpleFragment(new AddJarsToProjectBuildPathTask(), ""));
- root.add(new SimpleFragment(new DefaultsForClientJavaWSDLCommand(), ""));
- root.add(new SimpleFragment(new ValidateWSDLCommand(), ""));
- root.add(new SimpleFragment(new WSDL2JavaCommand(), ""));
- root.add(new SimpleFragment(new RefreshProjectCommand(), ""));
- root.add(new SimpleFragment(new Stub2BeanCommand(), ""));
- root.add(new SimpleFragment(new BuildProjectCommand(), ""));
-
- setCondition( new Condition()
- {
- public boolean evaluate()
- {
- return genProxy_;
- }
- });
- setTrueFragment( root );
- }
-
- public void setGenerateProxy( boolean genProxy )
- {
- genProxy_ = genProxy;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisClientFragment.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisClientFragment.java
deleted file mode 100644
index e457399..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisClientFragment.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.widgets;
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.command.AxisClientDefaultingCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.command.DefaultsForClientJavaWSDLCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.AddJarsToProjectBuildPathTask;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CopyAxisJarCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.DefaultsForHTTPBasicAuthCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.RefreshProjectCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.Stub2BeanCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.ValidateWSDLCommand;
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionOutputCommand;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-
-
-public class AxisClientFragment extends SequenceFragment
-{
-
- public AxisClientFragment()
- {
- add(new SimpleFragment(new AxisClientDefaultingCommand(), ""));
- add(new SimpleFragment("AxisClientStart"));
- add(new MappingFragment());
- add(new AxisClientCommandsFragment());
- // TODO: Look into AddWSDLtoWSILCommand for the client scenario
- }
-
- public void registerDataMappings(DataMappingRegistry registry)
- {
- // AxisClientDefaultingCommand
- registry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", AxisClientDefaultingCommand.class, "ClientProject",
- new StringToIProjectTransformer());
- registry.addMapping(ClientExtensionDefaultingCommand.class, "ClientRuntime", AxisClientDefaultingCommand.class, "ClientRuntimeID",
- null);
- registry.addMapping(ClientExtensionDefaultingCommand.class, "WebServicesParser", AxisClientDefaultingCommand.class);
- registry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", AxisClientDefaultingCommand.class,
- "ClientProjectEAR", new StringToIProjectTransformer());
- registry.addMapping(ClientExtensionDefaultingCommand.class, "WsdlURI", AxisClientDefaultingCommand.class, "WsdlURL", null); // URI
- // to
- // URL
- // transformer
- // req'd??
- registry.addMapping(ClientExtensionDefaultingCommand.class, "TestProxySelected", AxisClientDefaultingCommand.class,
- "TestProxySelected", null);
- registry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServer", AxisClientDefaultingCommand.class);
- registry.addMapping(ClientExtensionDefaultingCommand.class, "IsClientScenario", AxisClientDefaultingCommand.class);
- registry.addMapping(ClientExtensionDefaultingCommand.class, "GenerateProxy", AxisClientDefaultingCommand.class);
- // DefaultsForHTTPBasicAuthCommand()
- registry.addMapping(AxisClientDefaultingCommand.class, "JavaWSDLParam", DefaultsForHTTPBasicAuthCommand.class); //OK
- registry.addMapping(AxisClientDefaultingCommand.class, "WsdlURL", DefaultsForHTTPBasicAuthCommand.class, "WsdlServiceURL", null); //OK
- registry.addMapping(AxisClientDefaultingCommand.class, "WebServicesParser", DefaultsForHTTPBasicAuthCommand.class); //OK
- registry.addMapping(AxisClientDefaultingCommand.class, "CustomizeClientMappings", MappingFragment.class );
- //registry.addMapping(AxisClientDefaultingCommand.class,
- // "ServiceProject",
- // CreateWebProjectCommand.class);
- //registry.addMapping(AxisClientDefaultingCommand.class,
- // "EJBProjectName",
- // CreateWebProjectCommand.class);
- // CopyAxisJarCommand()
- registry.addMapping(AxisClientDefaultingCommand.class, "ClientProject", CopyAxisJarCommand.class, "Project", null);
- // AddJarsToProjectBuildPathTask()
- registry.addMapping(AxisClientDefaultingCommand.class, "ClientProject", AddJarsToProjectBuildPathTask.class, "Project", null);
- // DefaultsForClientJavaWSDLCommand() // javaParam_, model_
- registry.addMapping(AxisClientDefaultingCommand.class, "JavaWSDLParam", DefaultsForClientJavaWSDLCommand.class);
- registry.addMapping(AxisClientDefaultingCommand.class, "ClientProject", DefaultsForClientJavaWSDLCommand.class, "ProxyProject",
- null);
- // registry.addMapping(AxisClientDefaultingCommand.class, "WsdlURL",
- // DefaultsForClientJavaWSDLCommand.class,"WSDLServicePathname",null);
- // //
- // URL to URL??
- registry.addMapping(AxisClientDefaultingCommand.class, "WsdlURL", DefaultsForClientJavaWSDLCommand.class, "WSDLServiceURL", null); // URI
- // to
- // URL??
- // ValidateWSDLCommand()
- registry.addMapping(AxisClientDefaultingCommand.class, "JavaWSDLParam", ValidateWSDLCommand.class);
- registry.addMapping(AxisClientDefaultingCommand.class, "WsdlServiceURL", ValidateWSDLCommand.class);
- registry.addMapping(AxisClientDefaultingCommand.class, "WebServicesParser", ValidateWSDLCommand.class);
- // WSDL2JavaCommand() // javaParam_
- registry.addMapping(AxisClientDefaultingCommand.class, "JavaWSDLParam", WSDL2JavaCommand.class);
- registry.addMapping(AxisClientDefaultingCommand.class, "WsdlURL", WSDL2JavaCommand.class, "WsdlURI", null); // URL
- // to
- // URI??
- // RefreshProjectCommand()
- registry.addMapping(AxisClientDefaultingCommand.class, "ClientProject", RefreshProjectCommand.class, "Project", null);
- // Stub2BeanCommand()
- registry.addMapping(AxisClientDefaultingCommand.class, "JavaWSDLParam", Stub2BeanCommand.class);
- registry.addMapping(AxisClientDefaultingCommand.class, "WebServicesParser", Stub2BeanCommand.class);
- registry.addMapping(AxisClientDefaultingCommand.class, "ClientProject", Stub2BeanCommand.class);
- // BuildProjectCommand()
- registry.addMapping(AxisClientDefaultingCommand.class, "ClientProject", BuildProjectCommand.class, "Project", null);
- registry.addMapping(AxisClientDefaultingCommand.class, "ForceBuild", BuildProjectCommand.class);
- registry.addMapping(AxisClientDefaultingCommand.class, "ValidationManager", BuildProjectCommand.class);
- registry.addMapping(Stub2BeanCommand.class, "ProxyBean", ClientExtensionOutputCommand.class, "ProxyBean", null);
- registry.addMapping(AxisClientDefaultingCommand.class, "GenerateProxy", AxisClientCommandsFragment.class);
- registry.addMapping(AxisClientDefaultingCommand.class, "GenerateProxy", ClientExtensionOutputCommand.class);
- registry.addMapping(AxisClientDefaultingCommand.class, "SetEndpointMethod", ClientExtensionOutputCommand.class);
- }
-
- public class MappingFragment extends BooleanFragment {
-
- private boolean showMappings_;
- public MappingFragment() {
-
- super();
- setTrueFragment(new SimpleFragment("AxisClientBeanMapping"));
- setCondition(new Condition() {
-
- public boolean evaluate() {
-
- return showMappings_;
- }
- });
- }
- public void setCustomizeClientMappings(boolean showMappings) {
-
- showMappings_ = showMappings;
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisMappingsFragment.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisMappingsFragment.java
deleted file mode 100644
index ff4a66c..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisMappingsFragment.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.widgets;
-
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-
-
-public class AxisMappingsFragment extends BooleanFragment
-{
- private boolean showMappings_;
-
- public AxisMappingsFragment()
- {
- super();
- setTrueFragment( new SimpleFragment( "AxisMappingsWidget" ));
- setCondition( new Condition()
- {
- public boolean evaluate()
- {
- return showMappings_;
- }
- } );
- }
-
- public void setShowMapping( boolean showMappings )
- {
- showMappings_ = showMappings;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisMappingsWidget.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisMappingsWidget.java
deleted file mode 100644
index 0213242..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisMappingsWidget.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.widgets;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.TableViewerWidget;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class AxisMappingsWidget extends SimpleWidgetDataContributor
-{
- private String pluginId_ = "org.eclipse.jst.ws.axis.consumption.ui";
-
- private TableViewerWidget mappings_;
-
- private byte mode_;
- private JavaWSDLParameter javaParameter_;
-
- public static final byte MODE_BEAN2XML = (byte)0;
- public static final byte MODE_XML2BEAN = (byte)1;
- public static final byte MODE_XML2PROXY = (byte)2;
- public static final byte MODE_XML2EJB = (byte)3;
- public static final byte MODE_EJB2XML = (byte)4;
-
- private final String DEFAULT_PACKAGE = "default.javapackage";
- private final String DEFAULT_NAMESPACE = "http://default.namespace";
-
- /*CONTEXT_ID PWJM0001 for the WSDL to Java Mappings Page*/
- private String INFOPOP_PWJM_PAGE = "PWJM0001"; //$NON-NLS-1$
-
- public AxisMappingsWidget( byte mode )
- {
- mode_ = mode;
- }
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- UIUtils uiUtils = new UIUtils(msgUtils, pluginId_ );
-
- // TODO The TOOLTIP_PWJM_PAGE key doesn't seem to exist anywhere???
- //parent.setToolTipText( msgUtils.getMessage( "TOOLTIP_PWJM_PAGE" ) );
- WorkbenchHelp.setHelp( parent, pluginId_ + "." + INFOPOP_PWJM_PAGE );
-
- // TODO No tooltip or infopop for this group.
- Group mappingGroup = uiUtils.createGroup( parent, "LABEL_MAPPING_PAIRS", null, null );
-
- List initValues = new ArrayList();
-
- if( mode_ == MODE_BEAN2XML || mode_ == MODE_EJB2XML)
- {
- String[] columns = { msgUtils.getMessage("TABLE_COLUMN_LABEL_PACKAGE"),
- msgUtils.getMessage("TABLE_COLUMN_LABEL_NAMESPACE" )};
- mappings_ = new TableViewerWidget( columns, initValues, new String[] {DEFAULT_PACKAGE, DEFAULT_NAMESPACE}, TableViewerWidget.MAP_ONE_TO_ONE); //$NON-NLS-1$
- }
- else
- {
- String[] columns = { msgUtils.getMessage("TABLE_COLUMN_LABEL_NAMESPACE"),
- msgUtils.getMessage("TABLE_COLUMN_LABEL_PACKAGE")};
- mappings_ = new TableViewerWidget( columns, initValues, new String[] {DEFAULT_NAMESPACE, DEFAULT_PACKAGE }, TableViewerWidget.MAP_MANY_TO_ONE); //$NON-NLS-1$
- }
-
- mappings_.addControls( mappingGroup, statusListener );
-
- return this;
- }
-
- public Status getStatus()
- {
- return mappings_.getStatus();
- }
-
- public void setJavaParameter( JavaWSDLParameter parameter )
- {
- javaParameter_ = parameter;
- }
-
- public JavaWSDLParameter getJavaParameter()
- {
- if( mode_ == MODE_BEAN2XML || mode_ == MODE_EJB2XML || mode_ == MODE_XML2BEAN || mode_ == MODE_XML2PROXY)
- {
- //Set the mappings on javaParameter
- TableItem[] pairs = mappings_.getItems();
- HashMap map = new HashMap();
- for (int i=0; i<pairs.length; i++)
- {
- map.put(pairs[i].getText(0),pairs[i].getText(1));
- }
- javaParameter_.setMappings(map);
-
- //Set the namespace on the javaParameter
- String beanName = javaParameter_.getBeanName();
- if(beanName != null && !beanName.equals(""))
- {
- String packageName = beanName.substring(0, beanName.lastIndexOf('.'));
- if(map.containsKey(packageName))
- {
- String tns = (String)map.get(packageName);
- javaParameter_.setNamespace(tns);
- }
- }
-
- }
- return javaParameter_;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisProxyWidget.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisProxyWidget.java
deleted file mode 100644
index 34e5f78..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/AxisProxyWidget.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.widgets;
-
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class AxisProxyWidget extends SimpleWidgetDataContributor
-{
- private String pluginId_ = "org.eclipse.jst.ws.axis.consumption.ui";
-
- /*CONTEXT_ID PWJB0001 for the WSDL to Java Bindings Page*/
- private final String INFOPOP_PWJB_PAGE = "PWJB0001"; //$NON-NLS-1$
- private final String TOOLTIP_PWJB_PAGE = "TOOLTIP_PWJB_PAGE";
-
- private Text folderText_;
- /*CONTEXT_ID PWJB0003 for the Folder field of the WSDL to Java Bindings Page*/
- private final String INFOPOP_PWJB_TEXT_FOLDER = "PWJB0003"; //$NON-NLS-1$
- private final String TOOLTIP_PWJB_TEXT_FOLDER = "TOOLTIP_PWJB_TEXT_FOLDER";
-
- private Button genProxyCheckbox_;
- /*CONTEXT_ID PWJB0009 Indicates whether to generate a proxy or not. */
- private final String INFOPOP_PWJB_CHECKBOX_GENPROXY = "PWJB0009"; //$NON-NLS-1$
- private final String TOOLTIP_PWJB_CHECKBOX_GENPROXY = "TOOLTIP_PWJB_CHECKBOX_GENPROXY";
-
- private Button showMappingsCheckbox_;
- /*CONTEXT_ID PWJB0016 for the Show Mappings checkbox of the Bean Methods Page*/
- private String INFOPOP_N2P_SHOW_MAPPINGS = "PWJB0016"; //$NON-NLS-1$
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- UIUtils uiUtils = new UIUtils(msgUtils, pluginId_ );
-
- parent.setToolTipText( msgUtils.getMessage( TOOLTIP_PWJB_PAGE ) );
- WorkbenchHelp.setHelp( parent, pluginId_ + "." + INFOPOP_PWJB_PAGE);
-
- genProxyCheckbox_ = uiUtils.createCheckbox( parent, "CHECKBOX_GENPROXY",
- TOOLTIP_PWJB_CHECKBOX_GENPROXY,
- INFOPOP_PWJB_CHECKBOX_GENPROXY );
- genProxyCheckbox_.addListener( SWT.Selection, statusListener );
-
- genProxyCheckbox_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleGenProxy();
- }
- });
-
- Composite textGroup = uiUtils.createComposite( parent, 2, 5, 0 );
-
- folderText_ = uiUtils.createText( textGroup, "LABEL_FOLDER_NAME",
- TOOLTIP_PWJB_TEXT_FOLDER,
- INFOPOP_PWJB_TEXT_FOLDER,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
- folderText_.addListener( SWT.Modify, statusListener );
-
- showMappingsCheckbox_ = uiUtils.createCheckbox( parent, "LABEL_EXPLORE_MAPPINGS_XML2BEAN",
- "TOOLTIP_N2P_SHOW_MAPPINGS",
- INFOPOP_N2P_SHOW_MAPPINGS );
- // Since this widget affects whether the next page is shown or not we
- // need to add the statusListener.
- showMappingsCheckbox_.addListener( SWT.Selection, statusListener );
-
- return this;
- }
-
- private void handleGenProxy()
- {
- boolean enabled = genProxyCheckbox_.getSelection();
-
- folderText_.setEnabled( enabled );
- showMappingsCheckbox_.setEnabled( enabled );
- }
-
- public void setProxyFolder( String proxyFolder )
- {
- folderText_.setText( proxyFolder );
- }
-
- public String getProxyFolder()
- {
- return folderText_.getText();
- }
-
- public void setGenerateProxy( Boolean genProxy )
- {
- genProxyCheckbox_.setSelection( genProxy.booleanValue() );
- }
-
- public Boolean getGenerateProxy()
- {
- return new Boolean( genProxyCheckbox_.getSelection() );
- }
-
- public void setCustomizeClientMappings( boolean showMappings )
- {
- showMappingsCheckbox_.setSelection( showMappings );
- }
-
- public boolean getCustomizeClientMappings()
- {
- return showMappingsCheckbox_.getSelection() && genProxyCheckbox_.getSelection();
- }
-
- public void setIsClientScenario( boolean isClientScenario )
- {
- genProxyCheckbox_.setEnabled( !isClientScenario );
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/DefaultsForClient.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/DefaultsForClient.java
deleted file mode 100644
index a119734..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/widgets/DefaultsForClient.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.widgets;
-
-import org.eclipse.wst.command.env.core.SimpleCommand;
-
-public class DefaultsForClient extends SimpleCommand
-{
- private boolean customizeMappings_ = true;
-
- public boolean getCustomizeClientMappings()
- {
- return customizeMappings_;
- }
-
- public void setCustomizeClientMappings( boolean value )
- {
- customizeMappings_ = value;
- }
-
- public String getProxyFolder()
- {
- return "/proxyproject/myfolder";
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/wizard/client/WebServiceClientAxisType.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/wizard/client/WebServiceClientAxisType.java
deleted file mode 100644
index 3afaec2..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/wizard/client/WebServiceClientAxisType.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.wizard.client;
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.command.AxisClientDefaultingCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.command.DefaultsForClientJavaWSDLCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.DefaultsForHTTPBasicAuthCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.Stub2BeanCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.ValidateWSDLCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.widgets.AxisClientCommandsFragment;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.widgets.AxisClientFragment;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.widgets.AxisMappingsWidget;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.widgets.AxisProxyWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionOutputCommand;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-/**
- * Developers who are adding web service clients into the wizard should create
- * a class that implements this interface.
-**/
-public class WebServiceClientAxisType implements CommandWidgetBinding
-{
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- // AxisClientDefaultingCommand
- dataRegistry.addMapping( AxisClientDefaultingCommand.class, "CustomizeClientMappings", AxisProxyWidget.class );
- dataRegistry.addMapping( AxisClientDefaultingCommand.class, "ProxyProjectFolder", AxisProxyWidget.class, "ProxyFolder", null );
- dataRegistry.addMapping( AxisClientDefaultingCommand.class, "GenerateProxy", AxisProxyWidget.class);
- dataRegistry.addMapping( AxisClientDefaultingCommand.class, "IsClientScenario", AxisProxyWidget.class);
- dataRegistry.addMapping( AxisClientDefaultingCommand.class, "JavaWSDLParam", AxisMappingsWidget.class, "JavaParameter", null);
-
- // AxisProxyWidget
- dataRegistry.addMapping( AxisProxyWidget.class, "CustomizeClientMappings", AxisClientFragment.MappingFragment.class );
- dataRegistry.addMapping( AxisProxyWidget.class, "GenerateProxy", AxisClientCommandsFragment.class );
- dataRegistry.addMapping( AxisProxyWidget.class, "GenerateProxy", ClientExtensionOutputCommand.class );
-
- //AxisMappingsWidget
- dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", DefaultsForHTTPBasicAuthCommand.class, "JavaWSDLParam", null); //OK
- dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", DefaultsForClientJavaWSDLCommand.class, "JavaWSDLParam", null); //OK
- dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", ValidateWSDLCommand.class, "JavaWSDLParam", null); //OK
- dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", WSDL2JavaCommand.class, "JavaWSDLParam", null); //OK
- dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", Stub2BeanCommand.class, "JavaWSDLParam", null); //OK
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- String axisPluginId_ = "org.eclipse.jst.ws.axis.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- MessageUtils axisMsgUtils = new MessageUtils( axisPluginId_ + ".plugin", this );
-
- widgetRegistry.add( "AxisClientStart",
- axisMsgUtils.getMessage("PAGE_TITLE_WS_AXIS_PROXY"),
- axisMsgUtils.getMessage("PAGE_DESC_WS_AXIS_PROXY"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new AxisProxyWidget();
- }
- } );
-
- widgetRegistry.add( "AxisClientBeanMapping",
- axisMsgUtils.getMessage("PAGE_TITLE_WS_XML2PROXY"),
- msgUtils.getMessage("PAGE_DESC_N2P_MAPPINGS"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new AxisMappingsWidget(AxisMappingsWidget.MODE_XML2PROXY );
- }
- } );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragmentFactoryFactory#create()
- */
- public CommandFragmentFactory create()
- {
- return new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- return new AxisClientFragment();
- }
- };
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/wizard/test/TestWizardPage.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/wizard/test/TestWizardPage.java
deleted file mode 100644
index 7b672e5..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/wizard/test/TestWizardPage.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.wizard.test;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jst.j2ee.internal.webservices.WebServicesClientDataHelper;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.command.AxisClientGenerator;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-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.Text;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-
-/*
- * Add the stuff below to the properties file to make this work.
-#
-#Test only - do not commit
-#
-wsdlURI=wsdlURI
-clientProject=clientProject
-serviceQName=serviceQName
-outputWSDLpath=outputWSDLpath
-GO=GO
-pop1=pop1
-pop2=pop2
-*/
-public class TestWizardPage extends WizardPage
-{
- private String pluginId_= "org.eclipse.jst.ws.axis.consumption.ui";
- private MessageUtils msgUtils_;
-
- private Text wsdlURIText_;
- private Text clientProjectText_;
- private Text serviceQNameText_;
- private Text outputWSDLPathText_;
- private Button goButton_;
- private Button pop1Button_;
- private Button pop2Button_;
-
- public TestWizardPage(String name)
- {
- super(name);
- setTitle("Test Page");
- setDescription("Test page description");
- }
-
- public void createControl(Composite parent)
- {
- Composite page = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout();
- page.setLayout(gl);
- GridData gd = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
- page.setLayoutData(gd);
- page.setSize(500,500);
-
-
- //Composite outerGroup_ = new Composite(page,SWT.H_SCROLL | SWT.V_SCROLL);
- Composite outerGroup_ = new Composite(page,SWT.NONE);
- GridLayout gl2 = new GridLayout();
- gl2.numColumns = 2;
- gl2.marginHeight = 0;
- gl2.marginWidth = 0;
- outerGroup_.setLayout(gl2);
- //GridData gd2 = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- GridData gd2 = new GridData(GridData.FILL_BOTH);
- outerGroup_.setLayoutData(gd2);
-
- msgUtils_ = new MessageUtils(pluginId_ + ".plugin", this);
- UIUtils uiUtils = new UIUtils(msgUtils_, pluginId_);
-
- wsdlURIText_ = uiUtils.createText(outerGroup_,"wsdlURI","wsdlURI","wsdlURI",SWT.SINGLE|SWT.BORDER);
- clientProjectText_ = uiUtils.createText(outerGroup_,"clientProject","clientProject","clientProject",SWT.SINGLE|SWT.BORDER);
- serviceQNameText_ = uiUtils.createText(outerGroup_,"serviceQName","serviceQName","",SWT.SINGLE|SWT.BORDER);
- outputWSDLPathText_ = uiUtils.createText(outerGroup_,"outputWSDLpath","outputWSDLpath","",SWT.SINGLE|SWT.BORDER);
- goButton_ = uiUtils.createButton(SWT.PUSH,outerGroup_,"GO","GO","");
- goButton_.addSelectionListener(new SelectionListener()
- {
- public void widgetSelected(SelectionEvent e)
- {
- handleGOPushed();
- }
- public void widgetDefaultSelected(SelectionEvent e)
- {
- handleGOPushed();
- }
- });
- pop1Button_ = uiUtils.createButton(SWT.PUSH,outerGroup_,"pop1","pop1","");
- pop1Button_.addSelectionListener(new SelectionListener()
- {
- public void widgetSelected(SelectionEvent e)
- {
- handlePop1Pushed();
- }
- public void widgetDefaultSelected(SelectionEvent e)
- {
- handlePop1Pushed();
- }
- });
- pop2Button_ = uiUtils.createButton(SWT.PUSH,outerGroup_,"pop2","pop2","");
- pop2Button_.addSelectionListener(new SelectionListener()
- {
- public void widgetSelected(SelectionEvent e)
- {
- handlePop2Pushed();
- }
- public void widgetDefaultSelected(SelectionEvent e)
- {
- handlePop2Pushed();
- }
- });
-
- setControl(page);
- }
-
- private void handlePop1Pushed()
- {
- wsdlURIText_.setText("http://www.xmethods.net/sd/2001/TemperatureService.wsdl");
- clientProjectText_.setText("cwp");
- serviceQNameText_.setText("http://www.xmethods.net/sd/TemperatureService.wsdl:TemperatureService");
- outputWSDLPathText_.setText("/cwp/Web Content/WEB-INF/wsdl/TemperatureService.wsdl");
- }
-
- private void handlePop2Pushed()
- {
- wsdlURIText_.setText("file:/D:/Eclipse/eclipse/runtime-workspace_t1/wp2/Web Content/Converters.wsdl");
- clientProjectText_.setText("cwp2");
- serviceQNameText_.setText("http://sample.converters:ConvertDistanceService");
- outputWSDLPathText_.setText("/cwp2/Web Content/WEB-INF/wsdl/Converters.wsdl");
- }
-
- private void handleGOPushed()
- {
- AxisClientGenerator generator = new AxisClientGenerator();
- TestWSCDataHelper dataModel = new TestWSCDataHelper();
- dataModel.populate(wsdlURIText_.getText(), serviceQNameText_.getText(), clientProjectText_.getText(), outputWSDLPathText_.getText(),false);
-
- generator.genWebServiceClientArtifacts(dataModel);
- System.out.println("Generated service interface= "+dataModel.getServiceInterfaceName());
- String[] seis = dataModel.getServiceEndpointInterfaceNames();
- System.out.println("Generated service endpoint interfaces:");
- for (int i=0;i<seis.length;i++)
- {
- System.out.println(seis[i]);
- }
- System.out.println("Touched descriptors? "+dataModel.shouldGenDescriptors());
- }
-
- private class TestWSCDataHelper implements WebServicesClientDataHelper
- {
- private String wsdlUrl_;
- private String serviceQName_;
- private String projectName_;
- private String outputWSDLFileName_;
- private String serviceInterfaceName_;
- private String[] serviceEndpointInterfaceNames_;
- private boolean shouldDeploy_;
- private boolean shouldGenDescriptors_;
-
- public void populate(String wsdlURL, String serviceQName, String projectName, String outputWSDLFileName, boolean shouldDeploy)
- {
- wsdlUrl_ = wsdlURL;
- serviceQName_ = serviceQName;
- projectName_ = projectName;
- outputWSDLFileName_ = outputWSDLFileName;
- shouldDeploy_ = shouldDeploy;
- }
- /**
- * @return the URL for the associated original WSDL file referenced by the client
- */
- public String getWSDLUrl()
- {
- return wsdlUrl_;
- }
-
- /**
- * @return the QName for the associated web service for the client
- */
- public String getServiceQName()
- {
- return serviceQName_;
- }
-
- /**
- * @return the name of the target project for the web service client
- */
- public String getProjectName()
- {
- return projectName_;
- }
-
- /**
- * @return the fileName location for the copied WSDL file into the client project
- */
- public String getOutputWSDLFileName()
- {
- return outputWSDLFileName_;
- }
-
- /**
- * @return the qualified classname of the generated Service Interface
- */
- public String getServiceInterfaceName()
- {
- return serviceInterfaceName_;
- }
-
- /**
- * @return the qualified classname of the generated Service Endpoint Interface
- */
- public String[] getServiceEndpointInterfaceNames()
- {
- return serviceEndpointInterfaceNames_;
- }
-
- /**
- * @return should generate code for deployment?
- */
- public boolean shouldDeploy()
- {
- return shouldDeploy_;
- }
-
- /**
- * @return whether the extension generated the descriptors or not
- */
- public boolean shouldGenDescriptors()
- {
- return shouldGenDescriptors_;
- }
-
- /**
- * Set the SI classname for the web service client
- */
- public void setServiceInterfaceName(String name)
- {
- serviceInterfaceName_ = name;
- }
-
- /**
- * Set the SEI classnames for the web service client
- */
- public void setServiceEndpointInterfaceNames(String[] names)
- {
- serviceEndpointInterfaceNames_ = names;
- }
-
- /**
- * Set whether descriptors were generated
- */
- public void setDidGenDescriptors(boolean b)
- {
- shouldGenDescriptors_ = b;
- }
-
- /**
- * This method will invoke any operations required to set up web services client, SI, and SEI
- */
- public void genWebServiceClientArtifacts(WebServicesClientDataHelper dataModel)
- {
- // Do nothing. This shouldn't be on the interface!
- }
-
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/wizard/test/WebServiceTestWizard.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/wizard/test/WebServiceTestWizard.java
deleted file mode 100644
index 551c8d2..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/wizard/test/WebServiceTestWizard.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.ui.wizard.test;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-
-public class WebServiceTestWizard extends Wizard implements INewWizard
-{
-
- public WebServiceTestWizard()
- {
- super();
-
- TestWizardPage page = new TestWizardPage("Test page");
- }
-
-
-
- /**
- * Initializes this "New" wizard.
- * @param workbench The workbench that launched this wizard.
- * @param selection The selection context of this wizard.
- * @return This wizard.
- */
- public void init ( IWorkbench workbench, IStructuredSelection selection )
- {
- //Do nothing
- }
-
-
- public void addPages()
- {
-
- TestWizardPage page = new TestWizardPage("Test page");
- addPage(page);
- }
-
- public boolean performFinish()
- {
- //Always allow finish
- return true;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/util/ClasspathUtils.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/util/ClasspathUtils.java
deleted file mode 100644
index b36679b..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/util/ClasspathUtils.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.util;
-
-
-import java.io.File;
-import java.net.URL;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
-import org.eclipse.jst.j2ee.internal.earcreation.IEARNatureConstants;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-
-public class ClasspathUtils {
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2003."; //$NON-NLS-1$
-
- private static ClasspathUtils instance_; //$NON-NLS-1$
- private static String DIR_CLASSES = "classes"; //$NON-NLS-1$
- private static String DIR_LIB = "lib"; //$NON-NLS-1$
- private static String DOT_JAR = ".jar"; //$NON-NLS-1$
-
- private ClasspathUtils() {
- }
-
- public static ClasspathUtils getInstance() {
- if (instance_ == null)
- instance_ = new ClasspathUtils();
- return instance_;
- }
-
- public String getClasspathString(IProject project) {
- StringBuffer classpath = new StringBuffer();
- String[] classpathEntries = getClasspath(project, false);
- Vector classpathVector = new Vector();
- for (int i = 0; i < classpathEntries.length; i++) {
- if (!classpathVector.contains(classpathEntries[i])) {
- classpathVector.add(classpathEntries[i]);
- classpath.append(classpathEntries[i]);
- classpath.append(";"); //$NON-NLS-1$
- }
- }
- return classpath.toString();
- }
-
- public URL[] getClasspathURL(IProject project) {
- String[] classpathEntries = getClasspath(project, false);
- Vector classpathVector = new Vector();
- for (int i = 0; i < classpathEntries.length; i++) {
- try {
- File file = new File(classpathEntries[i]);
- // System.out.println("adding project CP["+i+"] = "+file);
- URL url = file.toURL();
- if (!classpathVector.contains(url))
- classpathVector.add(url);
- } catch (Throwable t) {
- }
- }
- addLibClassspath(classpathVector);
- // add the plugin lib directory jars to classpath
- URL[] classpath = new URL[classpathVector.size()];
- classpathVector.copyInto(classpath);
- return classpath;
- }
-
- private void addLibClassspath(Vector classpathVector) {
- }
-
- private String[] getClasspath(IProject project, boolean isDependent) {
- try {
- String[] classpath;
- EARNatureRuntime earProject = castToEARProject(project);
- if (earProject != null)
- return getClasspathForEARProject(earProject);
- else if (project.hasNature(IWebNatureConstants.J2EE_NATURE_ID))
- return getClasspathForWebProject(
- (J2EEWebNatureRuntime) project.getNature(
- IWebNatureConstants.J2EE_NATURE_ID),
- isDependent);
- else if (project.hasNature(JavaCore.NATURE_ID))
- return getClasspathForJavaProject(
- (IJavaProject) project.getNature(JavaCore.NATURE_ID));
- else
- return new String[0];
- } catch (CoreException ce) {
- return new String[0];
- }
- }
-
- private EARNatureRuntime castToEARProject(IProject project) {
- try {
- String[] earNatures = IEARNatureConstants.NATURE_IDS;
- for (int i = 0; i < earNatures.length; i++) {
- if (project.hasNature(earNatures[i]))
- return (EARNatureRuntime) project.getNature(earNatures[i]);
- }
- return null;
- } catch (CoreException ce) {
- return null;
- }
- }
-
- private String[] getClasspathForEARProject(EARNatureRuntime earProject) {
- IPath earPath =
- earProject.getProject().getLocation().addTrailingSeparator();
- return getDirectoryJarFiles(earPath);
- }
-
- private String[] getDirectoryJarFiles(IPath iPath) {
- File dir = iPath.toFile();
- Vector jarsVector = new Vector();
- if (dir.exists() && dir.isDirectory()) {
- String[] filenames = dir.list();
- for (int i = 0; i < filenames.length; i++) {
- if (filenames[i].endsWith(DOT_JAR))
- jarsVector.add(path2String(iPath) + filenames[i]);
- }
- }
- String[] jars = new String[jarsVector.size()];
- jarsVector.copyInto(jars);
- return jars;
- }
-
- private String[] getClasspathForWebProject(
- J2EEWebNatureRuntime webProject,
- boolean isDependent) {
- String[] webinfClasses = getWEBINFClasses(webProject);
- String[] webinfLib;
- String[] javaClasspath;
- if (isDependent) {
- webinfLib = new String[0];
- javaClasspath = new String[0];
- } else {
- webinfLib = getWEBINFLib(webProject);
- javaClasspath =
- getClasspathForJavaProject(webProject.getJ2EEJavaProject());
- }
- String[] webClasspath =
- new String[webinfClasses.length
- + webinfLib.length
- + javaClasspath.length];
- int index = 0;
- for (int i = 0; i < webinfClasses.length; i++) {
- webClasspath[index] = webinfClasses[i];
- index++;
- }
- for (int i = 0; i < webinfLib.length; i++) {
- webClasspath[index] = webinfLib[i];
- index++;
- }
- for (int i = 0; i < javaClasspath.length; i++) {
- webClasspath[index] = javaClasspath[i];
- index++;
- }
- return webClasspath;
- }
-
- private String[] getWEBINFClasses(J2EEWebNatureRuntime webProject) {
- IPath webinf =
- webProject
- .getProject()
- .getLocation()
- .addTrailingSeparator()
- .append(
- webProject.getWEBINFPath());
- IPath classes =
- ((IPath) webinf.clone()).addTrailingSeparator().append(DIR_CLASSES);
- return new String[] { path2String(classes)};
- }
-
- private String[] getWEBINFLib(J2EEWebNatureRuntime webProject) {
- IPath webinf =
- webProject
- .getProject()
- .getLocation()
- .addTrailingSeparator()
- .append(
- webProject.getWEBINFPath());
- IPath lib =
- ((IPath) webinf.clone())
- .addTrailingSeparator()
- .append(DIR_LIB)
- .addTrailingSeparator();
- return getDirectoryJarFiles(lib);
- }
-
- private String[] getClasspathForJavaProject(IJavaProject javaProject) {
- String[] javaBuildPath;
- try {
- IClasspathEntry[] buildPath =
- javaProject.getResolvedClasspath(true);
- Vector v = new Vector();
- for (int i = 0; i < buildPath.length; i++) {
- String[] buildPathString =
- classpathEntry2String(
- buildPath[i],
- javaProject.getProject());
- for (int j = 0; j < buildPathString.length; j++) {
- v.add(buildPathString[j]);
- }
- }
- javaBuildPath = new String[v.size()];
- v.copyInto(javaBuildPath);
- } catch (JavaModelException jme) {
- javaBuildPath = new String[0];
- }
-
- String[] earClasspath;
- Vector utilityJarsVector = new Vector();
- IProject project = javaProject.getProject();
- IProject[] referencingProjects = project.getReferencingProjects();
- for (int i = 0; i < referencingProjects.length; i++) {
- EARNatureRuntime earProject =
- castToEARProject(referencingProjects[i]);
- if (earProject != null) {
- String[] utilityJars = getClasspathForEARProject(earProject);
- for (int j = 0; j < utilityJars.length; j++) {
- utilityJarsVector.add(utilityJars[j]);
- }
- }
- }
- earClasspath = new String[utilityJarsVector.size()];
- utilityJarsVector.copyInto(earClasspath);
-
- String[] javaClasspath =
- new String[javaBuildPath.length + earClasspath.length];
- int index = 0;
- for (int i = 0; i < javaBuildPath.length; i++) {
- javaClasspath[index] = javaBuildPath[i];
- index++;
- }
- for (int i = 0; i < earClasspath.length; i++) {
- javaClasspath[index] = earClasspath[i];
- index++;
- }
- return javaClasspath;
- }
-
- private String[] classpathEntry2String(
- IClasspathEntry entry,
- IProject project) {
- switch (entry.getEntryKind()) {
- case IClasspathEntry.CPE_LIBRARY :
- return new String[] { path2String(entry.getPath())};
- case IClasspathEntry.CPE_PROJECT :
- return getClasspath(
- ResourcesPlugin.getWorkspace().getRoot().getProject(
- entry.getPath().lastSegment()),
- true);
- case IClasspathEntry.CPE_SOURCE :
- {
- IPath path = entry.getPath();
- if (path.segment(0).equals(project.getName()))
- path = path.removeFirstSegments(1);
- return new String[] {
- path2String(
- project
- .getLocation()
- .addTrailingSeparator()
- .append(
- path))};
- }
- case IClasspathEntry.CPE_VARIABLE :
- return classpathEntry2String(
- JavaCore.getResolvedClasspathEntry(entry),
- project);
- default :
- return new String[] { path2String(entry.getPath())};
- }
- }
-
- private String path2String(IPath path) {
- return path.toOSString();
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/util/FileUtil.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/util/FileUtil.java
deleted file mode 100644
index add9b0c..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/util/FileUtil.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.util;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-public class FileUtil
-{
- public FileUtil()
- {
- super();
- }
-
- public static void copyFile(String src, String dest)
- {
- InputStream is = null;
- FileOutputStream fos = null;
- try
- {
- is = new FileInputStream(src);
- byte buff[] = new byte[1024];
- fos = new FileOutputStream(dest);
- int c = 0;
- byte[] array = new byte[1024];
- while ((c = is.read(array)) >= 0)
- {
- fos.write(array, 0, c);
- }
- }
- catch (Exception e)
- {
- }
- finally
- {
- try
- {
- fos.close();
- is.close();
- }
- catch (Exception e)
- {
- }
- }
- }
-
- public static File createFileAndParentDirectories(String fileName) throws Exception
- {
- File file = new File(fileName);
- File parent = file.getParentFile();
- if (!parent.exists())
- {
- parent.mkdirs();
- }
- file.createNewFile();
- return file;
- }
-
- public static void deleteDirectories(File dir) throws Exception
- {
- File[] children = dir.listFiles();
- for (int i = 0; i < children.length; i++)
- {
- if (children[i].list() != null && children[i].list().length > 0)
- {
- deleteDirectories(children[i]);
- }
- else
- {
- children[i].delete();
- }
- }
- dir.delete();
- }
-
- /**
- * Creates a folder and all parent folders if not existing Project must exist
- */
- public static void createFolder(IFolder folder, boolean force, boolean local) throws CoreException
- {
- if (!folder.exists())
- {
- IContainer parent = folder.getParent();
- if (parent instanceof IFolder)
- {
- createFolder((IFolder)parent, force, local);
- }
- folder.create(force, local, new NullProgressMonitor());
- }
- }
-
- public static void createTargetFile(String sourceFileName, String targetFileName) throws Exception
- {
- createTargetFile(sourceFileName, targetFileName, false);
- }
-
- public static void createTargetFile(String sourceFileName, String targetFileName, boolean overwrite) throws Exception
- {
- File idealResultFile = new File(targetFileName);
- if (overwrite || !idealResultFile.exists())
- {
- FileUtil.createFileAndParentDirectories(targetFileName);
- FileUtil.copyFile(sourceFileName, targetFileName);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/util/PlatformUtils.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/util/PlatformUtils.java
deleted file mode 100644
index 9911e21..0000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/util/PlatformUtils.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.util;
-
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-
-public class PlatformUtils {
-
- public static final String PLATFORM_ROOT = "platform:/resource";
- public static final String WIN_FILE_PROTOCOL = "file:/";
- public static final String LNX_FILE_PROTOCOL = "file://";
- public static final String PLATFORM = "platform";
- public static final String RESOURCE = "/resource";
-
- private PlatformUtils() {
- }
-
- /**
- * Returns the string representation of platform URL given an IPath
- * @param IPath path
- * @return String platformURL
- */
- public static String getPlatformURL(IPath path) {
- String platformURL;
- platformURL = URI.createPlatformResourceURI(path.toString()).toString();
- // old method: file system representation
- // platformURL = ResourcesPlugin.getWorkspace().getRoot().getFile(path).getLocation().toString();
- return platformURL;
- }
-
- /**
- * Returns the URL representation of the Platform URL given an IPath
- * The PlatformResourceManager underdstands this format and therefore
- * this is suited for command URL's
- * @param IPath path
- * @return URL Platform URL
- */
- public static URL getCommandPlatformURL(IPath path) {
- URL url = null;
- try {
- url = new URL(PLATFORM, null, RESOURCE + path.toString());
- } catch (MalformedURLException e) {
- return url;
- }
- return url;
- }
-
- /**
- * Returns the string representation of path given platform URL string
- * @param String platform URL string
- * @return String path string
- */
- public static String getPathFromPlatform(String platformStr) {
- String pathStr = platformStr;
-
- String rootLocation;
- rootLocation = PLATFORM_ROOT;
- // old method: file system representation
- // rootLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
- if (platformStr.startsWith(rootLocation))
- pathStr = platformStr.substring(rootLocation.length());
- return pathStr;
- }
-
- /**
- * Returns the string representation of platform URL given the path string
- * @param String path string
- * @return String platform URL string
- */
- public static String getPlatformFromPath(String pathStr) {
- String platformStr = pathStr;
-
- String rootLocation;
- rootLocation = PLATFORM_ROOT;
- // old method: file system representation
- // rootLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
- platformStr = rootLocation + pathStr;
- return platformStr;
- }
-
- /**
- * Returns the string representation of the local file system file given platform URL string
- * @param String platform URL string
- * @return String file string
- */
- public static String getFileFromPlatform(String platformStr) {
- String fileStr = platformStr;
- String pathStr = getPathFromPlatform(platformStr);
-
- fileStr =
- ResourcesPlugin
- .getWorkspace()
- .getRoot()
- .getFile(new Path(pathStr))
- .getLocation()
- .toString();
-
- // old method: file system representation
- // Do nothing
-
- return fileStr;
- }
-
- /**
- * Returns the file protocol representation of the local file system file given platform URL string
- * @param String platform URL string
- * @return String the file protocol uri
- */
- public static String getFileURLFromPlatform(String platformStr) {
- String fileStr = platformStr;
- String pathStr = getPathFromPlatform(platformStr);
- try {
- fileStr =
- ResourcesPlugin
- .getWorkspace()
- .getRoot()
- .getFile(new Path(pathStr))
- .getLocation()
- .toFile()
- .toURL()
- .toString();
- } catch (MalformedURLException murle) {
- fileStr = getFileURLFromPath(new Path(pathStr));
- }
- return fileStr;
- }
-
- /**
- * Returns the file protocol representation of a local file
- * @param IPath the Path object representing the file
- * @return String the file protocol uri
- */
- public static String getFileURLFromPath(IPath path) {
-
- String file = null;
- if (path != null) {
- if (!path.isAbsolute()) {
- file =
- ResourcesPlugin
- .getWorkspace()
- .getRoot()
- .getFile(path)
- .getLocation()
- .toString();
- if (file.charAt(0) == IPath.SEPARATOR) {
- file = LNX_FILE_PROTOCOL + file;
- } else {
- file = WIN_FILE_PROTOCOL + file;
- }
- } else {
- file = path.toString();
- }
- if (file != null && file.charAt(0) == IPath.SEPARATOR) {
- file = LNX_FILE_PROTOCOL + file;
- } else {
- file = WIN_FILE_PROTOCOL + file;
- }
- }
- return file == null ? null : file;
-
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/.classpath b/bundles/org.eclipse.jst.ws.axis.creation.ui/.classpath
deleted file mode 100644
index 275b34c..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/.cvsignore b/bundles/org.eclipse.jst.ws.axis.creation.ui/.cvsignore
deleted file mode 100644
index 60463af..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-build.xml
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/.project b/bundles/org.eclipse.jst.ws.axis.creation.ui/.project
deleted file mode 100644
index 0a3d1e9..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/.project
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.ws.axis.creation.ui</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.wst.command.env</project>
- <project>org.eclipse.wst.command.env.core</project>
- <project>org.eclipse.jst.ws</project>
- <project>org.eclipse.jst.ws.axis.consumption.core</project>
- <project>org.eclipse.jst.ws.axis.consumption.ui</project>
- <project>org.eclipse.jst.ws.consumption</project>
- <project>org.eclipse.jst.ws.consumption.ui</project>
- <project>org.eclipse.jst.ws.creation.ui</project>
- <project>org.eclipse.jst.ws.discovery.core</project>
- <project>org.eclipse.jst.ws.ui</project>
- <project>org.eclipse.wst.wsdl</project>
- <project>org.eclipse.wst.ws.parser</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/build.properties b/bundles/org.eclipse.jst.ws.axis.creation.ui/build.properties
deleted file mode 100644
index 625980c..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-source.wss-axis-ui.jar = src/
-bin.includes = wss-axis-ui.jar,\
- deploy.xsl,\
- plugin.properties,\
- plugin.xml,\
- readme.html
-src.includes = build.properties,\
- deploy.xsl,\
- plugin.xml,\
- plugin.properties,\
- readme.html,\
- src/
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/deploy.xsl b/bundles/org.eclipse.jst.ws.axis.creation.ui/deploy.xsl
deleted file mode 100644
index 3fdf164..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/deploy.xsl
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0"
- xmlns:xalan="http://xml.apache.org/xslt"
- xmlns:ns1="http://xml.apache.org/axis/wsdd/"
- xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
- <xsl:output method="xml" encoding="UTF-8"/>
-
- <xsl:param name="newClassName" select="ss"/>
-
- <xsl:template match="/ns1:deployment/ns1:service/ns1:parameter[@name='className']">
- <xsl:copy>
- <xsl:attribute name="name">className</xsl:attribute>
- <xsl:attribute name="value">
- <xsl:value-of select="$newClassName"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="@*|node()">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
- </xsl:template>
-</xsl:stylesheet>
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/plugin.properties b/bundles/org.eclipse.jst.ws.axis.creation.ui/plugin.properties
deleted file mode 100644
index 993760d..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/plugin.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Webservice Axis Creation UI
-PLUGIN_PROVIDER=Eclipse.org
-
-LABEL_RUNTIME_AXIS_11=Apache Axis 1.0
-DESC_RUNTIME_AXIS_11=Apache Axis 1.0
-
-#
-#WSWSDLAxisType
-#
-WS_NAME_WSDLAXIS=Skeleton Java bean Axis Web service
-
-#
-#WSBeanAxisType
-#
-WS_NAME_BEANAXIS=Java bean Axis Web service
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/plugin.xml b/bundles/org.eclipse.jst.ws.axis.creation.ui/plugin.xml
deleted file mode 100644
index 6bb9d5b..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/plugin.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id="org.eclipse.jst.ws.axis.creation.ui"
- version="1.0.0"
- name="%PLUGIN_NAME"
- provider-name="%PLUGIN_PROVIDER"
- class="org.eclipse.jst.ws.internal.axis.creation.ui.plugin.WebServiceAxisCreationUIPlugin">
-
- <runtime>
- <library name="wss-axis-ui.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.emf.common"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="org.eclipse.jem"/>
- <import plugin="org.eclipse.jem.workbench"/>
- <import plugin="org.eclipse.wst.ws.parser"/>
- <import plugin="org.eclipse.jst.ws"/>
- <import plugin="org.eclipse.jst.ws.creation.ui"/>
- <import plugin="org.eclipse.jst.ws.consumption.ui"/>
- <import plugin="org.eclipse.jst.ws.consumption"/>
- <import plugin="org.eclipse.jst.ws.ui"/>
- <import plugin="org.eclipse.jst.ws.axis.consumption.core"/>
- <import plugin="org.eclipse.jst.ws.axis.consumption.ui"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="com.ibm.wtp.emf.workbench"/>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <import plugin="org.eclipse.wst.command.env"/>
- <import plugin="org.eclipse.wst.command.env.ui"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.wst.wsdl"/>
- <import plugin="org.eclipse.jst.j2ee"/>
- <import plugin="org.eclipse.jst.j2ee.core"/>
- <import plugin="org.eclipse.jst.j2ee.ejb"/>
- <import plugin="org.eclipse.jst.j2ee.web"/>
- <import plugin="org.eclipse.wst.common.emf"/>
- <import plugin="org.eclipse.wst.common.emfworkbench.integration"/>
- <import plugin="org.eclipse.wst.common.frameworks"/>
- </requires>
-
- <!-- Web Service Server Types -->
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.webServiceServerRuntimeType">
-
- <webServiceRuntime
- label="%LABEL_RUNTIME_AXIS_11"
- description="%DESC_RUNTIME_AXIS_11"
- isDefault="false"
- j2eeversion="13 14"
- id="org.eclipse.jst.ws.runtime.axis11">
- </webServiceRuntime>
-
- <webServiceServer
- factoryId="org.eclipse.jst.server.tomcat.32"
- isDefault="false"
- runtimeTypeIds="org.eclipse.jst.server.tomcat.32.runtime"
- id="SERVER_ID_TOMCAT32_LOCAL">
- </webServiceServer>
-
- <webServiceServer
- factoryId="org.eclipse.jst.server.tomcat.40"
- isDefault="false"
- runtimeTypeIds="org.eclipse.jst.server.tomcat.40.runtime"
- id="SERVER_ID_TOMCAT40_LOCAL">
- </webServiceServer>
-
- <webServiceServer
- factoryId="org.eclipse.jst.server.tomcat.41"
- isDefault="false"
- runtimeTypeIds="org.eclipse.jst.server.tomcat.41.runtime"
- id="SERVER_ID_TOMCAT41_LOCAL">
- </webServiceServer>
-
- <webServiceServer
- factoryId="org.eclipse.jst.server.tomcat.50"
- isDefault="false"
- runtimeTypeIds="org.eclipse.jst.server.tomcat.50.runtime"
- id="SERVER_ID_TOMCAT50_LOCAL">
- </webServiceServer>
-
- <webServiceServerRuntimeType
- requireEJBModule="false"
- requireWebModule="true"
- name="%WS_NAME_BEANAXIS"
- type="org.eclipse.jst.ws.type.java"
- runtime="org.eclipse.jst.ws.runtime.axis11"
- assemblyBinding="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.beans.WSBeanAxisType"
- server="SERVER_ID_TOMCAT50_LOCAL"
- id="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.beans.WSBeanAxisType.TOMCAT50LOCAL">
- </webServiceServerRuntimeType>
-
- <webServiceServerRuntimeType
- requireEJBModule="false"
- requireWebModule="true"
- name="%WS_NAME_WSDLAXIS"
- type="org.eclipse.jst.ws.type.wsdl"
- runtime="org.eclipse.jst.ws.runtime.axis11"
- assemblyBinding="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.wsdl.WSWSDLAxisType"
- server="SERVER_ID_TOMCAT50_LOCAL"
- id="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.wsdl.WSWSDLAxisType.TOMCAT50LOCAL">
- </webServiceServerRuntimeType>
-
- <webServiceServerRuntimeType
- requireEJBModule="false"
- requireWebModule="true"
- name="%WS_NAME_BEANAXIS"
- type="org.eclipse.jst.ws.type.java"
- runtime="org.eclipse.jst.ws.runtime.axis11"
- assemblyBinding="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.beans.WSBeanAxisType"
- server="SERVER_ID_TOMCAT41_LOCAL"
- id="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.beans.WSBeanAxisType.TOMCAT41LOCAL">
- </webServiceServerRuntimeType>
-
- <webServiceServerRuntimeType
- requireEJBModule="false"
- requireWebModule="true"
- name="%WS_NAME_WSDLAXIS"
- type="org.eclipse.jst.ws.type.wsdl"
- runtime="org.eclipse.jst.ws.runtime.axis11"
- assemblyBinding="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.wsdl.WSWSDLAxisType"
- server="SERVER_ID_TOMCAT41_LOCAL"
- id="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.wsdl.WSWSDLAxisType.TOMCAT41LOCAL">
- </webServiceServerRuntimeType>
-
- <webServiceServerRuntimeType
- requireEJBModule="false"
- requireWebModule="true"
- name="%WS_NAME_BEANAXIS"
- type="org.eclipse.jst.ws.type.java"
- runtime="org.eclipse.jst.ws.runtime.axis11"
- assemblyBinding="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.beans.WSBeanAxisType"
- server="SERVER_ID_TOMCAT40_LOCAL"
- id="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.beans.WSBeanAxisType.TOMCAT40LOCAL">
- </webServiceServerRuntimeType>
-
- <webServiceServerRuntimeType
- requireEJBModule="false"
- requireWebModule="true"
- name="%WS_NAME_WSDLAXIS"
- type="org.eclipse.jst.ws.type.wsdl"
- runtime="org.eclipse.jst.ws.runtime.axis11"
- assemblyBinding="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.wsdl.WSWSDLAxisType"
- server="SERVER_ID_TOMCAT40_LOCAL"
- id="org.eclipse.jst.ws.internal.axis.creation.ui.wizard.wsdl.WSWSDLAxisType.TOMCAT40LOCAL">
- </webServiceServerRuntimeType>
-
- </extension>
-
- <!-- Server Defaulters -->
-
- <extension point="org.eclipse.jst.ws.consumption.serverDefaulter">
- <serverDefaulter
- class="org.eclipse.jst.ws.internal.axis.creation.ui.command.AxisServerDefaulter">
- </serverDefaulter>
- </extension>
-
-</plugin>
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/axis/creation/ui/plugin.properties b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/axis/creation/ui/plugin.properties
deleted file mode 100644
index 2b2f8c4..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/axis/creation/ui/plugin.properties
+++ /dev/null
@@ -1,160 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-
-#
-# Error messages used in this plugin
-#
-MSG_ERROR_INTERAL=IWAB0512E Internal error
-MSG_ERROR_PROJECT_URL=IWAB0514E Unable to get URL for project {0}
-MSG_ERROR_READ_WSDL=IWAB0516E Error in reading WSDL file {0}
-MSG_ERROR_WSDL_NO_PORT=IWAB0518E WSDL file at {0} has no port element
-MSG_ERROR_CANNOT_NO_JAVA_BEAN=IWAB0015E A Java bean was not selected
-MSG_ERROR_NO_PROJECT=IWAB0016E A project was not selected
-MSG_ERROR_CANNOT_LOAD_JAVA_BEAN=IWAB0017E The Java bean, {0}, cannot be loaded from {1}
-MSG_ERROR_JAVA_MOF_REFLECT_FAILED=IWAB0521E Failed to analyze the Java bean: {0}.
-MSG_ERROR_READ_BEAN=IWAB0522E Error in reading methods from Java bean.
-MSG_ERROR_MOVE_RESOURCE=IWAB0523E Error moving resource
-MSG_ERROR_UPDATE_AXIS_WSDD=IWAB0524E Error updating Axis deploy.wsdd file
-MSG_ERROR_LITERAL_SUPPORT_MESSAGE=IWAB0536E Axis 1.0 support for Document/Literal and Document/Literal (Wrapped) is minimal, thus the generated code may contain errors. RPC/Encoded is the recommended style and encoding selection.
-MSG_ERROR_INITIAL_SELECTION=IWAB0018E Error getting initial selection.
-
-
-#
-#JavaToWSDLMethodCommand
-#
-TASK_LABEL_JAVA_TO_WSDL=Create deployment descriptor document model from Java bean.
-TASK_DESC_JAVA_TO_WSDL=Creating deployment descriptor document model from Java bean.
-MSG_ERROR_JAVA_TO_METHOD=IWAB0019E Error in getting method from Java bean.
-
-#
-#DefaultsForServerJavaWSDLTask
-#
-TASK_LABEL_SERVER_JAVA_WSDL_DEFAULTS=DefaultsForJavaWSDLServer
-TASK_DESC_SERVER_JAVA_WSDL_DEFAULTS=Builds the JavaWSDLParameter for server side.
-
-#
-#UpdateWEBXMLCommand
-#
-TASK_LABEL_UPDATE_WEB_XML=UpdateWEBXMLCommand
-TASK_DESC_UPDATE_WEB_XML=Update project's web.xml file with Axis servlets
-MSG_ERROR_UPDATE_WEB_XML=IWAB0020E Error in adding servlet in web.xml.
-
-#
-#DefaultsForWSDL2SkeletonTask
-#
-
-#
-#MoveDeploymentFilesTask
-#
-TASK_LABEL_MOVE_DEPLOYMENT_FILES=MoveDeploymentFilesTask
-TASK_DESC_MOVE_DEPLOYMENT_FILES=Move deploy.wsdd and undeploy.wsdd from Java Source to Web Content/WEB-INF
-
-#
-#MoveJavaFilesTask
-#
-TASK_LABEL_MOVE_JAVA_FILES=MoveJavaFilesTask
-TASK_DESC_MOVE_JAVA_FILES=Move server side java files
-
-#
-#Skeleton2WSDLTask
-#
-TASK_LABEL_SKELETON_WSDL=DefaultsForSkeleton2WSDLTask
-TASK_DESC_SKELETON_WSDL=Creates WSDL for a Java bean skeleton.
-
-#
-#UpdateAxisWSDDFileTask
-#
-TASK_LABEL_UPDATE_AXIS_WSDD=UpdateAxisWSDDFileTask
-TASK_DESC_UPDATE_AXIS_WSDD=Update Axis deploy.wsdd with actual service implementation class name
-MSG_PLUGIN_FILE_URL=Problem locating plugin file
-
-#
-#WebServiceWSDLAxisSelectionPage
-#
-PAGE_MSG_NO_FILE_SPECIFIED=No file specified.
-PAGE_MSG_NO_METHOD_SELECTED=No methods selected.
-
-#
-#WebServiceSkeletonAxisConfigFragment
-#
-
-#
-#WebServiceSkeletonAxisConfigPage
-#
-TOOLTIP_PBSC_PAGE=
-TOOLTIP_PBCF_TEXT_URI=The SOAP body namespace and unique identifier of the Web service.
-TOOLTIP_PBCF_TEXT_WSDL_FOLDER=The folder of the WSDL file.
-TOOLTIP_PBCF_TEXT_WSDL_FILE=The name of the WSDL file.
-LABEL_URI=Web service URI:
-LABEL_OUTPUT_FOLDER_NAME=WSDL Folder:
-LABEL_OUTPUT_FILE_NAME=WSDL File:
-
-
-#
-#WSWSDLAxisType
-#
-WS_NAME_WSDLAXIS=Skeleton Java bean Axis Web service
-WS_DESC_WSDLAXIS=Skeleton Java bean Axis Web service
-
-#
-#WSBeanAxisType
-#
-
-#
-#WebServiceAxisBeanClassFragment
-#
-
-#
-#WebServiceAxisBeanClassPage
-#
-PAGE_TITLE_WSBEAN_CLASS=Web Service Java Bean Selection
-PAGE_DESC_WSBEAN_CLASS=Select a Java bean
-LABEL_EXPLORE_MAPPINGS_BEAN2XML=Define custom mapping for package to namespace.
-TOOLTIP_P2N_SHOW_MAPPINGS=Define package to namespace mapping for customization.
-
-#
-#WebServiceAxisBeanConfigFragment
-#
-
-#
-#WebServiceAxisBeanConfigPage
-#
-TOOLTIP_PBCF_PAGE=
-TOOLTIP_PBCF_TEXT_URI=The SOAP body namespace and unique identifier of the Web service.
-TOOLTIP_PBME_TREE_METHODS=Java bean methods to include.
-PAGE_TITLE_WSBEAN_CONFIG=Web Service Java Bean Identity
-PAGE_DESC_WSBEAN_CONFIG=Configure the Java bean as a Web service.
-LABEL_STYLE_USE=Style and Use
-STYLE_RPC_LITERAL=Document/ Literal
-STYLE_DOC_LITERAL=Document/ Literal (Wrapped)
-STYLE_RPC_ENCODED=RPC/ Encoded
-
-#
-#WSDLConsumptionTaskFactory
-#
-
-#
-#CopyAxisServerConfigTask
-#
-
-TASK_LABEL_COPY_SERVER_CONFIG_FILES=Copy server-config.wsdd from the server location to the Web Project
-TASK_DESC_COPY_SERVER_CONFIG_FILES=Coping server-config.wsdd from the server location to the Web Project
-
-
-#
-#LiteralSupportMessageTask
-#
-TASK_LABEL_LITERAL_SUPPORT_MESSAGE=Axis support for Literal encoding message task
-TASK_DESC_LITERAL_SUPPORT_MESSAGE=Axis support for Literal encoding message task
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisServerDefaulter.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisServerDefaulter.java
deleted file mode 100644
index b378b6b..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisServerDefaulter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.axis.creation.ui.command;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.consumption.common.IServerDefaulter;
-import org.eclipse.jst.ws.internal.consumption.common.ServerInfo;
-
-
-
-public class AxisServerDefaulter implements IServerDefaulter
-{
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.consumption.common.IServerDefaulter#recommendDefaultServer(org.eclipse.core.resources.IProject)
- */
- public ServerInfo recommendDefaultServer(IProject project)
- {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/ComputeAxisSkeletonBeanCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/ComputeAxisSkeletonBeanCommand.java
deleted file mode 100644
index 33db21b..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/ComputeAxisSkeletonBeanCommand.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.command;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-public class ComputeAxisSkeletonBeanCommand extends SimpleCommand
-{
- private List classNames;
- //private String wsdlURI;
- //private WebServicesParser webServicesParser;
- private JavaWSDLParameter javaWSDLParameter;
-
- public ComputeAxisSkeletonBeanCommand()
- {
- }
-
- public Status execute(Environment environment)
- {
- classNames = new Vector();
- if (javaWSDLParameter != null)
- {
- String beanName = javaWSDLParameter.getBeanName();
- if (beanName != null)
- classNames.add(beanName);
- }
- return new SimpleStatus("");
- }
-
- public List getClassNames()
- {
- return classNames;
- }
-
- /**
- * @param webServicesParser The webServicesParser to set.
- */
- public void setWebServicesParser(WebServicesParser webServicesParser)
- {
- //this.webServicesParser = webServicesParser;
- }
-
- /**
- * @param wsdlURI The wsdlURI to set.
- */
- public void setWsdlURI(String wsdlURI)
- {
- //this.wsdlURI = wsdlURI;
- }
-
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParameter)
- {
- this.javaWSDLParameter = javaWSDLParameter;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/JavaToWSDLMethodCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/JavaToWSDLMethodCommand.java
deleted file mode 100644
index ca953c1..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/JavaToWSDLMethodCommand.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.command;
-
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jem.internal.plugin.JavaEMFNature;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jem.java.impl.JavaClassImpl;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class JavaToWSDLMethodCommand extends SimpleCommand {
-
- private static String LABEL = "TASK_LABEL_JAVA_TO_WSDL";
- private static String DESCRIPTION = "TASK_DESC_JAVA_TO_WSDL";
- private static String JAVA_EXTENSION = ".java"; //$NON-NLS-1$
- private static String CLASS_EXTENSION = ".class"; //$NON-NLS-1$
-
- private Hashtable fMethodNames;
- private String fClassName;
- private String fBeanName;
- private String fbeanBaseName;
- private IProject fProject;
- private JavaWSDLParameter javaWSDLParam_;
- private IProject serviceProject_;
- private MessageUtils msgUtils_;
-
- /**
- * Default CTOR
- */
- public JavaToWSDLMethodCommand() {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- setName (msgUtils_.getMessage(LABEL));
- setDescription( msgUtils_.getMessage(DESCRIPTION));
- }
- /**
- * Default CTOR
- */
- public JavaToWSDLMethodCommand(
- JavaWSDLParameter javaParameter,
- IProject serviceProject) {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- setName (msgUtils_.getMessage(LABEL));
- setDescription( msgUtils_.getMessage(DESCRIPTION));
- javaWSDLParam_ = javaParameter;
- serviceProject_ = serviceProject;
-
- }
-
- /**
- * JavaToToWSDLMethod execute
- */
- public Status execute(Environment environment) {
- fbeanBaseName = javaWSDLParam_.getBeanName();
- environment.getLog().log(Log.INFO, 5070, this, "execute", "beanBaseName = "+fbeanBaseName);
- Status status;
- try {
- //Get the qualified bean name; my.package.MyClass
- fMethodNames = new Hashtable();
- Hashtable oldMethodsNames = javaWSDLParam_.getMethods();
- String qName = fbeanBaseName;
-
- if (qName.toLowerCase().endsWith(JAVA_EXTENSION)
- || qName.toLowerCase().endsWith(CLASS_EXTENSION)) {
- qName = qName.substring(0, qName.lastIndexOf('.'));
- }
-
- JavaEMFNature jMOF =
- (JavaEMFNature) JavaEMFNature.createRuntime(
- serviceProject_);
- JavaClass javaClass =
- (JavaClass) JavaClassImpl.reflect(qName, jMOF.getResourceSet());
- if (!javaClass.isExistingType()) {
- environment.getLog().log(Log.ERROR, 5022, this, "execute", msgUtils_.getMessage(
- "MSG_ERROR_JAVA_MOF_REFLECT_FAILED",
- new String[] { qName }));
-
- status = new SimpleStatus("JavaToWSDLMethodCommand", //$NON-NLS-1$
- msgUtils_.getMessage(
- "MSG_ERROR_JAVA_MOF_REFLECT_FAILED",
- new String[] { qName }),
- Status.ERROR);
- environment.getStatusHandler().reportError(status);
- return status;
- }
-
- // Get the qualified name
- fClassName = javaClass.getQualifiedName();
- fBeanName = fClassName;
- String beanName;
- if (fClassName.lastIndexOf('.') != -1) {
- beanName =
- fClassName.substring(
- fClassName.lastIndexOf('.') + 1,
- fClassName.length());
- } else
- beanName = fClassName;
-
- // Walk the java class and get the method names
- gatherMethods(javaClass, beanName, oldMethodsNames);
- /*
- Iterator m = javaClass.getPublicMethodsExtended().iterator();
- while (m.hasNext()) {
- Method method = (Method) m.next();
- if ( ! method.isConstructor()){
- if (!beanName.equals(method.getName())
- && !(isDuplicateMethodName(method
- .getMethodElementSignature()))
- && !(method
- .getContainingJavaClass()
- .getJavaName()
- .equalsIgnoreCase("javax.ejb.EJBObject")) //$NON-NLS-1$
- && !(method
- .getContainingJavaClass()
- .getJavaName()
- .equalsIgnoreCase("javax.ejb.EJBObject[]")) //$NON-NLS-1$
- && !(method
- .getContainingJavaClass()
- .getJavaName()
- .equalsIgnoreCase("java.lang.Object")) //$NON-NLS-1$
- && !(method
- .getContainingJavaClass()
- .getJavaName()
- .equalsIgnoreCase("java.lang.Object[]"))) { //$NON-NLS-1$
- // add the method name to our list of method names
- String methodName =method.getMethodElementSignature();
- Boolean isSelected = new Boolean(true);
- if (oldMethodsNames != null && oldMethodsNames.containsKey(methodName))
- isSelected = (Boolean)oldMethodsNames.get(methodName);
- fMethodNames.put(methodName, isSelected);
- }
- }
- }
- */
- javaWSDLParam_.setMethods(fMethodNames);
-
- return new SimpleStatus( "" );
-
- } catch (Exception e) {
- environment.getLog().log(Log.ERROR, 5023, this, "execute", msgUtils_.getMessage("MSG_ERROR_READ_BEAN"));
-
- status = new SimpleStatus("JavaToWSDLMethodCommand", //$NON-NLS-1$
- msgUtils_.getMessage(
- "MSG_ERROR_JAVA_TO_METHOD"),
- Status.ERROR, e);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- }
-
- private void gatherMethods(JavaClass javaClass, String beanName, Hashtable oldMethodsNames)
- {
- String javaName = javaClass.getJavaName();
- if (!javaClass.isInterface()
- && !javaName.equalsIgnoreCase("javax.ejb.EJBObject[]")
- && !javaName.equalsIgnoreCase("javax.ejb.EJBObject")
- && !javaName.equalsIgnoreCase("java.lang.Object[]")
- && !javaName.equalsIgnoreCase("java.lang.Object"))
- {
- List publicMethods = javaClass.getPublicMethods();
- for (Iterator it = publicMethods.iterator(); it.hasNext();)
- {
- Method method = (Method)it.next();
- if (!method.isConstructor()
- && !beanName.equals(method.getName())
- && !(isDuplicateMethodName(method.getMethodElementSignature())))
- {
- // add the method name to our list of method names
- String methodName = method.getMethodElementSignature();
- Boolean isSelected = new Boolean(true);
- if (oldMethodsNames != null && oldMethodsNames.containsKey(methodName))
- isSelected = (Boolean)oldMethodsNames.get(methodName);
- fMethodNames.put(methodName, isSelected);
- }
- }
- gatherMethods(javaClass.getSupertype(), beanName, oldMethodsNames);
- }
- }
-
- //Returns true if the provided method name already exists in the
- //fMethodNames vector. This method is used to detect overloaded
- //methods in Beans and EJBs, which are currently unsupported.
- private boolean isDuplicateMethodName(String methodName) {
- return (fMethodNames == null ? false: fMethodNames.containsKey(methodName));
- }
-
- /**
- * Returns the javaWSDLParam.
- * @return JavaWSDLParameter
- */
- public JavaWSDLParameter getJavaWSDLParam() {
- return javaWSDLParam_;
- }
-
- /**
- * Sets the javaWSDLParam.
- * @param javaWSDLParam The javaWSDLParam to set
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) {
- this.javaWSDLParam_ = javaWSDLParam;
- }
-
- public void setServiceProject(IProject serviceProject)
- {
- serviceProject_ = serviceProject;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/UpdateWEBXMLCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/UpdateWEBXMLCommand.java
deleted file mode 100644
index 6125044..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/UpdateWEBXMLCommand.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.command;
-
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.jst.j2ee.internal.web.operations.WebEditModel;
-import org.eclipse.jst.j2ee.webapplication.Servlet;
-import org.eclipse.jst.j2ee.webapplication.ServletMapping;
-import org.eclipse.jst.j2ee.webapplication.ServletType;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-public class UpdateWEBXMLCommand extends SimpleCommand {
-
- private String LABEL = "TASK_LABEL_UPDATE_WEB_XML";
- private String DESCRIPTION = "TASK_DESC_UPDATE_WEB_XML";
- private final String webProjectNature = IWebNatureConstants.J2EE_NATURE_ID;
-
- private MessageUtils msgUtils_;
- private IProject serverProject;
-
- public UpdateWEBXMLCommand()
- {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- setName (msgUtils_.getMessage(LABEL));
- setDescription( msgUtils_.getMessage(DESCRIPTION));
- }
-
- public Status execute(Environment environment) {
- if (serverProject != null) {
- Status status = null;
- status = addServlet(serverProject, getAxisServletDescriptor());
- if (status.getSeverity() == Status.ERROR) {
- environment.getStatusHandler().reportError(status);
- return status;
- }
- if (status.getSeverity() == Status.ERROR) {
- environment.getStatusHandler().reportError(status);
- return status;
- }
- addServlet(serverProject, getAdmintServletDescriptor());
- if (status.getSeverity() == Status.ERROR) {
- environment.getStatusHandler().reportError(status);
- return status;
- }
- }
- return new SimpleStatus( "" );
- }
-
- private ServletDescriptor getAxisServletDescriptor() {
-
- ServletDescriptor sd = new ServletDescriptor();
- sd._name = "AxisServlet"; //$NON-NLS-1$
- sd._displayName = "Apache-Axis Servlet"; //$NON-NLS-1$
- sd._className = "org.apache.axis.transport.http.AxisServlet"; //$NON-NLS-1$
- sd._mappings = new String[] { "/servlet/AxisServlet", //$NON-NLS-1$
- "*.jws", //$NON-NLS-1$
- "/services/*" }; //$NON-NLS-1$
- return sd;
- }
-
- private ServletDescriptor getAdmintServletDescriptor() {
- ServletDescriptor sd = new ServletDescriptor();
- sd._name = "AdminServlet"; //$NON-NLS-1$
- sd._displayName = "Axis Admin Servlet"; //$NON-NLS-1$
- sd._className = "org.apache.axis.transport.http.AdminServlet"; //$NON-NLS-1$
- sd._mappings = new String[] { "/servlet/AdminServlet" }; //$NON-NLS-1$
- sd._loadOnStartup = new Integer(100);
- return sd;
- }
-
- private ServletDescriptor getSoapMonitorServletDescriptor() {
- ServletDescriptor sd = new ServletDescriptor();
- sd._name = "SOAPMonitorService"; //$NON-NLS-1$
- sd._displayName = "SOAPMonitorService"; //$NON-NLS-1$
- sd._className = "org.apache.axis.monitor.SOAPMonitorService"; //$NON-NLS-1$
- sd._mappings = new String[] { "/SOAPMonitor" }; //$NON-NLS-1$
- sd._loadOnStartup = new Integer(100);
- Map params = new HashMap();
- params.put("SOAPMonitorPort", //$NON-NLS-1$
- "5001"); //$NON-NLS-1$
- sd._params = params;
- return sd;
- }
-
- public Status addServlet(
- IProject webProject,
- ServletDescriptor servletDescriptor) {
- J2EEWebNatureRuntime nature = null;
- WebEditModel resource = null;
- Object accessorKey = new Object();
- try {
- nature =
- (J2EEWebNatureRuntime) (webProject.getNature(webProjectNature));
- resource = nature.getWebAppEditModelForWrite(accessorKey);
- WebApp webapp = resource.getWebApp();
-
- boolean foundServlet = false;
-
- List theServlets = webapp.getServlets();
- for (int i = 0; i < theServlets.size(); i++) {
- Servlet aServlet = (Servlet) theServlets.get(i);
- if (aServlet.getServletName().equals(servletDescriptor._name)) {
- foundServlet = true;
- }
- }
-
- if (foundServlet) {
- if (resource != null) resource.releaseAccess(accessorKey);
- return new SimpleStatus( "" );
- }
-
- WebapplicationFactory factory = WebapplicationFactory.eINSTANCE;
-
- Servlet servlet = factory.createServlet();
- ServletType servletType = factory.createServletType();
- servlet.setWebType(servletType);
- servlet.setServletName(servletDescriptor._name);
- servletType.setClassName(servletDescriptor._className);
- if(servletDescriptor._displayName != null){
- servlet.setDisplayName(servletDescriptor._displayName);
- }
- if(servletDescriptor._loadOnStartup != null){
- servlet.setLoadOnStartup(servletDescriptor._loadOnStartup);
- }
- if(servletDescriptor._params != null){
- Properties properties = servlet.getParamsAsProperties();
- properties.putAll(servletDescriptor._params);
- }
- webapp.getServlets().add(servlet);
-
- if(servletDescriptor._mappings != null){
- for(int i=0; i<servletDescriptor._mappings.length; i++){
- ServletMapping servletMapping = factory.createServletMapping();
- servletMapping.setServlet(servlet);
- servletMapping.setUrlPattern(servletDescriptor._mappings[i]);
- webapp.getServletMappings().add(servletMapping);
- }
- }
- resource.save(accessorKey);
- if (resource != null) resource.releaseAccess(accessorKey);
- return new SimpleStatus( "" );
- } catch (Exception e) {
- if (resource != null) resource.releaseAccess(accessorKey);
- return new SimpleStatus(
- "UpdateWEBXMLCommand.addServlet", //$NON-NLS-1$
- msgUtils_.getMessage("MSG_ERROR_UPDATE_WEB_XML"),
- Status.ERROR, e);
- }
- }
-
- public void setServerProject(IProject serverProject)
- {
- this.serverProject = serverProject;
- }
-
- public class ServletDescriptor {
- String _name;
- String _className;
- String _displayName;
- Map _params;
- String[] _mappings;
- Integer _loadOnStartup;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/plugin/WebServiceAxisCreationUIPlugin.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/plugin/WebServiceAxisCreationUIPlugin.java
deleted file mode 100644
index e0e2eb1..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/plugin/WebServiceAxisCreationUIPlugin.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.plugin;
-
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-
-/**
-* This is the plugin class for the Web Services plugin.
-* <p>
-* This plugin contains the graphic user interface to the
-* Web Services runtime found in org.eclipse.jst.ws.
-*/
-public class WebServiceAxisCreationUIPlugin extends AbstractUIPlugin
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2003."; //$NON-NLS-1$
-
- /**
- * The identifier of the descriptor of this plugin in plugin.xml.
- */
- public static final String ID = "org.eclipse.jst.ws.axis.creation.ui"; //$NON-NLS-1$
-
- /**
- * The reference to the singleton instance of this plugin.
- */
- private static WebServiceAxisCreationUIPlugin instance_;
- private Log log_;
-
- /**
- * Constructs a runtime plugin object for this plugin.
- * The "plugin" element in plugin.xml should include the attribute
- * class = "org.eclipse.jst.ws.internal.ui.plugin.WebServicePlugin".
- * @param descriptor The descriptor of this plugin.
- */
- public WebServiceAxisCreationUIPlugin ( IPluginDescriptor descriptor )
- {
- super(descriptor);
- if (instance_ == null)
- {
- instance_ = this;
- }
- log_ = new EclipseLog();
-
- }
-
- /**
- * Returns the singleton instance of this plugin. Equivalent to calling
- * (WebServiceWasCreationUIPlugin)Platform.getPlugin("org.eclipse.jst.ws.was.v5.tp.ui");
- * @return The WebServiceConsumptionUIPlugin singleton.
- */
- static public WebServiceAxisCreationUIPlugin getInstance ()
- {
- return instance_;
- }
-
- /**
- * Called once by the platform when this plugin is first loaded.
- * @throws CoreException If this plugin fails to start.
- */
- public void startup () throws CoreException
- {
- log_.log(Log.INFO, 5068, this, "startup", "Starting plugin org.eclipse.jst.ws.axis.creation.ui");
- super.startup();
- setPreferences();
- }
-
- /**
- * Called once by the platform when this plugin is unloaded.
- * @throws CoreException If this plugin fails to shutdown.
- */
- public void shutdown () throws CoreException
- {
- log_.log(Log.INFO, 5069, this, "shutdown", "Shutting plugin org.eclipse.jst.ws.axis.creation.ui");
- super.shutdown();
- }
-
-
- /**
- * Sets the general preferences to the values in the preferences store.
- **/
- public void setPreferences()
- {
- // setDialogsPreferences();
- }
-
- /**
- * @see AbstractUIPlugin#initializeDefaultPreferences
- */
- protected void initializeDefaultPreferences(IPreferenceStore preferenceStore) {
-
- // Set the defaults Preference
-// ActionDialogsPreferenceHelper.initializeDefaults(preferenceStore);
- }
-
- /**
- * Returns the message string identified by the given key from
- * the plugin.properties file for the appropriate locale.
- * @param key The message key string prefixed by a "%" symbol.
- * That is, the string passed in must be of the form "%KEY"
- * where the plugin.properties file contains a line of the
- * form: "KEY = value".
- * @return The locale-specific message.
- */
- public static String getMessage ( String key )
- {
- return instance_.getDescriptor().getResourceString(key);
- }
-
- /**
- * Returns the message string identified by the given key from
- * the plugin.properties file for the appropriate locale.
- * Substitution sequences in the message string
- * are replaced by the given array of substitution objects (which
- * are most frequently strings). See java.text.MessageFormat for
- * further details on substitution.
- * @param key The message key string prefixed by a "%" symbol.
- * That is, the string passed in must be of the form "%KEY"
- * where the plugin.properties file contains a line of the
- * form: "KEY = value".
- * @param args The substitution values for the message
- * as required by the message in plugin.properties and
- * by the rules of class java.text.MessageFormat.
- * @return The locale-specific message.
- */
- public static String getMessage ( String key, Object[] args )
- {
- return MessageFormat.format(getMessage(key),args);
- }
-
- /**
- * Returns an image descriptor for the named resource
- * as relative to the plugin install location.
- * @return An image descriptor, possibly null.
- */
- public static ImageDescriptor getImageDescriptor ( String name )
- {
- try
- {
- URL installURL = instance_.getDescriptor().getInstallURL();
- URL imageURL = new URL(installURL,name);
- return ImageDescriptor.createFromURL(imageURL);
- }
- catch (MalformedURLException e)
- {
- return null;
- }
- }
-
- public String getPluginStateLocation() {
- return Platform.getPluginStateLocation(this).addTrailingSeparator().toOSString();
- }
-
- public String getPluginInstallLocation() {
- try {
- return Platform.resolve(getDescriptor().getInstallURL()).getFile();
- }
- catch (Exception e) {
- return null;
- }
- }
- }
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/CopyAxisServerConfigTask.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/CopyAxisServerConfigTask.java
deleted file mode 100644
index 98f2552..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/CopyAxisServerConfigTask.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.task;
-
-
-import java.io.File;
-import java.io.FileInputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.wst.command.env.common.FileResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.core.context.TransientResourceContext;
-import org.eclipse.wst.server.core.IServer;
-
-public class CopyAxisServerConfigTask extends SimpleCommand {
-
-
- private final String LABEL = "TASK_LABEL_COPY_SERVER_CONFIG_FILES";
- private final String DESCRIPTION ="TASK_DESC_COPY_SERVER_CONFIG_FILES";
-
- private final String DEPLOYEDSERVICES = "WEB-INF" + File.separator + "server-config.wsdd"; //$NON-NLS-1$
- private MessageUtils msgUtils_;
- private MessageUtils coreMsgUtils_;
- private MessageUtils baseConMsgUtils_;
- private JavaWSDLParameter javaWSDLParam_;
- private IProject serviceProject_;
- private Boolean projectRestartRequired_;
- private String serviceServerTypeID_;
- private IServer serviceExistingServer_;
- // rm private Model model_;
-
- public CopyAxisServerConfigTask() {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- baseConMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.consumption.plugin", this );
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
-
- }
-
- public CopyAxisServerConfigTask(JavaWSDLParameter javaWSDLParam) {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- baseConMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.consumption.plugin", this );
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
- javaWSDLParam_ = javaWSDLParam;
-
- }
-
- /**
- * Execute CopyAxisServerConfigTask
- */
- public Status execute(Environment env) {
-
- // rm
- /*
- //Begin setters
- WebServiceElement webServiceElement =
- WebServiceElement.getWebServiceElement(model_);
- setServiceProject(webServiceElement.getServiceProject());
- setServiceServerTypeID(webServiceElement.getServiceServerTypeID());
- setServiceExistingServer(webServiceElement.getServiceExistingServer());
-
- //End Setters
- */
-
-
- Status status = new SimpleStatus( "" );
-
- if (javaWSDLParam_ == null) {
- status = new SimpleStatus("", coreMsgUtils_.getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- // rm
- /*
- if (model_ == null) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_MODEL_NOT_SET"), Status.ERROR);
- return status;
- }
- */
-
- try {
-
- projectRestartRequired_ = Boolean.TRUE;
- // rm webServiceElement.setProjectRestartRequired(true);
-
- IProject project = serviceProject_;
- if (project == null) {
- status = new SimpleStatus("", baseConMsgUtils_.getMessage("MSG_ERROR_PROJECT_NOT_FOUND"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- IServer instance =
- ServerUtils.getServerForModule(
- ResourceUtils.getModule(project),
- serviceServerTypeID_,
- serviceExistingServer_,
- true,
- EnvironmentUtils.getIProgressMonitor(env));
- if (instance == null) {
- status = new SimpleStatus("", baseConMsgUtils_.getMessage("MSG_ERROR_INSTANCE_NOT_FOUND"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
-// M5 Port: replacing instance.isLocal() with instance.getFactoryId().indexOf("test") > 0
- if (!(instance.getServerType().getId().indexOf(".te") > 0)) {
- IPath installPath = instance.getRuntime().getLocation();
- IPath sourcePath = installPath.append(
- "webapps").append( //$NON-NLS-1$
- project.getName());
-
- IPath webModulePath =
- ResourceUtils.getWebModuleServerRoot(project).getFullPath();
-
- ResourceContext context = new TransientResourceContext();
- context.setOverwriteFilesEnabled(true);
- context.setCreateFoldersEnabled(true);
- context.setCheckoutFilesEnabled(true);
- IFile file =
- FileResourceUtils.createFile(
- context,
- webModulePath.append(DEPLOYEDSERVICES),
- new FileInputStream(
- sourcePath.append(DEPLOYEDSERVICES).toOSString()),
- env.getProgressMonitor(),
- env.getStatusHandler());
- }
- return status;
-
- } catch (Exception e) {
- return status;
- }
-
- }
-
-
- /**
- * Sets the javaWSDLParam.
- * @param javaWSDLParam The javaWSDLParam to set
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) {
- javaWSDLParam_ = javaWSDLParam;
- }
-
- public void setServiceProject(IProject serviceProject)
- {
- serviceProject_ = serviceProject;
- }
-
- public void setServiceServerTypeID(String serviceServerTypeID)
- {
- serviceServerTypeID_ = serviceServerTypeID;
- }
-
- public void setServiceExistingServer(IServer serviceExistingServer)
- {
- serviceExistingServer_ = serviceExistingServer;
- }
-
- // rm
- /*
- public void setModel(Model model)
- {
- model_ = model;
- }
- */
-
- public Boolean getProjectRestartRequired()
- {
- return projectRestartRequired_;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/DefaultsForServerJavaWSDLCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/DefaultsForServerJavaWSDLCommand.java
deleted file mode 100644
index 1bba5f2..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/DefaultsForServerJavaWSDLCommand.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.task;
-
-
-import javax.wsdl.Definition;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.axis.consumption.util.ClasspathUtils;
-import org.eclipse.jst.ws.internal.axis.consumption.util.FileUtil;
-import org.eclipse.jst.ws.internal.axis.consumption.util.PlatformUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.wsil.Utils;
-import org.eclipse.jst.ws.internal.consumption.util.WSDLUtils;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-public class DefaultsForServerJavaWSDLCommand extends SimpleCommand {
-
- private MessageUtils msgUtils_;
- private MessageUtils coreMsgUtils_;
- private MessageUtils conMsgUtils_;
-
- // rm private Model model_;
- private JavaWSDLParameter javaWSDLParam_ = null;
- private IProject serviceProject_;
- private String javaBeanName_; // this needs to be set by the extension with initial selection
- private String WSDLServiceURL_;
- private String WSDLServicePathname_;
- private WebServicesParser WSParser_;
- // rm private WebServiceElement wse_; // temporary
-
- private String LABEL = "TASK_LABEL_SERVER_JAVA_WSDL_DEFAULTS";
- private String DESCRIPTION = "TASK_DESC_SERVER_JAVA_WSDL_DEFAULTS";
- private final String WSDL_FOLDER = "wsdl"; //$NON-NLS-1$
- public final String SERVICE_EXT = "/services/"; //$NON-NLS-1$
- private final String WSDL_EXT = "wsdl"; //$NON-NLS-1$
- public final byte MODE_BEAN = (byte) 0;
- public final String SERVICE_NAME_EXT = "Service"; //$NON-NLS-1$
-
- public DefaultsForServerJavaWSDLCommand() {
-
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- conMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.ui.plugin", this );
-
- setName (msgUtils_.getMessage(LABEL));
- setDescription( msgUtils_.getMessage(DESCRIPTION));
- }
-
-
- public DefaultsForServerJavaWSDLCommand(
- JavaWSDLParameter javaWSDLParam,
- Model model) {
-
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
-
- setName (msgUtils_.getMessage(LABEL));
- setDescription( msgUtils_.getMessage(DESCRIPTION));
- //rm setModel(model);
- setJavaWSDLParam(javaWSDLParam);
-
- }
-
- /**
- * Execute DefaultsForJavaToWSDLTask
- */
- public Status execute( Environment env ) {
-
- Status status;
- if (javaWSDLParam_ == null) {
- status = new SimpleStatus( "DefaultsForServerJavaWSDLTask", coreMsgUtils_.getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR );
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- if (javaBeanName_ == null) { // either set by extension point or bean class page
- javaBeanName_ = javaWSDLParam_.getBeanName();
- if (javaBeanName_ == null) {
- //rm javaBeanName_ = isdElement.getJavaBeanName();
- javaWSDLParam_.setBeanName(javaBeanName_);
- }
- }
- // rm WSParser_ = (WebServicesParser) wse_.getWSParser();
-
- javaWSDLParam_.setServerSide(JavaWSDLParameter.SERVER_SIDE_BEAN);
- javaWSDLParam_.setSkeletonDeploy(false);
-
- javaWSDLParam_.setBeanName(javaBeanName_);
- String classpath = ClasspathUtils.getInstance().getClasspathString(serviceProject_);
- javaWSDLParam_.setClasspath(classpath);
-
- String simpleBeanName = javaBeanName_;
- String beanPackageName = null;
- if (javaBeanName_ != null) {
- int index = javaBeanName_.lastIndexOf('.');
- if (index != -1) {
- simpleBeanName = javaBeanName_.substring(index + 1);
- beanPackageName = javaBeanName_.substring(0, index);
- }
- }
- String namespace = WSDLUtils.makeNamespace(javaWSDLParam_.getBeanName());
- javaWSDLParam_.setNamespace(namespace);
-
- javaWSDLParam_.setPortTypeName(simpleBeanName);
- javaWSDLParam_.setServiceName(simpleBeanName + SERVICE_NAME_EXT);
-
- IPath moduleServerRoot = null;
-
- IPath modulePath = serviceProject_.getFullPath();
- IPath webinfPath = serviceProject_.getFullPath();
- try {
- if (serviceProject_.hasNature(IWebNatureConstants.J2EE_NATURE_ID)) {
- moduleServerRoot = ResourceUtils.getJavaSourceLocation(serviceProject_);
-
- J2EEWebNatureRuntime webProject =
- (J2EEWebNatureRuntime) serviceProject_.getNature(
- IWebNatureConstants.J2EE_NATURE_ID);
- modulePath = webProject.getWebModulePath();
- webinfPath = webinfPath.append(webProject.getWEBINFPath());
- }
-
- } catch (CoreException e) {
- status = new SimpleStatus( "DefaultsForServerJavaWSDLTask", conMsgUtils_.getMessage("MSG_ERROR_DEFAULT_BEAN"), Status.ERROR, e );
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- IPath wsdlPath =
- modulePath.append(WSDL_FOLDER).append(simpleBeanName).addFileExtension(WSDL_EXT);
-
- try{
- IFolder folder = ResourceUtils
- .getWorkspaceRoot()
- .getFolder(modulePath.append(WSDL_FOLDER));
- FileUtil.createFolder(folder, true, true);
-
- }
- catch(CoreException e){
- status = new SimpleStatus( "DefaultsForServerJavaWSDLTask", conMsgUtils_.getMessage("MSG_ERROR_WRITE_WSDL"), Status.ERROR, e );
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- String wsdlLocation =
- ResourceUtils
- .getWorkspaceRoot()
- .getFile(wsdlPath)
- .getLocation()
- .toString();
-
- javaWSDLParam_.setOutputWsdlLocation(wsdlLocation);
- javaWSDLParam_.setInputWsdlLocation(wsdlLocation);
- WSDLServicePathname_ = wsdlPath.toString();
-
- if (wsdlPath != null) {
- String wsdlURL = PlatformUtils.getFileURLFromPath(new Path(wsdlLocation));
- WSDLServiceURL_ = wsdlURL;
- // set parser
- if (wsdlURL == null || wsdlURL.length() <= 0) {
- IResource res =
- ResourceUtils.findResource(WSDLServicePathname_);
- if (res != null)
- wsdlURL = (new Utils()).toFileSystemURI(res);
- }
- Definition definition = null;
- if (wsdlURL != null && wsdlURL.length() > 0) {
- if (WSParser_ == null) {
- WSParser_ = new WebServicesParserExt();
- }
- definition = WSParser_.getWSDLDefinition(wsdlURL);
- }
- }
-
- javaWSDLParam_.setStyle(JavaWSDLParameter.STYLE_RPC);
- javaWSDLParam_.setUse(JavaWSDLParameter.USE_ENCODED);
-
- String projectURL =
- ResourceUtils.getEncodedWebProjectURL(serviceProject_);
- String serviceURL = null;
- if (projectURL == null) {
- status = new SimpleStatus( "DefaultsForServerJavaWSDLTask", msgUtils_.getMessage("MSG_ERROR_PROJECT_URL"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
- serviceURL = projectURL + SERVICE_EXT + simpleBeanName;
-
- javaWSDLParam_.setUrlLocation(serviceURL);
-
- javaWSDLParam_.setMetaInfOnly(true);
-
- // String javaOutput = PlatformUtils.getPlatformURL(moduleServerRoot);
- // String output = PlatformUtils.getPlatformURL(modulePath);
-
- String javaOutput =
- ResourceUtils
- .findResource(moduleServerRoot)
- .getLocation()
- .toString();
-
- String serviceName = javaWSDLParam_.getServiceName();
- String output =
- ResourceUtils.findResource(webinfPath).getLocation().append(serviceName).toString();
-
- javaWSDLParam_.setJavaOutput(javaOutput);
- javaWSDLParam_.setOutput(output);
-
- return new SimpleStatus( "" );
- }
-
- /**
- * Returns the javaWSDLParam.
- * @return JavaWSDLParameter
- */
- public JavaWSDLParameter getJavaWSDLParam() {
- return javaWSDLParam_;
- }
-
- /**
- * Sets the javaWSDLParam.
- * @param javaWSDLParam The javaWSDLParam to set
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) {
- this.javaWSDLParam_ = javaWSDLParam;
- }
-
- // rm
- /*
- public void setModel(Model model) {
- this.model_ = model;
- }
- */
-
- public void setServiceProject(IProject serviceProject) {
- this.serviceProject_ = serviceProject;
- }
-
- public void setJavaBeanName(String javaBeanName) {
- this.javaBeanName_ = javaBeanName;
- }
-
- public String getWSDLServiceURL() {
- return WSDLServiceURL_;
- }
-
- public String getWSDLServicePathname() {
- return WSDLServicePathname_;
- }
-
- public void setParser(WebServicesParser wsParser) {
- this.WSParser_ = wsParser;
- }
-
- public WebServicesParser getParser() {
- return WSParser_;
- }
-
- public void setObjectSelection(IStructuredSelection objectSelection)
- {
- if (objectSelection != null && !objectSelection.isEmpty())
- {
- Object object = objectSelection.getFirstElement();
- if (object instanceof String)
- setJavaBeanName((String)object);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/LiteralSupportMessageTask.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/LiteralSupportMessageTask.java
deleted file mode 100644
index 4e3f342..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/LiteralSupportMessageTask.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.task;
-
-
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusException;
-
-
-
-public class LiteralSupportMessageTask extends SimpleCommand {
-
- private final String LABEL = "TASK_LABEL_LITERAL_SUPPORT_MESSAGE";
- private final String DESCRIPTION =
- "TASK_DESC_LITERAL_SUPPORT_MESSAGE";
- private MessageUtils msgUtils_;
- private MessageUtils coreMsgUtils_;
-
- private JavaWSDLParameter javaWSDLParam_;
-
- public LiteralSupportMessageTask() {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils(pluginId+".plugin", this);
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
- }
-
- public LiteralSupportMessageTask(JavaWSDLParameter javaWSDLParam) {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils(pluginId+".plugin", this);
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
- javaWSDLParam_ = javaWSDLParam;
-
- }
-
-
- /**
- * Execute LiteralSupportMessageTask
- */
- public Status execute(Environment env) {
- Status status = new SimpleStatus("");
- if (javaWSDLParam_ == null) {
- status = new SimpleStatus("",coreMsgUtils_.getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- String use = javaWSDLParam_.getUse();
- if(use != null &&
- use.equals(JavaWSDLParameter.USE_LITERAL)){
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_LITERAL_SUPPORT_MESSAGE"), Status.WARNING);
- try
- {
- env.getStatusHandler().report(status);
- }
- catch(StatusException se)
- {
- status = new SimpleStatus("","User aborted",Status.ERROR);
- }
- }
-
- return status;
- }
-
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam)
- {
- javaWSDLParam_ = javaWSDLParam;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/MoveDeploymentFilesTask.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/MoveDeploymentFilesTask.java
deleted file mode 100644
index 1d8bc1b..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/MoveDeploymentFilesTask.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.task;
-
-
-import java.io.File;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.axis.consumption.util.FileUtil;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-public class MoveDeploymentFilesTask extends SimpleCommand {
-
- private final String LABEL = "TASK_LABEL_MOVE_DEPLOYMENT_FILES";
- private final String DESCRIPTION = "TASK_DESC_MOVE_DEPLOYMENT_FILES";
- private final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
- private final String META_INF = "META-INF"; //$NON-NLS-1$
-
- private MessageUtils msgUtils_;
- private MessageUtils coreMsgUtils_;
- private IProject serverProject;
- private JavaWSDLParameter javaWSDLParam_;
-
- public MoveDeploymentFilesTask()
- {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
- }
-
- /**
- * Execute DefaultsForJavaToWSDLTask
- */
- public Status execute(Environment env) {
- Status status = new SimpleStatus("");
- if (javaWSDLParam_ == null) {
- status = new SimpleStatus("",coreMsgUtils_.getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- IProject project = serverProject;
- String projectURL = ResourceUtils.getEncodedWebProjectURL(project);
- if (projectURL == null) {
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_PROJECT_URL",new String[] { project.toString()}), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- } else {
- javaWSDLParam_.setProjectURL(projectURL);
- }
-
- try {
- if (!project.hasNature(IWebNatureConstants.J2EE_NATURE_ID))
- return status;
- } catch (Exception ex) {
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_INTERAL"), Status.ERROR, ex);
- env.getStatusHandler().reportError(status);
- return status;
- }
- String[] deployFiles = javaWSDLParam_.getDeploymentFiles();
- String javaOutput = javaWSDLParam_.getJavaOutput();
-
- if (deployFiles == null || javaOutput == null) {
- return status;
- }
-
-
- IPath webinfPath = project.getLocation();
- try {
-
- if (project.hasNature(IWebNatureConstants.J2EE_NATURE_ID)) {
- J2EEWebNatureRuntime webProject =
- (J2EEWebNatureRuntime) project.getNature(
- IWebNatureConstants.J2EE_NATURE_ID);
- webinfPath = webinfPath.append(webProject.getWEBINFPath());
- }
- for (int i = 0; i < deployFiles.length; i++) {
- File f = new File(deployFiles[i]);
- String resourceToMove = f.getName();
- String targetFileName = webinfPath.addTrailingSeparator().append(resourceToMove).toString();
- FileUtil.createTargetFile(deployFiles[i], targetFileName, true);
- File deploymentFile = new File(deployFiles[i]);
- deploymentFile.delete();
- deployFiles[i] = targetFileName;
- }
-
- } catch (Exception e) {
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_MOVE_RESOURCE",new String[] { e.getLocalizedMessage()}), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- return status;
- }
-
- public JavaWSDLParameter getJavaWSDLParam()
- {
- return javaWSDLParam_;
- }
-
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam)
- {
- javaWSDLParam_ = javaWSDLParam;
- }
-
- public void setServerProject(IProject serverProject)
- {
- this.serverProject = serverProject;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/MoveJavaFilesTask.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/MoveJavaFilesTask.java
deleted file mode 100644
index bed83a7..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/MoveJavaFilesTask.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.task;
-
-
-import java.io.File;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class MoveJavaFilesTask extends SimpleCommand {
-
- private final String LABEL = "TASK_LABEL_MOVE_JAVA_FILES";
- private final String DESCRIPTION = "TASK_DESC_MOVE_JAVA_FILES";
-
- private JavaWSDLParameter javaWSDLParam_;
- private MessageUtils msgUtils_;
- private MessageUtils coreMsgUtils_;
- private IProject serviceProject_;
- // rm private Model model_;
-
- public MoveJavaFilesTask() {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
- }
-
-
- public MoveJavaFilesTask(JavaWSDLParameter javaWSDLParam) {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
- javaWSDLParam_ = javaWSDLParam;
-
- }
-
- /**
- * Execute DefaultsForJavaToWSDLTask
- */
- public Status execute(Environment env) {
-
- // rm
- /*
- //Begin Setters
- WebServiceElement wse =
- WebServiceElement.getWebServiceElement(model_);
- setServiceProject(wse.getServiceProject());
- //End Setters
- */
- Status status = new SimpleStatus("");
-
- if (javaWSDLParam_ == null) {
- status = new SimpleStatus("",coreMsgUtils_.getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- // rm
- /*
- if (model_ == null) {
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_MODEL_NOT_SET"), Status.ERROR);
- return status;
- }
- */
-
- IProject project = serviceProject_;
- String projectURL = ResourceUtils.getEncodedWebProjectURL(project);
- if (projectURL == null) {
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_PROJECT_URL",new String[] {project.toString()}), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
-
- } else {
- javaWSDLParam_.setProjectURL(projectURL);
- }
-
- String[] javaFiles = javaWSDLParam_.getJavaFiles();
- String javaoutput = javaWSDLParam_.getJavaOutput(); // <webproject>/JavaSource
- String output = javaWSDLParam_.getOutput(); // <webproject>/WebContent/META_INF
-
- if(javaFiles == null || javaoutput == null && output == null ){
- return status;
- }
- try {
- for (int i = 0; i < javaFiles.length; i++) {
- String resourceToMove = javaFiles[i].substring(output.length());
- String targetFileName = javaoutput + resourceToMove;
- File resultFile = new File(targetFileName);
- // copy java files that without overwtriting existing ones
-// if (!resultFile.exists()) {
-// FileUtil.createTargetFile(
-// javaFiles[i],
-// javaoutput + resourceToMove);
-// }
- // delete java files from the output directory
- File source = new File(javaFiles[i]);
- source.delete();
- }
- } catch (Exception e) {
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_MOVE_RESOURCE",new String[]{e.getLocalizedMessage()}), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- return status;
- }
-
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam)
- {
- javaWSDLParam_ = javaWSDLParam;
- }
-
- public JavaWSDLParameter getJavaWSDLParam() {
- return javaWSDLParam_;
- }
-
- public void setServiceProject(IProject serviceProject)
- {
- serviceProject_ = serviceProject;
- }
-
- // rm
- /*
- public void setModel(Model model)
- {
- model_ = model;
- }
- */
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/Skeleton2WSDLCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/Skeleton2WSDLCommand.java
deleted file mode 100644
index 215f796..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/Skeleton2WSDLCommand.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.task;
-
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.wsdl.Binding;
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.soap.SOAPAddress;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.j2ee.internal.ejb.project.EJBNatureRuntime;
-import org.eclipse.jst.j2ee.internal.project.IEJBNatureConstants;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.axis.consumption.util.FileUtil;
-import org.eclipse.jst.ws.internal.axis.consumption.util.PlatformUtils;
-import org.eclipse.jst.ws.internal.axis.creation.ui.plugin.WebServiceAxisCreationUIPlugin;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.command.common.CopyWSDLCommand;
-import org.eclipse.jst.ws.internal.consumption.util.WSDLUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseEnvironment;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-public class Skeleton2WSDLCommand extends SimpleCommand
-{
- private static final String LABEL = "TASK_LABEL_SKELETON_WSDL";
- private static final String DESCRIPTION = "TASK_DESC_SKELETON_WSDL";
- private static final String IMPL = "Impl"; //$NON-NLS-1$
- private static final String SERVICE_EXT = "/services/"; //$NON-NLS-1$
- private static final String WSDL_EXT = "wsdl"; //$NON-NLS-1$
- private static final String DOT = "."; //$NON-NLS-1$
- private static final String SLASH = "/"; //$NON-NLS-1$
- private static final String PROTOCOL_SUFFIX = "://"; //$NON-NLS-1$
- private final String WSDL_FOLDER = "wsdl"; //$NON-NLS-1$
- private WebServicesParser webServicesParser;
- private JavaWSDLParameter javaWSDLParam;
- private IProject serverProject;
- private HashMap visitedLinks;
- private MessageUtils msgUtils_;
-
- public Skeleton2WSDLCommand() {
- super(WebServiceAxisCreationUIPlugin.getMessage(LABEL), WebServiceAxisCreationUIPlugin.getMessage(DESCRIPTION));
- msgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.creation.ui.plugin", this );
- setName( LABEL );
- setDescription( DESCRIPTION );
- }
-
- /**
- * Execute Skeleton2WSDLCommand
- */
- public Status execute(Environment env)
- {
- if (!(env instanceof EclipseEnvironment))
- {
- Status status = new SimpleStatus(WebServiceAxisCreationUIPlugin.ID, msgUtils_.getMessage("MSG_ERROR_NOT_IN_ECLIPSE_ENVIRONMENT", new String[] {"Skeleton2WSDLCommand"}), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
- if (javaWSDLParam == null)
- {
- Status status = new SimpleStatus(WebServiceAxisCreationUIPlugin.ID, msgUtils_.getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- // Read WSDL
- Definition definition = null;
- String wsdlURL = javaWSDLParam.getInputWsdlLocation();
- try
- {
- URL url = new URL(wsdlURL);
- definition = webServicesParser.getWSDLDefinition(url.toString());
- }
- catch(MalformedURLException e)
- {
- wsdlURL = PlatformUtils.getFileURLFromPath(new Path(wsdlURL));
- definition = webServicesParser.getWSDLDefinition(wsdlURL);
- }
-
- // Compute the qualified name of the Java bean skeleton
- Service service = null;
- Port port = null;
- if (definition != null) {
- StringBuffer beanName = new StringBuffer();
- beanName.append(WSDLUtils.getPackageName(definition));
- beanName.append(DOT);
- try{
- service = (Service) definition.getServices().values().iterator().next();
- port = (Port) service.getPorts().values().iterator().next();
- Binding binding = port.getBinding();
- beanName.append(binding.getQName().getLocalPart());
- beanName.append(IMPL);
- javaWSDLParam.setBeanName(beanName.toString());
-
- javaWSDLParam.setPortTypeName(WSDLUtils.getPortTypeName(definition));
- javaWSDLParam.setServiceName(
- WSDLUtils.getServiceElementName(definition));
- javaWSDLParam.setBeanPackage(WSDLUtils.getPackageName(definition));
- }
- catch(Throwable e){
- e.printStackTrace();
- }
- }
- else {
- Status status = new SimpleStatus(WebServiceAxisCreationUIPlugin.ID, msgUtils_.getMessage("MSG_ERROR_WSDL_NO_DEFINITION", new String[] {wsdlURL}), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- // Modify WSDL endpoint
- if (port == null) {
- Status status = new SimpleStatus(WebServiceAxisCreationUIPlugin.ID, msgUtils_.getMessage("MSG_ERROR_WSDL_NO_PORT", new String[] {wsdlURL}), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
- Map services = definition.getServices();
- for (Iterator servicesIt = services.values().iterator(); servicesIt.hasNext();)
- {
- Service s = (Service)servicesIt.next();
- Map ports = s.getPorts();
- for (Iterator portsIt = ports.values().iterator(); portsIt.hasNext();)
- {
- Port p = (Port)portsIt.next();
- modifyEndpoint(p);
- }
- }
-
- visitedLinks = new HashMap();
-
- // Set WSDL file name: javaWSDLParam.setOutputWsdlLocation();
- IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
-
- String wsdlLocation = javaWSDLParam.getOutputWsdlLocation();
- IPath wsdlPath = null;
- IFile outputFile = null;
- try {
- if(wsdlLocation != null){
- outputFile = workspace.getFileForLocation( new Path(wsdlLocation));
- }
- else{
- wsdlPath = serverProject.getFullPath();
- if (serverProject.hasNature(IWebNatureConstants.J2EE_NATURE_ID)) {
- J2EEWebNatureRuntime webProject =
- (J2EEWebNatureRuntime) serverProject.getNature(
- IWebNatureConstants.J2EE_NATURE_ID);
- wsdlPath = webProject.getWebModulePath();
- //wsdlPath = wsdlPath.append(webProject.getWEBINFPath());
- }
- else if (serverProject.hasNature(IEJBNatureConstants.NATURE_ID))
- {
- EJBNatureRuntime ejbProject = EJBNatureRuntime.getRuntime(serverProject);
- wsdlPath = wsdlPath.append(ejbProject.getMetaFolder().getProjectRelativePath().addTrailingSeparator());
- }
-
- IPath wsdlFilePath = wsdlPath.append(WSDL_FOLDER).append(port.getName()).addFileExtension(WSDL_EXT);
- IFolder folder = ResourceUtils
- .getWorkspaceRoot()
- .getFolder(wsdlPath.append(WSDL_FOLDER));
- FileUtil.createFolder(folder, true, true);
- outputFile = workspace.getFile(wsdlFilePath);
- wsdlLocation = outputFile.getLocation().toString();
- javaWSDLParam.setOutputWsdlLocation(wsdlLocation);
-
- }
-
- // copy WSDL
- CopyWSDLCommand copyWSDLCommand = new CopyWSDLCommand();
- copyWSDLCommand.setWebServicesParser(webServicesParser);
- copyWSDLCommand.setWsdlURI(wsdlURL);
- copyWSDLCommand.setDestinationURI(outputFile.getLocation().toFile().toURL().toString());
- copyWSDLCommand.setDefinition(definition);
- Status status = copyWSDLCommand.execute(env);
- if(status!=null && status.getSeverity()==Status.ERROR) {
- return status;
- }
- }
- catch (Exception e) {
- Status status = new SimpleStatus(WebServiceAxisCreationUIPlugin.ID, msgUtils_.getMessage("MSG_ERROR_WRITE_WSDL", new String[] { wsdlLocation }), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return status;
- }
- return new SimpleStatus("");
- }
-
- private Status modifyEndpoint(Port port)
- {
- Iterator it = port.getExtensibilityElements().iterator();
- SOAPAddress soapAddress = null;
- while (it.hasNext())
- {
- Object obj = it.next();
- if (obj instanceof SOAPAddress)
- {
- soapAddress = (SOAPAddress)obj;
- break;
- }
- }
- if (soapAddress != null)
- {
- String projectURL = ResourceUtils.getEncodedWebProjectURL(serverProject);
- if (projectURL == null)
- return new SimpleStatus(WebServiceAxisCreationUIPlugin.ID, msgUtils_.getMessage("MSG_ERROR_PROJECT_URL", new String[] {serverProject.toString()}), Status.ERROR, null);
- StringBuffer serviceURL = new StringBuffer(projectURL);
- serviceURL.append(SERVICE_EXT).append(port.getName());
- javaWSDLParam.setUrlLocation(serviceURL.toString());
- soapAddress.setLocationURI(serviceURL.toString());
- }
- return new SimpleStatus("");
- }
-
- /**
- * Returns the javaWSDLParam.
- * @return JavaWSDLParameter
- */
- public JavaWSDLParameter getJavaWSDLParam() {
- return javaWSDLParam;
- }
-
- /**
- * Sets the javaWSDLParam.
- * @param javaWSDLParam The javaWSDLParam to set
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) {
- this.javaWSDLParam = javaWSDLParam;
- }
-
- /**
- * @param serverProject The serverProject to set.
- */
- public void setServerProject(IProject serverProject) {
- this.serverProject = serverProject;
- }
-
- /**
- * @return Returns the webServicesParser.
- */
- public WebServicesParser getWebServicesParser() {
- return webServicesParser;
- }
-
- /**
- * @param webServicesParser The webServicesParser to set.
- */
- public void setWebServicesParser(WebServicesParser webServicesParser) {
- this.webServicesParser = webServicesParser;
- }
-
- public String getWsdlURI()
- {
- File file = new File(getJavaWSDLParam().getOutputWsdlLocation());
- String url = "";
- try {
- url = file.toURL().toString();
- }
- catch(MalformedURLException mue){}
- return url;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/UpdateAxisWSDDFileTask.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/UpdateAxisWSDDFileTask.java
deleted file mode 100644
index 600ef42..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/UpdateAxisWSDDFileTask.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.task;
-
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.axis.consumption.util.FileUtil;
-import org.eclipse.jst.ws.internal.axis.creation.ui.plugin.WebServiceAxisCreationUIPlugin;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-public class UpdateAxisWSDDFileTask extends SimpleCommand {
-
-
- private final String LABEL = "TASK_LABEL_UPDATE_AXIS_WSDD";
- private final String DESCRIPTION = "TASK_DESC_UPDATE_AXIS_WSDD";
- private final String DEPLOY_XSL = "deploy.xsl"; //$NON-NLS-1$
- private final String DEPLOY_BAK = "deploy.wsdd.bak"; //$NON-NLS-1$
- private final String CLASSNAME_PARAM = "newClassName"; //$NON-NLS-1$
- private MessageUtils msgUtils_;
- private MessageUtils coreMsgUtils_;
- private JavaWSDLParameter javaWSDLParam_;
- private IProject serviceProject_;
- // rm private Model model_;
-
- public UpdateAxisWSDDFileTask() {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
- }
-
- public UpdateAxisWSDDFileTask(JavaWSDLParameter javaWSDLParam) {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- coreMsgUtils_ = new MessageUtils( "org.eclipse.jst.ws.axis.consumption.core.consumption", this );
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- setName(msgUtils_.getMessage(LABEL));
- javaWSDLParam_ = javaWSDLParam;
- }
-
- /**
- * Execute UpdateAxisWSDDFileTask
- */
- public Status execute(Environment env) {
-
- // rm
- /*
- //Begin Setters
- WebServiceElement wse =
- WebServiceElement.getWebServiceElement(model_);
- setServiceProject(wse.getServiceProject());
- //End Setters
- */
- Status status = new SimpleStatus("");
- if (javaWSDLParam_ == null) {
- status = new SimpleStatus("",coreMsgUtils_.getMessage("MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- // rm
- /*
- if (model_ == null) {
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_MODEL_NOT_SET"), Status.ERROR);
- return status;
- }
- */
-
- IProject project = serviceProject_;
- String projectURL = ResourceUtils.getEncodedWebProjectURL(project);
- if (projectURL == null) {
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_PROJECT_URL",new String[] {project.toString()}), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- } else {
- javaWSDLParam_.setProjectURL(projectURL);
- }
- String outputLocation = javaWSDLParam_.getJavaOutput();
- if (outputLocation == null) {
- return status;
- }
- try {
- if (!project.hasNature(IWebNatureConstants.J2EE_NATURE_ID))
- return status;
- } catch (Exception ex) {
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_INTERAL"), Status.ERROR, ex);
- env.getStatusHandler().reportError(status);
- return status;
- }
- String[] javaFiles = javaWSDLParam_.getJavaFiles();
- String javaoutput = javaWSDLParam_.getJavaOutput();
- String output = javaWSDLParam_.getOutput();
-
- String webContentPath =
- ResourceUtils
- .getWebModuleServerRoot(project)
- .getLocation()
- .toString();
-
- try {
-
- if (javaWSDLParam_.getDeploymentFiles() != null
- && javaWSDLParam_.getDeploymentFiles().length > 0) {
-
- String wsdd_deploy = javaWSDLParam_.getDeploymentFiles()[0];
- Path deployPath = new Path(wsdd_deploy);
- String deployBackup =
- deployPath
- .removeLastSegments(1)
- .append(DEPLOY_BAK)
- .toString();
- FileUtil.createTargetFile(wsdd_deploy, deployBackup, true);
- String deployXSL = getPluginFilePath(DEPLOY_XSL).toString();
-
- TransformerFactory tFactory = TransformerFactory.newInstance();
-
- // Use the TransformerFactory to instantiate a Transformer that will work with
- // the stylesheet you specify. This method call also processes the stylesheet
- // into a compiled Templates object.
- Transformer transformer =
- tFactory.newTransformer(new StreamSource(deployXSL));
- transformer.setParameter(CLASSNAME_PARAM, javaWSDLParam_.getBeanName());
-
- // Use the Transformer to apply the associated Templates object to an XML document
- // (foo.xml) and write the output to a file (foo.out).
- transformer.transform(
- new StreamSource(deployBackup),
- new StreamResult(new FileOutputStream(wsdd_deploy)));
-
- }
-
- } catch (Exception e) {
- String[] errorMsgStrings = new String[]{project.toString(), outputLocation.toString(), webContentPath.toString()};
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_UPDATE_AXIS_WSDD", errorMsgStrings), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- return status;
- }
-
- private IPath getPluginFilePath(String pluginfileName)
- throws CoreException {
- try {
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- IPluginDescriptor pluginDescriptor =
- pluginRegistry.getPluginDescriptor(WebServiceAxisCreationUIPlugin.ID);
-
- URL localURL =
- Platform.asLocalURL(
- new URL(pluginDescriptor.getInstallURL(), pluginfileName));
- return new Path(localURL.getFile());
- } catch (MalformedURLException e) {
- throw new CoreException(
- new org.eclipse.core.runtime.Status(
- IStatus.WARNING,
- WebServiceAxisCreationUIPlugin.ID,
- 0,
- msgUtils_.getMessage(
- "MSG_PLUGIN_FILE_URL"),
- e));
- } catch (IOException e) {
- throw new CoreException(
- new org.eclipse.core.runtime.Status(
- IStatus.WARNING,
- WebServiceAxisCreationUIPlugin.ID,
- 0,
- msgUtils_.getMessage(
- "MSG_PLUGIN_FILE_URL"),
- e));
- }
- }
-
-
- /**
- * Sets the javaWSDLParam.
- * @param javaWSDLParam The javaWSDLParam to set
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) {
- javaWSDLParam_ = javaWSDLParam;
- }
-
- public JavaWSDLParameter getJavaWSDLParam()
- {
- return javaWSDLParam_;
- }
-
- public void setServiceProject(IProject serviceProject)
- {
- serviceProject_ = serviceProject;
- }
-
- // rm
- /*
- public void setModel(Model model)
- {
- model_ = model;
- }
- */
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/AxisBeanFragment.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/AxisBeanFragment.java
deleted file mode 100644
index 8cfc254..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/AxisBeanFragment.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean;
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.AxisDeployCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.Java2WSDLCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.AddJarsToProjectBuildPathTask;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CheckAxisDeploymentDescriptorsTask;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CopyAxisJarCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.RefreshProjectCommand;
-import org.eclipse.jst.ws.internal.axis.creation.ui.command.JavaToWSDLMethodCommand;
-import org.eclipse.jst.ws.internal.axis.creation.ui.command.UpdateWEBXMLCommand;
-import org.eclipse.jst.ws.internal.axis.creation.ui.task.DefaultsForServerJavaWSDLCommand;
-import org.eclipse.jst.ws.internal.axis.creation.ui.task.LiteralSupportMessageTask;
-import org.eclipse.jst.ws.internal.axis.creation.ui.task.MoveJavaFilesTask;
-import org.eclipse.jst.ws.internal.axis.creation.ui.task.UpdateAxisWSDDFileTask;
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.StartProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.command.WSINonCompliantRuntimeCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionOutputCommand;
-import org.eclipse.wst.command.env.common.WaitForAutoBuildCommand;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.SelectionCommand;
-
-
-public class AxisBeanFragment extends SequenceFragment
-{
-
- public AxisBeanFragment()
- {
- add( new SimpleFragment( new ValidateObjectSelectionCommand(), ""));
- add( new SimpleFragment( new BUAxisDefaultingCommand(), "" ) );
- add( new BUAxisCommandsFragment1());
- add( new BUAxisCommandsFragment2());
- add( new SimpleFragment( "BeanConfig" ) );
- add( new MappingFragment() );
- add( new BUAxisCommandsFragment3());
- }
-
- public void registerDataMappings(DataMappingRegistry registry)
- {
- //ValidateObjectSelectionCommand
- registry.addMapping(ObjectSelectionOutputCommand.class, "ObjectSelection", ValidateObjectSelectionCommand.class);
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", ValidateObjectSelectionCommand.class,"ServiceProjectName", null );
-
- //BUAxisDefaultingCommand
- registry.addMapping(SelectionCommand.class, "InitialSelection", BUAxisDefaultingCommand.class );
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", BUAxisDefaultingCommand.class );
-
- //WSINonCompliantRuntimeCommand
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", WSINonCompliantRuntimeCommand.class, "ServiceProject", new StringToIProjectTransformer());
-
- //BUAxisCommands2 - these run after BeanClassWidget
- //DefaultsForServerJavaWSDLCommand
- registry.addMapping(BUAxisDefaultingCommand.class, "JavaWSDLParam", DefaultsForServerJavaWSDLCommand.class);
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", DefaultsForServerJavaWSDLCommand.class, "ServiceProject", new StringToIProjectTransformer());
- registry.addMapping(BUAxisDefaultingCommand.class, "JavaBeanName", DefaultsForServerJavaWSDLCommand.class);
- registry.addMapping(BUAxisDefaultingCommand.class, "Parser", DefaultsForServerJavaWSDLCommand.class);
- registry.addMapping(BUAxisDefaultingCommand.class, "CustomizeServiceMappings", AxisBeanFragment.MappingFragment.class);
-
- //JavaWSDLMethodCommand
- registry.addMapping(DefaultsForServerJavaWSDLCommand.class, "JavaWSDLParam", JavaToWSDLMethodCommand.class);
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", JavaToWSDLMethodCommand.class, "ServiceProject", new StringToIProjectTransformer());
-
- // BUAxisCommands3 - these run after BeanConfigWidget
- //LiteralSupportMessageTask
- registry.addMapping(JavaToWSDLMethodCommand.class, "JavaWSDLParam", LiteralSupportMessageTask.class);
-
- //CheckAxisDeploymentDescriptorsTask
- //registry.addMapping(JavaToWSDLMethodCommand.class, "JavaWSDLParam", CheckAxisDeploymentDescriptorsTask.class);
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", CheckAxisDeploymentDescriptorsTask.class, "ServerProject", new StringToIProjectTransformer());
-
- //CopyAxisJarCommand
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", CopyAxisJarCommand.class, "Project", new StringToIProjectTransformer());
-
- //AddJarsToProjectBuildPathTask
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", AddJarsToProjectBuildPathTask.class, "Project", new StringToIProjectTransformer());
-
- //Java2WSDLCommand
- registry.addMapping(JavaToWSDLMethodCommand.class, "JavaWSDLParam", Java2WSDLCommand.class);
-
- //RefreshProjectCommand
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", RefreshProjectCommand.class, "Project", new StringToIProjectTransformer());
-
- //WSDL2JavaCommand
- registry.addMapping(JavaToWSDLMethodCommand.class, "JavaWSDLParam", WSDL2JavaCommand.class);
-
-
- //MoveJavaFilesTask
- registry.addMapping(WSDL2JavaCommand.class, "JavaWSDLParam", MoveJavaFilesTask.class);
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", MoveJavaFilesTask.class, "ServiceProject", new StringToIProjectTransformer());
-
- //UpdateAxisWSDDFileTask
- registry.addMapping(MoveJavaFilesTask.class, "JavaWSDLParam", UpdateAxisWSDDFileTask.class);
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", UpdateAxisWSDDFileTask.class, "ServiceProject", new StringToIProjectTransformer());
-
- //UpdateWEBXMLCommand
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", UpdateWEBXMLCommand.class, "ServerProject", new StringToIProjectTransformer());
-
- //BuildProjectCommand
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", BuildProjectCommand.class, "Project", new StringToIProjectTransformer());
- registry.addMapping(BUAxisDefaultingCommand.class, "ForceBuild", BuildProjectCommand.class);
- registry.addMapping(BUAxisDefaultingCommand.class, "ValidationManager", BuildProjectCommand.class);
-
- //StartProjectCommand
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", StartProjectCommand.class, "ServiceProject", new StringToIProjectTransformer());
- registry.addMapping(BUAxisDefaultingCommand.class, "SampleProject", StartProjectCommand.class);
- registry.addMapping(BUAxisDefaultingCommand.class, "ServiceServerTypeID", StartProjectCommand.class);
- registry.addMapping(BUAxisDefaultingCommand.class, "SampleServerTypeID", StartProjectCommand.class);
- registry.addMapping(BUAxisDefaultingCommand.class, "ServiceExistingServer", StartProjectCommand.class);
- registry.addMapping(BUAxisDefaultingCommand.class, "SampleExistingServer", StartProjectCommand.class);
- registry.addMapping(BUAxisDefaultingCommand.class, "IsWebProjectStartupRequested",StartProjectCommand.class);
-
- //AxisDeployCommand
- registry.addMapping(UpdateAxisWSDDFileTask.class, "JavaWSDLParam", AxisDeployCommand.class);
-
- //CopyAxisServerConfigTask
- /*
- registry.addMapping(UpdateAxisWSDDFileTask.class, "JavaWSDLParam", CopyAxisServerConfigTask.class);
- registry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", CopyAxisServerConfigTask.class, "ServiceProject", new StringToIProjectTransformer());
- registry.addMapping(BUAxisDefaultingCommand.class, "ServiceExistingServer", CopyAxisServerConfigTask.class);
- registry.addMapping(BUAxisDefaultingCommand.class, "ServiceServerTypeID", CopyAxisServerConfigTask.class);
- */
-
- // ServerExtensionOutputCommand
- registry.addMapping(Java2WSDLCommand.class, "WsdlURI", ServerExtensionOutputCommand.class);
- }
-
- private class BUAxisCommandsFragment1 extends SequenceFragment
- {
- public BUAxisCommandsFragment1()
- {
- add(new SimpleFragment(new WSINonCompliantRuntimeCommand(), ""));
- }
- }
-
- private class BUAxisCommandsFragment2 extends SequenceFragment
- {
- public BUAxisCommandsFragment2()
- {
- add(new SimpleFragment(new DefaultsForServerJavaWSDLCommand(), ""));
- add(new SimpleFragment(new JavaToWSDLMethodCommand(), ""));
- }
- }
-
- private class BUAxisCommandsFragment3 extends SequenceFragment
- {
- public BUAxisCommandsFragment3()
- {
- add(new SimpleFragment(new LiteralSupportMessageTask(), ""));
- add(new SimpleFragment(new CheckAxisDeploymentDescriptorsTask(), ""));
- add(new SimpleFragment(new CopyAxisJarCommand(), ""));
- add(new SimpleFragment(new AddJarsToProjectBuildPathTask(), ""));
- add(new SimpleFragment(new WaitForAutoBuildCommand(), "" ));
- add(new SimpleFragment(new Java2WSDLCommand(), ""));
- add(new SimpleFragment(new RefreshProjectCommand(), ""));
- add(new SimpleFragment(new WSDL2JavaCommand(), ""));
- add(new SimpleFragment(new MoveJavaFilesTask(), ""));
- add(new SimpleFragment(new UpdateAxisWSDDFileTask(), ""));
- add(new SimpleFragment(new UpdateWEBXMLCommand(), ""));
- add(new SimpleFragment(new RefreshProjectCommand(), ""));
- add(new SimpleFragment(new BuildProjectCommand(), ""));
- add(new SimpleFragment(new StartProjectCommand(), ""));
- add(new SimpleFragment(new AxisDeployCommand(), ""));
- //add(new SimpleFragment(new CopyAxisServerConfigTask(), ""));
- add(new SimpleFragment(new RefreshProjectCommand(), ""));
- }
- }
-
- public class MappingFragment extends BooleanFragment
- {
- private boolean showMappings_;
-
- public MappingFragment()
- {
- super();
-
- setTrueFragment( new SimpleFragment( "AxisServiceBeanMapping" ));
- setCondition( new Condition()
- {
- public boolean evaluate()
- {
- return showMappings_;
- }
- } );
- }
-
- public void setCustomizeServiceMappings( boolean showMappings )
- {
- showMappings_ = showMappings;
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BUAxisDefaultingCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BUAxisDefaultingCommand.java
deleted file mode 100644
index e8eda24..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BUAxisDefaultingCommand.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.common.JavaResourceFilter;
-import org.eclipse.jst.ws.internal.consumption.datamodel.validate.ValidationManager;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-/**
- *
- */
-public class BUAxisDefaultingCommand extends SimpleCommand
-{
- //Need
- private IStructuredSelection initialSelection_;
- private TypeRuntimeServer serviceIds_;
-
- //Provide
- private IServer serviceExistingServer_;
- private String serviceServerTypeID_; // rsk revisit
- private JavaWSDLParameter javaWSDLParam_;
- private String javaBeanName_;
- private WebServicesParser parser_;
- private boolean forceBuild_ = true;
- private Boolean IsWebProjectStartupRequested = Boolean.TRUE; // rsk revisit
- private ValidationManager validationManager_;
- private boolean customizeServiceMappings_ = false;
-
- //This is proxy and client related information
- //which can be nulled for commands dealing
- //with service creation.
- //rsk revisit
- private Boolean isProxyProject_ = Boolean.FALSE;
- private String clientRuntimeID_ = null;
- private IProject proxyProject_ = null;
- private IProject sampleProject_ = null;
- private String sampleServerTypeID_ = null;
- private IServer sampleExistingServer_ = null;
-
- private MessageUtils msgUtils_;
-
- public Status execute(Environment env)
- {
-
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
-
- if (serviceIds_.getServerInstanceId() != null) { // server exists
- serviceExistingServer_ = ServerCore.findServer(serviceIds_.getServerInstanceId());
- }
- if (serviceExistingServer_ != null)
- {
- serviceServerTypeID_ = serviceExistingServer_.getServerType().getId();
- }
- else
- {
- serviceServerTypeID_ = serviceIds_.getServerId();
- // server will be created in ServerDeployableConfigurationCommand
- }
-
- //javaWSDLParam
- javaWSDLParam_ = new JavaWSDLParameter();
-
- if (initialSelection_ == null) {
- Status status = new SimpleStatus("BUAxisDefaultingCommand", //$NON-NLS-1$
- msgUtils_.getMessage("MSG_ERROR_INITIAL_SELECTION"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- try {
-
- javaBeanName_ = getJavaBeanFromInitialSelection(env);
-
- } catch (CoreException e) {
- Status status = new SimpleStatus("BUAxisDefaultingCommand", //$NON-NLS-1$
- msgUtils_.getMessage("MSG_ERROR_INITIAL_SELECTION") + " " //$NON-NLS-1$
- +e.getCause().toString(), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- //parser
- parser_ = new WebServicesParserExt();
-
-
-
- //validationManager
- validationManager_ = new ValidationManager();
-
- return new SimpleStatus("");
- }
-
- private String getJavaBeanFromInitialSelection(Environment env) throws CoreException
- {
- String beanClass = "";
- JavaResourceFilter filter = new JavaResourceFilter();
- IStructuredSelection selection = initialSelection_;
- //
- if (selection != null)
- {
- Object obj = selection.getFirstElement();
- if (obj != null)
- {
- // get the IResource represented by the selection
- IResource res = null;
-
- res = ResourceUtils.getResourceFromSelection(obj);
-
- if (filter.accepts(res))
- {
- // get the package-qualified class name without file extensions
- String beanPackage = ResourceUtils.getJavaResourcePackageName(res.getFullPath());
- if (beanPackage==null)
- beanPackage = "";
- else
- beanPackage = beanPackage + ".";
-
- beanClass = beanPackage + res.getName();
-
- if (beanClass.toLowerCase().endsWith(".java") || beanClass.toLowerCase().endsWith(".class")) {
- beanClass = beanClass.substring(0,beanClass.lastIndexOf('.'));
- }
- }
- }
- }
-
- //
- return beanClass;
- }
- /**
- * @return Returns the clientRuntimeID_.
- */
- public String getClientRuntimeID()
- {
- return clientRuntimeID_;
- }
- /**
- * @return Returns the forceBuild_.
- */
- public boolean getForceBuild()
- {
- return forceBuild_;
- }
- /**
- * @return Returns the isProxyProject_.
- */
- public Boolean getIsProxyProject()
- {
- return isProxyProject_;
- }
- /**
- * @return Returns the javaBeanName_.
- */
- public String getJavaBeanName()
- {
- return javaBeanName_;
- }
- /**
- * @return Returns the javaWSDLParam_.
- */
- public JavaWSDLParameter getJavaWSDLParam()
- {
- return javaWSDLParam_;
- }
- /**
- * @return Returns the parser_.
- */
- public WebServicesParser getParser()
- {
- return parser_;
- }
- /**
- * @return Returns the proxyProject_.
- */
- public IProject getProxyProject()
- {
- return proxyProject_;
- }
- /**
- * @return Returns the sampleExistingServer_.
- */
- public IServer getSampleExistingServer()
- {
- return sampleExistingServer_;
- }
- /**
- * @return Returns the sampleProject_.
- */
- public IProject getSampleProject()
- {
- return sampleProject_;
- }
- /**
- * @return Returns the sampleServerTypeID_.
- */
- public String getSampleServerTypeID()
- {
- return sampleServerTypeID_;
- }
- /**
- * @return Returns the validationManager_.
- */
- public ValidationManager getValidationManager()
- {
- return validationManager_;
- }
-
- public void setInitialSelection(IStructuredSelection initialSelection)
- {
- initialSelection_ = initialSelection;
- }
- /**
- * @return Returns the serviceExistingServer_.
- */
- public IServer getServiceExistingServer()
- {
- return serviceExistingServer_;
- }
-
- public String getServiceServerTypeID()
- {
- return serviceServerTypeID_;
- }
-
- public boolean getCustomizeServiceMappings()
- {
- return customizeServiceMappings_;
- }
- /**
- * @return Returns the isWebProjectStartupRequested.
- */
- public Boolean getIsWebProjectStartupRequested()
- {
- return IsWebProjectStartupRequested;
- }
-
- public void setServiceTypeRuntimeServer(TypeRuntimeServer ids)
- {
- serviceIds_ = ids;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BeanClassWidget.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BeanClassWidget.java
deleted file mode 100644
index 111b923..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BeanClassWidget.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.common.JavaResourceFilter;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.jst.ws.internal.ui.dialog.DialogUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class BeanClassWidget extends SimpleWidgetDataContributor
-{
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- private String thisPlugin = "org.eclipse.jst.ws.axis.creation.ui";
- private IProject serverProject_ = null;
- private Composite parent_ = null;
- private IWizardContainer context_ = null;
- private JavaResourceFilter filter_ = new JavaResourceFilter();
- private IResource initialResource_ = null;
-
- /*CONTEXT_ID PBCL0001 for the Bean Selection Page*/
- private String INFOPOP_PBCL_PAGE = "PBCL0001";
-
- private Text beanClassText_;
- /*CONTEXT_ID PBCL0002 for the Bean Selection field of the Bean Selection Page*/
- private String INFOPOP_PBCL_TEXT_BEAN_CLASS = "PBCL0002";
-
- private Button beanClassBrowseButton_;
- /*CONTEXT_ID PBCL0003 for the Bean Class Browse button of the Bean Selection Page*/
- private String INFOPOP_PBCL_BUTTON_BEAN_CLASS_BROWSE = "PBCL0003";
-
- private Button beanResourceBrowseButton_;
- /*CONTEXT_ID PBCL0004 for the Bean Resource Browse button of the Bean Selection Page*/
- private String INFOPOP_PBCL_BUTTON_BEAN_RESOURCE_BROWSE = "PBCL0004";
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- UIUtils uiUtils = new UIUtils(msgUtils, thisPlugin );
-
- parent_ = parent;
-
- Composite group = uiUtils.createComposite( parent, 4 );
-
- group.setToolTipText( msgUtils.getMessage("TOOLTIP_PBCL_PAGE") );
- WorkbenchHelp.setHelp( group, pluginId_ + "." + INFOPOP_PBCL_PAGE );
-
- beanClassText_ = uiUtils.createText( group, "LABEL_BEAN_CLASS_NAME",
- "TOOLTIP_PBCL_TEXT_BEAN_CLASS",
- INFOPOP_PBCL_TEXT_BEAN_CLASS,
- SWT.SINGLE | SWT.BORDER);
-
- beanClassBrowseButton_ = uiUtils.createPushButton( group, "BUTTON_BROWSE_CLASSES",
- "TOOLTIP_PBCL_BUTTON_BEAN_CLASS_BROWSE",
- INFOPOP_PBCL_BUTTON_BEAN_CLASS_BROWSE );
- beanClassBrowseButton_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleBrowseClasses();
- }
- } );
-
- beanResourceBrowseButton_ = uiUtils.createPushButton( group, "BUTTON_BROWSE_FILES",
- "TOOLTIP_PBCL_BUTTON_BEAN_RESOURCE_BROWSE",
- INFOPOP_PBCL_BUTTON_BEAN_RESOURCE_BROWSE );
- beanResourceBrowseButton_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleBrowseFiles();
- }
- } );
-
- return this;
- }
-
- private void handleBrowseClasses()
- {
- String className = DialogUtils.browseClasses( parent_.getShell(),
- serverProject_, context_ );
-
- if (className!=null) beanClassText_.setText(className);
-
- }
-
- private void handleBrowseFiles()
- {
- IResource topResource = serverProject_;
-
- if (topResource == null)
- {
- topResource = ResourceUtils.getWorkspaceRoot();
- }
-
- IResource resource
- = DialogUtils.browseResources( parent_.getShell(),
- topResource,
- initialResource_,
- filter_ );
-
- if( resource != null )
- {
- IPath path = resource.getFullPath();
- String basename = path.lastSegment();
-
- if( basename != null && basename.length() > 0 )
- {
- String beanPackage = org.eclipse.jst.ws.internal.common.ResourceUtils.getJavaResourcePackageName(path);
- String beanClass = (beanPackage == null ? basename : (beanPackage + "." + basename));
-
- if( beanClass.toLowerCase().endsWith(".java") || beanClass.toLowerCase().endsWith(".class" ) )
- {
- beanClass = beanClass.substring( 0, beanClass.lastIndexOf('.') );
- }
-
- beanClassText_.setText(beanClass);
- }
- }
- }
-
- public void setCurrentPage( IWizardPage page )
- {
- context_ = page.getWizard().getContainer();
- }
-
- public void setBeanClassName(String beanClassName)
- {
- beanClassText_.setText(beanClassName);
- }
-
- public String getBeanClassName()
- {
- return beanClassText_.getText().trim();
- }
-
- public void setServerProjectName( String name )
- {
- serverProject_ = (IProject)ResourceUtils.findResource( new Path( name ).makeAbsolute() );
- }
-
- public void setInitialResource( IResource resource )
- {
- initialResource_ = resource;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BeanConfigWidget.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BeanConfigWidget.java
deleted file mode 100644
index 2b834e9..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BeanConfigWidget.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.axis.consumption.util.PlatformUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class BeanConfigWidget extends SimpleWidgetDataContributor
-{
- private String pluginId_ = "org.eclipse.jst.ws.axis.creation.ui";
-
- private Button rpcEncodedButton_;
- private Button rpcLiteralButton_;
- private Button docLiteralButton_;
-
- private Listener statusListener_;
-
- private JavaWSDLParameter javaParameter_;
-
- /* CONTEXT_ID PBCF0001 for the Bean Config Page */
- private final String INFOPOP_PBCF_PAGE = "PBCF0001"; //$NON-NLS-1$
- private final String TOOLTIP_PBCF_PAGE = "TOOLTIP_PBCF_PAGE";
-
- private Text uriText_;
- /* CONTEXT_ID PBCF0002 for the URI field of the Bean Config Page */
- private final String INFOPOP_PBCF_TEXT_URI = "PBCF0002"; //$NON-NLS-1$
- private final String TOOLTIP_PBCF_TEXT_URI = "TOOLTIP_PBCF_TEXT_URI";
-
- private Text wsdlFolderText_;
- /* CONTEXT_ID PBCF0006 for the WSDL Folder field in the Bean Config Page */
- private final String INFOPOP_PBCF_TEXT_WSDL_FOLDER = "PBCF0006"; //$NON-NLS-1$
- private final String TOOLTIP_PBCF_TEXT_WSDL_FOLDER = "TOOLTIP_PBCF_TEXT_WSDL_FOLDER";
-
- private Text wsdlFileText_;
- /* CONTEXT_ID PBCF0007 for the WSDL File field of the Bean Config Page */
- private final String INFOPOP_PBCF_TEXT_WSDL_FILE = "PBCF0007"; //$NON-NLS-1$
- private final String TOOLTIP_PBCF_TEXT_WSDL_FILE = "TOOLTIP_PBCF_TEXT_WSDL_FILE";
-
- private Tree methodsTree_;
- /* CONTEXT_ID PBME0002 for the Methods tree of the Bean Methods Page */
- private final String INFOPOP_PBME_TREE_METHODS = "PBME0002"; //$NON-NLS-1$
- private final String TOOLTIP_PBME_TREE_METHODS = "TOOLTIP_PBME_TREE_METHODS";
-
- private Button selectAllMethodsButton_;
- /* CONTEXT_ID PBME0010 for the Select All button of the Bean Methods Page */
- private final String INFOPOP_PBME_BUTTON_SELECT_ALL = "PBME0010"; //$NON-NLS-1$
- private final String TOOLTIP_PBME_BUTTON_SELECT_ALL = "TOOLTIP_PBME_BUTTON_SELECT_ALL";
-
- private Button deselectAllMethodsButton_;
- /* CONTEXT_ID PBME0011 for the Deselect All button of the Bean Methods Page */
- private final String INFOPOP_PBME_BUTTON_DESELECT_ALL = "PBME0011"; //$NON-NLS-1$
- private final String TOOLTIP_PBME_BUTTON_DESELECT_ALL = "TOOLTIP_PBME_BUTTON_DESELECT_ALL";
-
- private Button showMappingsCheckbox_;
- /* CONTEXT_ID PBCF0016 for the Show Mappings checkbox of the Bean Methods Page */
- private String INFOPOP_P2N_SHOW_MAPPINGS = "PBCF0016"; //$NON-NLS-1$
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- String baseConPluginId = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- MessageUtils baseConUtils = new MessageUtils( baseConPluginId + ".plugin", this );
- UIUtils uiUtils = new UIUtils(msgUtils, pluginId_ );
- UIUtils baseConUiUtils = new UIUtils( baseConUtils, pluginId_ );
-
- statusListener_ = statusListener;
- parent.setToolTipText( msgUtils.getMessage( TOOLTIP_PBCF_PAGE ) );
- WorkbenchHelp.setHelp( parent, pluginId_ + "." + INFOPOP_PBCF_PAGE );
-
- Composite configGroup = uiUtils.createComposite( parent, 2 );
-
- uriText_ = uiUtils.createText( configGroup, "LABEL_URI",
- TOOLTIP_PBCF_TEXT_URI,
- INFOPOP_PBCF_TEXT_URI,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
-
- wsdlFolderText_ = uiUtils.createText( configGroup, "LABEL_OUTPUT_FOLDER_NAME",
- TOOLTIP_PBCF_TEXT_WSDL_FOLDER,
- INFOPOP_PBCF_TEXT_WSDL_FOLDER,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
-
- wsdlFileText_ = uiUtils.createText( configGroup, "LABEL_OUTPUT_FILE_NAME",
- TOOLTIP_PBCF_TEXT_WSDL_FILE,
- INFOPOP_PBCF_TEXT_WSDL_FILE,
- SWT.SINGLE | SWT.BORDER );
- wsdlFileText_.addListener( SWT.Modify, statusListener );
-
- Label separator = uiUtils.createHorizontalSeparator( parent, 6 );
-
- // TODO this group has no TOOLTIP or INFOPOP.
- Group methodsGroup = baseConUiUtils.createGroup( parent, "LABEL_METHODS", null, null );
- methodsGroup.setLayoutData( uiUtils.createFillAll() );
-
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- methodsGroup.setLayout( layout );
-
- methodsTree_ = uiUtils.createTree( methodsGroup, TOOLTIP_PBME_TREE_METHODS,
- INFOPOP_PBME_TREE_METHODS,
- SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.CHECK );
- methodsTree_.addListener( SWT.Selection, statusListener );
-
- Composite selectButtons = uiUtils.createComposite( methodsGroup, 2 );
-
- selectAllMethodsButton_
- = baseConUiUtils.createPushButton( selectButtons, "BUTTON_SELECT_ALL",
- TOOLTIP_PBME_BUTTON_SELECT_ALL,
- INFOPOP_PBME_BUTTON_SELECT_ALL );
- selectAllMethodsButton_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleSelectAll( true );
- }
- });
-
- deselectAllMethodsButton_
- = baseConUiUtils.createPushButton( selectButtons, "BUTTON_DESELECT_ALL",
- TOOLTIP_PBME_BUTTON_DESELECT_ALL,
- INFOPOP_PBME_BUTTON_DESELECT_ALL );
- deselectAllMethodsButton_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleSelectAll( false );
- }
- });
-
- // TODO this group has no TOOLTIP or INFOPOP.
- Group styleGroup = uiUtils.createGroup( parent, "LABEL_STYLE_USE", null, null );
-
- // TODO radio buttons have no TOOLTIP or INFOPOP.
- docLiteralButton_ = uiUtils.createRadioButton( styleGroup, "STYLE_DOC_LITERAL", null, null );
- rpcLiteralButton_ = uiUtils.createRadioButton( styleGroup, "STYLE_RPC_LITERAL", null, null );
- rpcEncodedButton_ = uiUtils.createRadioButton( styleGroup, "STYLE_RPC_ENCODED", null, null );
-
- showMappingsCheckbox_ = uiUtils.createCheckbox( parent, "LABEL_EXPLORE_MAPPINGS_BEAN2XML",
- "TOOLTIP_P2N_SHOW_MAPPINGS",
- INFOPOP_P2N_SHOW_MAPPINGS );
-
- return this;
- }
-
- public void handleSelectAll( boolean value )
- {
- TreeItem[] items = methodsTree_.getItems();
-
- for( int i = 0; i < items.length; i++ )
- {
- items[i].setChecked(value);
- }
-
- statusListener_.handleEvent( null );
- }
-
- public void setCustomizeServiceMappings( boolean value )
- {
- showMappingsCheckbox_.setSelection( value );
- }
-
- public boolean getCustomizeServiceMappings()
- {
- return showMappingsCheckbox_.getSelection();
- }
-
- public void setJavaParameter( JavaWSDLParameter javaParameter )
- {
- javaParameter_ = javaParameter;
-
- String wsdlLocation = javaParameter.getOutputWsdlLocation();
-
- // TODO Verify that we need to find the WSDL in the eclipse file system.
- //IFile file
- // = ResourceUtils.getWorkspaceRoot().getFileForLocation(new Path(wsdlLocation));
- //IPath wsdlPath = file.getFullPath();
- IPath wsdlPath = new Path( wsdlLocation );
-
- wsdlFolderText_.setText(wsdlPath.removeLastSegments(1).toString());
- wsdlFileText_.setText(wsdlPath.lastSegment());
-
- String location = javaParameter.getUrlLocation();
- uriText_.setText(location == null ? "" : location);
-
- methodsTree_.removeAll();
- Hashtable methods = javaParameter.getMethods();
- Enumeration e = methods.keys();
-
- while( e.hasMoreElements() )
- {
- String name = (String) e.nextElement();
- TreeItem item = new TreeItem(methodsTree_, SWT.NULL);
-
- item.setData(name);
- item.setText(name);
- item.setChecked((((Boolean) methods.get(name)).booleanValue()));
- }
-
- TreeItem[] items = methodsTree_.getItems();
-
- if( items.length > 0 )
- {
- methodsTree_.setSelection( new TreeItem[]{ items[0] } );
- }
-
- String style = javaParameter.getStyle();
-
- if( style.equals( JavaWSDLParameter.STYLE_RPC ) )
- {
- rpcEncodedButton_.setSelection(true);
- }
- else if( style.equals( JavaWSDLParameter.STYLE_DOCUMENT ) )
- {
- rpcLiteralButton_.setSelection(true);
- }
- else
- {
- docLiteralButton_.setSelection(true);
- }
- }
-
- public JavaWSDLParameter getJavaParameter()
- {
- IPath wsdlPath
- = new Path( wsdlFolderText_.getText().trim() ).append( wsdlFileText_.getText().trim() );
- IWorkspaceRoot workspace = ResourceUtils.getWorkspaceRoot();
-
- // TODO Do we need to go to the eclipse file system??
- //String wsdlLocation = workspace.getFile(wsdlPath).getLocation().toString();
- String wsdlLocation = wsdlPath.toString();
-
- javaParameter_.setOutputWsdlLocation(wsdlLocation);
- javaParameter_.setInputWsdlLocation(wsdlLocation);
-
- String fileURL = PlatformUtils.getFileURLFromPath(new Path(wsdlLocation));
-
- Hashtable methods = new Hashtable();
-
- TreeItem[] items = methodsTree_.getItems();
-
- for( int i = 0; i < items.length; i++ )
- {
- TreeItem item = items[i];
- methods.put((String)item.getData(), new Boolean(item.getChecked()));
- }
-
- javaParameter_.setMethods(methods);
-
- if( rpcEncodedButton_.getSelection())
- {
- javaParameter_.setStyle(JavaWSDLParameter.STYLE_RPC);
- javaParameter_.setUse(JavaWSDLParameter.USE_ENCODED);
- }
- else if( rpcLiteralButton_.getSelection())
- {
- javaParameter_.setStyle(JavaWSDLParameter.STYLE_DOCUMENT);
- javaParameter_.setUse(JavaWSDLParameter.USE_LITERAL);
- }
- else
- {
- javaParameter_.setStyle(JavaWSDLParameter.STYLE_WRAPPED);
- javaParameter_.setUse(JavaWSDLParameter.USE_LITERAL);
- }
-
- return javaParameter_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus()
- */
- public Status getStatus()
- {
- Status result = null;
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
-
- if( wsdlFileText_.getText().equals( "" ) )
- {
- result = new SimpleStatus( "", msgUtils.getMessage( "PAGE_MSG_NO_FILE_SPECIFIED" ), Status.ERROR );
- }
- else
- {
- TreeItem[] items = methodsTree_.getItems();
- boolean itemSelected = false;
-
- for( int index = 0; index < items.length; index++ )
- {
- if( items[index].getChecked() )
- {
- itemSelected = true;
- break;
- }
- }
-
- if( !itemSelected )
- {
- result = new SimpleStatus( "", msgUtils.getMessage( "PAGE_MSG_NO_METHOD_SELECTED" ), Status.ERROR );
- }
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/DefaultsForConfig.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/DefaultsForConfig.java
deleted file mode 100644
index db676aa..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/DefaultsForConfig.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean;
-
-import java.util.Hashtable;
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-
-
-public class DefaultsForConfig extends SimpleCommand
-{
- public JavaWSDLParameter getJavaParameter()
- {
- JavaWSDLParameter parameter = new JavaWSDLParameter();
- Hashtable methods = new Hashtable();
-
- methods.put( "method1", new Boolean( true ) );
- methods.put( "method2", new Boolean( false ) );
- methods.put( "method3", new Boolean( true ) );
-
- parameter.setMethods( methods );
- parameter.setOutputWsdlLocation( "/SomeProj/SomeFolder/SomeFile" );
- parameter.setUrlLocation( "SomeURLLocation" );
- parameter.setStyle( JavaWSDLParameter.STYLE_DOCUMENT );
-
- return parameter;
- }
-
- public boolean getCustomizeServiceMappings()
- {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/ValidateObjectSelectionCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/ValidateObjectSelectionCommand.java
deleted file mode 100644
index 8c88ee3..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/ValidateObjectSelectionCommand.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jem.internal.plugin.JavaEMFNature;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.impl.JavaClassImpl;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.common.JavaResourceFilter;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class ValidateObjectSelectionCommand extends SimpleCommand
-{
- private String JAVA_EXTENSION = ".java"; //$NON-NLS-1$
- private String CLASS_EXTENSION = ".class"; //$NON-NLS-1$
- private MessageUtils msgUtils_;
- private IStructuredSelection objectSelection;
- private String serviceProjectName;
-
-
- /**
- * Validates that the selected Java bean can be loaded from the service project. If it can't, an error is displayed.
- */
- public ValidateObjectSelectionCommand()
- {
- super();
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- }
- public Status execute(Environment env)
- {
- //Make sure a bean is selected
- String javaBeanName = null;
- if (objectSelection != null && !objectSelection.isEmpty())
- {
- Object object = objectSelection.getFirstElement();
- if (object instanceof String)
- {
- javaBeanName = ((String)object);
- }
- else
- {
- //The ObjectSelectionWidget never appeared and so the IStucturedSelection from
- //ObjectSelectionWidgetOutputCommand is the initial selection.
- //Get the Java bean name from the selection.
- try
- {
- System.out.println(object.getClass().toString());
- javaBeanName = getJavaBeanFromObjectSelection(objectSelection);
- } catch (CoreException ce)
- {
- Status errorStatus = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_CANNOT_NO_JAVA_BEAN"),Status.ERROR);
- env.getStatusHandler().reportError(errorStatus);
- return errorStatus;
- }
- }
- }
-
- if (javaBeanName==null || javaBeanName.length()==0)
- {
- Status errorStatus = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_CANNOT_NO_JAVA_BEAN"),Status.ERROR);
- env.getStatusHandler().reportError(errorStatus);
- return errorStatus;
- }
-
- //Make sure a project is selected
- IProject serviceProject = (IProject)((new StringToIProjectTransformer()).transform(serviceProjectName));
- if (serviceProject==null)
- {
- Status errorStatus = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_NO_PROJECT"),Status.ERROR);
- env.getStatusHandler().reportError(errorStatus);
- return errorStatus;
- }
-
- //Make sure the selected bean can be loaded from the selected project
- if (javaBeanName.toLowerCase().endsWith(JAVA_EXTENSION)
- || javaBeanName.toLowerCase().endsWith(CLASS_EXTENSION)) {
- javaBeanName = javaBeanName.substring(0, javaBeanName.lastIndexOf('.'));
- }
-
- try
- {
- JavaEMFNature jMOF = (JavaEMFNature) JavaEMFNature.createRuntime(serviceProject);
- JavaClass javaClass =(JavaClass) JavaClassImpl.reflect(javaBeanName, jMOF.getResourceSet());
- if (!javaClass.isExistingType())
- {
- Status errorStatus = new SimpleStatus("JavaToWSDLMethodCommand", msgUtils_.getMessage("MSG_ERROR_CANNOT_LOAD_JAVA_BEAN", new String[] { javaBeanName, serviceProjectName }),Status.ERROR);
- env.getStatusHandler().reportError(errorStatus);
- return errorStatus;
- }
- } catch (CoreException ce)
- {
- Status errorStatus = new SimpleStatus("JavaToWSDLMethodCommand", msgUtils_.getMessage("MSG_ERROR_CANNOT_LOAD_JAVA_BEAN", new String[] { javaBeanName, serviceProjectName }),Status.ERROR);
- env.getStatusHandler().reportError(errorStatus);
- return errorStatus;
- }
-
- return new SimpleStatus("");
- }
-
- /**
- * @param serviceProjectName The serviceProjectName to set.
- */
- public void setServiceProjectName(String serviceProjectName)
- {
- this.serviceProjectName = serviceProjectName;
- }
-
- /**
- * @param objectSelection The objectSelection to set.
- */
- public void setObjectSelection(IStructuredSelection objectSelection)
- {
- this.objectSelection = objectSelection;
- }
-
- private String getJavaBeanFromObjectSelection(IStructuredSelection objectSelection) throws CoreException
- {
- String beanClass = "";
- JavaResourceFilter filter = new JavaResourceFilter();
- //IStructuredSelection selection = initialSelection_;
- //
- if (objectSelection != null)
- {
- Object obj = objectSelection.getFirstElement();
- if (obj != null)
- {
- // get the IResource represented by the selection
- IResource res = null;
-
- res = ResourceUtils.getResourceFromSelection(obj);
-
- if (filter.accepts(res))
- {
- // get the package-qualified class name without file extensions
- String beanPackage = ResourceUtils.getJavaResourcePackageName(res.getFullPath());
- if (beanPackage==null)
- beanPackage = "";
- else
- beanPackage = beanPackage + ".";
-
- beanClass = beanPackage + res.getName();
-
- if (beanClass.toLowerCase().endsWith(".java") || beanClass.toLowerCase().endsWith(".class")) {
- beanClass = beanClass.substring(0,beanClass.lastIndexOf('.'));
- }
- }
- }
- }
-
- //
- return beanClass;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/AxisSkeletonDefaultingCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/AxisSkeletonDefaultingCommand.java
deleted file mode 100644
index 3bbe932..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/AxisSkeletonDefaultingCommand.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-public class AxisSkeletonDefaultingCommand extends SimpleCommand
-{
- private IStructuredSelection initialSelection;
- private IStructuredSelection objectSelection;
- private WebServicesParser webServicesParser;
-
- public void setInitialSelection(IStructuredSelection initialSelection)
- {
- this.initialSelection = initialSelection;
- }
-
- public void setObjectSelection(IStructuredSelection objectSelection)
- {
- this.objectSelection = objectSelection;
- }
-
- public void setWebServicesParser(WebServicesParser webServicesParser)
- {
- this.webServicesParser = webServicesParser;
- }
-
- public WebServicesParser getWebServicesParser()
- {
- if (webServicesParser == null)
- webServicesParser = new WebServicesParserExt();
- return webServicesParser;
- }
-
- public String getWebServiceURI()
- {
- if (initialSelection != null && !initialSelection.isEmpty())
- {
- Object firstElement = initialSelection.getFirstElement();
- if (firstElement instanceof IFile)
- {
- IFile ifile = (IFile)firstElement;
- String fileExtension = ifile.getFileExtension();
- if (fileExtension.equals("wsdl") ||
- fileExtension.equals("wsil") ||
- fileExtension.equals("html"))
- {
- return ifile.getFullPath().toString();
- }
- }
- }
- return "";
- }
-
- public String getWsdlURI()
- {
- if (objectSelection != null && !objectSelection.isEmpty())
- {
- Object object = objectSelection.getFirstElement();
- if (object instanceof IResource)
- return ((IResource)object).getLocation().toString();
- else
- return object.toString();
- }
- return "";
- }
-
- public boolean getGenWSIL()
- {
- return false;
- }
-
- public String getWsilURI()
- {
- String wsURI = getWsdlURI();
- int index = wsURI.lastIndexOf('.');
- if (index != -1)
- {
- StringBuffer sb = new StringBuffer(wsURI.substring(0, index));
- sb.append(".wsil");
- return sb.toString();
- }
- return "";
- }
-
- public JavaWSDLParameter getJavaWSDLParam()
- {
- JavaWSDLParameter javaWSDLParam = new JavaWSDLParameter();
- javaWSDLParam.setServerSide(JavaWSDLParameter.SERVER_SIDE_BEAN);
- javaWSDLParam.setSkeletonDeploy(true);
- javaWSDLParam.setMetaInfOnly(false);
- return javaWSDLParam;
- }
-
- public String getHttpBasicAuthPassword()
- {
- return getWebServicesParser().getHTTPBasicAuthPassword();
- }
-
- public String getHttpBasicAuthUsername()
- {
- return getWebServicesParser().getHTTPBasicAuthUsername();
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/AxisSkeletonFragment.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/AxisSkeletonFragment.java
deleted file mode 100644
index 29a4b19..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/AxisSkeletonFragment.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton;
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.AxisDeployCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.AddJarsToProjectBuildPathTask;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CheckAxisDeploymentDescriptorsTask;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CopyAxisJarCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.RefreshProjectCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.ValidateWSDLCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.widgets.AxisMappingsFragment;
-import org.eclipse.jst.ws.internal.axis.creation.ui.command.ComputeAxisSkeletonBeanCommand;
-import org.eclipse.jst.ws.internal.axis.creation.ui.command.UpdateWEBXMLCommand;
-import org.eclipse.jst.ws.internal.axis.creation.ui.task.MoveDeploymentFilesTask;
-import org.eclipse.jst.ws.internal.axis.creation.ui.task.Skeleton2WSDLCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.StartProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.command.OpenJavaEditorCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.command.data.ProjectName2IProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.command.data.ServerName2IServerTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionOutputCommand;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.SelectionCommand;
-
-public class AxisSkeletonFragment extends SequenceFragment
-{
- public AxisSkeletonFragment()
- {
- add( new SimpleFragment( new AxisSkeletonDefaultingCommand(), "" ) );
- add( new SimpleFragment( new ValidateWSDLCommand(), ""));
- add( new SimpleFragment( new SkeletonConfigWidgetDefaultingCommand(), ""));
- add( new SimpleFragment( "SkeletonConfig") );
- add( new AxisMappingsFragment() );
- add( new SimpleFragment( new CheckAxisDeploymentDescriptorsTask(), ""));
- add( new SimpleFragment( new AddJarsToProjectBuildPathTask(), ""));
- add( new SimpleFragment( new CopyAxisJarCommand(), ""));
- add( new SimpleFragment( new WSDL2JavaCommand(), ""));
- add( new SimpleFragment( new MoveDeploymentFilesTask(), ""));
- add( new SimpleFragment( new Skeleton2WSDLCommand(), ""));
- add( new SimpleFragment( new UpdateWEBXMLCommand(), ""));
- add( new SimpleFragment( new RefreshProjectCommand(), ""));
- add( new SimpleFragment( new BuildProjectCommand(), ""));
- add( new SimpleFragment( new StartProjectCommand(), ""));
- // the second build project command is needed to synchronize with workspace auto build
- add( new SimpleFragment( new BuildProjectCommand(), ""));
- add( new SimpleFragment( new AxisDeployCommand(), ""));
- add( new SimpleFragment( new RefreshProjectCommand(), ""));
- add (new SimpleFragment( new ComputeAxisSkeletonBeanCommand(), ""));
- add( new SimpleFragment( new OpenJavaEditorCommand(), ""));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragment#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- // Transformers
- ProjectName2IProjectTransformer projectTransformer = new ProjectName2IProjectTransformer();
-
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", AxisSkeletonDefaultingCommand.class);
- dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "ObjectSelection", AxisSkeletonDefaultingCommand.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "WebServicesParser", AxisSkeletonDefaultingCommand.class);
-
- // ValidateWSDLCommand
- dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WebServicesParser", ValidateWSDLCommand.class);
- dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WsdlURI", ValidateWSDLCommand.class);
-
- // SkeletonConfigWidgetDefaultingCommand
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", SkeletonConfigWidgetDefaultingCommand.class);
- dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WsdlURI", SkeletonConfigWidgetDefaultingCommand.class);
-
- // CheckAxisDeploymentDescriptorsTask
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", CheckAxisDeploymentDescriptorsTask.class, "ServerProject", projectTransformer);
-
- // AddJarsToProjectBuildPathTask
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", AddJarsToProjectBuildPathTask.class, "Project", projectTransformer);
-
- dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WsdlURI", WSDL2JavaCommand.class);
- //dataRegistry.addMapping(WSDLSelectionTreeWidget.class, "WsdlURI", WSDL2JavaCommand.class);
- dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "HttpBasicAuthUsername", WSDL2JavaCommand.class);
- dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "HttpBasicAuthPassword", WSDL2JavaCommand.class);
-
- // MoveDeploymentFilesTask
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", MoveDeploymentFilesTask.class, "ServerProject", projectTransformer);
- dataRegistry.addMapping(WSDL2JavaCommand.class, "JavaWSDLParam", MoveDeploymentFilesTask.class);
-
- // CopyAxisJarCommand
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", CopyAxisJarCommand.class, "Project", projectTransformer);
-
- // Skeleton2WSDLCommand
- dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WebServicesParser", Skeleton2WSDLCommand.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", Skeleton2WSDLCommand.class, "ServerProject", projectTransformer);
- dataRegistry.addMapping(WSDL2JavaCommand.class, "JavaWSDLParam", Skeleton2WSDLCommand.class);
-
- // UpdateWEBXMLCommand
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", UpdateWEBXMLCommand.class, "ServerProject", projectTransformer);
-
- // RefreshProjectCommand
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", RefreshProjectCommand.class, "Project", projectTransformer);
-
- // BuildProjectCommand
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", BuildProjectCommand.class, "Project", projectTransformer);
-
- // StartProjectCommand
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", StartProjectCommand.class, "ServiceProject", projectTransformer);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerServer", StartProjectCommand.class, "ServiceExistingServer", new ServerName2IServerTransformer());
- dataRegistry.addMapping(CopyAxisJarCommand.class, "ProjectRestartRequired", StartProjectCommand.class, "IsWebProjectStartupRequested", null);
-
- // AxisDeployCommand
- dataRegistry.addMapping(WSDL2JavaCommand.class, "JavaWSDLParam", AxisDeployCommand.class);
-
- // ServerExtensionOutputCommand
- dataRegistry.addMapping(Skeleton2WSDLCommand.class, "WsdlURI", ServerExtensionOutputCommand.class);
- dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WebServicesParser", ServerExtensionOutputCommand.class);
-
- // ComputeAxisSkeletonBeanCommand
- dataRegistry.addMapping(WSDL2JavaCommand.class, "JavaWSDLParam", ComputeAxisSkeletonBeanCommand.class);
- //dataRegistry.addMapping(Skeleton2WSDLCommand.class, "WsdlURI", ComputeAxisSkeletonBeanCommand.class);
- //dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WebServicesParser", ComputeAxisSkeletonBeanCommand.class);
-
- // OpenJavaEditorCommand
- dataRegistry.addMapping(ComputeAxisSkeletonBeanCommand.class, "ClassNames", OpenJavaEditorCommand.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", OpenJavaEditorCommand.class, "Project", projectTransformer);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidget.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidget.java
deleted file mode 100644
index ede7f0b..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidget.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton;
-
-import java.io.File;
-import java.net.MalformedURLException;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-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.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class SkeletonConfigWidget extends SimpleWidgetDataContributor
-{
- private JavaWSDLParameter javaWSDLParam;
-
- /* CONTEXT_ID PBSC0001 for the Skeleton Config Page */
- private static final String INFOPOP_PBSC_PAGE = "PBSC0001"; //$NON-NLS-1$
- private static final String TOOLTIP_PBSC_PAGE = "TOOLTIP_PBSC_PAGE";
-
- // private Text uriText_;
- /* CONTEXT_ID PBCF0002 for the URI field of the Bean Config Page */
- private final String INFOPOP_PBCF_TEXT_URI = "PBCF0002"; //$NON-NLS-1$
- private final String TOOLTIP_PBCF_TEXT_URI = "TOOLTIP_PBCF_TEXT_URI";
-
- private Text wsdlFolderText_;
- /* CONTEXT_ID PBCF0006 for the WSDL Folder field in the Bean Config Page */
- private final String INFOPOP_PBCF_TEXT_WSDL_FOLDER = "PBCF0006"; //$NON-NLS-1$
- private final String TOOLTIP_PBCF_TEXT_WSDL_FOLDER = "TOOLTIP_PBCF_TEXT_WSDL_FOLDER";
-
- private Text wsdlFileText_;
- /* CONTEXT_ID PBCF0007 for the WSDL File field of the Bean Config Page */
- private final String INFOPOP_PBCF_TEXT_WSDL_FILE = "PBCF0007"; //$NON-NLS-1$
- private final String TOOLTIP_PBCF_TEXT_WSDL_FILE = "TOOLTIP_PBCF_TEXT_WSDL_FILE";
-
- private Combo skeletonFolderText_;
- /* CONTEXT_ID PBSC0004 for the Skeleton Folder field of the Skeleton Config Page */
- private static final String INFOPOP_PBSC_TEXT_SKELETON_FOLDER = "PBSC0004"; //$NON-NLS-1$
- private static final String TOOLTIP_PBSC_TEXT_SKELETON_FOLDER = "TOOLTIP_PBSC_TEXT_SKELETON_FOLDER";
- //
-
- /* CONTEXT_ID PBSC0005 for the Skeleton Folder Browse button of the Skeleton Config Page */
- // private static final String INFOPOP_PBSC_BUTTON_SKELETON_FOLDER_BROWSE = "PBSC0005"; //$NON-NLS-1$
- // private static final String TOOLTIP_PBSC_BUTTON_SKELETON_FOLDER_BROWSE = "TOOLTIP_PBSC_BUTTON_SKELETON_FOLDER_BROWSE";
-
- private Button showMappingsCheckbox_;
- /* CONTEXT_ID PBSC0016 for the Show Mappings checkbox of the Bean Methods Page */
- private String INFOPOP_N2P_SHOW_MAPPINGS = "PBSC0016"; //$NON-NLS-1$
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener)
- {
- String pluginId = "org.eclipse.jst.ws.axis.creation.ui";
- String conPluginId = "org.eclipse.jst.ws.axis.consumption.ui";
- String baseConPluginId = "org.eclipse.jst.ws.consumption.ui";
-
- MessageUtils msgUtils = new MessageUtils( pluginId + ".plugin", this );
- MessageUtils conMsgUtils = new MessageUtils( conPluginId + ".plugin", this );
- MessageUtils baseConMsgUtils = new MessageUtils( baseConPluginId + ".plugin", this );
- UIUtils uiUtils = new UIUtils( msgUtils, pluginId );
- UIUtils conUiUtils = new UIUtils( conMsgUtils, pluginId );
- UIUtils baseConUiUtils = new UIUtils( baseConMsgUtils, pluginId );
-
- WorkbenchHelp.setHelp( parent, pluginId + "." + INFOPOP_PBSC_PAGE );
- parent.setToolTipText( msgUtils.getMessage( TOOLTIP_PBSC_PAGE ) );
-
- Composite textGroup = uiUtils.createComposite( parent, 2, 0, 0 );
-
- /*
- uriText_ = uiUtils.createText( textGroup, "LABEL_URI",
- TOOLTIP_PBCF_TEXT_URI,
- INFOPOP_PBCF_TEXT_URI,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
- */
-
- wsdlFolderText_ = uiUtils.createText( textGroup, "LABEL_OUTPUT_FOLDER_NAME",
- TOOLTIP_PBCF_TEXT_WSDL_FOLDER,
- INFOPOP_PBCF_TEXT_WSDL_FOLDER,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
-
- wsdlFileText_ = uiUtils.createText( textGroup, "LABEL_OUTPUT_FILE_NAME",
- TOOLTIP_PBCF_TEXT_WSDL_FILE,
- INFOPOP_PBCF_TEXT_WSDL_FILE,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
-
- skeletonFolderText_ = baseConUiUtils.createCombo( textGroup, "LABEL_SKELETON_ROOT_NAME",
- TOOLTIP_PBSC_TEXT_SKELETON_FOLDER,
- INFOPOP_PBSC_TEXT_SKELETON_FOLDER,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
-
- Label separator = uiUtils.createHorizontalSeparator( parent, 5 );
-
- showMappingsCheckbox_ = conUiUtils.createCheckbox( parent, "LABEL_EXPLORE_MAPPINGS_XML2BEAN",
- "TOOLTIP_N2P_SHOW_MAPPINGS",
- INFOPOP_N2P_SHOW_MAPPINGS );
-
- return this;
- }
-
- public void setEndpointURI(String endpointURI)
- {
- /*
- if (endpointURI != null)
- uriText_.setText(endpointURI);
- */
- }
-
- public void setOutputWSDLFolder(String outputWSDLFolder)
- {
- if (outputWSDLFolder != null)
- wsdlFolderText_.setText(outputWSDLFolder);
- }
-
- public void setOutputWSDLFile(String outputWSDLFile)
- {
- if (outputWSDLFile != null)
- wsdlFileText_.setText(outputWSDLFile);
- }
-
- public void setOutputJavaFolder(String outputJavaFolder)
- {
- if (outputJavaFolder != null)
- {
- int index = skeletonFolderText_.indexOf(outputJavaFolder);
- if (index != -1)
- skeletonFolderText_.select(index);
- else if (skeletonFolderText_.getItemCount() <= 0)
- {
- String root = getWorkspaceRootLocation();
- if (outputJavaFolder.startsWith(root))
- skeletonFolderText_.setText(outputJavaFolder.substring(root.length()));
- else
- skeletonFolderText_.setText(outputJavaFolder);
- }
- }
- }
-
- public void setShowMapping(boolean showMapping)
- {
- showMappingsCheckbox_.setSelection(showMapping);
- }
-
- public boolean getShowMapping()
- {
- return showMappingsCheckbox_.getSelection();
- }
-
- /**
- * @return Returns the javaWSDLParam.
- */
- public JavaWSDLParameter getJavaWSDLParam() {
- String root = getWorkspaceRootLocation();
- File file = new File(root);
- try
- {
- root = file.toURL().toString();
- char lastChar = root.charAt(root.length()-1);
- if (lastChar == '/' || lastChar == '\\')
- root = root.substring(0, root.length()-1);
- }
- catch (MalformedURLException murle)
- {
- }
- javaWSDLParam.setOutput(root + wsdlFolderText_.getText());
- javaWSDLParam.setJavaOutput(root + skeletonFolderText_.getText());
- return javaWSDLParam;
- }
-
- /**
- * @param javaWSDLParam The javaWSDLParam to set.
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) {
- this.javaWSDLParam = javaWSDLParam;
- }
-
- public void setServerProject(IProject serviceProject)
- {
- String originalSkeletonFolder = skeletonFolderText_.getText();
- skeletonFolderText_.removeAll();
- IPath[] paths = ResourceUtils.getAllJavaSourceLocations(serviceProject);
- for (int i = 0; i < paths.length ; i++)
- skeletonFolderText_.add(paths[i].toString());
- int index = skeletonFolderText_.indexOf(originalSkeletonFolder);
- if (index != -1)
- skeletonFolderText_.select(index);
- else
- skeletonFolderText_.select(0);
- }
-
- private String getWorkspaceRootLocation()
- {
- return ResourcesPlugin.getWorkspace().getRoot().getLocation().removeTrailingSeparator().toString();
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidgetDefaultingCommand.java
deleted file mode 100644
index 937db38..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidgetDefaultingCommand.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-
-public class SkeletonConfigWidgetDefaultingCommand extends SimpleCommand
-{
- private String wsdlURI;
- private IProject serverProject;
- private JavaWSDLParameter javaWSDLParam;
-
- public void setWsdlURI(String wsdlURI)
- {
- this.wsdlURI = wsdlURI;
- }
-
- public void setServerProject(String serverProject)
- {
- this.serverProject = ResourcesPlugin.getWorkspace().getRoot().getProject(serverProject);
- }
-
- public String getEndpointURI()
- {
- return null;
- }
-
- public String getOutputWSDLFolder()
- {
- try
- {
- J2EEWebNatureRuntime nature = (J2EEWebNatureRuntime)serverProject.getNature(IWebNatureConstants.J2EE_NATURE_ID);
- StringBuffer sb = new StringBuffer(nature.getModuleServerRoot().getFullPath().addTrailingSeparator().toString());
- sb.append("wsdl");
- return sb.toString();
- }
- catch (CoreException ce)
- {
- }
- return null;
- }
-
- public String getOutputWSDLFile()
- {
- int index = wsdlURI.lastIndexOf('/');
- if (index == -1)
- index = wsdlURI.lastIndexOf('\\');
- return wsdlURI.substring(index+1, wsdlURI.length());
- }
-
- public String getOutputJavaFolder()
- {
- try
- {
- IClasspathEntry[] cp = JavaCore.create(serverProject).getRawClasspath();
- for (int i = 0; i < cp.length; i++)
- if (cp[i].getEntryKind() == IClasspathEntry.CPE_SOURCE)
- return ResourcesPlugin.getWorkspace().getRoot().getLocation().removeTrailingSeparator().append(cp[i].getPath()).toString();
- }
- catch (JavaModelException jme)
- {
- }
- return null;
- }
-
- public boolean getShowMapping()
- {
- return false;
- }
-
- public boolean isShowMapping()
- {
- return getShowMapping();
- }
-
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam)
- {
- this.javaWSDLParam = javaWSDLParam;
- }
-
- public JavaWSDLParameter getJavaWSDLParam()
- {
- javaWSDLParam.setOutput(getOutputWSDLFolder());
- javaWSDLParam.setJavaOutput(getOutputJavaFolder());
- return javaWSDLParam;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/beans/WSBeanAxisType.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/beans/WSBeanAxisType.java
deleted file mode 100644
index e8a99c0..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/beans/WSBeanAxisType.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.wizard.beans;
-
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.Java2WSDLCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.AddJarsToProjectBuildPathTask;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CheckAxisDeploymentDescriptorsTask;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.widgets.AxisMappingsWidget;
-import org.eclipse.jst.ws.internal.axis.creation.ui.command.JavaToWSDLMethodCommand;
-import org.eclipse.jst.ws.internal.axis.creation.ui.plugin.WebServiceAxisCreationUIPlugin;
-import org.eclipse.jst.ws.internal.axis.creation.ui.task.DefaultsForServerJavaWSDLCommand;
-import org.eclipse.jst.ws.internal.axis.creation.ui.task.LiteralSupportMessageTask;
-import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean.AxisBeanFragment;
-import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean.BeanConfigWidget;
-import org.eclipse.jst.ws.internal.consumption.common.JavaResourceFilter;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeType;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-/**
-* This is the class for the
-* Java Bean
-* {@link org.eclipse.jst.ws.was.creation.ui.wizard.WebServiceServerRuntimeType WebServiceServerRuntimeType}.
-*/
-public class WSBeanAxisType implements WebServiceServerRuntimeType, CommandWidgetBinding
-{
- private JavaResourceFilter filter_ = new JavaResourceFilter();
- private String serverName_;
- private String runtimeName_;
- private boolean isWebModuleRequired_;
-
- /**
- * Returns a short, locale specific name of this Web Service type.
- * @return A short, locale specific name of this Web Service type.
- */
- public String getName ()
- {
- return WebServiceAxisCreationUIPlugin.getMessage("%WS_NAME_BEANWAXIS");
- }
-
- /**
- * Returns a locale specific description of this Web Service type.
- * @return A locale specific description of this Web Service type.
- */
- public String getDescription ()
- {
- return WebServiceAxisCreationUIPlugin.getMessage("%WS_DESC_BEANWAXIS");
- }
-
- /**
- * Returns a locale specific label for the Server supported by this Web Service type
- * @return A locale specific server label from server plugins
- */
- public String getServerLabel()
- {
- return serverName_;
- }
-
- /**
- * Sets the server label to the appropriate name found in the server plugins.
- * @param server name
- */
- public void setServerLabel(String serverLabel)
- {
- serverName_ = serverLabel;
- }
-
- /**
- * Returns a locale specific label for the deployment runtime of this Web Service type
- * @return A locale specific label for the deployment runtime
- */
- public String getRuntimeLabel()
- {
- return runtimeName_;
- }
-
- /**
- * Sets the runtime label for the appropriate runtime
- * @param server name
- */
- public void setRuntimeLabel(String runtimeLabel)
- {
- runtimeName_ = runtimeLabel;
- }
-
- /**
- * Returns a label for the Web Service type associated with this WebServiceServerRuntimeType
- * @return A label for the Web Service type
- */
- public String getWebServiceTypeLabel()
- {
- return WebServiceAxisCreationUIPlugin.getMessage("%WEBSERVICETYPE_NAME_JAVA_AXIS");
- }
-
- /**
- * Returns whether or not a Web Module is required for this WebServiceServerRuntimeType
- * @return true if requireWebModule
- */
- public boolean isWebModuleRequired()
- {
- return isWebModuleRequired_;
- }
-
- /**
- * Sets the boolean value at runtime according to requireWebModule attribute from the manifest file
- * @param requireWebModule
- */
- public void setWebModuleRequired(boolean requireWebModule)
- {
- isWebModuleRequired_ = requireWebModule;
- }
-
-
- /**
- * Returns a string representation of this object.
- * @return A string representation of this object.
- */
- public String toString ()
- {
- return getName();
- }
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeType#isEJBModuleRequired()
- */
- public boolean isEJBModuleRequired() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeType#setEJBModuleRequired(boolean)
- */
- public void setEJBModuleRequired(boolean arg0) {
- return;
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- /*
- dataRegistry.addMapping( CurrentPageCommand.class, "CurrentPage", BeanClassWidget.class );
- //BeanClassWidget - as target
- dataRegistry.addMapping(BUAxisDefaultingCommand.class, "JavaBeanName", BeanClassWidget.class, "BeanClassName", null);
- //BeanClassWidget - as source
- dataRegistry.addMapping(BeanClassWidget.class, "BeanClassName", DefaultsForServerJavaWSDLCommand.class, "JavaBeanName", null); //BeanConfigWidget
- */
- // ObjectSelectionWidget
- dataRegistry.addMapping(ObjectSelectionWidget.class, "ObjectSelection", DefaultsForServerJavaWSDLCommand.class);
-
- //BeanConfigWidget - as target
- dataRegistry.addMapping(JavaToWSDLMethodCommand.class, "JavaWSDLParam", BeanConfigWidget.class, "JavaParameter", null );
- //BeanConfigWidget - as source
- dataRegistry.addMapping(BeanConfigWidget.class, "JavaParameter", LiteralSupportMessageTask.class, "JavaWSDLParam", null);
- dataRegistry.addMapping(BeanConfigWidget.class, "JavaParameter", CheckAxisDeploymentDescriptorsTask.class, "JavaWSDLParam", null);
- dataRegistry.addMapping(BeanConfigWidget.class, "JavaParameter", AddJarsToProjectBuildPathTask.class, "JavaWSDLParam", null);
- dataRegistry.addMapping(BeanConfigWidget.class, "JavaParameter", Java2WSDLCommand.class, "JavaWSDLParam", null);
- dataRegistry.addMapping(BeanConfigWidget.class, "JavaParameter", WSDL2JavaCommand.class, "JavaWSDLParam", null);
-
- //MappingFragment (optionally displays the AxisMappingsWidget)
- dataRegistry.addMapping(BeanConfigWidget.class, "CustomizeServiceMappings", AxisBeanFragment.MappingFragment.class);
-
- //AxisMappingsWidget - as target
- dataRegistry.addMapping(BeanConfigWidget.class, "JavaParameter", AxisMappingsWidget.class);
-
- //AxisMappingsWidget - as source
- dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", LiteralSupportMessageTask.class, "JavaWSDLParam", null);
- dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", CheckAxisDeploymentDescriptorsTask.class, "JavaWSDLParam", null);
- dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", AddJarsToProjectBuildPathTask.class, "JavaWSDLParam", null);
- dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", Java2WSDLCommand.class, "JavaWSDLParam", null);
- dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", WSDL2JavaCommand.class, "JavaWSDLParam", null);
-
- //dataRegistry.addMapping( DefaultsForConfig.class, "JavaParameter", BeanConfigWidget.class );
- //dataRegistry.addMapping( DefaultsForConfig.class, "CustomizeServiceMappings", BeanConfigWidget.class );
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- String pluginId_ = "org.eclipse.jst.ws.axis.creation.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
-
- /*
- widgetRegistry.add( "BeanSelection",
- msgUtils.getMessage("PAGE_TITLE_WSBEAN_CLASS"),
- msgUtils.getMessage("PAGE_DESC_WSBEAN_CLASS"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new BeanClassWidget();
- }
- } );
- */
-
- widgetRegistry.add( "BeanConfig",
- msgUtils.getMessage("PAGE_TITLE_WSBEAN_CONFIG"),
- msgUtils.getMessage("PAGE_DESC_WSBEAN_CONFIG"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new BeanConfigWidget();
- }
- } );
-
- String consPluginId_ = "org.eclipse.jst.ws.axis.consumption.ui";
- MessageUtils consMsgUtils = new MessageUtils( consPluginId_ + ".plugin", this );
-
- widgetRegistry.add( "AxisServiceBeanMapping",
- consMsgUtils.getMessage("PAGE_TITLE_WS_BEAN2XML"),
- consMsgUtils.getMessage("PAGE_DESC_P2N_MAPPINGS"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new AxisMappingsWidget(AxisMappingsWidget.MODE_BEAN2XML );
- }
- } );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragmentFactoryFactory#create()
- */
- public CommandFragmentFactory create()
- {
- return new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- return new AxisBeanFragment();
- }
- };
- }
-
-}
-
-
-
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/wsdl/WSWSDLAxisType.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/wsdl/WSWSDLAxisType.java
deleted file mode 100644
index 77f24cf..0000000
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/wsdl/WSWSDLAxisType.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.creation.ui.wizard.wsdl;
-
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.widgets.AxisMappingsFragment;
-import org.eclipse.jst.ws.internal.axis.consumption.ui.widgets.AxisMappingsWidget;
-import org.eclipse.jst.ws.internal.axis.creation.ui.plugin.WebServiceAxisCreationUIPlugin;
-import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton.AxisSkeletonDefaultingCommand;
-import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton.AxisSkeletonFragment;
-import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton.SkeletonConfigWidget;
-import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton.SkeletonConfigWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.common.WSDLResourceFilter;
-import org.eclipse.jst.ws.internal.consumption.ui.command.data.ProjectName2IProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeType;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-/**
-* This is the class for the Axis Web service type.
-*/
-public class WSWSDLAxisType implements WebServiceServerRuntimeType, CommandWidgetBinding
-{
- private WSDLResourceFilter filter_ = new WSDLResourceFilter();
-
- private String serverName_;
- private String runtimeName_;
- private boolean isWebModuleRequired_;
- /**
- * Returns a short, locale specific name of this Web Service type.
- * @return A short, locale specific name of this Web Service type.
- */
- public String getName() {
- return WebServiceAxisCreationUIPlugin.getMessage("%WS_NAME_WSDLAXIS");
- }
-
- /**
- * Returns a locale specific description of this Web Service type.
- * @return A locale specific description of this Web Service type.
- */
- public String getDescription() {
- return WebServiceAxisCreationUIPlugin.getMessage("%WS_DESC_WSDLAXIS");
- }
-
- /**
- * Returns a locale specific label for the Server supported by this Web Service type
- * @return A locale specific server label from server plugins
- */
- public String getServerLabel() {
- return serverName_;
- }
-
- /**
- * Sets the server label to the appropriate name found in the server plugins.
- * @param server name
- */
- public void setServerLabel(String serverLabel) {
- serverName_ = serverLabel;
- }
-
- /**
- * Returns a locale specific label for the deployment runtime of this Web Service type
- * @return A locale specific label for the deployment runtime
- */
- public String getRuntimeLabel() {
- return runtimeName_;
- }
-
- /**
- * Sets the runtime label for the appropriate runtime
- * @param server name
- */
- public void setRuntimeLabel(String runtimeLabel) {
- runtimeName_ = runtimeLabel;
- }
-
- /**
- * Returns a label for the Web Service type associated with this WebServiceServerRuntimeType
- * @return A label for the Web Service type
- */
- public String getWebServiceTypeLabel() {
- return WebServiceAxisCreationUIPlugin.getMessage(
- "%WEBSERVICETYPE_NAME_WSDL_AXIS");
- }
-
- /**
- * Returns whether or not a Web Module is required for this WebServiceServerRuntimeType
- * @return true if requireWebModule
- */
- public boolean isWebModuleRequired() {
- return isWebModuleRequired_;
- }
-
- /**
- * Sets the boolean value at runtime according to requireWebModule attribute from the manifest file
- * @param requireWebModule
- */
- public void setWebModuleRequired(boolean requireWebModule) {
- isWebModuleRequired_ = requireWebModule;
- }
-
- /**
- * Returns a string representation of this object.
- * @return A string representation of this object.
- */
- public String toString() {
- return getName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeType#isEJBModuleRequired()
- */
- public boolean isEJBModuleRequired() {
-
- return false;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeType#setEJBModuleRequired(boolean)
- */
- public void setEJBModuleRequired(boolean arg0) {
- return;
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- // SkeletonConfigWidget
- dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "JavaWSDLParam", SkeletonConfigWidgetDefaultingCommand.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", SkeletonConfigWidget.class, "ServerProject", new ProjectName2IProjectTransformer());
- dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "JavaWSDLParam", SkeletonConfigWidget.class);
- dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "EndpointURI", SkeletonConfigWidget.class);
- dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "OutputWSDLFolder", SkeletonConfigWidget.class);
- dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "OutputWSDLFile", SkeletonConfigWidget.class);
- dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "OutputJavaFolder", SkeletonConfigWidget.class);
- dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "ShowMapping", SkeletonConfigWidget.class);
-
- // AxisMappingsFragment
- dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "ShowMapping", AxisMappingsFragment.class);
- dataRegistry.addMapping(SkeletonConfigWidget.class, "ShowMapping", AxisMappingsFragment.class);
-
- // AxisMappingsWidget
- dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "JavaWSDLParam", AxisMappingsWidget.class, "JavaParameter", null);
- dataRegistry.addMapping(SkeletonConfigWidget.class, "JavaWSDLParam", AxisMappingsWidget.class, "JavaParameter", null);
-
- // WSDL2JavaCommand
- dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "JavaWSDLParam", WSDL2JavaCommand.class);
- dataRegistry.addMapping(SkeletonConfigWidget.class, "JavaWSDLParam", WSDL2JavaCommand.class);
- dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", WSDL2JavaCommand.class, "JavaWSDLParam", null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
-
- /*
- widgetRegistry.add( "WSDLSelection",
- msgUtils.getMessage("PAGE_TITLE_WS_SELECTION"),
- msgUtils.getMessage("PAGE_DESC_WS_SELECTION"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new WSDLSelectionWidget();
- }
- } );
-
- widgetRegistry.add( "WSDLSelectionTreeWidget",
- msgUtils.getMessage("PAGE_TITLE_WSDL_SELECTION"),
- msgUtils.getMessage("PAGE_DESC_WSDL_SELECTION"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new WSDLSelectionTreeWidget();
- }
- });
- */
-
- widgetRegistry.add( "SkeletonConfig",
- msgUtils.getMessage("PAGE_TITLE_WSSKEL_CONFIG"),
- msgUtils.getMessage("PAGE_DESC_WSSKEL_CONFIG"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new SkeletonConfigWidget();
- }
- } );
-
- widgetRegistry.add( "AxisMappingsWidget",
- msgUtils.getMessage("PAGE_TITLE_WS_XML2BEAN"),
- msgUtils.getMessage("PAGE_DESC_N2P_MAPPINGS"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new AxisMappingsWidget(AxisMappingsWidget.MODE_XML2BEAN);
- }
- } );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragmentFactoryFactory#create()
- */
- public CommandFragmentFactory create()
- {
- return new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- return new AxisSkeletonFragment();
- }
- };
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/.classpath b/bundles/org.eclipse.jst.ws.consumption.ui/.classpath
deleted file mode 100644
index 275b34c..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/.cvsignore b/bundles/org.eclipse.jst.ws.consumption.ui/.cvsignore
deleted file mode 100644
index 60463af..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-build.xml
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/.project b/bundles/org.eclipse.jst.ws.consumption.ui/.project
deleted file mode 100644
index 67d2e8a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/.project
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.ws.consumption.ui</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.wst.command.env</project>
- <project>org.eclipse.wst.command.env.core</project>
- <project>org.eclipse.jst.ws</project>
- <project>org.eclipse.jst.ws.consumption</project>
- <project>org.eclipse.jst.ws.discovery.core</project>
- <project>org.eclipse.jst.ws.ui</project>
- <project>org.eclipse.wst.wsdl</project>
- <project>org.eclipse.wst.ws.parser</project>
- <project>org.eclipse.wst.ws.apache.wsil</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/build.properties b/bundles/org.eclipse.jst.ws.consumption.ui/build.properties
deleted file mode 100644
index b863f50..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-source.wsc-ui.jar = src/
-bin.includes = wsc-ui.jar,\
- icons/,\
- plugin.properties,\
- plugin.xml
-src.includes = build.properties,\
- doc/,\
- icons/,\
- plugin.properties,\
- plugin.xml,\
- src/
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/config_handler_wiz.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/config_handler_wiz.gif
deleted file mode 100644
index 8da3a21..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/config_handler_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/ctool16/configure_handlers.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/ctool16/configure_handlers.gif
deleted file mode 100644
index a113c85..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/ctool16/configure_handlers.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/ctool16/generated_sample.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/ctool16/generated_sample.gif
deleted file mode 100644
index eaba51f..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/ctool16/generated_sample.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/ctool16/newclient_webserv_wiz.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/ctool16/newclient_webserv_wiz.gif
deleted file mode 100644
index 1ee05fa..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/ctool16/newclient_webserv_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/dtool/configure_handlers.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/dtool/configure_handlers.gif
deleted file mode 100644
index 1060dd9..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/dtool/configure_handlers.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/dtool/generated_sample.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/dtool/generated_sample.gif
deleted file mode 100644
index 590d396..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/dtool/generated_sample.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/wizban/webservicesclient_wiz.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/wizban/webservicesclient_wiz.gif
deleted file mode 100644
index 68b7a26..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/full/wizban/webservicesclient_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/gen_sample_wiz.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/gen_sample_wiz.gif
deleted file mode 100644
index 927ad5a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/gen_sample_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/import_ws.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/import_ws.gif
deleted file mode 100644
index 641fe84..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/import_ws.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/import_ws_wiz.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/import_ws_wiz.gif
deleted file mode 100644
index a3061e6..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/import_ws_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/registry.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/registry.gif
deleted file mode 100644
index 5b43cae..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/registry.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/servers/existing_server_obj.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/servers/existing_server_obj.gif
deleted file mode 100644
index afb6cb7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/servers/existing_server_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/servers/servers_obj.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/servers/servers_obj.gif
deleted file mode 100644
index afb6cb7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/servers/servers_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/html.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/html.gif
deleted file mode 100644
index 53e7dbd..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/html.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/import_wiz_banner_wsil.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/import_wiz_banner_wsil.gif
deleted file mode 100644
index 11b34b7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/import_wiz_banner_wsil.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/import_wsil.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/import_wsil.gif
deleted file mode 100644
index 618a946..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/import_wsil.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/wsdl.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/wsdl.gif
deleted file mode 100644
index 8fb844f..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/wsdl.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/wsil.gif b/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/wsil.gif
deleted file mode 100644
index 7c5916f..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/icons/wsil/wsil.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/plugin.properties b/bundles/org.eclipse.jst.ws.consumption.ui/plugin.properties
deleted file mode 100644
index 4e11141..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/plugin.properties
+++ /dev/null
@@ -1,111 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Web Services Consumption Graphical User Interface
-PLUGIN_PROVIDER=Eclipse.org
-
-#
-# Wizards.
-#
-WIZARD_TITLE_WSC=Web Service Client
-
-PLUGIN_NEW_WIZARD_NAME_WS_CLIENT=Web Service Client
-PLUGIN_IMPORT_WIZARD_NAME_WS=Web Service
-PLUGIN_NEW_WIZARD_DESC_WS_CLIENT=Access an existing XML web service
-PLUGIN_IMPORT_WIZARD_DESC_WS=A wizard for importing a web service
-IMPORT_WIZARD_DESC_WSIL=Import WSDL references to a WSIL document
-
-#
-# Web Samples IDs
-#
-SAMPLE_TYPE_WEBSERVICES_ID=Web service sample JSPs
-
-#
-# Pop-up actions
-#
-ACTION_GENERATE_JAVA_PROXY=Generate Client
-ACTION_GEN_SAMPLE=Generate Sample JSPs
-
-#
-# Dialogs
-#
-CHECKBOX_SHOW_GENERATE_JAVA_PROXY_DIALOG=Hide Generate Java bean Proxy Dialog
-CHECKBOX_SHOW_PROXY2SAMPLE_DIALOG=Hide Proxy To Sample Generation Dialog
-TOOLTIP_PPAD_CHECKBOX_WSDL2PROXY=Hide the dialog for generating the Java bean proxy action.
-TOOLTIP_PPAD_CHECKBOX_PROXY2SAMPLE=Hide the dialog for generating the sample application action.
-
-#
-# Web Services Preferance Pages
-#
-# Categories
-
-PREFERENCE_CATEGORY_SERVER_RUNTIME=Server and Runtime
-PREFERENCE_CATEGORY_PROJECT_TOPOLOGY=Project Topology
-PREFERENCE_CATEGORY_TEST_FACILITY=Test Facility Defaults
-PREFERENCE_CATEGORY_DIALOGS=Popup Dialog Selection
-
-
-#
-# Pop-up actions
-#
-MENU_RUN=&Run
-
-#
-# WebServiceTestPage
-#
-WSEXPLORER_ID=Web Services Explorer
-
-#
-# WebServicePublishPage
-#
-TOOLTIP_LAUNCH_WS_EXPLORER=Launch the Web Services Explorer
-COMMAND_LAUNCH_WS_EXPLORER=Launch the Web Services Explorer
-
-#
-# PublicUDDIRegistryType
-#
-PUBLICUDDIREGISTRYTYPE_NAME_IBM=IBM UDDI Registry
-PUBLICUDDIREGISTRYTYPE_NAME_IBM_TEST=IBM UDDI Test Registry
-PUBLICUDDIREGISTRYTYPE_NAME_MICROSOFT=Microsoft UDDI Registry
-PUBLICUDDIREGISTRYTYPE_NAME_MICROSOFT_TEST=Microsoft UDDI Test Registry
-PUBLICUDDIREGISTRYTYPE_NAME_SAP=SAP UDDI Registry
-PUBLICUDDIREGISTRYTYPE_NAME_SAP_TEST=SAP UDDI Test Registry
-PUBLICUDDIREGISTRYTYPE_NAME_XMETHODS=XMethods Registry
-PUBLICUDDIREGISTRYTYPE_NAME_NTTCOMM=NTT Communications Registry
-
-#
-# WSIL proxy
-#
-IMPORT_WIZARD_NAME_WSIL=WSIL
-POPUP_GENERATE_WSIL=Generate WSIL
-
-#
-# Web Service Server Runtime Type
-#
-WEBSERVICETYPE_NAME_WSDL=Skeleton Java bean Web Service
-WEBSERVICETYPE_NAME_JAVA=Java bean Web Service
-
-#
-# Client project type
-#
-LABEL_CLIENT_TYPE_WEB=Web
-LABEL_CLIENT_TYPE_EJB=EJB
-LABEL_CLIENT_TYPE_APP_CLIENT=Application Client
-LABEL_CLIENT_TYPE_CONTAINERLESS=Java
-
-#
-# Handlers Configuration wizard page
-#
-POPUP_ADD_HANDLERS=Configure handlers
-LABEL_HANDLERS_CONFIG=Configure Handlers
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/plugin.xml b/bundles/org.eclipse.jst.ws.consumption.ui/plugin.xml
deleted file mode 100644
index 0ec1dcc..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/plugin.xml
+++ /dev/null
@@ -1,754 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id="org.eclipse.jst.ws.consumption.ui"
- version="1.0.0"
- name="%PLUGIN_NAME"
- provider-name="%PLUGIN_PROVIDER"
- class="org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin">
-
- <runtime>
- <library name="wsc-ui.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.wst.ws.parser"/>
- <import plugin="org.eclipse.wst.command.env"/>
- <import plugin="org.eclipse.wst.command.env.ui"/>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <!--
- Should not need the following import, but absence causes
- ClientHandlersWidgetOutputCommand to fail to compile due to
- missing indirect dependency on
- org.eclipse.jst.common.jdt.internal.integration.WorkingCopyProvider
- -->
- <import plugin="org.eclipse.jst.common.frameworks"/>
- <import plugin="org.eclipse.jst.ws"/>
- <import plugin="org.eclipse.jst.ws.ui"/>
- <import plugin="org.eclipse.jst.ws.consumption"/>
- <import plugin="org.eclipse.jem"/>
- <import plugin="org.eclipse.jem.workbench"/>
- <import plugin="org.eclipse.emf.common"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.wst.ws.apache.wsil"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="com.ibm.wtp.emf.workbench"/>
- <import plugin="org.eclipse.emf.ecore.xmi"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.wst.server.ui"/>
- <import plugin="org.eclipse.wst.wsdl"/>
- <import plugin="org.eclipse.jst.j2ee"/>
- <import plugin="org.eclipse.jst.j2ee.core"/>
- <import plugin="org.eclipse.jst.j2ee.ejb"/>
- <import plugin="org.eclipse.jst.j2ee.ui"/>
- <import plugin="org.eclipse.jst.j2ee.web"/>
- <import plugin="org.eclipse.wst.common.emf"/>
- <import plugin="org.eclipse.wst.common.emfworkbench.integration"/>
- <import plugin="org.eclipse.wst.common.frameworks"/>
- <import plugin="org.eclipse.wst.internet.webbrowser"/>
- <import plugin="org.eclipse.jst.j2ee.webservice"/>
- </requires>
-
-
- <extension-point
- id="publicUDDIRegistryType"
- name="Public UDDI Registry Types"/>
-
- <extension-point
- id="privateUDDIRegistryType"
- name="Private UDDI Registry Types"/>
-
- <extension-point
- id="webServiceClientType"
- name="Web Service Client Types"/>
-
- <extension-point
- id="webServiceTest"
- name="Web Service Test"/>
-
- <extension-point
- id="webServiceServerRuntimeType"
- name="Web Service Server Runtime Types"/>
-
- <extension-point
- id="clientProjectType"
- name="clientProjectType"/>
-
- <extension-point
- id="objectSelectionWidget"
- name="objectSelectionWidget"/>
-
- <!-- UDDI Registry Types -->
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.publicUDDIRegistryType">
- <publicUDDIRegistryType
- name="%PUBLICUDDIREGISTRYTYPE_NAME_IBM_TEST"
- class="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryIBMTest"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryIBMTest">
- </publicUDDIRegistryType>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.publicUDDIRegistryType">
- <publicUDDIRegistryType
- name="%PUBLICUDDIREGISTRYTYPE_NAME_IBM"
- class="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryIBM"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryIBM">
- </publicUDDIRegistryType>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.publicUDDIRegistryType">
- <publicUDDIRegistryType
- name="%PUBLICUDDIREGISTRYTYPE_NAME_MICROSOFT_TEST"
- class="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryMicrosoftTest"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryMicrosoftTest">
- </publicUDDIRegistryType>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.publicUDDIRegistryType">
- <publicUDDIRegistryType
- name="%PUBLICUDDIREGISTRYTYPE_NAME_MICROSOFT"
- class="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryMicrosoft"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryMicrosoft">
- </publicUDDIRegistryType>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.publicUDDIRegistryType">
- <publicUDDIRegistryType
- name="%PUBLICUDDIREGISTRYTYPE_NAME_SAP_TEST"
- class="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistrySAPTest"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistrySAPTest">
- </publicUDDIRegistryType>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.publicUDDIRegistryType">
- <publicUDDIRegistryType
- name="%PUBLICUDDIREGISTRYTYPE_NAME_SAP"
- class="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistrySAP"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistrySAP">
- </publicUDDIRegistryType>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.publicUDDIRegistryType">
- <publicUDDIRegistryType
- name="%PUBLICUDDIREGISTRYTYPE_NAME_XMETHODS"
- class="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryXMethods"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryXMethods">
- </publicUDDIRegistryType>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.publicUDDIRegistryType">
- <publicUDDIRegistryType
- name="%PUBLICUDDIREGISTRYTYPE_NAME_NTTCOMM"
- class="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryNTTComm"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryNTTComm">
- </publicUDDIRegistryType>
- </extension>
-
- <!-- Test Facilities -->
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.webServiceTest">
-
- <webServiceTest
- methodsneeded="true"
- name="%SAMPLE_TYPE_WEBSERVICES_ID"
- java="true"
- codegen="true"
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.test.wssample.WebServiceWSSampleExecutable"
- id="org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WebServiceSampleTest">
- </webServiceTest>
-
- <webServiceTest
- methodsneeded="false"
- name="%WSEXPLORER_ID"
- java="false"
- codegen="false"
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.test.explorer.WebServiceExplorerExecutable"
- id="org.eclipse.jst.ws.internal.consumption.ui.widgets.test.explorer.WebServiceExplorerExecutable">
- </webServiceTest>
-
- </extension>
-
- <!-- Java Beans -->
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.webServiceServerRuntimeType">
-
- <webServiceType
- label="%WEBSERVICETYPE_NAME_JAVA"
- resourceTypeMetadata="File IResource CompilationUnit"
- extensionMetadata=".java .class"
- objectSelectionWidget="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.JavaBeanSelectionWidget"
- includeNatures="org.eclipse.jst.j2ee.web.WebNature"
- excludeNatures=""
- id="org.eclipse.jst.ws.type.java">
- </webServiceType>
-
- <webServiceType
- label="%WEBSERVICETYPE_NAME_WSDL"
- resourceTypeMetadata="File IResource String ServiceImpl ServiceRefImpl WSDLResourceImpl"
- extensionMetadata=".wsdl .wsil .html .ServiceImpl .ServiceRefImpl .WSDLResourceImpl"
- objectSelectionWidget="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.WSDLSelectionWidget"
- includeNatures="org.eclipse.jst.j2ee.web.WebNature"
- excludeNatures=""
- id="org.eclipse.jst.ws.type.wsdl">
- </webServiceType>
-
- </extension>
-
- <!-- Dynamic Wizards -->
-
- <extension
- point="org.eclipse.ui.newWizards">
- <wizard
- name="%PLUGIN_NEW_WIZARD_NAME_WS_CLIENT"
- icon="icons/full/ctool16/newclient_webserv_wiz.gif"
- category="org.eclipse.jst.ws.ui.new"
- class="org.eclipse.wst.command.env.ui.widgets.DynamicWizard"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- <description>
- %PLUGIN_NEW_WIZARD_DESC_WS_CLIENT
- </description>
- <selection
- class="org.eclipse.core.resources.IResource">
- </selection>
- </wizard>
- </extension>
-
- <extension
- point="org.eclipse.wst.command.env.dynamicWizard">
- <dynamicWizard
- iconbanner="icons/full/wizban/webservicesclient_wiz.gif"
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.binding.ClientWidgetBinding"
- title="%WIZARD_TITLE_WSC"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- </dynamicWizard>
- </extension>
-
- <extension
- point="org.eclipse.wst.command.env.dynamicWizard">
- <dynamicWizard
- iconbanner="icons/gen_sample_wiz.gif"
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.binding.GenSampleWidgetBinding"
- title="%WIZARD_TITLE_WSC"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.gensamplewizard">
- </dynamicWizard>
- </extension>
-
- <extension
- point="org.eclipse.wst.command.env.dynamicWizard">
- <dynamicWizard
- iconbanner="icons/config_handler_wiz.gif"
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.binding.ConfigServiceHandlersWidgetBinding"
- title="%LABEL_HANDLERS_CONFIG"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.service">
- </dynamicWizard>
- </extension>
-
- <extension
- point="org.eclipse.wst.command.env.dynamicWizard">
- <dynamicWizard
- iconbanner="icons/config_handler_wiz.gif"
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.binding.ConfigClientHandlersWidgetBinding"
- title="%LABEL_HANDLERS_CONFIG"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.client">
- </dynamicWizard>
- </extension>
-
- <extension
- point="org.eclipse.wst.command.env.dynamicWizard">
- <dynamicWizard
- iconbanner="icons/config_handler_wiz.gif"
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.binding.ConfigureHandlersWidgetBinding"
- title="%LABEL_HANDLERS_CONFIG"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers">
- </dynamicWizard>
- </extension>
-
- <extension
- point="org.eclipse.ui.importWizards">
- <wizard
- name="%PLUGIN_IMPORT_WIZARD_NAME_WS"
- icon="icons/import_ws.gif"
- class="org.eclipse.wst.command.env.ui.widgets.DynamicWizard"
- id="wsimport">
- <description>
- %PLUGIN_IMPORT_WIZARD_DESC_WS
- </description>
- </wizard>
- </extension>
-
- <extension
- point="org.eclipse.wst.command.env.dynamicWizard">
- <dynamicWizard
- iconbanner="icons/import_ws_wiz.gif"
- name="%PLUGIN_IMPORT_WIZARD_NAME_WS"
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.binding.ImportWSWidgetBinding"
- id="wsimport">
- </dynamicWizard>
- </extension>
-
- <extension
- point="org.eclipse.ui.importWizards">
- <wizard
- name="%IMPORT_WIZARD_NAME_WSIL"
- icon="icons/wsil/import_wsil.gif"
- class="org.eclipse.wst.command.env.ui.widgets.DynamicWizard"
- id="wsilimport">
- <description>
- %IMPORT_WIZARD_DESC_WSIL
- </description>
- </wizard>
- </extension>
-
- <extension
- point="org.eclipse.wst.command.env.dynamicWizard">
- <dynamicWizard
- iconbanner="icons/wsil/import_wiz_banner_wsil.gif"
- name="%IMPORT_WIZARD_NAME_WSIL"
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.binding.ImportWSILWidgetBinding"
- id="wsilimport">
- </dynamicWizard>
- </extension>
-
- <!-- Preference Pages -->
-
- <extension
- point="org.eclipse.ui.preferencePages">
-
- <page
- name="%PREFERENCE_CATEGORY_SERVER_RUNTIME"
- category="org.eclipse.jst.ws.internal.ui.preferences.name"
- class="org.eclipse.jst.ws.internal.consumption.ui.preferences.ServerRuntimePreferencePage"
- id="org.eclipse.jst.ws.internal.consumption.ui.preferences.ServerRuntimePreferencePage">
- </page>
-
- <page
- name="%PREFERENCE_CATEGORY_DIALOGS"
- category="org.eclipse.jst.ws.internal.ui.preferences.name"
- class="org.eclipse.wst.command.internal.env.ui.preferences.ActionDialogsPreferencePage"
- id="org.eclipse.jst.wss.popup.category">
- </page>
-
- <page
- name="%PREFERENCE_CATEGORY_TEST_FACILITY"
- category="org.eclipse.jst.ws.internal.ui.preferences.name"
- class="org.eclipse.jst.ws.internal.ui.preferences.ScenarioDefaultsPreferencePage"
- id="org.eclipse.jst.ws.internal.ui.preferences.ScenarioDefaultsPreferencePage">
- </page>
-
- <page
- name="%PREFERENCE_CATEGORY_PROJECT_TOPOLOGY"
- category="org.eclipse.jst.ws.internal.ui.preferences.name"
- class="org.eclipse.jst.ws.internal.ui.preferences.ProjectTopologyPreferencePage"
- id="org.eclipse.jst.ws.internal.ui.preferences.ProjectTopologyPreferencePage">
- </page>
-
- </extension>
-
- <!-- Main Menu Actions -->
-
- <extension point="org.eclipse.ui.actionSets">
-
- <actionSet
- label="%COMMAND_LAUNCH_WS_EXPLORER"
- visible="true"
- id="org.eclipse.jst.ws.consumption">
- <menu
- label="%MENU_RUN"
- path="additions"
- id="org.eclipse.ui.run">
- <separator name="explorer">
- </separator>
- </menu>
- <action
- label="%COMMAND_LAUNCH_WS_EXPLORER"
- icon="icons/registry.gif"
- tooltip="%TOOLTIP_LAUNCH_WS_EXPLORER"
- class="org.eclipse.jst.ws.internal.consumption.ui.action.LaunchWSEAction"
- menubarPath="org.eclipse.ui.run/explorer"
- toolbarPath="additions"
- id="org.eclipse.jst.ws.internal.consumption.ui.action.LaunchWSEAction">
- </action>
- </actionSet>
-
- </extension>
-
- <!-- "Don't Show Me" Extensions -->
-
- <extension
- point="org.eclipse.wst.command.env.actionDialogPreferenceType">
-
- <actionDialogPreferenceType
- showcheckbox="true"
- name="%CHECKBOX_SHOW_GENERATE_JAVA_PROXY_DIALOG"
- category="org.eclipse.jst.wss.popup.category"
- tooltip="%TOOLTIP_PPAD_CHECKBOX_WSDL2PROXY"
- infopop="org.eclipse.jst.ws.consumption.ui.PPAD0004"
- alwayshide="false"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- </actionDialogPreferenceType>
-
- <actionDialogPreferenceType
- name="%CHECKBOX_SHOW_PROXY2SAMPLE_DIALOG"
- category="org.eclipse.jst.wss.popup.category"
- tooltip="%TOOLTIP_PPAD_CHECKBOX_PROXY2SAMPLE"
- infopop="org.eclipse.jst.ws.consumption.ui.PPAD0005"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.gensamplewizard">
- </actionDialogPreferenceType>
-
- <actionDialogPreferenceType
- showcheckbox="false"
- alwayshide="false"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.genwsil">
- </actionDialogPreferenceType>
-
- <actionDialogPreferenceType
- showcheckbox="false"
- alwayshide="false"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.editor">
- </actionDialogPreferenceType>
-
- </extension>
-
- <!-- Popups -->
-
- <extension
- point="org.eclipse.ui.popupMenus">
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.wsdl"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.genwsil">
- <action
- label="%POPUP_GENERATE_WSIL"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="wsilimport">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.wsdl"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- <action
- label="%ACTION_GENERATE_JAVA_PROXY"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.wsil"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- <action
- label="%ACTION_GENERATE_JAVA_PROXY"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.java"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.gensamplewizard">
- <action
- label="%ACTION_GEN_SAMPLE"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.gensamplewizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.jdt.internal.core.CompilationUnit"
- nameFilter="*.java"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.gensamplewizard">
- <action
- label="%ACTION_GEN_SAMPLE"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.gensamplewizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.wst.wsdl.Service"
- nameFilter="*"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- <action
- label="%ACTION_GENERATE_JAVA_PROXY"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.wst.wsdl.Service"
- nameFilter="*"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.genwsil">
- <action
- label="%POPUP_GENERATE_WSIL"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="wsilimport">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="webservices.xml"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.editor">
- <action
- label="%POPUP_ADD_HANDLERS"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.service">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.wst.wsdl.Service"
- nameFilter="*"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.editor">
- <action
- label="%POPUP_ADD_HANDLERS"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.service">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.jst.internal.webservice.WebServiceNavigatorGroupType"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.editor">
- <action
- label="%POPUP_ADD_HANDLERS"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers">
- </action>
- <visibility>
- <objectState
- name="type"
- value="Handlers">
- </objectState>
- </visibility>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl"
- nameFilter="*"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.editor">
- <action
- label="%POPUP_ADD_HANDLERS"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.service">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="webservicesclient.xml"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.editor">
- <action
- label="%POPUP_ADD_HANDLERS"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.client">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="ejb-jar.xml"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.editor">
- <action
- label="%POPUP_ADD_HANDLERS"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.client">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="web.xml"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.editor">
- <action
- label="%POPUP_ADD_HANDLERS"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.client">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="application-client.xml"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.editor">
- <action
- label="%POPUP_ADD_HANDLERS"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.client">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef"
- nameFilter="*"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.editor">
- <action
- label="%POPUP_ADD_HANDLERS"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.handlers.client">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl"
- nameFilter="*"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- <action
- label="%ACTION_GENERATE_JAVA_PROXY"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef"
- nameFilter="*"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- <action
- label="%ACTION_GENERATE_JAVA_PROXY"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl"
- nameFilter="*"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.genwsil">
- <action
- label="%POPUP_GENERATE_WSIL"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="wsilimport">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef"
- nameFilter="*"
- id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.genwsil">
- <action
- label="%POPUP_GENERATE_WSIL"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="wsilimport">
- </action>
- </objectContribution>
-
- </extension>
-
- <!-- Client Project Types -->
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.clientProjectType">
- <clientProjectType
- include="org.eclipse.jst.j2ee.web.WebNature"
- exclude=""
- label="%LABEL_CLIENT_TYPE_WEB"
- id="org.eclipse.jst.ws.consumption.ui.clientProjectType.Web">
- </clientProjectType>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.clientProjectType">
- <clientProjectType
- include="org.eclipse.jdt.core.javanature"
- exclude="org.eclipse.jst.j2ee.web.WebNature org.eclipse.jst.j2ee.ejb.EJBNature org.eclipse.jst.j2ee.ApplicationClientNature"
- label="%LABEL_CLIENT_TYPE_CONTAINERLESS"
- id="org.eclipse.jst.ws.consumption.ui.clientProjectType.Containerless">
- </clientProjectType>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.clientProjectType">
- <clientProjectType
- include="org.eclipse.jst.j2ee.ejb.EJBNature"
- exclude=""
- label="%LABEL_CLIENT_TYPE_EJB"
- id="org.eclipse.jst.ws.consumption.ui.clientProjectType.EJB">
- </clientProjectType>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.clientProjectType">
- <clientProjectType
- include="org.eclipse.jst.j2ee.ApplicationClientNature"
- exclude=""
- label="%LABEL_CLIENT_TYPE_APP_CLIENT"
- id="org.eclipse.jst.ws.consumption.ui.clientProjectType.AppClient">
- </clientProjectType>
- </extension>
-
- <!-- Object Selection Widgets -->
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.objectSelectionWidget">
- <objectSelectionWidget
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.JavaBeanSelectionWidget"
- transformer="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.JavaBeanSelectionTransformer"
- id="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.JavaBeanSelectionWidget">
- </objectSelectionWidget>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.objectSelectionWidget">
- <objectSelectionWidget
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.EJBSelectionWidget"
- id="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.EJBSelectionWidget">
- </objectSelectionWidget>
- </extension>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.objectSelectionWidget">
- <objectSelectionWidget
- class="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.WSDLSelectionWidget"
- transformer="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.WSDLSelectionTransformer"
- id="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.WSDLSelectionWidget">
- </objectSelectionWidget>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/consumption/ui/plugin.properties b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/consumption/ui/plugin.properties
deleted file mode 100644
index 7a40c96..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/consumption/ui/plugin.properties
+++ /dev/null
@@ -1,510 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-
-PLUGIN_NEW_WIZARD_NAME_WS_CLIENT=Web Service Client
-#
-# Web services "Internet" preferences extension.
-#
-
-#
-# Web Samples IDs
-#
-
-#
-# Pop-up actions
-#
-ACTION_GENERATE_JAVA_PROXY=Generate Client
-
-#
-# Dialogs
-#
-CHECKBOX_SHOW_GENERATE_JAVA_PROXY_DIALOG=Show Generate Java bean Proxy Dialog
-TOOLTIP_PPAD_CHECKBOX_WSDL2PROXY=Show the dialog for generating the Java bean proxy action.
-
-#
-# Web Services Preferance Pages
-#
-# Categories
-#
-
-#
-# Preferences Tooltips
-#
-
-#
-#Server Runtime Preferences
-#
-TOOLTIP_SRPF_COMBO_SERVER=The preferred server type
-TOOLTIP_SRPF_COMBO_RUNTIME=The preferred Web service runtime
-TOOLTIP_SRPF_COMBO_J2EE=The preferred J2EE version
-
-#
-# Pop-up actions
-#
-
-#
-# General messages.
-#
-MSG_ERROR_TASK_EXCEPTED=IWAB0234E An internal error occurred. Details: {0}
-
-
-
-
-#
-#Runtime labels
-#
-
-
-#
-# Wizard page task labels and descriptions
-# (used only for progress indication).
-#
-
-#
-# Common wizard strings.
-#
-LABEL_FOLDER_NAME=Folder:
-LABEL_JSP_FOLDER_NAME=JSP folder:
-LABEL_WEB_PROJECT_NAME=Web project:
-LABEL_WEBSERVICETYPE=Web service type:
-LABEL_J2EE_VERSION=J2EE version:
-LABEL_NA=N/A
-
-BUTTON_BROWSE=Browse...
-BUTTON_BROWSE_FILES=Browse files...
-BUTTON_USE_ABSOLUTE_LOCATION=Use absolute location URI for WSDL input statements
-BUTTON_USE_INLINE_SCHEMA=Use inline schema
-
-
-
-
-#
-# Wizards.
-#
-WIZARD_TITLE_WSC=Web Service Client
-
-#
-# WebServiceClientSelectionPage
-#
-
-#
-# WebServiceServerSelectionPage
-#
-
-#
-# WebServiceProjectPage
-#
-PAGE_TITLE_WS_PROJECT=Web Services
-PAGE_DESC_WS_PROJECT=Review your Web service options and make any necessary changes before proceeding to the next page.
-BUTTON_START_WEB_PROJECT=Start Web service in Web project
-GROUP_SCENARIO_SERVICE=Service
-GROUP_SCENARIO_CLIENT=Client proxy
-LABEL_WEBSERVICECLIENTTYPE=Client proxy type:
-
-
-
-# Items common to WebServiceRuntimeSelectionPage and WebServiceClientRuntimeSelectionPage
-# WebServiceRuntimeSelectionPage
-PAGE_TITLE_WS_RUNTIME_SELECTION=Service Deployment Configuration
-PAGE_DESC_WS_RUNTIME_SELECTION=Choose from the list of runtime protocols and deployment servers, or use the default settings.
-LABEL_RUNTIMES_LIST=Web service runtime:
-LABEL_SERVERS_LIST=Server:
-LABEL_SERVICE_WEB_MODULE=Service project:
-LABEL_EDIT_BUTTON=Edit...
-LABEL_SERVICE_EAR_PROJECT=EAR project:
-LABEL_EAR_PROJECT=EAR project:
-LABEL_CLIENT_PROJECT=Client project:
-
-TOOLTIP_PWRS_TEXT_RUNTIME=The runtime to be used.
-TOOLTIP_PWRS_TEXT_SERVER=The server to be used.
-TOOLTIP_PWRS_J2EE_VERSION=J2EE version to be used.
-
-LABEL_SELECTION_VIEW_TITLE=Server-Side Deployment Selection:
-LABEL_SELECTION_VIEW_RUNTIME=Choose Web service runtime protocol first
-LABEL_SELECTION_VIEW_SERVER=Choose server first
-LABEL_SELECTION_VIEW_EXPLORE=Explore options
-
-LABEL_TREE_EXISTING_SERVERS=Existing Servers
-LABEL_TREE_SERVER_TYPES=Server Types
-
-MSG_INVALID_SRT_SELECTIONS=This server and runtime combination is not supported. Choose a different server or runtime to proceed through the Web services wizard.
-MSG_NO_RUNTIME=No runtime specified for the {0} scenario.
-MSG_NO_SERVER=No server specified for the {0} scenario.
-
-MSG_SERVER_TARGET_MISMATCH=The project, {0}, has a server target which is not compatible with the selected server type
-MSG_J2EE_MISMATCH=The project, {0}, has a different J2EE level from the selected J2EE level
-MSG_SERVICE_PROJECT_EMPTY=The service project cannot be empty. Select a service project
-MSG_SERVICE_EAR_EMPTY=The service EAR cannot be empty. Select a service EAR.
-MSG_CLIENT_PROJECT_EMPTY=The client project cannot be empty. Select a client project
-MSG_CLIENT_EAR_EMPTY=The client EAR cannot be empty. Select a client EAR.
-MSG_INVALID_EJB_PROJECT={0} is not an EJB project. Choose an EJB project, or enter a new EJB project name.
-MSG_INVALID_WEB_PROJECT={0} is not a Web project. Choose a Web project, or enter a new Web project name.
-
-MSG_SAME_CLIENT_AND_SERVICE_EARS=Your selected service and client {0} projects are the same. Proceeding with this configuration may result in runtime errors when invoking the Web service.
-MSG_WRONG_CLIENT_PROJECT_TYPE=The selected client project, {0}, is not a {1} project. Please select a {1} project or enter a new project name.
-MSG_CLIENT_SUB=client
-MSG_SERVICE_SUB=service
-MSG_GENERAL_PROJECT_AND_EAR=Select the {0} project and the EAR project with which you want it to be associated.
-MSG_EAR_PROJECT_WILL_BE_CREATED=If an EAR or project does not exist or is currently unassociated, it will be created and \nassociated as required when you click Next.
-
-MSG_EAR_WILL_BE_ASSOCIATED=The selected {0} project will be associated with the EAR project.
-MSG_PROJECT_WILL_BE_CREATED=The {0} project will be created and associated with the EAR project.
-MSG_EAR_WILL_BE_CREATED=The {0} EAR project will be created and associated with the project.
-MSG_PROJECT_AND_EAR_CREATED=The {0} project and EAR project will be created and associated with one another.
-
-# WebServiceClientRuntimeSelectionPage
-PAGE_TITLE_WS_CLIENT_RUNTIME_SELECTION=Client Environment Configuration
-PAGE_DESC_WS_CLIENT_RUNTIME_SELECTION=Choose from the list of supported runtime protocols and servers for the client environment, or use the default settings.
-
-LABEL_CLIENT_SELECTION_VIEW_TITLE=Client-Side Environment Selection:
-LABEL_CLIENT_TYPE=Client type:
-LABEL_WEB=Web
-LABEL_EJB=EJB
-LABEL_NO_LABEL=
-
-
-#
-# Items common to WebServiceMappingsPage, WebServiceMappingsPage (client), and WebServiceSOAPBindingPage
-#
-PAGE_MSG_VALIDATION_INTERNAL_ERROR=An internal error occurred during page validation. See logs for details.
-
-#
-# WebServiceMappingsPage
-#
-PAGE_TITLE_WS_XML2BEAN=Web Service Skeleton XML to Java Mappings
-PAGE_DESC_N2P_MAPPINGS=Define custom mapping for namespace to package.
-MSG_MAPPING_DUPLICATE_ENTRIES=Duplicate {0} mapped to the same {1}.
-
-
-#
-# The two ITEM_* strings are entries in a list box of mappings.
-# There are two forms, one when the page is in Java-to-XML mode:
-# <java-bean-name>, <encoding-style>
-# and one when the page is in XML-to-Java mode:
-# <xml-namespace-uri>:<xml-short-name>, <encoding-style>
-# where:
-# <java-bean-name> is a fully-qualified Java class name
-# <xml-namespace-uri> is the namespace of an XML type
-# <xml-short-name> is the XML type name within the namespace
-# <encoding-style> is the encoding style (SOAP or Literal XML)
-#
-
-#
-# WebServiceProxyPage
-#
-BUTTON_GENERATE_PROXY=Generate a proxy
-
-#
-# WebServiceSkeletonConfigPage
-#
-PAGE_DESC_WSSKEL_CONFIG=Define a skeleton Java bean as a Web service.
-PAGE_TITLE_WSSKEL_CONFIG=Web Service Skeleton Java Bean Configuration
-TOOLTIP_PBSC_TEXT_SKELETON_FOLDER=Folder for generated Java skeleton.
-TOOLTIP_PBSC_BUTTON_SKELETON_FOLDER_BROWSE=Browse folders.
-LABEL_SKELETON_ROOT_NAME=Skeleton folder:
-
-#
-# WebServiceBeanClassPage
-#
-LABEL_BEAN_CLASS_NAME=Bean:
-PAGE_MSG_BEAN_CANNOT_BE_EMPTY=Please select a Java bean class.
-BUTTON_BROWSE_CLASSES=Browse classes...
-
-
-#
-# WebServiceTestPage
-#
-PAGE_TITLE_WSTEST=Web Service Test Page
-PAGE_DESC_WSTEST=Select a test facility
-LABEL_TEST_TYPES=Test Facility
-CHECKBOX_TEST_WEBSERVICE=Test the Web service
-CHECKBOX_MONITOR_WEBSERVICE=Monitor the Web service
-MSG_ERROR_UNABLE_TO_LAUNCH_WSDL_TEST=An error occurred. Unable to launch WSDL test facility.
-
-#
-# WebServiceExplorerPage
-#
-BUTTON_LAUNCH_SERVICE_TEST=Launch
-
-#
-# WebServiceClientTestPage
-#
-PAGE_TITLE_WS_SAMPLE=Web Service Client Test
-PAGE_DESC_WS_SAMPLE=Do you want to test the generated proxy?
-BUTTON_TEST=Test the generated proxy
-LABEL_TEST_TYPES=Test facility
-BUTTON_RUN_TEST=Run test on server
-LABEL_METHODS=Methods
-MSG_ERROR_JTS_JSP_GEN=IWAB0313E Error encountered while generating the sample.
-LABEL_JSP_PROJECT_NAME=JSP project:
-MSG_ERROR_JTS_PROXY_NOT_COMPILED=IWAB0357E The Generated proxy was not found. WebService sample jsps cannot be generated.
-MSG_ERROR_MALFORMED_URL=IWAB0358E Test client URL is malformed.
-
-#
-# WebServiceISDPage
-#
-
-#
-# WebServiceBeanConfigPage
-#
-
-#
-# WebServiceBeanMethodsPage
-#
-BUTTON_SELECT_ALL=Select All
-BUTTON_DESELECT_ALL=Deselect All
-TOOLTIP_PBME_BUTTON_SELECT_ALL=Select all methods
-TOOLTIP_PBME_BUTTON_DESELECT_ALL=Deselect all methods
-
-#
-# WebServiceEJBConfigPage
-#
-
-#
-# WebServiceWSDLSelectionPage
-#
-PAGE_TITLE_WSDL_SELECTION=Web Service WSDL File Selection
-PAGE_DESC_WSDL_SELECTION=Select a WSDL file.
-
-
-#
-# WebServicePublishPage
-#
-PAGE_TITLE_WS_PUBLISH=Web Service Publication
-PAGE_DESC_WS_PUBLISH=Do you want to publish your Web service?
-PAGE_TITLE_WS_FIND=Find a Web service
-PAGE_DESC_WS_FIND=Do you want to find a Web service?
-BUTTON_WS_PUBLISH=Launch the Web Services Explorer to publish this Web service to a UDDI Registry
-BUTTON_WS_PUBLISH_PRIVATE_UDDI=Launch the Web Services Explorer to publish this Web service to the Unit Test UDDI Registry
-BUTTON_WS_FIND=Launch the Web Services Explorer to find a Web service from a UDDI Registry
-BUTTON_WS_FIND_PRIVATE_UDDI=Launch the Web Services Explorer to find a Web service from the Unit Test UDDI Registry
-LABEL_PUBLIC_UDDI_REGISTRIES=Public UDDI Registry
-
-#
-# PublicUDDIRegistryType
-#
-PUBLICUDDIREGISTRYTYPE_NAME_IBM=IBM UDDI Registry
-PUBLICUDDIREGISTRYTYPE_NAME_IBM_TEST=IBM UDDI Test Registry
-PUBLICUDDIREGISTRYTYPE_NAME_MICROSOFT=Microsoft UDDI Registry
-PUBLICUDDIREGISTRYTYPE_NAME_MICROSOFT_TEST=Microsoft UDDI Test Registry
-PUBLICUDDIREGISTRYTYPE_NAME_SAP=SAP UDDI Registry
-PUBLICUDDIREGISTRYTYPE_NAME_SAP_TEST=SAP UDDI Test Registry
-PUBLICUDDIREGISTRYTYPE_NAME_XMETHODS=XMethods Registry
-PUBLICUDDIREGISTRYTYPE_NAME_NTTCOMM=NTT Communications Registry
-
-#
-# UDDI Launch Page
-#
-
-#
-# EJB UI strings
-#
-LABEL_EJB_BEAN_NAME=EJB bean
-TABLE_TITLE_EJB_BEAN_NAMES=Stateless EJB beans
-TABLE_TITLE_EJB_PROJECT_NAME=EJB project
-LABEL_EAR_PROJECTS=EAR projects
-TOOLTIP_EAR_PROJECTS=Enterprise application projects.
-TOOLTIP_TABLE_BEAN_NAMES=Select an EJB.
-
-#
-# Tooltips for WebServiceWSDLSelectionPage
-#
-TOOLTIP_PWWS_PAGE=
-
-#
-# Tooltips for beans.WebServiceBeanClassPage
-#
-TOOLTIP_PBCL_PAGE=
-TOOLTIP_PBCL_TEXT_BEAN_CLASS=Selected Java bean.
-TOOLTIP_PBCL_BUTTON_BEAN_CLASS_BROWSE=Browse classes.
-TOOLTIP_PBCL_BUTTON_BEAN_RESOURCE_BROWSE=Browse Java files.
-
-
-#
-# Tooltips for beans.WebServiceTestPage
-#
-TOOLTIP_PSTP_COMBOBOX_TEST=Test facilities available to test the service.
-TOOLTIP_PSTP_LAUNCH_BUTTON=Launch the selected test facility.
-
-
-
-
-#
-# Tooltips for WebServiceRuntimeSelectionPage
-#
-TOOLTIP_PWRS_PAGE=
-TOOLTIP_PWRS_LIST_RUNTIMES=Select from the following deployment runtime(s).
-TOOLTIP_PWRS_LIST_SERVERS=Select from application server(s).
-TOOLTIP_PWRS_RADIO_SERVER=Server oriented selection.
-TOOLTIP_PWRS_RADIO_RUNTIME=Runtime protocol oriented selection.
-TOOLTIP_PWRS_RADIO_EXPLORE=Explore combinations.
-TOOLTIP_PWRS_COMBO_PROJECT=Web project.
-
-#
-# Tooltips for WebServiceClientRuntimeSelectionPage
-#
-TOOLTIP_PWCR_COMBO_CLIENT_TYPE=Client type.
-
-
-#
-# Tooltips for WebServiceProjectPage
-#
-TOOLTIP_PWPR_COMBO_TYPE=Web service implementation type.
-TOOLTIP_PWPR_GROUP_SCENARIO_SERVICE=Service defaults for this wizard scenario.
-TOOLTIP_PWPR_CHECKBOX_GENERATE_PROXY=Enable/disable proxy generation for this scenario.
-TOOLTIP_PWPR_CHECKBOX_START_WEB_PROJECT=Start Web service in Web project for this scenario.
-TOOLTIP_PWPR_CHECKBOX_LAUNCH_WS=Launch the Web Services Explorer to publish the Web service in this scenario to a UDDI Registry.
-TOOLTIP_PWPR_CHECKBOX_TEST_SERVICE=Select this to explore the Web service created.
-TOOLTIP_PWPR_CHECKBOX_MONITOR_SERVICE=Select this to monitor the SOAP traffics of this Web service.
-TOOLTIP_PWPR_GROUP_SCENARIO_CLIENT=Client proxy defaults for this wizard scenario.
-TOOLTIP_PWPR_COMBO_CLIENTTYPE=Client proxy selection type.
-
-#
-# Tooltips for WebServicePublishPage
-#
-TOOLTIP_PWPB_PAGE=
-TOOLTIP_PWPB_CHECKBOX_WS_LAUNCH=Publish the Web service.
-
-
-#
-# WSIL proxy
-#
-
-PAGE_WSIL_IMPORT=WSIL Import Page
-TITLE_WSIL_IMPORT=WSIL Import
-DESC_WSIL_IMPORT=Import WSDL references to a WSIL document
-PAGE_TITLE_WS_SELECTION=Web Service Selection Page
-PAGE_DESC_WS_SELECTION=Enter a web service URI.
-
-PAGE_MSG_LOADING_WEB_SERVICE_URI=Loading Web service URI...
-PAGE_MSG_INVALID_WEB_SERVICE_URI=Invalid Web service URI. Enter an URI to a WSDL, WSIL or HTML document.
-PAGE_MSG_NO_SUCH_FILE=File "{0}" does not exists.
-PAGE_MSG_SELECTION_MUST_BE_WSDL=Selection must be WSDL.
-PAGE_MSG_INVALID_WSIL_FILE_NAME=Invalid WSIL file name. WSIL file name must end with .wsil
-
-
-
-MSG_ERROR_URI_NOT_RESOLVABLE=IWAB0469E "{0}" is not resolvable.
-MSG_ERROR_WSDL_HAS_NO_SERVICE_ELEMENT=IWAB0551E WSDL file at {0} has no service element.
-
-LABEL_WSIL_URI=WSIL URI:
-LABEL_BROWSE=Browse
-LABEL_WSDL=WSDL:
-LABEL_WSDL_URI=WSDL URI
-LABEL_IMPORT=Import...
-LABEL_ADD=Add
-LABEL_REMOVE=Remove
-LABEL_WS_SELECTION=Enter an URI to a WSDL, WSIL or HTML document:
-LABEL_SELECT_WSDL=Select a WSDL
-
-
-TOOLTIP_WSIL_IMPORT_PAGE=This page allows you to add WSDL references to a WSIL document.
-TOOLTIP_WSIL_TEXT_WSIL=Enter the location of a new or existing WSIL document.
-TOOLTIP_WSIL_BUTTON_BROWSE_WSIL=Browse for a WSIL document.
-TOOLTIP_WSIL_TABLE_WSDL=Enter the URIs of the WSDLs that are going to be added as service references.
-TOOLTIP_PCON_PAGE=Select a web service for consumption.
-TOOLTIP_PCON_TEXT_WS=Enter an URI to a WSDL, WSIL or HTML document.
-TOOLTIP_PCON_BUTTON_BROWSE_WS=Browse for a web service resource.
-
-#
-# Tooltips for client.WebServiceClienTestPage
-#
-TOOLTIP_PWSM_PAGE=
-TOOLTIP_PWSM_CHECKBOX_TEST=Enable/disable Test.
-TOOLTIP_PWSM_COMBOBOX_TEST=Select the test type.
-TOOLTIP_PWSM_CHECKBOX_LAUNCH=Run test on a server.
-TOOLTIP_PWSM_TEXT_JSP_FOLDER=Destination folder of generated sample files.
-TOOLTIP_PWSM_BUTTON_JSP_FOLDER_BROWSE=Browse folders.
-TOOLTIP_PWSM_BUTTON_SELECT_ALL=Select all methods.
-TOOLTIP_PWSM_BUTTON_DESELECT_ALL=Deselect all methods.
-TOOLTIP_PWSM_COMBO_PROJECT=Web project for generated sample.
-TOOLTIP_PWSM_TEXT_SAMPLE_FOLDER=Destination folder of generated sample files.
-TOOLTIP_PWSM_TREE_METHODS=Methods to generate into the sample.
-TOOLTIP_PWSM_EAR_PROJECT=EAR project for the generated sample.
-
-#
-# HTTP Basic Auth
-#
-DIALOG_TITLE_HTTP_BASIC_AUTH=HTTP Basic Authentication
-LABEL_URL=URL:
-LABEL_HTTP_BASIC_AUTH_USERNAME=User name:
-LABEL_HTTP_BASIC_AUTH_PASSWORD=Password:
-
-TOOLTIP_HTTP_BASIC_AUTH_USERNAME=Enter your HTTP basic authentication user name.
-TOOLTIP_HTTP_BASIC_AUTH_PASSWORD=Enter your HTTP basic authentication password.
-
-#
-# Web Service Server Runtime Type
-#
-
-
-#
-# Client project type
-#
-
-#
-# Generate Handler Skeleton
-#
-TASK_LABEL_GEN_HANDLER_SKELETON=Generate handler skeleton command
-TASK_DESC_GEN_HANDLER_SKELETON=Generate handler skeleton command
-MSG_ERROR_GENERATE_HANDLER_SKELETON=IWAB0359E Error in generating handler skeleton.
-MSG_ERROR_WRITE_FILE=IWAB0360E Error in writing file {0}.
-
-#
-# Handlers Configuration wizard page
-#
-LABEL_HANDLERS_CONFIG=Handler Configuration
-LABEL_BUTTON_ADD=Add
-LABEL_BUTTON_REMOVE=Remove
-LABEL_BUTTON_MOVE_UP=Move Up
-LABEL_BUTTON_MOVE_DOWN=Move Down
-LABEL_BUTTON_GEN_SKELETON=Generate skeleton classes for new handlers
-LABEL_COMBO_SOURCE_LOC=Output folder:
-LABEL_COMBO_WS_CLIENT_REF=Client Service Reference:
-LABEL_COMBO_WS_SERVICE_DESC=Service Description:
-
-LABEL_HANDLER_NAME=Name
-LABLE_HANDLER_CLASS=Class Name
-LABEL_HANDLER_PORT=Port Name
-
-DIALOG_TITLE_WS_ADD_HANDLER=Add New Handler
-LABEL_TEXT_HANDLER_NAME=Name:
-LABEL_TEXT_HANDLER_CLASS=Class name:
-LABEL_TEXT_HANDLER_PORT=Port name:
-
-PAGE_TITLE_SERVICE_HDLR_CONFIG=Service Handlers Configuration
-PAGE_DESC_SERVICE_HDLR_CONFIG=Configure service-side handlers
-PAGE_TITLE_CLIENT_HDLR_CONFIG=Client Handlers Configuration
-PAGE_DESC_CLIENT_HDLR_CONFIG=Configure client-side handlers
-
-TOOLTIP_EDIT_WS_HANDLERS=Configure Web Service Handlers
-TOOLTIP_BUTTON_GEN_SKELETON=Select to generate skeleton classes for new handlers.
-TOOLTIP_COMBO_SOURCE_LOC=Select the output location for file generation.
-TOOLTIP_TEXT_HANDLER_NAME=Handler name
-TOOLTIP_TEXT_HANDLER_CLASS=Handler class name
-TOOLTIP_TEXT_HANDLER_PORT=Handler port component name
-TOOLTIP_WS_CLIENT_REF=Select a client service-reference to show its handlers.
-TOOLTIP_WS_SERVICE_DESC=Select a service description to show its handlers.
-
-#
-# OpenJavaEditorCommand
-#
-MSG_ERROR_UNABLE_TO_OPEN_JAVA_EDITOR=IWAB0029E Unable to open class {0} from project {1} in the Java editor.
-
-#
-# CheckIfServiceProject
-#
-MSG_WARN_IS_SERVICE_PROJECT=The selected client project, {0}, contains the Web service. Proceeding with this configuration may result in runtime errors when invoking the Web service. Would you like to proceed?
-MSG_USER_ABORTED=User pressed cancel in warning dialog which warned about the selected client project being the service project.
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/action/LaunchWSEAction.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/action/LaunchWSEAction.java
deleted file mode 100644
index 42f5a3d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/action/LaunchWSEAction.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.action;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.ws.internal.ui.wse.LaunchWebServicesExplorerCommand;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.wst.command.env.core.context.TransientResourceContext;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseEnvironment;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseProgressMonitor;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseStatusHandler;
-
-
-public class LaunchWSEAction implements IWorkbenchWindowActionDelegate
-{
- public void run(IAction action)
- {
- EclipseStatusHandler handler = new EclipseStatusHandler();
- EclipseProgressMonitor monitor = new EclipseProgressMonitor();
- TransientResourceContext context = new TransientResourceContext();
- EclipseEnvironment environment = new EclipseEnvironment( null, context, monitor, handler );
- LaunchWebServicesExplorerCommand cmd = new LaunchWebServicesExplorerCommand();
-
- cmd.execute( environment );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() { }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) { }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) { }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/CheckForServiceProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/CheckForServiceProjectCommand.java
deleted file mode 100644
index 8c8c892..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/CheckForServiceProjectCommand.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.command;
-
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.common.ValidationUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusException;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-/**
- * This command checks to see if the selected client project is the
- * service project. If so, the user is warned.
- */
-public class CheckForServiceProjectCommand extends SimpleCommand
-{
- MessageUtils msgUtils;
- SelectionListChoices runtime2ClientTypes;
- String wsdlURI;
- WebServicesParser webServicesParser;
-
- public CheckForServiceProjectCommand()
- {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- msgUtils = new MessageUtils(pluginId + ".plugin", this);
- }
-
- public void setRuntime2ClientTypes( SelectionListChoices runtime2ClientTypes )
- {
- this.runtime2ClientTypes = runtime2ClientTypes;
- }
-
- public void setWsdlURI(String wsdlURI)
- {
- this.wsdlURI = wsdlURI;
- }
-
- public void setWebServicesParser(WebServicesParser webServicesParser)
- {
- this.webServicesParser = webServicesParser;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.Command#execute(org.eclipse.wst.command.env.core.common.Environment)
- */
- public Status execute(Environment environment)
- {
- Status status = new SimpleStatus("");
- if (runtime2ClientTypes==null || wsdlURI==null || wsdlURI.length()==0 || webServicesParser==null)
- return status;
-
- String clientProjectName = runtime2ClientTypes.getChoice().getChoice().getList().getSelection();
- if (clientProjectName==null || clientProjectName.length()==0)
- return status;
-
- IProject clientProject = (IProject)((new StringToIProjectTransformer()).transform(clientProjectName));
- ValidationUtils vu = new ValidationUtils();
- Calendar cal = new GregorianCalendar();
- boolean isServiceProject = vu.isProjectServiceProject(clientProject, wsdlURI, webServicesParser);
- if (isServiceProject)
- {
- Status wStatus = new SimpleStatus("", msgUtils.getMessage("MSG_WARN_IS_SERVICE_PROJECT", new String[]{clientProjectName}), Status.WARNING);
- try
- {
- environment.getStatusHandler().report(wStatus);
- }
- catch (StatusException se)
- {
- //User decided to abort. Return an error status
- Status eStatus = new SimpleStatus("", msgUtils.getMessage("MSG_USER_ABORTED"), Status.ERROR);
- return eStatus;
- }
- }
-
- return status;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/GenerateHandlerSkeletonCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/GenerateHandlerSkeletonCommand.java
deleted file mode 100644
index 3e26a34..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/GenerateHandlerSkeletonCommand.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.command;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.wst.command.env.common.FileResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-public class GenerateHandlerSkeletonCommand extends SimpleCommand
-{
-
- private IProject serviceProject_;
- private MessageUtils msgUtils_;
-
- private String LABEL = "TASK_LABEL_GEN_HANDLER_SKELETON";
- private String DESCRIPTION = "TASK_DESC_GEN_HANDLER_SKELETON";
-
- private IPath outputLocation_;
- private String[] handlerNames_;
- private boolean genSkeleton_;
- private String handlerNameForEdit_ = null;
-
- public GenerateHandlerSkeletonCommand()
- {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- setName (msgUtils_.getMessage(LABEL));
- setDescription( msgUtils_.getMessage(DESCRIPTION));
- }
-
-
- public Status execute (Environment env)
- {
-
- if (!genSkeleton_)
- return new SimpleStatus("");
-
- int i;
- boolean error = false;
- boolean warning = false;
-
- SimpleStatus status = null;
- Status writeStatus;
-
-
- for (i=0; i<handlerNames_.length; i++) {
- writeStatus = writeFile(env, handlerNames_[i], outputLocation_);
- // handle status return
- if (writeStatus.getSeverity() == Status.ERROR) { // write status is OK or ERROR
- error = true;
- if (status == null) {
- status = new SimpleStatus( "execute", msgUtils_.getMessage("MSG_ERROR_GENERATE_HANDLER_SKELETON"), Status.ERROR);
- }
- status.addChild(writeStatus);
- }
- }
- if (error) {
- env.getStatusHandler().reportError(status);
- } else {
- status = new SimpleStatus( "" );
- }
- return status;
- }
-
- public Status writeFile (Environment env, String className, IPath outputLocation)
- {
- Status status = new SimpleStatus("");
- int index;
-
- String simpleClassName = className;
- String packageName = null;
- IPath filePath = outputLocation;
- if (className != null) {
- index = className.lastIndexOf('.');
- if (index != -1) {
- simpleClassName = className.substring(index + 1);
- packageName = className.substring(0, index);
-
- String packageSegment = packageName;
- int j = 0;
- j = packageSegment.indexOf('.');
- while (j != -1) {
- filePath = filePath.append(packageSegment.substring(0, j));
- packageSegment = packageSegment.substring(j + 1);
- j = packageSegment.indexOf('.');
- }
- filePath = filePath.append(packageSegment);
- }
- else {
- packageName = "";
- }
- }
-
- filePath = filePath.append(simpleClassName);
-
- filePath = filePath.addFileExtension("java");
-
- // check if Handler already exists; do not overwrite existing Handlers
- IResource workspaceRes = ResourceUtils.findResource(filePath);
- if (workspaceRes!=null && workspaceRes.exists()) {
- return status;
- }
-
- if (handlerNameForEdit_ == null){
- handlerNameForEdit_ = className;
- }
-
- OutputStream outputStream = FileResourceUtils.newFileOutputStream( EnvironmentUtils.getResourceContext(env), filePath, env.getProgressMonitor(), env.getStatusHandler());
- // create buffered writer for writing file
- BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(outputStream));
- try {
- if (packageName.length() != 0) {
- bw.write("package " +packageName+";");
- bw.newLine();
- bw.newLine();
- }
- bw.write("import javax.xml.rpc.handler.GenericHandler;");
- bw.newLine();
- bw.write("import javax.xml.rpc.handler.MessageContext;");
- bw.newLine();
- bw.write("import javax.xml.namespace.QName;");
- bw.newLine();
- bw.newLine();
-
- bw.write("public class "+simpleClassName+" extends GenericHandler");
- bw.newLine();
- bw.write("{");
- bw.newLine();
- bw.newLine();
-
- bw.write(" public QName[] getHeaders ()");
- bw.newLine();
- bw.write(" {");
- bw.newLine();
- bw.write(" // Fill in method body");
- bw.newLine();
- bw.write(" return null;");
- bw.newLine();
- bw.write(" }");
- bw.newLine();
- bw.newLine();
- bw.write(" public boolean handleRequest( MessageContext context )");
- bw.newLine();
- bw.write(" {");
- bw.newLine();
- bw.write(" // Fill in method body or delete method to use GenericHandler");
- bw.newLine();
- bw.write(" return true;");
- bw.newLine();
- bw.write(" }");
- bw.newLine();
- bw.newLine();
- bw.write(" public boolean handleResponse( MessageContext context )");
- bw.newLine();
- bw.write(" {");
- bw.newLine();
- bw.write(" // Fill in method body or delete method to use GenericHandler ");
- bw.newLine();
- bw.write(" return true;");
- bw.newLine();
- bw.write(" }");
- bw.newLine();
- bw.newLine();
- bw.write(" public boolean handleFault( MessageContext context )");
- bw.newLine();
- bw.write(" {");
- bw.newLine();
- bw.write(" // Fill in method body or delete method to use GenericHandler");
- bw.newLine();
- bw.write(" return true;");
- bw.newLine();
- bw.write(" }");
- bw.newLine();
-
- bw.newLine();
- bw.write("}");
- bw.close();
- status = new SimpleStatus( "" );
- } catch (IOException e) {
- status = new SimpleStatus( "writeFile", msgUtils_.getMessage("MSG_ERROR_WRITE_FILE", new String[]{ className }), Status.ERROR, e );
- if (bw != null) {
- try {
- bw.close();
- } catch (IOException e1) {
- }
- }
- }
- return status;
- }
-
- public Status undo(Environment environment)
- {
- return null;
- }
-
- public Status redo(Environment environment)
- {
- return null;
- }
-
- public void setOutputLocation(IPath outputLocation)
- {
- this.outputLocation_ = outputLocation;
- }
-
- public void setHandlerNames (String[] handlerNames)
- {
- this.handlerNames_ = handlerNames;
- }
-
- public void setGenSkeletonEnabled(boolean genSkeleton)
- {
- this.genSkeleton_ = genSkeleton;
- }
-
- public IProject getProject(){
- IProject project = null;
- if (outputLocation_!=null){
- project = ResourceUtils.getProjectOf(outputLocation_);
- }
- return project;
- }
-
- public List getClassNames(){
- List classes = new ArrayList();
- if (handlerNameForEdit_!=null){
- classes.add(handlerNameForEdit_);
- }
- return classes;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/OpenJavaEditorCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/OpenJavaEditorCommand.java
deleted file mode 100644
index 8b98767..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/OpenJavaEditorCommand.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.command;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class OpenJavaEditorCommand extends SimpleCommand
-{
- private List classNames;
- private IProject project;
-
- public OpenJavaEditorCommand()
- {
- }
-
- public Status execute(Environment environment)
- {
- OpenJavaEditorJob job = new OpenJavaEditorJob(classNames, project);
- job.setPriority(Job.LONG);
- job.schedule();
- return new SimpleStatus("");
- }
-
- public void setClassNames(List classNames)
- {
- this.classNames = classNames;
- }
-
- public void setProject(IProject project)
- {
- this.project = project;
- }
-
- private class OpenJavaEditorJob extends UIJob
- {
- private List classNames;
- private IProject project;
-
- public OpenJavaEditorJob(List classNames, IProject project)
- {
- super("org.eclipse.jst.ws.internal.consumption.ui.command.OpenJavaEditorJob");
- this.classNames = classNames;
- this.project = project;
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor)
- {
- if (project != null && classNames != null)
- {
- IJavaProject javaProject = JavaCore.create(project);
- for (Iterator it = classNames.iterator(); it.hasNext();)
- {
- String className = (String)it.next();
- try
- {
- IType type = javaProject.findType(className);
- JavaUI.openInEditor(type);
- }
- catch (Throwable t)
- {
- return new org.eclipse.core.runtime.Status(org.eclipse.core.runtime.Status.ERROR, WebServiceConsumptionUIPlugin.ID, 0, WebServiceConsumptionUIPlugin.getMessage("MSG_ERROR_UNABLE_TO_OPEN_JAVA_EDITOR", new String[]{className, project.getName()}), t);
- }
- }
- return new org.eclipse.core.runtime.Status(org.eclipse.core.runtime.Status.OK, WebServiceConsumptionUIPlugin.ID, 0, "", null);
- }
- else
- return new org.eclipse.core.runtime.Status(org.eclipse.core.runtime.Status.ERROR, WebServiceConsumptionUIPlugin.ID, 0, WebServiceConsumptionUIPlugin.getMessage("MSG_ERROR_UNABLE_TO_OPEN_JAVA_EDITOR", new String[]{classNames != null ? classNames.toString() : "", project != null ? project.getName() : ""}), null);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/WSINonCompliantRuntimeCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/WSINonCompliantRuntimeCommand.java
deleted file mode 100644
index e94a506..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/WSINonCompliantRuntimeCommand.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.command;
-
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.jst.ws.internal.ui.wsi.preferences.PersistentWSIAPContext;
-import org.eclipse.jst.ws.internal.ui.wsi.preferences.PersistentWSISSBPContext;
-import org.eclipse.jst.ws.internal.ui.wsi.preferences.WSIComplianceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-public class WSINonCompliantRuntimeCommand extends SimpleCommand
-{
-
- private IProject serviceProject_;
- private MessageUtils msgUtils_;
-
- private String LABEL = "TASK_LABEL_WSI_NONCOMPLIANT";
- private String DESCRIPTION = "TASK_DESC_WSI_NONCOMPLIANT";
-
- public WSINonCompliantRuntimeCommand()
- {
- String pluginId = "org.eclipse.jst.ws.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- setName (msgUtils_.getMessage(LABEL));
- setDescription( msgUtils_.getMessage(DESCRIPTION));
- }
-
-
- public Status execute (Environment environment)
- {
-
- PersistentWSISSBPContext wsiSSBPContext = WebServiceUIPlugin.getInstance().getWSISSBPContext();
- PersistentWSIAPContext wsiAPContext = WebServiceUIPlugin.getInstance().getWSIAPContext();
- Vector statusSSBP = new Vector();
- statusSSBP.add(new SimpleStatus("WSINonCompliantRuntimeCommand",
- msgUtils_.getMessage("WSI_SSBP_INCOMPLIANT_RUNTIME"), WSIComplianceUtils.getWSISeverity(serviceProject_, wsiSSBPContext)));
- Status[] statusesSSBP = (Status[]) statusSSBP.toArray(new Status[statusSSBP.size()]);
-
- Vector statusAP = new Vector();
- statusAP.add(new SimpleStatus("WSINonCompliantRuntimeCommand",
- msgUtils_.getMessage("WSI_AP_INCOMPLIANT_RUNTIME"), WSIComplianceUtils.getWSISeverity(serviceProject_, wsiAPContext)));
- Status[] statusesAP = (Status[]) statusAP.toArray(new Status[statusAP.size()]);
-
- if (WSIComplianceUtils.checkWSICompliance (environment.getStatusHandler(), statusesSSBP, serviceProject_, wsiSSBPContext)) {
- if (WSIComplianceUtils.checkWSICompliance (environment.getStatusHandler(), statusesAP, serviceProject_, wsiAPContext)) {
- return new SimpleStatus( "" );
- } else {
- return new SimpleStatus(
- "WSINonCompliantRuntimeCommand",
- msgUtils_.getMessage("NOT_OK"),
- Status.ERROR);
- }
- } else {
- return new SimpleStatus(
- "WSINonCompliantRuntimeCommand",
- msgUtils_.getMessage("NOT_OK"),
- Status.ERROR);
- }
- }
-
- public Status undo(Environment environment)
- {
- return null;
- }
-
- public Status redo(Environment environment)
- {
- return null;
- }
-
- public void setServiceProject(IProject serviceProject) {
- this.serviceProject_ = serviceProject;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/EclipseIPath2URLStringTransformer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/EclipseIPath2URLStringTransformer.java
deleted file mode 100644
index 6c52632..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/EclipseIPath2URLStringTransformer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.command.data;
-
-import java.net.MalformedURLException;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.wst.command.env.core.data.Transformer;
-
-
-public class EclipseIPath2URLStringTransformer implements Transformer
-{
- public Object transform(Object value)
- {
- String s = value.toString();
- if (s.indexOf(":") < 0)
- {
- IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(value.toString());
- if (res.exists())
- {
- try
- {
- s = res.getLocation().toFile().toURL().toString();
- }
- catch (MalformedURLException murle)
- {
- }
- }
- }
- return s;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ProjectName2IProjectTransformer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ProjectName2IProjectTransformer.java
deleted file mode 100644
index fb25883..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ProjectName2IProjectTransformer.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.command.data;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.wst.command.env.core.data.Transformer;
-
-public class ProjectName2IProjectTransformer implements Transformer
-{
- public Object transform(Object value)
- {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(value.toString());
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ServerInstToIServerTransformer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ServerInstToIServerTransformer.java
deleted file mode 100644
index c522b84..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ServerInstToIServerTransformer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Apr 20, 2004
- */
-package org.eclipse.jst.ws.internal.consumption.ui.command.data;
-
-import org.eclipse.wst.command.env.core.data.Transformer;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-
-/*
- * Transforms a server instance id to an IServer
- */
-public class ServerInstToIServerTransformer implements Transformer {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.data.Transformer#transform(java.lang.Object)
- */
- public Object transform(Object value) {
-
- String existingServerInstId = (String)value;
- IServer serverInst = null;
- if (existingServerInstId != null) {
- serverInst = ServerCore.findServer(existingServerInstId);
- }
- return serverInst;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ServerName2IServerTransformer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ServerName2IServerTransformer.java
deleted file mode 100644
index c6a46c3..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/command/data/ServerName2IServerTransformer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.command.data;
-
-import java.util.Vector;
-
-import org.eclipse.wst.command.env.core.data.Transformer;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-
-public class ServerName2IServerTransformer implements Transformer
-{
- public Object transform(Object value)
- {
- Vector serverIds = new Vector();
- {
- String serverName = value.toString();
- IServer[] servers = ServerCore.getServers();
- if (servers != null && servers.length!=0)
- {
- for (int i = 0; i < servers.length; i++)
- {
- IServer server = (IServer)servers[i];
- if ((server.getName()).equals(serverName))
- return server;
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ClientServerSelectionUtils.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ClientServerSelectionUtils.java
deleted file mode 100644
index d48e46b..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ClientServerSelectionUtils.java
+++ /dev/null
@@ -1,510 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.common;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.j2ee.internal.servertarget.IServerTargetConstants;
-import org.eclipse.jst.j2ee.internal.servertarget.ServerTargetHelper;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.consumption.common.IServerDefaulter;
-import org.eclipse.jst.ws.internal.consumption.common.ServerInfo;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.consumption.ui.preferences.PersistentServerRuntimeContext;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceClientTypeRegistry;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-
-
-public class ClientServerSelectionUtils
-{
- /*
- * Returns reasonable defaults for server factory id and instance id based on
- * an existing project
- * index [0] contains factoryId, index[1] contains instance Id.
- * @deprecated
- */
- public static String[] getServerInfoFromExistingProject(IProject project, String typeId, boolean askExtenders)
- {
- String[] serverInfo = new String[2]; //serverInfp[0] contains factoryId, serverInfo[1] contains instance Id
-
- // If the project has been added to an existing server, pick that server
- IServer[] configuredServers = ServerUtil.getServersByModule(ResourceUtils.getModule(project), null);
- IServer firstSupportedServer = getFirstSupportedServer(configuredServers, typeId );
- if (firstSupportedServer != null)
- {
- serverInfo[0] = firstSupportedServer.getServerType().getId();
- serverInfo[1] = firstSupportedServer.getId();
- return serverInfo;
- }
-
- //Does the project have a runtime-target?
- IRuntime runtimeTarget = getRuntimeTarget(project.getName());
- if (runtimeTarget != null)
- {
- //Look for an existing server which is compatible with the runtime-target
- IServer[] compatibleServers = getCompatibleExistingServers(runtimeTarget);
- if (compatibleServers!=null && compatibleServers.length > 0)
- {
- IServer firstSupportedCompatServer = getFirstSupportedServer(compatibleServers, typeId);
- if (firstSupportedCompatServer != null)
- {
- serverInfo[0] = firstSupportedCompatServer.getServerType().getId();
- serverInfo[1] = firstSupportedCompatServer.getId();
- return serverInfo;
-
- }
- }
-
- //No existing compatible server was found. Choose a compatible server type.
-
- //If the preferred server is compatible with the project's runtime target, use it.
- PersistentServerRuntimeContext ctx = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- String pFactoryId = ctx.getServerFactoryId();
- IServerType serverType = ServerCore.findServerType(pFactoryId);
- if (serverType!=null){
- String serverRuntimeId = serverType.getRuntimeType().getId();
- if (serverRuntimeId.equals(runtimeTarget.getRuntimeType().getId()))
- {
- serverInfo[0] = pFactoryId;
- return serverInfo;
- }
- }
-
- //The preferred server was not compatible. Pick the first valid compatible server type.
- String factoryId = getFirstSupportedServerType(runtimeTarget, typeId);
- if (factoryId != null) serverInfo[0] = factoryId;
- return serverInfo;
-
- }
-
-
- if (askExtenders)
- {
- ServerInfo recommendedServerInfo = getExtenderRecommendation(project);
- if (recommendedServerInfo!=null)
- {
- if (recommendedServerInfo.getServerFactoryId()!=null && recommendedServerInfo.getServerFactoryId().length()>0)
- serverInfo[0] = recommendedServerInfo.getServerFactoryId();
-
- if (recommendedServerInfo.getServerInstanceId()!=null && recommendedServerInfo.getServerInstanceId().length()>0)
- serverInfo[1] = recommendedServerInfo.getServerInstanceId();
-
- return serverInfo;
- }
- }
-
- //Use ServerTargetHelper to get a list of valid runtime-targets and use these to determine a default server type.
- String[] projectAttrs = ServerTargetHelper.getProjectTypeAndJ2EELevel(project);
- List runtimes = ServerTargetHelper.getServerTargets(projectAttrs[0], projectAttrs[1]);
- String[] compatServerInfo = getCompatibleExistingServer(runtimes,typeId);
- if ( compatServerInfo != null)
- {
- return compatServerInfo;
- }
-
- //No existing compatible server, pick a type.
- String factoryId = getFirstSupportedServerType(runtimes, typeId);
- if (factoryId != null) serverInfo[0] = factoryId;
- return serverInfo;
-
- }
-
- /*
- * Returns reasonable defaults for server factory id and instance id based on
- * an existing project
- * index [0] contains factoryId, index[1] contains instance Id.
- * @deprecated
- */
- public static String[] getServerInfoFromExistingProject(IProject project, String typeId, String runtimeId, boolean askExtenders)
- {
- String[] serverInfo = new String[2]; //serverInfp[0] contains factoryId, serverInfo[1] contains instance Id
-
- // If the project has been added to an existing server, pick that server
- IServer[] configuredServers = ServerUtil.getServersByModule(ResourceUtils.getModule(project), null);
- IServer firstSupportedServer = getFirstSupportedServer(configuredServers, typeId );
- if (firstSupportedServer != null)
- {
- serverInfo[0] = firstSupportedServer.getServerType().getId();
- serverInfo[1] = firstSupportedServer.getId();
- return serverInfo;
- }
-
- //Does the project have a runtime-target?
- IRuntime runtimeTarget = getRuntimeTarget(project.getName());
- if (runtimeTarget != null)
- {
- //Look for an existing server which is compatible with the runtime-target
- IServer[] compatibleServers = getCompatibleExistingServers(runtimeTarget);
- if (compatibleServers!=null && compatibleServers.length > 0)
- {
- IServer firstSupportedCompatServer = getFirstSupportedServer(compatibleServers, typeId);
- if (firstSupportedCompatServer != null)
- {
- serverInfo[0] = firstSupportedCompatServer.getServerType().getId();
- serverInfo[1] = firstSupportedCompatServer.getId();
- return serverInfo;
-
- }
- }
-
- //No existing compatible server was found. Choose a compatible server type.
-
- //If the preferred server is compatible with the project's runtime target, use it.
- PersistentServerRuntimeContext ctx = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- String pFactoryId = ctx.getServerFactoryId();
- IServerType serverType = ServerCore.findServerType(pFactoryId);
- if (serverType!=null){
- String serverRuntimeId = serverType.getRuntimeType().getId();
- if (serverRuntimeId.equals(runtimeTarget.getRuntimeType().getId()))
- {
- serverInfo[0] = pFactoryId;
- return serverInfo;
- }
- }
-
- //The preferred server was not compatible. Pick the first valid compatible server type.
- String factoryId = getFirstSupportedServerType(runtimeTarget, typeId);
- if (factoryId != null) serverInfo[0] = factoryId;
- return serverInfo;
-
- }
-
-
- if (askExtenders)
- {
- ServerInfo recommendedServerInfo = getExtenderRecommendation(project);
- if (recommendedServerInfo!=null)
- {
- if (recommendedServerInfo.getServerFactoryId()!=null && recommendedServerInfo.getServerFactoryId().length()>0)
- serverInfo[0] = recommendedServerInfo.getServerFactoryId();
-
- if (recommendedServerInfo.getServerInstanceId()!=null && recommendedServerInfo.getServerInstanceId().length()>0)
- serverInfo[1] = recommendedServerInfo.getServerInstanceId();
-
- return serverInfo;
- }
- }
-
- //Use ServerTargetHelper to get a list of valid runtime-targets and use these to determine a default server type.
- String[] projectAttrs = ServerTargetHelper.getProjectTypeAndJ2EELevel(project);
- List runtimes = ServerTargetHelper.getServerTargets(projectAttrs[0], projectAttrs[1]);
- List suppRuntimes = getRuntimeTargetsSupportedByWSRuntime(runtimes, runtimeId);
- String[] compatServerInfo = getCompatibleExistingServer(suppRuntimes,typeId);
- if ( compatServerInfo != null)
- {
- return compatServerInfo;
- }
-
- //No existing compatible server, pick a type.
- String factoryId = getFirstSupportedServerType(suppRuntimes, typeId);
- if (factoryId != null) serverInfo[0] = factoryId;
- return serverInfo;
-
- }
-
- /*
- * Given a list of existing servers, this returns the first one that is supported
- * by the given Web service type id.
- * Returns null of there are no supported servers in the array.
- */
- public static IServer getFirstSupportedServer(IServer[] servers, String typeId)
- {
- WebServiceClientTypeRegistry wsctRegistry = WebServiceClientTypeRegistry.getInstance();
- if (servers != null && servers.length > 0) {
- for (int i = 0; i < servers.length; i++)
- {
- String serverFactoryId = servers[i].getServerType().getId();
- if (wsctRegistry.isServerSupportedForChosenType(typeId, serverFactoryId))
- {
- return servers[i];
- }
- }
- }
- return null;
- }
-
- /*
- * Returns the factory id of a server type compatible with the Web service type and the runtime target.
- * Returns null if there are none.
- */
- public static String getFirstSupportedServerType(IRuntime runtimeTarget, String typeId)
- {
- String runtimeId = runtimeTarget.getRuntimeType().getId();
- WebServiceClientTypeRegistry wsctRegistry = WebServiceClientTypeRegistry.getInstance();
- String[] serverFactoryIds = wsctRegistry.getServerFactoryIdsByType(typeId);
-
- for (int i=0; i<serverFactoryIds.length; i++)
- {
- IServerType serverType = ServerCore.findServerType(serverFactoryIds[i]);
- if (serverType!=null ){
- String serverRuntimeId = serverType.getRuntimeType().getId();
- if (serverRuntimeId.equals(runtimeId))
- {
- return serverFactoryIds[i];
- }
- }
- }
- return null;
- }
-
- /*
- * Return the factory id of the first server type compatible with the runtimeTargets and typeId.
- * Returns null if there are none.
- */
- public static String getFirstSupportedServerType(List runtimeTargets, String typeId)
- {
- for (int i=0; i<runtimeTargets.size(); i++ )
- {
- IRuntime runtimeTarget = (IRuntime)runtimeTargets.get(i);
- String factoryId = getFirstSupportedServerType(runtimeTarget, typeId);
- if (factoryId != null && factoryId.length()>0)
- return factoryId;
- }
-
- return null;
- }
-
- public static IRuntime getRuntimeTarget(String projectName)
- {
- if( projectName != null && projectName.length() > 0 ){ //$NON-NLS-1$
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- if( project != null && project.exists() ){
- return ServerCore.getProjectProperties(project).getRuntimeTarget();
- }
- }
- return null;
- }
-
- public static IServer[] getCompatibleExistingServers(IRuntime runtime)
- {
- if (runtime == null)
- return null;
-
- IServer[] servers = ServerCore.getServers();
- if (servers==null || servers.length!=0)
- return null;
-
- ArrayList compatibleServersList = new ArrayList();
- String runtimeId = runtime.getRuntimeType().getId();
- for (int i=0; i<servers.length; i++)
- {
- IServer server = (IServer)servers[i];
- String serverRuntimeId = server.getRuntime().getRuntimeType().getId();
- if (serverRuntimeId.equals(runtimeId))
- compatibleServersList.add(server);
-
- }
- if (compatibleServersList.size()<1)
- return null;
-
-
- Object[] compatibleServersArray = compatibleServersList.toArray();
- IServer[] compatibleServers = new IServer[compatibleServersArray.length];
- for (int j=0; j<compatibleServersArray.length; j++)
- {
- compatibleServers[j] = (IServer)compatibleServersArray[j];
- }
-
- return compatibleServers;
- }
- /*
- * Returns the factory Id and instance id of the first exiting server compatible
- * with the runtime targets and typeId
- * Returns null if there are none.
- * The item at [0] is the factory id.
- * The item at [1] is the instance id.
- */
- public static String[] getCompatibleExistingServer(List runtimeTargets, String typeId)
- {
- String[] serverInfo = new String[2];
- for (int i=0; i<runtimeTargets.size(); i++ )
- {
- IRuntime runtimeTarget = (IRuntime)runtimeTargets.get(i);
- IServer[] existingCompatServers = getCompatibleExistingServers(runtimeTarget);
- IServer compatServer = getFirstSupportedServer(existingCompatServers, typeId);
- if (compatServer != null)
- {
- serverInfo[0] = compatServer.getServerType().getId();
- serverInfo[1] = compatServer.getId();
- return serverInfo;
- }
- }
- return null;
- }
-
- public static ServerInfo getExtenderRecommendation(IProject project)
- {
- try
- {
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] elements = reg.getConfigurationElementsFor("org.eclipse.jst.ws.consumption", "serverDefaulter");
- for (int i=0; i<elements.length; i++)
- {
- Object serverDefaulterObject = elements[i].createExecutableExtension("class");
- if (serverDefaulterObject instanceof IServerDefaulter)
- {
- IServerDefaulter serverDefaulter = (IServerDefaulter)serverDefaulterObject;
- ServerInfo serverInfo = serverDefaulter.recommendDefaultServer(project);
- if (serverInfo != null)
- return serverInfo;
- }
-
- }
- } catch (CoreException ce)
- {
- return null;
- }
-
- return null;
- }
-
- private static List getRuntimeTargetsSupportedByWSRuntime(List runtimeTargets, String webServiceRuntimeId)
- {
- ArrayList suppRuntimeTargets = new ArrayList();
- WebServiceClientTypeRegistry wsctReg = WebServiceClientTypeRegistry.getInstance();
- for (int i=0; i<runtimeTargets.size(); i++)
- {
- IRuntime runtimeTarget = (IRuntime)runtimeTargets.get(i);
- String rtId = runtimeTarget.getRuntimeType().getId();
- if (wsctReg.doesRuntimeSupportServerTarget(rtId, webServiceRuntimeId))
- {
- suppRuntimeTargets.add(runtimeTarget);
- }
- }
- return suppRuntimeTargets;
- }
-
- /**
- * Use this method to get a server factory id and instance id that is compatible with the given Web
- * service runtime.
- * @param clientRuntimeId
- * @param j2eeVersion String representation of the int values in J2EEVersionConstants i.e. "12", "13", "14"
- * @return String[] index [0] contains factoryId, index[1] contains instance Id.
- */
- public static String[] getServerFromClientRuntimeAndJ2EE(String clientRuntimeId, String j2eeVersion)
- {
- String[] serverInfo = new String[2];
- WebServiceClientTypeRegistry wsctReg = WebServiceClientTypeRegistry.getInstance();
-
- //Get all possible valid servers. If there are none, we can't default intelligently, return null.
- String[] validServerFactoryIds = wsctReg.getServerFactoryIdsByRuntimeId(clientRuntimeId);
- if (validServerFactoryIds==null || validServerFactoryIds.length<1)
- return null;
-
- //Get all existing servers
- IServer[] servers = ServerCore.getServers(); //Get all existing servers
-
- //Get the preferred server.
- PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- String prefServerFactoryId = context.getServerFactoryId();
-
- boolean preferredIsValid = containsString(validServerFactoryIds, prefServerFactoryId)
- && isServerValid(prefServerFactoryId, j2eeVersion);
- if (preferredIsValid)
- {
- for (int i=0; i<servers.length; i++)
- {
- IServer server = (IServer)servers[i];
- String thisFactoryId = server.getServerType().getId();
-
- if (thisFactoryId.equals(prefServerFactoryId))
- {
- serverInfo[0] = prefServerFactoryId;
- serverInfo[1] = server.getId();
- return serverInfo;
- }
- }
- }
-
- //Either the preferred server was not valid or it was valid but does not exist.
- //Check the existing servers for validity
- for (int i=0; i<servers.length; i++)
- {
- IServer server = (IServer)servers[i];
- String thisFactoryId = server.getServerType().getId();
-
- boolean thisServerValid = containsString(validServerFactoryIds, thisFactoryId)
- && isServerValid(thisFactoryId, j2eeVersion);
- if (thisServerValid)
- {
- serverInfo[0] = thisFactoryId;
- serverInfo[1] = server.getId();
- return serverInfo;
- }
- }
-
- //None of the existing servers is valid. Pick the preferred one if valid. Otherwise, pick the
- //first valid server type.
- if (preferredIsValid)
- {
- serverInfo[0] = prefServerFactoryId;
- return serverInfo;
- }
- else
- {
- for (int i=0; i<validServerFactoryIds.length; i++ )
- {
- boolean isValid = isServerValid(validServerFactoryIds[i], j2eeVersion);
- if (isValid)
- {
- serverInfo[0] = validServerFactoryIds[0];
- return serverInfo;
- }
- }
- }
-
- //We can't determine a valid server selection. Return null.
- return null;
- }
-
- private static boolean isServerValid(String serverFactoryId, String j2eeVersion)
- {
- if (serverFactoryId==null || serverFactoryId.length()==0 || j2eeVersion==null || j2eeVersion.length()==0)
- return true;
-
- String runtimeTargetId = ServerUtils.getRuntimeTargetIdFromFactoryId(serverFactoryId);
- if (runtimeTargetId == null || runtimeTargetId.length()==0)
- return false;
- String webModuleType = IServerTargetConstants.WEB_TYPE;
- boolean isValid = ServerUtils.isTargetValidForProjectType(runtimeTargetId, j2eeVersion, webModuleType);
- return isValid;
- }
- /*
- * Returns true if a contains b, false otherwise.
- */
- private static boolean containsString(String[] a, String b)
- {
- if (a==null || a.length<0 || b == null || b.length()==0 )
- return false;
-
- for (int i=0; i<a.length; i++)
- {
- String s = a[i];
- if (s.equals(b))
- {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/FinishFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/FinishFragment.java
deleted file mode 100644
index 072dbe8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/FinishFragment.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.ws.internal.consumption.ui.common;
-
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishTestFragment;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-
-
-/**
- * @author gilberta
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class FinishFragment extends SequenceFragment
-{
- public FinishFragment()
- {
- add(new FinishTestFragment() );
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ServerSelectionUtils.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ServerSelectionUtils.java
deleted file mode 100644
index 60a2bb9..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ServerSelectionUtils.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.common;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.j2ee.internal.servertarget.IServerTargetConstants;
-import org.eclipse.jst.j2ee.internal.servertarget.ServerTargetHelper;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.consumption.common.IServerDefaulter;
-import org.eclipse.jst.ws.internal.consumption.common.ServerInfo;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.consumption.ui.preferences.PersistentServerRuntimeContext;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-
-
-public class ServerSelectionUtils
-{
- /*
- * Returns reasonable defaults for server factory id and instance id based on
- * an existing project
- * index [0] contains factoryId, index[1] contains instance Id.
- * @deprecated
- */
- public static String[] getServerInfoFromExistingProject(IProject project, String typeId, boolean askExtenders)
- {
- String[] serverInfo = new String[2]; //serverInfp[0] contains factoryId, serverInfo[1] contains instance Id
-
- // If the project has been added to an existing server, pick that server
- IServer[] configuredServers = ServerUtil.getServersByModule(ResourceUtils.getModule(project), null);
- IServer firstSupportedServer = getFirstSupportedServer(configuredServers, typeId );
- if (firstSupportedServer != null)
- {
- serverInfo[0] = firstSupportedServer.getServerType().getId();
- serverInfo[1] = firstSupportedServer.getId();
- return serverInfo;
-
- }
-
-
- //Does the project have a runtime-target?
- IRuntime runtimeTarget = getRuntimeTarget(project.getName());
- if (runtimeTarget != null)
- {
- //Look for an existing server which is compatible with the runtime-target
- IServer[] compatibleServers = getCompatibleExistingServers(runtimeTarget);
- if (compatibleServers!=null && compatibleServers.length > 0)
- {
- IServer firstSupportedCompatServer = getFirstSupportedServer(compatibleServers, typeId);
- if (firstSupportedCompatServer != null)
- {
- serverInfo[0] = firstSupportedCompatServer.getServerType().getId();
- serverInfo[1] = firstSupportedCompatServer.getId();
- return serverInfo;
-
- }
- }
-
- //No existing compatible server was found. Choose a compatible server type.
-
- //If the preferred server is compatible with the project's runtime target, use it.
- PersistentServerRuntimeContext ctx = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- String pFactoryId = ctx.getServerFactoryId();
- IServerType serverType = ServerCore.findServerType(pFactoryId);
- if (serverType!=null){
- String serverRuntimeId = serverType.getRuntimeType().getId();
- if (serverRuntimeId.equals(runtimeTarget.getRuntimeType().getId()))
- {
- serverInfo[0] = pFactoryId;
- return serverInfo;
- }
- }
-
- //The preferred server was not compatible. Pick the first valid compatible server type.
- String factoryId = getFirstSupportedServerType(runtimeTarget, typeId);
- if (factoryId != null) serverInfo[0] = factoryId;
- return serverInfo;
-
- }
-
- if (askExtenders)
- {
- ServerInfo recommendedServerInfo = getExtenderRecommendation(project);
- if (recommendedServerInfo!=null)
- {
- if (recommendedServerInfo.getServerFactoryId()!=null && recommendedServerInfo.getServerFactoryId().length()>0)
- serverInfo[0] = recommendedServerInfo.getServerFactoryId();
-
- if (recommendedServerInfo.getServerInstanceId()!=null && recommendedServerInfo.getServerInstanceId().length()>0)
- serverInfo[1] = recommendedServerInfo.getServerInstanceId();
-
- return serverInfo;
- }
-
- }
-
- //Use ServerTargetHelper to get a list of valid runtime-targets and use these to determine a default server type.
- String[] projectAttrs = ServerTargetHelper.getProjectTypeAndJ2EELevel(project);
- List runtimes = ServerTargetHelper.getServerTargets(projectAttrs[0], projectAttrs[1]);
- String[] compatServerInfo = getCompatibleExistingServer(runtimes,typeId);
- if ( compatServerInfo != null)
- {
- return compatServerInfo;
- }
-
- //No existing compatible server, pick a type.
- String factoryId = getFirstSupportedServerType(runtimes, typeId);
- if (factoryId != null) serverInfo[0] = factoryId;
- return serverInfo;
-
- }
-
- /*
- * Returns reasonable defaults for server factory id and instance id based on
- * an existing project
- * index [0] contains factoryId, index[1] contains instance Id.
- */
- public static String[] getServerInfoFromExistingProject(IProject project, String typeId, String runtimeId, boolean askExtenders)
- {
- String[] serverInfo = new String[2]; //serverInfp[0] contains factoryId, serverInfo[1] contains instance Id
-
- // If the project has been added to an existing server, pick that server
- IServer[] configuredServers = ServerUtil.getServersByModule(ResourceUtils.getModule(project), null);
- IServer firstSupportedServer = getFirstSupportedServer(configuredServers, typeId );
- if (firstSupportedServer != null)
- {
- serverInfo[0] = firstSupportedServer.getServerType().getId();
- serverInfo[1] = firstSupportedServer.getId();
- return serverInfo;
-
- }
-
-
- //Does the project have a runtime-target?
- IRuntime runtimeTarget = getRuntimeTarget(project.getName());
- if (runtimeTarget != null)
- {
- //Look for an existing server which is compatible with the runtime-target
- IServer[] compatibleServers = getCompatibleExistingServers(runtimeTarget);
- if (compatibleServers!=null && compatibleServers.length > 0)
- {
- IServer firstSupportedCompatServer = getFirstSupportedServer(compatibleServers, typeId);
- if (firstSupportedCompatServer != null)
- {
- serverInfo[0] = firstSupportedCompatServer.getServerType().getId();
- serverInfo[1] = firstSupportedCompatServer.getId();
- return serverInfo;
-
- }
- }
-
- //No existing compatible server was found. Choose a compatible server type.
-
- //If the preferred server is compatible with the project's runtime target, use it.
- PersistentServerRuntimeContext ctx = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- String pFactoryId = ctx.getServerFactoryId();
- IServerType serverType = ServerCore.findServerType(pFactoryId);
- if (serverType!=null){
- String serverRuntimeId = serverType.getRuntimeType().getId();
- if (serverRuntimeId.equals(runtimeTarget.getRuntimeType().getId()))
- {
- serverInfo[0] = pFactoryId;
- return serverInfo;
- }
- }
-
- //The preferred server was not compatible. Pick the first valid compatible server type.
- String factoryId = getFirstSupportedServerType(runtimeTarget, typeId);
- if (factoryId != null) serverInfo[0] = factoryId;
- return serverInfo;
-
- }
-
- if (askExtenders)
- {
- ServerInfo recommendedServerInfo = getExtenderRecommendation(project);
- if (recommendedServerInfo!=null)
- {
- if (recommendedServerInfo.getServerFactoryId()!=null && recommendedServerInfo.getServerFactoryId().length()>0)
- serverInfo[0] = recommendedServerInfo.getServerFactoryId();
-
- if (recommendedServerInfo.getServerInstanceId()!=null && recommendedServerInfo.getServerInstanceId().length()>0)
- serverInfo[1] = recommendedServerInfo.getServerInstanceId();
-
- return serverInfo;
- }
-
- }
-
- //Use ServerTargetHelper to get a list of valid runtime-targets and use these to determine a default server type.
- String[] projectAttrs = ServerTargetHelper.getProjectTypeAndJ2EELevel(project);
- List runtimes = ServerTargetHelper.getServerTargets(projectAttrs[0], projectAttrs[1]);
- List suppRuntimes = getRuntimeTargetsSupportedByWSRuntime(runtimes, runtimeId);
- String[] compatServerInfo = getCompatibleExistingServer(suppRuntimes,typeId);
- if ( compatServerInfo != null)
- {
- return compatServerInfo;
- }
-
- //No existing compatible server, pick a type.
- String factoryId = getFirstSupportedServerType(suppRuntimes, typeId);
- if (factoryId != null) serverInfo[0] = factoryId;
- return serverInfo;
-
- }
-
- /*
- * Given a list of existing servers, this returns the first one that is supported
- * by the given Web service type id.
- * Returns null of there are no supported servers in the array.
- */
- public static IServer getFirstSupportedServer(IServer[] servers, String typeId)
- {
- WebServiceServerRuntimeTypeRegistry wssrtRegistry = WebServiceServerRuntimeTypeRegistry.getInstance();
- if (servers != null && servers.length > 0) {
- for (int i = 0; i < servers.length; i++)
- {
- String serverFactoryId = servers[i].getServerType().getId();
- if (wssrtRegistry.isServerSupportedForChosenType(typeId, serverFactoryId))
- {
- return servers[i];
- }
- }
- }
- return null;
- }
-
- /*
- * Returns the factory id of a server type compatible with the Web service type and the runtime target.
- * Returns null if there are none.
- */
- public static String getFirstSupportedServerType(IRuntime runtimeTarget, String typeId)
- {
- String runtimeId = runtimeTarget.getRuntimeType().getId();
- WebServiceServerRuntimeTypeRegistry wssrtRegistry = WebServiceServerRuntimeTypeRegistry.getInstance();
- String[] serverFactoryIds = wssrtRegistry.getServerFactoryIdsByType(typeId);
- for (int i=0; i<serverFactoryIds.length; i++)
- {
- IServerType serverType = ServerCore.findServerType(serverFactoryIds[i]);
- if (serverType!=null){
- String serverRuntimeId = serverType.getRuntimeType().getId();
- if (serverRuntimeId.equals(runtimeId))
- {
- return serverFactoryIds[i];
- }
- }
- }
- return null;
- }
-
- /*
- * Return the factory id of the first server type compatible with the runtimeTargets and typeId.
- * Returns null if there are none.
- */
- public static String getFirstSupportedServerType(List runtimeTargets, String typeId)
- {
- for (int i=0; i<runtimeTargets.size(); i++ )
- {
- IRuntime runtimeTarget = (IRuntime)runtimeTargets.get(i);
- String factoryId = getFirstSupportedServerType(runtimeTarget, typeId);
- if (factoryId != null && factoryId.length()>0)
- return factoryId;
- }
-
- return null;
- }
-
- public static IRuntime getRuntimeTarget(String projectName)
- {
- if( projectName != null && projectName.length() > 0 ){ //$NON-NLS-1$
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- if( project != null && project.exists() ){
- return ServerCore.getProjectProperties(project).getRuntimeTarget();
- }
- }
- return null;
- }
-
- public static IServer getFirstExistingServerFromFactoryId(String factoryId)
- {
- IServer[] servers = ServerCore.getServers();
- if (servers==null || servers.length!=0)
- return null;
- else
- {
- for (int i=0; i<servers.length; i++)
- {
- IServer server = (IServer)servers[i];
- if (server.getServerType().getId().equals(factoryId))
- {
- return server;
- }
- }
- }
- return null;
- }
-
- public static IServer[] getCompatibleExistingServers(IRuntime runtime)
- {
- if (runtime == null)
- return null;
-
- IServer[] servers = ServerCore.getServers();
- if (servers==null || servers.length!=0)
- return null;
-
- ArrayList compatibleServersList = new ArrayList();
- String runtimeId = runtime.getRuntimeType().getId();
- for (int i=0; i<servers.length; i++)
- {
- IServer server = (IServer)servers[i];
- String serverRuntimeId = server.getRuntime().getRuntimeType().getId();
- if (serverRuntimeId.equals(runtimeId))
- compatibleServersList.add(server);
-
- }
- if (compatibleServersList.size()<1)
- return null;
-
-
- Object[] compatibleServersArray = compatibleServersList.toArray();
- IServer[] compatibleServers = new IServer[compatibleServersArray.length];
- for (int j=0; j<compatibleServersArray.length; j++)
- {
- compatibleServers[j] = (IServer)compatibleServersArray[j];
- }
-
- return compatibleServers;
- }
- /*
- * Returns the factory Id and instance id of the first exiting server compatible
- * with the runtime targets and typeId
- * Returns null if there are none.
- * The item at [0] is the factory id.
- * The item at [1] is the instance id.
- */
- public static String[] getCompatibleExistingServer(List runtimeTargets, String typeId)
- {
- String[] serverInfo = new String[2];
- for (int i=0; i<runtimeTargets.size(); i++ )
- {
- IRuntime runtimeTarget = (IRuntime)runtimeTargets.get(i);
- IServer[] existingCompatServers = getCompatibleExistingServers(runtimeTarget);
- IServer compatServer = getFirstSupportedServer(existingCompatServers, typeId);
- if (compatServer != null)
- {
- serverInfo[0] = compatServer.getServerType().getId();
- serverInfo[1] = compatServer.getId();
- return serverInfo;
- }
- }
- return null;
- }
-
- public static ServerInfo getExtenderRecommendation(IProject project)
- {
- try
- {
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] elements = reg.getConfigurationElementsFor("org.eclipse.jst.ws.consumption", "serverDefaulter");
- for (int i=0; i<elements.length; i++)
- {
- Object serverDefaulterObject = elements[i].createExecutableExtension("class");
- if (serverDefaulterObject instanceof IServerDefaulter)
- {
- IServerDefaulter serverDefaulter = (IServerDefaulter)serverDefaulterObject;
- ServerInfo serverInfo = serverDefaulter.recommendDefaultServer(project);
- if (serverInfo != null)
- return serverInfo;
- }
-
- }
- } catch (CoreException ce)
- {
- return null;
- }
-
- return null;
- }
-
- private static List getRuntimeTargetsSupportedByWSRuntime(List runtimeTargets, String webServiceRuntimeId)
- {
- ArrayList suppRuntimeTargets = new ArrayList();
- WebServiceServerRuntimeTypeRegistry wssrtReg = WebServiceServerRuntimeTypeRegistry.getInstance();
- for (int i=0; i<runtimeTargets.size(); i++)
- {
- IRuntime runtimeTarget = (IRuntime)runtimeTargets.get(i);
- String rtId = runtimeTarget.getRuntimeType().getId();
- if (wssrtReg.doesRuntimeSupportServerTarget(rtId, webServiceRuntimeId));
- {
- suppRuntimeTargets.add(runtimeTarget);
- }
- }
- return suppRuntimeTargets;
- }
-
- /**
- * Use this method to get a server factory id and instance id that is compatible with the given Web
- * service runtime.
- * @param webServiceRuntimeId
- * @param j2eeVersion String representation of the int values in J2EEVersionConstants i.e. "12", "13", "14"
- * @return String[] index [0] contains factoryId, index[1] contains instance Id.
- */
- public static String[] getServerFromWebServceRuntimeAndJ2EE(String webServiceRuntimeId, String j2eeVersion)
- {
- String[] serverInfo = new String[2];
- WebServiceServerRuntimeTypeRegistry wssrtReg = WebServiceServerRuntimeTypeRegistry.getInstance();
-
- //Get all possible valid servers. If there are none, we can't default intelligently, return null.
- String[] validServerFactoryIds = wssrtReg.getServerFactoryIDByRuntimeID(webServiceRuntimeId);
- if (validServerFactoryIds==null || validServerFactoryIds.length<1)
- return null;
-
- //Get all existing servers
- IServer[] servers = ServerCore.getServers(); //Get all existing servers
-
- //Get the preferred server.
- PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- String prefServerFactoryId = context.getServerFactoryId();
-
- boolean preferredIsValid = containsString(validServerFactoryIds, prefServerFactoryId)
- && isServerValid(prefServerFactoryId, j2eeVersion);
- if (preferredIsValid)
- {
- for (int i=0; i<servers.length; i++)
- {
- IServer server = (IServer)servers[i];
- String thisFactoryId = server.getServerType().getId();
-
- if (thisFactoryId.equals(prefServerFactoryId))
- {
- serverInfo[0] = prefServerFactoryId;
- serverInfo[1] = server.getId();
- return serverInfo;
- }
- }
- }
-
- //Either the preferred server was not valid or it was valid but does not exist.
- //Check the existing servers for validity
- for (int i=0; i<servers.length; i++)
- {
- IServer server = (IServer)servers[i];
- String thisFactoryId = server.getServerType().getId();
-
- boolean thisServerValid = containsString(validServerFactoryIds, thisFactoryId)
- && isServerValid(thisFactoryId, j2eeVersion);
- if (thisServerValid)
- {
- serverInfo[0] = thisFactoryId;
- serverInfo[1] = server.getId();
- return serverInfo;
- }
- }
-
- //None of the existing servers is valid. Pick the preferred one if valid. Otherwise, pick the
- //first valid server type.
- if (preferredIsValid)
- {
- serverInfo[0] = prefServerFactoryId;
- return serverInfo;
- }
- else
- {
- for (int i=0; i<validServerFactoryIds.length; i++ )
- {
- boolean isValid = isServerValid(validServerFactoryIds[i], j2eeVersion);
- if (isValid)
- {
- serverInfo[0] = validServerFactoryIds[0];
- return serverInfo;
- }
- }
- }
-
- //We can't determine a valid server selection. Return null.
- return null;
- }
-
- private static boolean isServerValid(String serverFactoryId, String j2eeVersion)
- {
- if (serverFactoryId==null || serverFactoryId.length()==0 || j2eeVersion==null || j2eeVersion.length()==0)
- return true;
-
- String runtimeTargetId = ServerUtils.getRuntimeTargetIdFromFactoryId(serverFactoryId);
- if (runtimeTargetId == null || runtimeTargetId.length()==0)
- return false;
- String webModuleType = IServerTargetConstants.WEB_TYPE;
- boolean isValid = ServerUtils.isTargetValidForProjectType(runtimeTargetId, j2eeVersion, webModuleType);
- return isValid;
- }
- /*
- * Returns true is a contains b, false otherwise.
- */
- private static boolean containsString(String[] a, String b)
- {
- if (a==null || a.length<0 || b == null || b.length()==0 )
- return false;
-
- for (int i=0; i<a.length; i++)
- {
- String s = a[i];
- if (s.equals(b))
- {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ValidationUtils.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ValidationUtils.java
deleted file mode 100644
index d16f98c..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/common/ValidationUtils.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.common;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.j2ee.internal.project.J2EENature;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.jst.j2ee.internal.webservices.WebServiceEditModel;
-import org.eclipse.jst.j2ee.internal.webservices.WebServicesManager;
-import org.eclipse.jst.j2ee.webservice.WebServiceConstants;
-import org.eclipse.jst.j2ee.webservice.wsdd.PortComponent;
-import org.eclipse.jst.j2ee.webservice.wsdd.WSDLPort;
-import org.eclipse.jst.j2ee.webservice.wsdd.WebServiceDescription;
-import org.eclipse.jst.j2ee.webservice.wsdd.WebServices;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.ClientProjectTypeRegistry;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-/**
-
- */
-public class ValidationUtils
-{
- MessageUtils msgUtils;
-
- /**
- *
- */
- public ValidationUtils()
- {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- msgUtils = new MessageUtils( pluginId + ".plugin", this );
- }
-
- public Status validateProjectTargetAndJ2EE(String projectName, String earName, String serverFactoryId, String j2eeLevel)
- {
- IProject p = (IProject)((new StringToIProjectTransformer()).transform(projectName));
- IProject earP = (IProject)((new StringToIProjectTransformer()).transform(earName));
- Status targetStatus = doesProjectTargetMatchServerType(p, serverFactoryId);
- if (targetStatus.getSeverity()==Status.OK)
- {
- //check the EAR
- Status earTargetStatus = doesProjectTargetMatchServerType(earP, serverFactoryId);
- if(earTargetStatus.getSeverity()==Status.ERROR)
- {
- return earTargetStatus;
- }
- }
- else
- {
- return targetStatus;
- }
-
-
- //Validate service side J2EE level
- Status j2eeStatus = doesProjectMatchJ2EELevel(p, j2eeLevel);
- if(j2eeStatus.getSeverity()==Status.OK)
- {
- Status earJ2EEStatus = doesProjectMatchJ2EELevel(earP, j2eeLevel);
- if(earJ2EEStatus.getSeverity()==Status.ERROR)
- {
- return earJ2EEStatus;
- }
- }
- else
- {
- return j2eeStatus;
- }
-
- return new SimpleStatus("");
- }
-
- private Status doesProjectTargetMatchServerType(IProject p, String serverFactoryId)
- {
- if (p!=null && p.exists())
- {
- IRuntime projectTarget = ServerSelectionUtils.getRuntimeTarget(p.getName());
- if (projectTarget!=null)
- {
- String projectTargetId = projectTarget.getRuntimeType().getId();
- String serverTargetId = ServerUtils.getRuntimeTargetIdFromFactoryId(serverFactoryId);
- if (serverTargetId!=null && serverTargetId.length()>0)
- {
- if(!projectTargetId.equals(serverTargetId))
- {
- return new SimpleStatus("",msgUtils.getMessage("MSG_SERVER_TARGET_MISMATCH",new String[]{p.getName()}),Status.ERROR);
- }
- }
- }
- }
- return new SimpleStatus("");
- }
-
- private Status doesProjectMatchJ2EELevel(IProject p, String j2eeLevel)
- {
- if (p!=null && p.exists())
- {
- int projectJ2EELevel = J2EEUtils.getJ2EEVersion(p);
- if (projectJ2EELevel!=-1)
- {
- String projectJ2EELevelString = String.valueOf(projectJ2EELevel);
- if (j2eeLevel!=null && j2eeLevel.length()>0)
- {
- if (!projectJ2EELevelString.equals(j2eeLevel))
- {
- return new SimpleStatus("",msgUtils.getMessage("MSG_J2EE_MISMATCH",new String[]{p.getName()}), Status.ERROR);
- }
- }
- }
- }
- return new SimpleStatus("");
- }
-
- public Status validateProjectType(String projectName, SelectionListChoices runtime2ClientTypes)
- {
- Status status = new SimpleStatus("");
- IProject p = (IProject)((new StringToIProjectTransformer()).transform(projectName));
- if (p==null || !p.exists())
- {
- //Project does not exist which means a new project of the correct type will be creates
- //We're done. All is good.
- return status;
- }
-
- //If the project exists, we should see it in the project list for the selected client
- //project type.
- String[] projectNames = runtime2ClientTypes.getChoice().getChoice().getList().getList();
- for (int i=0; i<projectNames.length; i++)
- {
- if (projectName.equals(projectNames[i]))
- {
- //Found the project. All is good.
- return status;
- }
- }
-
- //Didn't find the project. Return an error.
- //Get the label for the client type id
- String clientTypeLabel = getClientTypeLabel(runtime2ClientTypes.getChoice().getList().getSelection());
- String message = msgUtils.getMessage("MSG_WRONG_CLIENT_PROJECT_TYPE",new String[]{projectName, clientTypeLabel});
- Status eStatus = new SimpleStatus("",message,Status.ERROR);
- return eStatus;
-
- }
-
- private String getClientTypeLabel( String type )
- {
- ClientProjectTypeRegistry registry = ClientProjectTypeRegistry.getInstance();
- String clientTypeLabel = null;
-
- clientTypeLabel = registry.getElementById(type).getAttribute("label");
-
- return clientTypeLabel;
- }
-
- public boolean isProjectServiceProject(IProject p, String wsdlURL, WebServicesParser parser)
- {
- if (p==null || wsdlURL==null || wsdlURL.length()==0 || parser==null)
- return false;
-
- IResource wsXML = getWebServcesXML(p);
- if (wsXML==null)
- return false;
-
-
- //Make a list of all the wsdl-port's in webservices.xml
- WebServicesManager wsm = new WebServicesManager();
- WebServiceEditModel wsEditModel = wsm.getWSEditModel(p);
- WebServices ws = wsEditModel.getWebServices();
- Iterator wsDescs = ws.getWebServiceDescriptions().iterator();
- ArrayList wsdlPortList = new ArrayList();
- while(wsDescs.hasNext())
- {
- WebServiceDescription wsDesc = (WebServiceDescription)wsDescs.next();
- Iterator pcs = wsDesc.getPortComponents().iterator();
- while(pcs.hasNext())
- {
- PortComponent pc = (PortComponent)pcs.next();
- WSDLPort wsdlPort = pc.getWsdlPort();
- wsdlPortList.add(new QualifiedName(wsdlPort.getNamespaceURI(), wsdlPort.getLocalPart()));
- }
- }
-
- ArrayList portList = getPortNamesFromWsdl(wsdlURL, parser);
-
- //If any of the QualifiedNames in portList equals any of the QualifiedNames
- //in wsdlPortList, this is the service project. Return true.
- Object[] ports = portList.toArray();
- Object[] wsdlPorts = wsdlPortList.toArray();
- for (int i = 0; i < ports.length; i++)
- {
- QualifiedName portName = (QualifiedName) ports[i];
- for (int j = 0; j < wsdlPorts.length; j++)
- {
- QualifiedName wsdlPortName = (QualifiedName) wsdlPorts[j];
- if (portName.equals(wsdlPortName))
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
- private IResource getWebServcesXML(IProject p)
- {
- J2EENature nature = (J2EENature) J2EENature.getRegisteredRuntime(p);
- if (nature == null)
- return null;
-
- IResource moduleRoot = nature.getModuleServerRoot();
- if (!(moduleRoot instanceof IContainer))
- return null;
-
- IResource webServicesXML=null;
- if (nature instanceof J2EEWebNatureRuntime)
- {
- StringBuffer wsPath = new StringBuffer();
- wsPath.append("WEB-INF/");
- wsPath.append(WebServiceConstants.WEBSERVICE_DD_SHORT_NAME);
- webServicesXML = ((IContainer)moduleRoot).findMember(wsPath.toString());
- }
- else //Must be an Application Client Module or an EJB Module
- {
- StringBuffer wsPath = new StringBuffer();
- wsPath.append("META-INF/");
- wsPath.append(WebServiceConstants.WEBSERVICE_DD_SHORT_NAME);
- webServicesXML = ((IContainer)moduleRoot).findMember(wsPath.toString());
- }
-
- return webServicesXML;
- }
-
- private ArrayList getPortNamesFromWsdl(String wsdlURL, WebServicesParser parser)
- {
- ArrayList portNameList = new ArrayList();
- Definition def = parser.getWSDLDefinition(wsdlURL);
- Map services = def.getServices();
- Service service = null;
- for (Iterator it = services.values().iterator(); it.hasNext();)
- {
- service = (Service)it.next();
- String namespace = service.getQName().getNamespaceURI();
- Map ports = service.getPorts();
- for (Iterator it2 = ports.values().iterator(); it2.hasNext();)
- {
- Port port = (Port)it2.next();
- portNameList.add(new QualifiedName(namespace, port.getName()));
- }
- }
-
- return portNameList;
-
- }
-
- private class QualifiedName
- {
- String namespaceURI;
-
- String localPart;
-
- /**
- * @param namespaceURI
- * @param localPart
- */
- public QualifiedName(String namespaceURI, String localPart)
- {
- super();
- this.namespaceURI = namespaceURI;
- this.localPart = localPart;
- }
-
- /**
- * @return Returns the localPart.
- */
- public String getLocalPart()
- {
- return localPart;
- }
-
- /**
- * @param localPart
- * The localPart to set.
- */
- public void setLocalPart(String localPart)
- {
- this.localPart = localPart;
- }
-
- /**
- * @return Returns the namespaceURI.
- */
- public String getNamespaceURI()
- {
- return namespaceURI;
- }
-
- /**
- * @param namespaceURI
- * The namespaceURI to set.
- */
- public void setNamespaceURI(String namespaceURI)
- {
- this.namespaceURI = namespaceURI;
- }
-
- public boolean equals(QualifiedName qn)
- {
- return (qn.getNamespaceURI().equals(namespaceURI) && qn.getLocalPart()
- .equals(localPart));
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/plugin/WebServiceConsumptionUIPlugin.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/plugin/WebServiceConsumptionUIPlugin.java
deleted file mode 100644
index 3bbed63..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/plugin/WebServiceConsumptionUIPlugin.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.plugin;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.ws.internal.consumption.ui.preferences.PersistentServerRuntimeContext;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-
-
-/**
-* This is the plugin class for the Web Services plugin.
-* <p>
-* This plugin contains the graphic user interface to the
-* Web Services runtime found in org.eclipse.jst.ws.
-*/
-public class WebServiceConsumptionUIPlugin extends AbstractUIPlugin
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- /**
- * The identifier of the descriptor of this plugin in plugin.xml.
- */
- public static final String ID = "org.eclipse.jst.ws.consumption.ui";
-
- /**
- * The reference to the singleton instance of this plugin.
- */
- private static WebServiceConsumptionUIPlugin instance_;
-
- private PersistentServerRuntimeContext serverRuntimeContext_;
- private Log log_;
-
- /**
- * Constructs a runtime plugin object for this plugin.
- * The "plugin" element in plugin.xml should include the attribute
- * class = "org.eclipse.jst.ws.internal.ui.plugin.WebServicePlugin".
- * @param descriptor The descriptor of this plugin.
- */
- public WebServiceConsumptionUIPlugin ( IPluginDescriptor descriptor )
- {
- super(descriptor);
- if (instance_ == null)
- {
- instance_ = this;
- }
- log_ = new EclipseLog();
-
- }
-
- /**
- * Returns the singleton instance of this plugin. Equivalent to calling
- * (WebServiceConsumptionUIPlugin)Platform.getPlugin("org.eclipse.jst.ws.ui");
- * @return The WebServiceConsumptionUIPlugin singleton.
- */
- static public WebServiceConsumptionUIPlugin getInstance ()
- {
- return instance_;
- }
-
- /**
- * Called once by the platform when this plugin is first loaded.
- * @throws CoreException If this plugin fails to start.
- */
- public void startup () throws CoreException
- {
- log_.log(Log.INFO, 5056, this, "startup", "Starting plugin org.eclipse.jst.ws.consumption.ui");
- super.startup();
- }
-
- /**
- * Called once by the platform when this plugin is unloaded.
- * @throws CoreException If this plugin fails to shutdown.
- */
- public void shutdown () throws CoreException
- {
- log_.log(Log.INFO, 5057, this, "shutdown", "Shutting plugin org.eclipse.jst.ws.consumption.ui");
- super.shutdown();
- }
-
- /**
- * Returns the message string identified by the given key from
- * the plugin.properties file for the appropriate locale.
- * @param key The message key string prefixed by a "%" symbol.
- * That is, the string passed in must be of the form "%KEY"
- * where the plugin.properties file contains a line of the
- * form: "KEY = value".
- * @return The locale-specific message.
- */
- public static String getMessage ( String key )
- {
- MessageUtils msgUtils = new MessageUtils( "org.eclipse.jst.ws.consumption.ui.plugin", instance_ );
-
- if( key.startsWith("%"))
- {
- key = key.substring( 1, key.length() );
- }
-
- return msgUtils.getMessage(key);
- }
-
- /**
- * Returns the message string identified by the given key from
- * the plugin.properties file for the appropriate locale.
- * Substitution sequences in the message string
- * are replaced by the given array of substitution objects (which
- * are most frequently strings). See java.text.MessageFormat for
- * further details on substitution.
- * @param key The message key string prefixed by a "%" symbol.
- * That is, the string passed in must be of the form "%KEY"
- * where the plugin.properties file contains a line of the
- * form: "KEY = value".
- * @param args The substitution values for the message
- * as required by the message in plugin.properties and
- * by the rules of class java.text.MessageFormat.
- * @return The locale-specific message.
- */
- public static String getMessage ( String key, Object[] args )
- {
- return MessageFormat.format(getMessage(key),args);
- }
-
- /**
- * Returns an image descriptor for the named resource
- * as relative to the plugin install location.
- * @return An image descriptor, possibly null.
- */
- public static ImageDescriptor getImageDescriptor ( String name )
- {
- try
- {
- URL installURL = instance_.getDescriptor().getInstallURL();
- URL imageURL = new URL(installURL,name);
- return ImageDescriptor.createFromURL(imageURL);
- }
- catch (MalformedURLException e)
- {
- return null;
- }
- }
-
- public String getPluginStateLocation() {
- return Platform.getPluginStateLocation(this).toOSString();
- }
-
- public String getPluginInstallLocation() {
- try {
- return Platform.resolve(getDescriptor().getInstallURL()).getFile();
- }
- catch (Exception e) {
- return null;
- }
- }
-
-
- public PersistentServerRuntimeContext getServerRuntimeContext()
- {
- if (serverRuntimeContext_ == null)
- {
- serverRuntimeContext_ = new PersistentServerRuntimeContext();
- serverRuntimeContext_.load();
- }
- return serverRuntimeContext_;
- }
- }
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/PersistentServerRuntimeContext.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/PersistentServerRuntimeContext.java
deleted file mode 100644
index 00400b3..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/PersistentServerRuntimeContext.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.preferences;
-
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.wst.command.env.context.PersistentContext;
-
-
-/**
- *
- */
-public class PersistentServerRuntimeContext extends PersistentContext {
-
- private String PREFERENCE_SERVER = "PREFERENCE_SERVER";
- private String PREFERENCE_RUNTIME = "PREFERENCE_RUNTIME";
- private String PREFERENCE_J2EE_VERSION = "PREFERENCE_J2EE_VERSION";
-
- private String SERVER_FACTORY_ID_DEFAULT = "org.eclipse.jst.server.tomcat.40";
- private String RUNTIME_ID_DEFAULT = "org.eclipse.jst.ws.runtime.axis11";
- private String J2EE_VERSION_DEFAULT = "13";
-
- public PersistentServerRuntimeContext()
- {
- super(WebServiceConsumptionUIPlugin.getInstance());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.Context#load()
- */
- public void load() {
- //Defaults will be set via the .ini customization. They are hard coded to default values in the
- //absence of a .ini file.
- String serverDefault = getDefaultString(PREFERENCE_SERVER);
- if (serverDefault==null || serverDefault.length()==0)
- {
- setDefault(PREFERENCE_SERVER, SERVER_FACTORY_ID_DEFAULT);
- }
-
- String runtimeDefault = getDefaultString(PREFERENCE_RUNTIME);
- if (runtimeDefault==null || runtimeDefault.length()==0)
- {
- setDefault(PREFERENCE_RUNTIME, RUNTIME_ID_DEFAULT);
- }
-
- String j2eeDefault = getDefaultString(PREFERENCE_J2EE_VERSION);
- if (j2eeDefault==null || j2eeDefault.length()==0)
- {
- setDefault(PREFERENCE_J2EE_VERSION, J2EE_VERSION_DEFAULT);
- }
-
-
- }
-
- public String getDefaultServerFactoryId()
- {
- return getDefaultString(PREFERENCE_SERVER);
- }
-
- public String getDefaultRuntimeId()
- {
- return getDefaultString(PREFERENCE_RUNTIME);
- }
-
- public String getDefaultJ2EEVersion()
- {
- return getDefaultString(PREFERENCE_J2EE_VERSION);
- }
-
- public String getServerFactoryId()
- {
- String value = getValueAsString(PREFERENCE_SERVER);
- /*
- if (value==null || value.length()==0)
- {
- value = SERVER_FACTORY_ID_DEFAULT;
- setServerFactoryId(value);
- }
- */
- return value;
- }
-
- public String getRuntimeId()
- {
- String value = getValueAsString(PREFERENCE_RUNTIME);
- /*
- if (value==null || value.length()==0)
- {
- value = RUNTIME_ID_DEFAULT;
- setRuntimeId(value);
- }
- */
- return value;
- }
-
- public String getJ2EEVersion()
- {
- String value = getValueAsString(PREFERENCE_J2EE_VERSION);
- /*
- if (value==null || value.length()==0)
- {
- value = J2EE_VERSION_DEFAULT;
- setJ2EEVersion(value);
- }
- */
- return value;
- }
-
- public void setServerFactoryId(String id)
- {
- setValue(PREFERENCE_SERVER,id);
- }
-
- public void setRuntimeId(String id)
- {
- setValue(PREFERENCE_RUNTIME, id);
- }
-
- public void setJ2EEVersion(String version)
- {
- setValue(PREFERENCE_J2EE_VERSION, version);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ServerRuntimePreferencePage.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ServerRuntimePreferencePage.java
deleted file mode 100644
index d0c2780..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/preferences/ServerRuntimePreferencePage.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.preferences;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-
-
-/**
- *
- */
-public class ServerRuntimePreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Listener
-{
- private String pluginId_= "org.eclipse.jst.ws.consumption.ui";
- private MessageUtils msgUtils_;
-
- /* CONTEXT_ID SRPF0001 for server preference on the server runtime preference page */
- private String INFOPOP_SRPF_SERVER_PREF = pluginId_ + ".SRPF0001";
- private Combo server_;
-
- /* CONTEXT_ID SRPF0002 for runtime preference on the server runtime preference page */
- private String INFOPOP_SRPF_RUNTIME_PREF = pluginId_ + ".SRPF0002";
- private Combo runtime_;
-
- /* CONTEXT_ID SRPF0003 for J2EE version preference on the server runtime preference page */
- private String INFOPOP_SRPF_J2EE_PREF = pluginId_ + ".SRPF0003";
- private Combo j2eeVersion_;
-
- SelectionListChoices serverToRuntimeToJ2EE_;
-
- public void init(IWorkbench workbench) { }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent)
- {
-
- msgUtils_ = new MessageUtils(pluginId_ + ".plugin", this);
- UIUtils uiUtils = new UIUtils(msgUtils_, pluginId_);
-
- Composite page = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- page.setLayout(gl);
- GridData gd = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
- page.setLayoutData(gd);
-
- server_ = uiUtils.createCombo(page,"LABEL_SERVERS_LIST",
- "TOOLTIP_SRPF_COMBO_SERVER",
- INFOPOP_SRPF_SERVER_PREF,
- SWT.SINGLE|SWT.BORDER|SWT.READ_ONLY);
-
- runtime_ = uiUtils.createCombo(page,"LABEL_RUNTIMES_LIST",
- "TOOLTIP_SRPF_COMBO_RUNTIME",
- INFOPOP_SRPF_RUNTIME_PREF,
- SWT.SINGLE|SWT.BORDER|SWT.READ_ONLY);
-
- j2eeVersion_ = uiUtils.createCombo(page,"LABEL_J2EE_VERSION",
- "TOOLTIP_SRPF_COMBO_J2EE",
- INFOPOP_SRPF_J2EE_PREF,
- SWT.SINGLE|SWT.BORDER|SWT.READ_ONLY);
-
- initializeValues();
- startListening();
- return page;
- }
-
- private void initializeValues()
- {
- PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- serverToRuntimeToJ2EE_ = WebServiceServerRuntimeTypeRegistry.getInstance().getServerToRuntimeToJ2EE();
-
-
- setServerItems(serverToRuntimeToJ2EE_.getList().getList());
- String defaultServerText = context.getServerFactoryId();
- serverToRuntimeToJ2EE_.getList().setSelectionValue(defaultServerText);
- setServerSelection(defaultServerText);
-
- setRuntimeItems(serverToRuntimeToJ2EE_.getChoice().getList().getList());
- String defaultRuntimeText = context.getRuntimeId();
- serverToRuntimeToJ2EE_.getChoice().getList().setSelectionValue(defaultRuntimeText);
- setRuntimeSelection(defaultRuntimeText);
-
- setJ2EEItems(serverToRuntimeToJ2EE_.getChoice().getChoice().getList().getList());
- String defaultJ2EEVersion = context.getJ2EEVersion();
- serverToRuntimeToJ2EE_.getChoice().getChoice().getList().setSelectionValue(defaultJ2EEVersion);
- setJ2EESelection(defaultJ2EEVersion);
-
- }
-
- public void handleEvent(Event event)
- {
- if (server_ == event.widget)
- {
- handleServerSelected();
- }
- else if (runtime_ == event.widget)
- {
- handleRuntimeSelected();
- }
- else if (j2eeVersion_ == event.widget)
- {
- handleJ2EESelected();
- }
- }
-
- private void handleServerSelected()
- {
- stopListening();
-
- String selectedText = getServerSelection();
- serverToRuntimeToJ2EE_.getList().setSelectionValue(selectedText);
-
- //Update the runtime -------------------------------
- setRuntimeItems(serverToRuntimeToJ2EE_.getChoice().getList().getList());
- if (serverToRuntimeToJ2EE_.getChoice().getList().getList().length > 0)
- serverToRuntimeToJ2EE_.getChoice().getList().setIndex(0);
-
- String newRuntimeText = serverToRuntimeToJ2EE_.getChoice().getList().getSelection();
- if (newRuntimeText!=null && newRuntimeText.length()>0)
- setRuntimeSelection(newRuntimeText);
-
- //Update the j2ee version -------------------------------
- if (newRuntimeText!=null && newRuntimeText.length()>0)
- {
- setJ2EEItems(serverToRuntimeToJ2EE_.getChoice().getChoice().getList().getList());
- if (serverToRuntimeToJ2EE_.getChoice().getChoice().getList().getList().length > 0)
- serverToRuntimeToJ2EE_.getChoice().getChoice().getList().setIndex(0);
-
- String newJ2EEText = serverToRuntimeToJ2EE_.getChoice().getChoice().getList().getSelection();
- if (newJ2EEText!=null && newJ2EEText.length()>0)
- setJ2EESelection(newJ2EEText);
- }
- else
- {
- setJ2EEItems(new String[0]);
- }
-
- startListening();
- }
-
- private void handleRuntimeSelected()
- {
- stopListening();
-
- String selectedText = getRuntimeSelection();
- serverToRuntimeToJ2EE_.getChoice().getList().setSelectionValue(selectedText);
-
- //Update the j2ee version -------------------------------
- setJ2EEItems(serverToRuntimeToJ2EE_.getChoice().getChoice().getList().getList());
- if (serverToRuntimeToJ2EE_.getChoice().getChoice().getList().getList().length > 0)
- serverToRuntimeToJ2EE_.getChoice().getChoice().getList().setIndex(0);
-
- String newJ2EEText = serverToRuntimeToJ2EE_.getChoice().getChoice().getList().getSelection();
- if (newJ2EEText!=null && newJ2EEText.length()>0)
- setJ2EESelection(newJ2EEText);
-
- startListening();
- }
-
- private void handleJ2EESelected()
- {
- stopListening();
-
- String selectedText = getJ2EESelection();
- serverToRuntimeToJ2EE_.getChoice().getChoice().getList().setSelectionValue(selectedText);
-
- startListening();
- }
- /**
- * Does anything necessary because the default button has been pressed.
- */
- protected void performDefaults()
- {
- super.performDefaults();
- setToDefaults();
- }
-
- private void setToDefaults()
- {
- PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
-
- String defaultServerText = context.getDefaultServerFactoryId();
- serverToRuntimeToJ2EE_.getList().setSelectionValue(defaultServerText);
- setServerSelection(defaultServerText);
-
- setRuntimeItems(serverToRuntimeToJ2EE_.getChoice().getList().getList());
- String defaultRuntimeText = context.getDefaultRuntimeId();
- serverToRuntimeToJ2EE_.getChoice().getList().setSelectionValue(defaultRuntimeText);
- setRuntimeSelection(defaultRuntimeText);
-
- setJ2EEItems(serverToRuntimeToJ2EE_.getChoice().getChoice().getList().getList());
- String defaultJ2EEVersion = context.getDefaultJ2EEVersion();
- serverToRuntimeToJ2EE_.getChoice().getChoice().getList().setSelectionValue(defaultJ2EEVersion);
- setJ2EESelection(defaultJ2EEVersion);
- }
-
- /**
- * Do anything necessary because the OK button has been pressed.
- * @return whether it is okay to close the preference page
- */
- public boolean performOk()
- {
- storeValues();
- return true;
- }
-
- private void storeValues()
- {
- PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- context.setServerFactoryId(getServerSelection());
- context.setRuntimeId(getRuntimeSelection());
- context.setJ2EEVersion(getJ2EESelection());
- }
-
- protected void performApply()
- {
- performOk();
- }
-
-
- private void startListening()
- {
- server_.addListener(SWT.Selection,this);
- runtime_.addListener(SWT.Selection,this);
- j2eeVersion_.addListener(SWT.Selection,this);
- }
-
- private void stopListening()
- {
- server_.removeListener(SWT.Selection, this);
- runtime_.removeListener(SWT.Selection, this);
- j2eeVersion_.removeListener(SWT.Selection, this);
- }
-
- private void setServerItems(String[] factoryIds)
- {
-
- if (factoryIds != null)
- {
- //String[] serverLabels = new String[factoryIds.length];
- ArrayList serverLabelsList = new ArrayList();
- for (int i=0;i<factoryIds.length;i++)
- {
- String thisFactoryId = factoryIds[i];
- String thisServerLabel = WebServiceServerRuntimeTypeRegistry.getInstance().getServerLabel(factoryIds[i]);
- if (thisServerLabel!=null && thisServerLabel.length()>0)
- {
- serverLabelsList.add(thisServerLabel);
- }
-
- }
- String[] serverLabels = convertToStringArray(serverLabelsList.toArray());
- server_.setItems(serverLabels);
- }
-
- }
-
- private void setRuntimeItems(String[] ids)
- {
- if (ids != null)
- {
- String[] runtimeLabels = new String[ids.length];
- for (int i=0;i<ids.length;i++)
- {
- runtimeLabels[i] = WebServiceServerRuntimeTypeRegistry.getInstance().getRuntimeLabel(ids[i]);
- }
- runtime_.setItems(runtimeLabels);
- }
-
- }
-
- private void setJ2EEItems(String[] versions)
- {
- if (versions != null)
- {
- String[] j2eeLabels = new String[versions.length];
- for (int i = 0; i < versions.length; i++)
- {
- String label = J2EEUtils.getLabelFromJ2EEVersion(versions[i]);
- if (label != null && label.length()>0)
- j2eeLabels[i] = label;
- else
- j2eeLabels[i] = msgUtils_.getMessage("LABEL_NA");
- }
- j2eeVersion_.setItems(j2eeLabels);
-
- //Disable the combo if it has no items.
- if (j2eeLabels.length > 0)
- j2eeVersion_.setEnabled(true);
- else
- j2eeVersion_.setEnabled(false);
- }
-
- }
-
- private String getServerSelection()
- {
- String serverLabel = server_.getText();
- return WebServiceServerRuntimeTypeRegistry.getInstance().getServerFactoryId(serverLabel);
- }
-
- private String getRuntimeSelection()
- {
- String runtimeLabel = runtime_.getText();
- return WebServiceServerRuntimeTypeRegistry.getInstance().getRuntimeId(runtimeLabel);
- }
-
- private String getJ2EESelection()
- {
- String j2eeLabel = j2eeVersion_.getText();
- return J2EEUtils.getJ2EEVersionFromLabel(j2eeLabel);
- }
-
- private void setServerSelection(String factoryId)
- {
- String label = WebServiceServerRuntimeTypeRegistry.getInstance().getServerLabel(factoryId);
- setSelection(server_,label);
- }
-
- private void setRuntimeSelection(String id)
- {
- String label = WebServiceServerRuntimeTypeRegistry.getInstance().getRuntimeLabel(id);
- setSelection(runtime_,label);
- }
-
- private void setJ2EESelection(String version)
- {
- String label = J2EEUtils.getLabelFromJ2EEVersion(version);
- setSelection(j2eeVersion_, label);
- }
-
- private void setSelection(Combo combo, String s)
- {
- String[] items = combo.getItems();
- for (int i=0; i<items.length; i++)
- {
- if (items[i].equals(s))
- {
- combo.select(i);
- return;
- }
- }
- }
-
- private String[] convertToStringArray(Object[] a)
- {
- if (a==null) return new String[0];
-
- int length = a.length;
- String[] sa = new String[length];
- for (int i=0; i<length; i++)
- {
- Object obj = a[i];
- if (obj instanceof String)
- {
- sa[i] = (String)obj;
- }
- }
- return sa;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AbstractHandlersWidgetDefaultingCmd.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AbstractHandlersWidgetDefaultingCmd.java
deleted file mode 100644
index 0bc9d46..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AbstractHandlersWidgetDefaultingCmd.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.internal.webservices.WebServiceEditModel;
-import org.eclipse.jst.j2ee.internal.webservices.WebServicesManager;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
- * AbstractHandlersWidgetDefaultingCmd
- *
- * Initialize and load the handlers data
- */
-public abstract class AbstractHandlersWidgetDefaultingCmd extends SimpleCommand {
-
- private IStructuredSelection initialSelection_;
- private IProject project_;
-
- public Status execute(Environment env){
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- Status status = new SimpleStatus("");
-
- IStructuredSelection selection = initialSelection_;
- if (selection == null) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
-
- return status;
-
- }
-
-
- public List getClientHandlers(){
- return null;
- }
-
- public void setInitialSelection(IStructuredSelection initSelection){
- this.initialSelection_ = initSelection;
- }
-
- public IStructuredSelection getInitialSelection(){
- return this.initialSelection_;
- }
-
- protected IResource getResourceFromInitialSelection()
- {
- if (initialSelection_ != null && initialSelection_.size() == 1)
- {
- Object obj = initialSelection_.getFirstElement();
- if (obj != null)
- {
- try
- {
- IResource resource = ResourceUtils.getResourceFromSelection(obj);
- return resource;
- } catch(CoreException e)
- {
- return null;
- }
- }
- }
- return null;
- }
-
- public IProject getProject(){
-
- IResource resource = getResourceFromInitialSelection();
- if (resource != null)
- {
- return ResourceUtils.getProjectOf( resource.getFullPath() );
- }
-
- return null;
- }
-
- public WebServiceEditModel getWebServiceEditModel() {
- WebServicesManager wsm = new WebServicesManager();
- IProject project = getProject();
- return wsm.getWSEditModel(project);
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AddHandlerDialog.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AddHandlerDialog.java
deleted file mode 100644
index 5e0d9df..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/AddHandlerDialog.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 12, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.jst.ws.internal.ui.dialog.DialogUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-
-
-
-public class AddHandlerDialog extends Dialog implements Listener {
-
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- private MessageUtils msgUtils_;
- private boolean validateOn_;
- private boolean isClient_;
- private String className;
- private String name;
- private String[] portNames;
- private String selectedPortName;
-
- private Text classNameText;
- private Text nameText;
- private Combo portNameCombo;
-
- // ----TOOLTIPS Section----
- /* CONTEXT_ID AHDL0001 for the Handler Config Page */
- private final String INFOPOP_TEXT_HANDLER_NAME = "AHDL0001"; //$NON-NLS-1$
- private final String TOOLTIP_TEXT_HANDLER_NAME = "TOOLTIP_TEXT_HANDLER_NAME";
-
- /* CONTEXT_ID AHDL0002 for the Handler Config Page */
- private final String INFOPOP_TEXT_HANDLER_CLASS = "AHDL0002"; //$NON-NLS-1$
- private final String TOOLTIP_TEXT_HANDLER_CLASS = "TOOLTIP_TEXT_HANDLER_CLASS";
-
- /* CONTEXT_ID AHDL0001 for the Handler Config Page */
- private final String INFOPOP_TEXT_HANDLER_PORT = "AHDL0003"; //$NON-NLS-1$
- private final String TOOLTIP_TEXT_HANDLER_PORT = "TOOLTIP_TEXT_HANDLER_PORT";
-
- private Button beanClassBrowseButton_;
- /*CONTEXT_ID PBCL0003 for the Bean Class Browse button of the Bean Selection Page*/
- private String INFOPOP_PBCL_BUTTON_BEAN_CLASS_BROWSE = "PBCL0003";
-
- public AddHandlerDialog( Shell shell, boolean isClientHandler)
- {
- super(shell);
- isClient_ = isClientHandler;
- }
-
- protected Control createContents(Composite parent) {
- Composite comp = (Composite) super.createContents(parent);
- parent.getShell().pack();
- return comp;
- }
-
- protected Control createDialogArea(Composite parent) {
- validateOn_ = false;
- msgUtils_ = new MessageUtils(WebServiceConsumptionUIPlugin.ID + ".plugin", this);
- UIUtils uiUtils = new UIUtils(msgUtils_, pluginId_);
-
- Shell thisShell = parent.getShell();
- if (thisShell == null) {
- thisShell = createShell();
- }
- thisShell.setText(msgUtils_.getMessage("DIALOG_TITLE_WS_ADD_HANDLER"));
-
- Composite composite = (Composite) super.createDialogArea(parent);
-
- Composite sourceLocationComp = uiUtils.createComposite(composite, 3);
-
- classNameText = uiUtils.createText(sourceLocationComp, "LABEL_TEXT_HANDLER_CLASS", TOOLTIP_TEXT_HANDLER_CLASS, INFOPOP_TEXT_HANDLER_CLASS, SWT.SINGLE | SWT.BORDER);
- classNameText.addListener(SWT.Modify,this);
-
- beanClassBrowseButton_ = uiUtils.createPushButton( sourceLocationComp, "BUTTON_BROWSE_CLASSES",
- "TOOLTIP_PBCL_BUTTON_BEAN_CLASS_BROWSE",
- INFOPOP_PBCL_BUTTON_BEAN_CLASS_BROWSE );
- beanClassBrowseButton_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleBrowseClasses();
- }
- } );
-
- nameText = uiUtils.createText(sourceLocationComp, "LABEL_TEXT_HANDLER_NAME", TOOLTIP_TEXT_HANDLER_NAME, INFOPOP_TEXT_HANDLER_NAME, SWT.SINGLE | SWT.BORDER );
- nameText.addListener(SWT.Modify, this);
-
- // dummy label for column 3.
- new Label( sourceLocationComp, SWT.NONE );
-
- if (!isClient_){
- portNameCombo = uiUtils.createCombo(sourceLocationComp, "LABEL_TEXT_HANDLER_PORT", TOOLTIP_TEXT_HANDLER_PORT, INFOPOP_TEXT_HANDLER_PORT, SWT.SINGLE | SWT.BORDER );
- portNameCombo.addListener(SWT.Modify, this);
-
- // dummy label for column 3.
- new Label( sourceLocationComp, SWT.NONE );
- }
- validateOn_ = true;
- return composite;
- }
-
- private void handleBrowseClasses()
- {
- Shell shell = getShell();
- IType itype = DialogUtils.browseClassesAsIType(shell, ResourcesPlugin.getWorkspace().getRoot().getProjects(), new ProgressMonitorDialog(shell));
-
- if( itype != null )
- {
- classNameText.setText(itype.getFullyQualifiedName());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
- */
- public void handleEvent(Event event) {
- if (!validateOn_)
- return;
- if (classNameText == event.widget) {
- handleClassNameTextEvent();
- validateTextFieldEntries();
- return;
- }
- if (nameText == event.widget) {
- handleNameTextEvent();
- validateTextFieldEntries();
- return;
- }
- if (portNameCombo == event.widget) {
- handlePortNameTextEvent();
- validateTextFieldEntries();
- return;
- }
- }
-
- private void handleClassNameTextEvent(){
- className = classNameText.getText();
- if (className.lastIndexOf(".java") != -1){
- nameText.setText(className.substring(0, className.lastIndexOf(".java")));
- }
- else {
- nameText.setText(className);
- }
-
- if (className.lastIndexOf(".") != -1){
- nameText.setText(className.substring(className.lastIndexOf(".")+1, className.length()));
- }
- name = nameText.getText();
- }
-
- private void handleNameTextEvent() {
- name = nameText.getText();
-
- }
-
- private void handlePortNameTextEvent(){
- selectedPortName = portNameCombo.getText();
- }
-
- private void disableOKButton() {
- if (getButton(0) != null)
- getButton(0).setEnabled(false);
- }
-
- private void enableOKButton() {
- if (getButton(0) != null)
- getButton(0).setEnabled(true);
- }
-
- private void validateTextFieldEntries(){
- if (classNameText.getText().equals("")){
- disableOKButton();
- return;
- }
- if (nameText.getText().equals("")){
- disableOKButton();
- return;
- }
- if (!isClient_){
- if (portNameCombo.getText()!=null && portNameCombo.getText().equals("")){
- disableOKButton();
- return;
- }
- else if (portNameCombo.getText()==null) {
- disableOKButton();
- return;
- }
- }
-
- enableOKButton();
-
-
- }
-
- /**
- * @return Returns the className.
- */
- public String getClassName() {
- if (className.lastIndexOf(".java") != -1){
- return className.substring(0, className.lastIndexOf(".java"));
- }
- else {
- return className;
- }
- }
- /**
- * @param className The className to set.
- */
- public void setClassName(String className) {
- this.className = className;
- }
- /**
- * @return Returns the name.
- */
- public String getName() {
- return name;
- }
- /**
- * @param name The name to set.
- */
- public void setName(String name) {
- this.name = name;
- }
- /**
- * @return Returns the portName.
- */
- public String getPortName() {
- return selectedPortName;
- }
- /**
- * @param portName The portName to set.
- */
- public void setPortNames(String[] portNames) {
- this.portNames = portNames;
- portNameCombo.setItems(portNames);
- portNameCombo.select(0);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetDefaultingCommand.java
deleted file mode 100644
index 781ede5..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetDefaultingCommand.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.internal.webservice.WebServiceNavigatorGroupType;
-import org.eclipse.jst.j2ee.applicationclient.creation.ApplicationClientNatureRuntime;
-import org.eclipse.jst.j2ee.client.ApplicationClient;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.internal.ejb.project.EJBNatureRuntime;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.jst.j2ee.internal.webservices.WebServiceEditModel;
-import org.eclipse.jst.j2ee.internal.webservices.WebServicesManager;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.j2ee.webservice.wsclient.Handler;
-import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef;
-import org.eclipse.jst.j2ee.webservice.wsclient.WebServicesResource;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.HandlerTableItem;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-import com.ibm.wtp.emf.workbench.ProjectUtilities;
-
-/**
- * ClientHandlersWidgetDefaultingCommand
- *
- * Initialize and load the handlers data
- */
-public class ClientHandlersWidgetDefaultingCommand extends AbstractHandlersWidgetDefaultingCmd {
-
- private HandlerTableItem[] handlers_;
-
- private MessageUtils msgUtils_;
-
- private boolean isGenSkeletonEnabled_;
-
- private IPath sourceOutputLocation_;
-
- private Hashtable wsRefsToHandlersTable_;
-
- private Hashtable refNameToServiceRefObj_;
-
- private WebServiceEditModel wsEditModel_;
-
- private WebServicesManager webServicesManager_;
-
- private IProject project_;
-
- private WebServicesResource wsClientRes_;
-
- private String serviceRefName_ = null;
-
- private Collection wsServiceRefs_;
-
- public Status execute(Environment env) {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- Status status = new SimpleStatus("");
-
- webServicesManager_ = new WebServicesManager();
-
- IStructuredSelection selection = getInitialSelection();
- if (selection == null) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- status = processHandlers();
- return status;
-
- }
-
- public Status processHandlers() {
- try {
- Vector handlers = new Vector();
- wsRefsToHandlersTable_ = new Hashtable();
- refNameToServiceRefObj_ = new Hashtable();
-
- wsEditModel_ = getWebServiceEditModel();
-
- wsServiceRefs_ = getWSServiceRefsFromSelection();
-
- if (wsServiceRefs_ != null) {
- Iterator wsRefsIter = wsServiceRefs_.iterator();
- for (int i = 0; i < wsServiceRefs_.size(); i++) {
-
- ServiceRef wsServiceRef = (ServiceRef) wsRefsIter.next();
-
- List wsHandlers = wsServiceRef.getHandlers();
- HandlerTableItem[] handlerItems = new HandlerTableItem[wsHandlers.size()];
- for (int k = 0; k < wsHandlers.size(); k++) {
-
- Handler wsHandler = (Handler) wsHandlers.get(k);
-
- HandlerTableItem handlerItem = new HandlerTableItem();
- handlerItem.setHandler(wsHandler);
- handlerItem.setHandlerName(wsHandler.getHandlerName());
- handlerItem.setHandlerClassName(wsHandler.getHandlerClass().getQualifiedName());
- handlerItem.setWsDescRef(wsServiceRef);
- handlerItems[k] = handlerItem;
- handlers.add(handlerItem);
- }
- String wsServiceRefName = wsServiceRef.getServiceRefName();
- wsRefsToHandlersTable_.put(wsServiceRefName, handlerItems);
- refNameToServiceRefObj_.put(wsServiceRefName, wsServiceRef);
-
- }
-
- handlers_ = (HandlerTableItem[]) handlers.toArray(new HandlerTableItem[0]);
- }
- }
- catch (Exception e) {
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, e);
- }
- return new SimpleStatus("");
- }
-
- public HandlerTableItem[] getAllHandlers() {
- return this.handlers_;
- }
-
- public Hashtable getHandlers() {
- return wsRefsToHandlersTable_;
- }
-
- /**
- * @return Returns the isGenSkeletonEnabled_.
- */
- public boolean getGenSkeletonEnabled() {
- return true;
- }
-
- /**
- * @return Returns the sourceOutputLocation_.
- */
- public IPath[] getSourceOutputLocation() {
- IPath[] locations = null;
- if (project_==null)
- project_ = getProject();
- if (project_ != null) {
- locations = ResourceUtils.getAllJavaSourceLocations(project_);
- }
-
- return locations;
- }
-
- /**
- * @return Returns the wsEditModel.
- */
- public WebServiceEditModel getWsEditModel() {
- return wsEditModel_;
- }
-
- public String getServiceRefName() {
- return this.serviceRefName_;
- }
-
- public WebServicesResource getWsClientResource() {
- return wsClientRes_;
- }
-
- public IProject getClientProject() {
- return project_;
- }
-
- private Collection getWSServiceRefsFromSelection() {
-
- IStructuredSelection initSel = getInitialSelection();
- if (initSel != null && initSel.size() == 1) {
- Object obj = initSel.getFirstElement();
- ServiceRef serviceRef = null;
- if (obj instanceof ServiceRef) {
- // Client ServiceRef
- serviceRef = (ServiceRef) obj;
- serviceRefName_ = serviceRef.getServiceRefName();
- project_ = ProjectUtilities.getProject(serviceRef);
- }
- else if (obj instanceof WebServiceNavigatorGroupType) {
- WebServiceNavigatorGroupType wsngt = (WebServiceNavigatorGroupType) obj;
- serviceRef = wsngt.getServiceRef();
- serviceRefName_ = serviceRef.getServiceRefName();
- project_ = ProjectUtilities.getProject(serviceRef);
- }
-
- if (project_==null){
- project_ = getProject();
- }
- if (project_==null){
- return null;
- }
-
- wsClientRes_ = webServicesManager_.getWebServicesClientResource(project_);
-
- if (ResourceUtils.isWebProject(project_)) {
- J2EEWebNatureRuntime rt = J2EEWebNatureRuntime.getRuntime(project_);
- if (rt != null) {
- WebApp webApp = rt.getWebApp();
- if (webApp != null) {
- return webServicesManager_.getServiceRefs(webApp);
- }
- }
- }
- else if (ResourceUtils.isAppClientProject(project_)){
- ApplicationClientNatureRuntime rt = ApplicationClientNatureRuntime.getRuntime(project_);
- if (rt!=null) {
- ApplicationClient appClient = rt.getApplicationClient();
- if (appClient != null){
- return webServicesManager_.getServiceRefs(appClient);
- }
- }
- }
- else if (ResourceUtils.isEJBProject(project_)){
- EJBNatureRuntime rt = EJBNatureRuntime.getRuntime(project_);
- if(rt!=null){
- EJBJar ejbJar = rt.getEJBJar();
- if (ejbJar !=null){
- return webServicesManager_.getServiceRefs(ejbJar);
- }
- }
- }
-
-
- }
- return null;
- }
-
- public Hashtable getRefNameToServiceRef() {
- return this.refNameToServiceRefObj_;
- }
-
- public Collection getWsServiceRefs(){
- return this.wsServiceRefs_;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetOutputCommand.java
deleted file mode 100644
index 70bb779..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientHandlersWidgetOutputCommand.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jem.internal.plugin.JavaEMFNature;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.impl.JavaClassImpl;
-import org.eclipse.jst.j2ee.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.applicationclient.creation.ApplicationClientNatureRuntime;
-import org.eclipse.jst.j2ee.internal.J2EEEditModel;
-import org.eclipse.jst.j2ee.internal.ejb.project.EJBNatureRuntime;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.jst.j2ee.internal.webservices.WebServiceEditModel;
-import org.eclipse.jst.j2ee.webservice.wsclient.Handler;
-import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef;
-import org.eclipse.jst.j2ee.webservice.wsclient.WebServicesResource;
-import org.eclipse.jst.j2ee.webservice.wsclient.Webservice_clientFactory;
-import org.eclipse.jst.j2ee.webservice.wsclient.impl.Webservice_clientFactoryImpl;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.HandlerTableItem;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.common.emf.utilities.EtoolsCopyUtility;
-
-/*
- * Provide a way to externalize the edited fields and create new handlers
- *
- */
-public class ClientHandlersWidgetOutputCommand extends SimpleCommand {
-
- //private List handlerTableItems_;
- private Hashtable oldWSServiceRefsToHandlersTable_;
-
- private Hashtable newWSServiceRefsToHandlersTable_;
-
- private WebServiceEditModel wsEditModel_;
-
- private Hashtable handlersTable_;
-
- private IProject project_;
-
- private WebServicesResource wsClientRes_;
-
- private Collection wsServiceRefs_;
-
- private J2EEEditModel editModel_;
-
- private Object accessorKey_;
-
- public Status execute(Environment env) {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- Status status = new SimpleStatus("");
-
- try {
-
- JavaEMFNature jMOF = (JavaEMFNature) JavaEMFNature.createRuntime(project_);
-
- oldWSServiceRefsToHandlersTable_ = new Hashtable();
- newWSServiceRefsToHandlersTable_ = new Hashtable();
-
- if (wsServiceRefs_ != null) {
- Iterator wsRefsIter = wsServiceRefs_.iterator();
- for (int i = 0; i < wsServiceRefs_.size(); i++) {
-
- ServiceRef wsServiceRef = (ServiceRef) wsRefsIter.next();
-
- List wsHandlers = wsServiceRef.getHandlers();
- oldWSServiceRefsToHandlersTable_.put(wsServiceRef, wsHandlers);
- newWSServiceRefsToHandlersTable_.put(wsServiceRef, new ArrayList());
- }
-
- Enumeration e = handlersTable_.keys();
- while (e.hasMoreElements()) {
-
- String serviceRefName = (String) e.nextElement();
- List handlerTableItems_ = (List) handlersTable_.get(serviceRefName);
- if (handlerTableItems_ != null) {
- // form Handler tables
- for (int i = 0; i < handlerTableItems_.size(); i++) {
-
- HandlerTableItem hti = (HandlerTableItem) handlerTableItems_.get(i);
- Object wsModelRef = hti.getWsDescRef();
- if (wsModelRef != null && wsModelRef instanceof ServiceRef) {
- ServiceRef wsRef = (ServiceRef) wsModelRef;
-
- Object handler = hti.getHandler();
- if (handler != null && handler instanceof Handler) {
- // clone it
- Handler clonedHandler = (Handler) EtoolsCopyUtility.createCopy((Handler) handler);
- ((List) newWSServiceRefsToHandlersTable_.get(wsRef)).add(clonedHandler);
- }
- else {
- // create it
- Webservice_clientFactory wsClientFactory = new Webservice_clientFactoryImpl();
- Handler newHandler = wsClientFactory.createHandler();
- newHandler.setHandlerName(hti.getHandlerName());
-
- JavaClass javaClass = (JavaClass) JavaClassImpl.reflect(hti.getHandlerClassName(), jMOF.getResourceSet());
- if (javaClass != null) {
- newHandler.setHandlerClass(javaClass);
- }
-
- ((List) newWSServiceRefsToHandlersTable_.get(wsRef)).add(newHandler);
- }
-
- }
-
- }
- }
- }
-
- // add handlers to ports
- addHandlersToServiceRefs();
- getJ2EEEditModel();
-
- // save the resource
- if (J2EEUtils.getJ2EEVersion(project_) == J2EEVersionConstants.J2EE_1_4_ID) {
- editModel_.save(accessorKey_);
- }
- else {
- if (wsClientRes_!=null)
- wsClientRes_.save(new HashMap());
- }
- }
- }
- catch (Exception e) {
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, e);
- }
- finally {
- if (editModel_ != null)
- editModel_.releaseAccess(accessorKey_);
- }
- return status;
- }
-
- private void addHandlersToServiceRefs() {
- try {
- int key = 0;
- Enumeration refsToHandlers = newWSServiceRefsToHandlersTable_.keys();
- while (refsToHandlers.hasMoreElements()) {
- ServiceRef serviceRef = (ServiceRef) refsToHandlers.nextElement();
- if (serviceRef != null) {
-
- List handlers = (List) newWSServiceRefsToHandlersTable_.get(serviceRef);
- List modelHandlers = (List) oldWSServiceRefsToHandlersTable_.get(serviceRef);
- modelHandlers.clear();
- modelHandlers.addAll(handlers);
- }
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @param handlerTableItems
- * The handlerTableItems to set.
- */
- // public void setAllHandlersList(List handlerTableItems) {
- // this.handlerTableItems_ = handlerTableItems;
- // }
- public void setHandlersTable(Hashtable handlersTable) {
- this.handlersTable_ = handlersTable;
- }
-
- /**
- * @param wsEditModel
- * The wsEditModel to set.
- */
- public void setWsEditModel(WebServiceEditModel wsEditModel) {
- this.wsEditModel_ = wsEditModel;
- }
-
- public void setClientProject(IProject project) {
- this.project_ = project;
- }
-
- public void setWsClientResource(WebServicesResource wsRes) {
- this.wsClientRes_ = wsRes;
- }
-
- public void setWsServiceRefs(Collection wsRefs) {
- this.wsServiceRefs_ = wsRefs;
- }
-
- public void getJ2EEEditModel() {
- accessorKey_ = new Object();
- if (ResourceUtils.isWebProject(project_)) {
- J2EEWebNatureRuntime rt = J2EEWebNatureRuntime.getRuntime(project_);
- if (rt != null) {
- editModel_ = rt.getWebAppEditModelForWrite(accessorKey_);
- }
- }
- else if (ResourceUtils.isAppClientProject(project_)){
- ApplicationClientNatureRuntime rt = ApplicationClientNatureRuntime.getRuntime(project_);
- if (rt!=null) {
- editModel_ = rt.getAppClientEditModelForWrite(accessorKey_);
- }
- }
- else if (ResourceUtils.isEJBProject(project_)){
- EJBNatureRuntime rt = EJBNatureRuntime.getRuntime(project_);
- if(rt!=null){
- editModel_ = rt.getEJBEditModelForWrite(accessorKey_);
- }
- }
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientWizardWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientWizardWidget.java
deleted file mode 100644
index 81b1daf..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientWizardWidget.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class ClientWizardWidget extends SimpleWidgetDataContributor
-{
- private WebServiceClientTypeWidget clientWidget_;
- private PreferencesSelectionWidget preferencesWidget_;
-
- /*CONTEXT_ID PWPR0013 for the test service checkbox of the project page*/
- private String INFOPOP_PWPR_CHECKBOX_TEST_SERVICE = "PWPR0013";
- private Button testService_;
-
- /*CONTEXT_ID PWPR0014 for the monitor service checkbox of the project page*/
- private String INFOPOP_PWPR_CHECKBOX_MONITOR_SERVICE = "PWRPR0014";
- private Button monitorService;
-
- /*CONTEXT_ID PWPR0001 for the Project Page*/
- private String INFOPOP_PWPR_PAGE = "PWPR0001";
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener)
- {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId + ".plugin", this );
- UIUtils utils = new UIUtils( msgUtils, pluginId );
-
- WorkbenchHelp.setHelp( parent, pluginId + "." + INFOPOP_PWPR_PAGE );
-
- Composite clientComposite = utils.createComposite( parent, 1 );
-
- clientWidget_ = new WebServiceClientTypeWidget();
- clientWidget_.addControls(clientComposite, statusListener );
-
-
- // Create test service check box.
- Composite testGroup = utils.createComposite(clientComposite,1);
-
- testService_ = utils.createCheckbox( testGroup, "CHECKBOX_TEST_WEBSERVICE",
- "TOOLTIP_PWPR_CHECKBOX_TEST_SERVICE",
- INFOPOP_PWPR_CHECKBOX_TEST_SERVICE );
-
- // Create monitor service check box.
- monitorService = utils.createCheckbox(testGroup, "CHECKBOX_MONITOR_WEBSERVICE", "TOOLTIP_PWPR_CHECKBOX_MONITOR_SERVICE", INFOPOP_PWPR_CHECKBOX_MONITOR_SERVICE);
-
- // Create the preferences controls.
- preferencesWidget_ = new PreferencesSelectionWidget();
- preferencesWidget_.addControls( clientComposite, statusListener );
-
- return this;
- }
-
- public void setResourceContext( ResourceContext context )
- {
- preferencesWidget_.setResourceContext( context );
- }
-
- public ResourceContext getResourceContext()
- {
- return preferencesWidget_.getResourceContext();
- }
-
- public void setClientTypeRuntimeServer( TypeRuntimeServer ids )
- {
- clientWidget_.setTypeRuntimeServer( ids );
- }
-
- public TypeRuntimeServer getClientTypeRuntimeServer()
- {
- return clientWidget_.getTypeRuntimeServer();
- }
-
- public Boolean getTestService()
- {
- return new Boolean( testService_.getSelection() );
- }
-
- public void setTestService( Boolean value )
- {
- testService_.setSelection( value.booleanValue() );
- }
-
- public Boolean getMonitorService()
- {
- return new Boolean(monitorService.getSelection());
- }
-
- public void setMonitorService(Boolean value)
- {
- monitorService.setSelection(value.booleanValue());
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientWizardWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientWizardWidgetDefaultingCommand.java
deleted file mode 100644
index 99b0ee8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientWizardWidgetDefaultingCommand.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceClientTypeRegistry;
-import org.eclipse.jst.ws.internal.context.ScenarioContext;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-
-
-public class ClientWizardWidgetDefaultingCommand extends SimpleCommand
-{
- public Boolean getTestService()
- {
- return new Boolean( getScenarioContext().getTestWebService() );
- }
-
- public Boolean getMonitorService()
- {
- return new Boolean( getScenarioContext().getMonitorWebService());
- }
-
- public ResourceContext getResourceContext()
- {
- return WebServicePlugin.getInstance().getResourceContext();
- }
-
- // Current ScenarioContext is used to default the first page of the wizard. The
- // properties in ScenarioContext are mapped individual. Therefore, ScenarioContext
- // should not also be mapped.
- protected ScenarioContext getScenarioContext()
- {
- return WebServicePlugin.getInstance().getScenarioContext();
- }
-
- // TODO Set client name defaults here.
- public TypeRuntimeServer getClientTypeRuntimeServer()
- {
- WebServiceClientTypeRegistry registry = WebServiceClientTypeRegistry.getInstance();
- String type = getScenarioContext().getClientWebServiceType();
- String runtime = registry.getAllClientRuntimes()[0];
- String server = registry.getAllClientServerFactoryIds()[0];
- TypeRuntimeServer result = new TypeRuntimeServer();
-
- result.setTypeId( type );
- result.setRuntimeId( runtime );
- result.setServerId( server );
-
- return result;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientWizardWidgetOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientWizardWidgetOutputCommand.java
deleted file mode 100644
index 5c70f36..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ClientWizardWidgetOutputCommand.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-
-
-public class ClientWizardWidgetOutputCommand extends SimpleCommand
-{
- private boolean testService_;
- private boolean monitorService;
- private ResourceContext resourceContext_;
- private TypeRuntimeServer clientIds_;
-
- public boolean getTestService()
- {
- return testService_;
- }
-
- public void setTestService( boolean testService )
- {
- testService_ = testService;
- }
-
- public boolean getMonitorService()
- {
- return monitorService;
- }
-
- public void setMonitorService(boolean monitorService)
- {
- this.monitorService = monitorService;
- }
-
- public ResourceContext getResourceContext()
- {
-
- return resourceContext_;
- }
-
- public void setResourceContext( ResourceContext context )
- {
- resourceContext_ = context;
- }
-
- public TypeRuntimeServer getClientTypeRuntimeServer()
- {
- return clientIds_;
- }
-
- public void setClientTypeRuntimeServer( TypeRuntimeServer clientIds )
- {
- clientIds_ = clientIds;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigClientHandlersTableWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigClientHandlersTableWidget.java
deleted file mode 100644
index 6c5da03..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigClientHandlersTableWidget.java
+++ /dev/null
@@ -1,594 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.HandlerTableItem;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-/**
- * ConfigClientHandlersTreeWidget
- *
- */
-public class ConfigClientHandlersTableWidget extends SimpleWidgetDataContributor {
-
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- private MessageUtils msgUtils_ = null;
- private Listener statusListener_;
- private Composite parent_;
- private boolean isGenSkeletonEnabled_;
- private String outputLocation_;
- private Combo webServiceRefCombo_;
- private Table handlersTable_;
- private TableViewer tableViewer_;
- private Button addButton_;
- private Button removeButton_;
- private Button genSkeletonRadioButton_;
- private Combo sourceLocationCombo_;
-
- private Hashtable pathsTable_ = new Hashtable();
- private Hashtable wsRefsToHandlers_;
- private Hashtable refNameToServiceRef_;
- private Vector orderedHandlers_;
- //private ServiceRef serviceRef_;
- private String serviceRefName_;
- private int DEFAULT_COLUMN_WIDTH = 150;
-
- // ----TOOLTIPS Section----
- /* CONTEXT_ID HDLR0001 for the Handler Config Page */
- private final String INFOPOP_HDLR_WS_HANDLERS = "HDLR0001"; //$NON-NLS-1$
- private final String TOOLTIP_EDIT_WS_HANDLERS = "TOOLTIP_EDIT_WS_HANDLERS";
-
- /* CONTEXT_ID HDLR0002 for the Handler Config Page */
- private final String INFOPOP_HDLR_GEN_SKELETON = "HDLR0002"; //$NON-NLS-1$
- private final String TOOLTIP_BUTTON_GEN_SKELETON = "TOOLTIP_BUTTON_GEN_SKELETON";
-
- /* CONTEXT_ID HDLR0003 for the Handler Config Page */
- private final String INFOPOP_COMBO_SOURCE_LOC = "HDLR0003"; //$NON-NLS-1$
- private final String TOOLTIP_COMBO_SOURCE_LOC = "TOOLTIP_COMBO_SOURCE_LOC";
-
- /* CONTEXT_ID HDLR0004 for the Handler Config Page */
- private final String INFOPOP_WS_CLIENT_REF = "HDLR0004"; //$NON-NLS-1$
- private final String TOOLTIP_WS_CLIENT_REF = "TOOLTIP_WS_CLIENT_REF";
-
- // ------------------------
-
- public ConfigClientHandlersTableWidget() {
- super();
- }
-
- public WidgetDataEvents addControls(Composite parent, Listener statusListener) {
- msgUtils_ = new MessageUtils(WebServiceConsumptionUIPlugin.ID + ".plugin", this);
- UIUtils uiUtils = new UIUtils(msgUtils_, pluginId_);
-
- parent_ = parent;
- statusListener_ = statusListener;
-
- // Web service reference combo
- Composite webServiceRefComp = uiUtils.createComposite(parent_, 2);
- webServiceRefCombo_ = uiUtils.createCombo(webServiceRefComp, "LABEL_COMBO_WS_CLIENT_REF", TOOLTIP_WS_CLIENT_REF, INFOPOP_WS_CLIENT_REF,
- SWT.READ_ONLY);
- webServiceRefCombo_.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent evt) {
- handleWebServiceRefCombo(evt);
- }
- });
-
- Composite displayComp = new Composite(parent_, SWT.NONE);
- GridLayout gridlayout = new GridLayout(2, false);
- displayComp.setLayout(gridlayout);
- displayComp.setLayoutData(uiUtils.createFillAll());
-
- Composite handlersComp = uiUtils.createComposite(displayComp, 1);
- GridData griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING
- | GridData.VERTICAL_ALIGN_FILL);
- handlersComp.setLayoutData(griddata);
- handlersComp.setSize(130, 600);
-
- Composite buttonsComp = uiUtils.createComposite(displayComp, 1);
- griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- buttonsComp.setLayoutData(griddata);
-
- Text handlersText = new Text(handlersComp, SWT.READ_ONLY);
- handlersText.setText(msgUtils_.getMessage("LABEL_HANDLERS_CONFIG"));
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 2;
- handlersText.setLayoutData(gd);
-
- handlersTable_ = uiUtils.createTable(handlersComp, TOOLTIP_EDIT_WS_HANDLERS, INFOPOP_HDLR_WS_HANDLERS, SWT.MULTI | SWT.FULL_SELECTION);
- handlersTable_.setHeaderVisible(true);
- handlersTable_.setLinesVisible(true);
-
- // empty space
- Label wsLabel = new Label(buttonsComp, SWT.NONE);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 2;
- wsLabel.setLayoutData(gd);
-
- Button moveUpButton = uiUtils.createPushButton(buttonsComp, "LABEL_BUTTON_MOVE_UP", null, null);
- griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- moveUpButton.setLayoutData(griddata);
- moveUpButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent event) {
- handleMoveUpButtonSelected(event);
- }
-
- public void widgetDefaultSelected(SelectionEvent event) {
- }
- });
-
- Button moveDownButton = uiUtils.createPushButton(buttonsComp, "LABEL_BUTTON_MOVE_DOWN", null, null);
- griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- moveDownButton.setLayoutData(griddata);
- moveDownButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent event) {
- handleMoveDownButtonSelected(event);
- }
-
- public void widgetDefaultSelected(SelectionEvent event) {
- }
- });
-
- // empty space
- wsLabel = new Label(buttonsComp, SWT.NONE);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 2;
- wsLabel.setLayoutData(gd);
-
- addButton_ = uiUtils.createPushButton(buttonsComp, "LABEL_BUTTON_ADD", null, null);
- griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- addButton_.setLayoutData(griddata);
- addButton_.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent event) {
- handleAddButtonSelected(event);
- }
-
- public void widgetDefaultSelected(SelectionEvent event) {
- }
- });
-
- removeButton_ = uiUtils.createPushButton(buttonsComp, "LABEL_BUTTON_REMOVE", null, null);
- griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- removeButton_.setLayoutData(griddata);
- removeButton_.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent event) {
- handleRemoveButtonSelected(event);
- }
-
- public void widgetDefaultSelected(SelectionEvent event) {
- }
- });
- enableRemove(false);
-
- // table stuff
- String[] columns_ = new String[] { msgUtils_.getMessage("LABEL_HANDLER_NAME"), msgUtils_.getMessage("LABLE_HANDLER_CLASS")};
-
- for (int i = 0; i < columns_.length; i++) {
- TableColumn tableColumn = new TableColumn(handlersTable_, i);
- tableColumn.setText(columns_[i]);
- tableColumn.setAlignment(SWT.LEFT);
- tableColumn.setWidth(DEFAULT_COLUMN_WIDTH);
- tableColumn.setResizable(true);
- }
-
- tableViewer_ = new TableViewer(handlersTable_);
- Control control = tableViewer_.getControl();
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- control.setLayoutData(data);
-
- tableViewer_.setColumnProperties(columns_);
- tableViewer_.setContentProvider(new ListContentProvider());
- tableViewer_.setLabelProvider(new ListLabelProvider());
- tableViewer_.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- enableRemove(true);
- }
- });
-
- // gen skeleton check box
- genSkeletonRadioButton_ = uiUtils.createCheckbox(parent_, "LABEL_BUTTON_GEN_SKELETON", TOOLTIP_BUTTON_GEN_SKELETON, INFOPOP_HDLR_GEN_SKELETON);
- genSkeletonRadioButton_.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent evt) {
- handleGenSkeletonRadioButton();
- }
- });
-
- // source location combo
- Composite sourceLocationComp = uiUtils.createComposite(parent_, 2);
- sourceLocationCombo_ = uiUtils.createCombo(sourceLocationComp, "LABEL_COMBO_SOURCE_LOC", TOOLTIP_COMBO_SOURCE_LOC, INFOPOP_COMBO_SOURCE_LOC,
- SWT.READ_ONLY);
- sourceLocationCombo_.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent evt) {
- handleSourceLocationCombo(evt);
- }
- });
-
- return this;
- }
-
- // Called at start
- private void populateHandlersTable() {
- try {
-
- int sizeOfHandlers = wsRefsToHandlers_.size();
- String[] wsRefs = new String[sizeOfHandlers];
-
- String[] wsRefNames = (String[]) wsRefsToHandlers_.keySet().toArray(new String[0]);
- webServiceRefCombo_.setItems(wsRefNames);
- webServiceRefCombo_.select(0);
-
- if (sizeOfHandlers < 1) {
- webServiceRefCombo_.select(0);
- webServiceRefCombo_.setEnabled(false);
- }
- else {
- if (serviceRefName_ != null) {
- int index = webServiceRefCombo_.indexOf(serviceRefName_);
- if (index != -1) webServiceRefCombo_.select(index);
- }
- else
- webServiceRefCombo_.select(0);
- }
-
- // get webServiceRef hint
- String wsRef = webServiceRefCombo_.getText();
-
- if (wsRefsToHandlers_.get(wsRef) != null) {
- orderedHandlers_ = (Vector) wsRefsToHandlers_.get(wsRef);
- tableViewer_.setInput(orderedHandlers_);
- tableViewer_.refresh();
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
- /**
- * @return Returns the handlers.
- */
- public List getAllHandlersList() {
- // convert to a ArrayList and return as List
- List list = new ArrayList();
- if (orderedHandlers_ != null && !orderedHandlers_.isEmpty()) list.addAll(orderedHandlers_);
-
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus()
- */
- public Status getStatus() {
- Status finalStatus = new SimpleStatus("");
-
- return finalStatus;
- }
-
- private void handleAddButtonSelected(SelectionEvent event) {
-
- AddHandlerDialog dialog = dialog = new AddHandlerDialog(parent_.getShell(), true);
- dialog.create();
- dialog.getShell().setSize( 500, 200 );
-
- int result = dialog.open();
-
- if (result == Window.OK) {
- String name = dialog.getName();
- String className = dialog.getClassName();
-
- HandlerTableItem hi = new HandlerTableItem();
- hi.setHandlerName(name);
- hi.setHandlerClassName(className);
- String wsRefName = webServiceRefCombo_.getText();
- ServiceRef serviceRef = (ServiceRef) refNameToServiceRef_.get(wsRefName);
- hi.setWsDescRef(serviceRef);
-
- orderedHandlers_ = (Vector) wsRefsToHandlers_.get(wsRefName);
- orderedHandlers_.add(hi);
-
- }
-
- refresh();
- }
-
- private void handleRemoveButtonSelected(SelectionEvent event) {
- handleDeleteKeyPressed();
- }
-
- private void handleMoveUpButtonSelected(SelectionEvent event) {
-
- int index = tableViewer_.getTable().getSelectionIndex();
- ISelection selected = tableViewer_.getSelection();
- if (index != -1) {
- if (index > 0) {
- orderedHandlers_ = (Vector) wsRefsToHandlers_.get(webServiceRefCombo_.getText());
- Object object = orderedHandlers_.remove(index);
- orderedHandlers_.insertElementAt(object, index - 1);
- tableViewer_.refresh();
- }
- }
-
- }
-
- private void handleMoveDownButtonSelected(SelectionEvent event) {
-
- int index = tableViewer_.getTable().getSelectionIndex();
- ISelection selected = tableViewer_.getSelection();
- if (index != -1) {
- if (index < orderedHandlers_.size() - 1) {
- orderedHandlers_ = (Vector) wsRefsToHandlers_.get(webServiceRefCombo_.getText());
- Object object = orderedHandlers_.remove(index);
- orderedHandlers_.insertElementAt(object, index + 1);
- tableViewer_.refresh();
- }
- }
-
- }
-
- public void handleSourceLocationCombo(SelectionEvent event) {
- outputLocation_ = sourceLocationCombo_.getText();
- }
-
- public void handleGenSkeletonRadioButton() {
- if (genSkeletonRadioButton_.isEnabled()) {
- if (genSkeletonRadioButton_.getSelection())
- this.isGenSkeletonEnabled_ = true;
- else
- this.isGenSkeletonEnabled_ = false;
- }
- }
-
- public void handleWebServiceRefCombo(SelectionEvent event) {
-
- if (webServiceRefCombo_.isEnabled()) {
- String webServiceRefName = webServiceRefCombo_.getText();
- Vector hndlers = (Vector) wsRefsToHandlers_.get(webServiceRefName);
- //HandlerTableItem item = (HandlerTableItem)hndlers.get(0);
- //serviceRef_ = (ServiceRef)item.getWsDescRef();
- if (hndlers != null) {
- tableViewer_.setInput(hndlers);
- tableViewer_.refresh();
- }
- }
- }
-
- /**
- * @return Returns the isGenSkeletonEnabled_.
- */
- public boolean isGenSkeletonEnabled_() {
- return isGenSkeletonEnabled_;
- }
-
- protected class ListLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object object, int columnIndex) {
-
- if (object instanceof HandlerTableItem) {
- HandlerTableItem hti = (HandlerTableItem) object;
- if (columnIndex == 0) {
-
- return hti.getHandlerName() != null ? hti.getHandlerName() : "";
- }
- else if (columnIndex == 1) { return hti.getHandlerClassName() != null ? hti.getHandlerClassName() : ""; }
- }
- return null;
- }
-
- }
-
- private void enableRemove(boolean enabled) {
- removeButton_.setEnabled(enabled && !tableViewer_.getSelection().isEmpty());
- }
-
- protected class ListContentProvider implements IStructuredContentProvider {
-
- public Object[] getElements(Object element) {
- if (element instanceof Vector) { return ((Vector) element).toArray(); }
- return null;
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object old, Object newobj) {
- }
-
- public boolean isDeleted(Object object) {
- return false;
- }
- }
-
- private void handleDeleteKeyPressed() {
- ISelection selection = tableViewer_.getSelection();
- if (selection != null && !selection.isEmpty() && (selection instanceof IStructuredSelection)) {
- int selectionIndex = handlersTable_.getSelectionIndex();
- int selectionCount = handlersTable_.getItemCount();
-
- orderedHandlers_ = (Vector) wsRefsToHandlers_.get(webServiceRefCombo_.getText());
- orderedHandlers_.remove(selectionIndex);
- refresh();
- }
- }
-
- public void refresh() {
- try {
- tableViewer_.setInput(null);
- if (orderedHandlers_ != null) tableViewer_.setInput(orderedHandlers_);
- tableViewer_.refresh();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public void setGenSkeletonEnabled(boolean isGenSkeletonEnabled) {
- this.isGenSkeletonEnabled_ = isGenSkeletonEnabled;
- genSkeletonRadioButton_.setSelection(isGenSkeletonEnabled);
-
- }
-
- public boolean getGenSkeletonEnabled() {
- return this.isGenSkeletonEnabled_;
- }
-
- public void setSourceOutputLocation(IPath[] locations) {
- if (locations[0]!=null)
- this.outputLocation_ = locations[0].toString();
- else
- return;
-
- String[] paths = new String[locations.length];
- for (int i = 0; i < locations.length; i++) {
- paths[i] = locations[i].toString();
- pathsTable_.put(paths[i], locations[i]);
- }
- sourceLocationCombo_.setItems(paths);
- sourceLocationCombo_.select(0);
-
- }
-
- public IPath getSourceOutputLocation() {
- IPath outputPath = (IPath) pathsTable_.get(outputLocation_);
- return outputPath;
- }
-
- /**
- * @return Returns the handlerClassNames.
- */
- public String[] getHandlerClassNames() {
- Vector handlerClasses = new Vector();
-
- Enumeration e = wsRefsToHandlers_.keys();
- while (e.hasMoreElements()) {
-
- String wsRefName = (String) e.nextElement();
- orderedHandlers_ = (Vector) wsRefsToHandlers_.get(wsRefName);
-
- if (orderedHandlers_ != null) {
- for (int i = 0; i < orderedHandlers_.size(); i++) {
- HandlerTableItem hti = (HandlerTableItem) orderedHandlers_.get(i);
- handlerClasses.add(hti.getHandlerClassName());
- }
- }
- }
- return (String[])handlerClasses.toArray(new String[0]);
- }
-
- /**
- * @return Returns the wsRefsToHandlers_.
- */
- public Hashtable getWsRefsToHandlers() {
- return wsRefsToHandlers_;
- }
-
- /**
- * @param wsRefsToHandlers_
- * The wsRefsToHandlers_ to set.
- */
- public void setWsRefsToHandlers(Hashtable wsRefsToHandlersArray) {
-
- wsRefsToHandlers_ = new Hashtable();
- try {
-
- if (wsRefsToHandlersArray != null) {
- int sizeOfHandlers = wsRefsToHandlersArray.size();
- String[] wsRefs = new String[sizeOfHandlers];
- // store the wsRefs
- Enumeration wsRef = wsRefsToHandlersArray.keys();
- while (wsRef.hasMoreElements()) {
- String wsRefName = (String) wsRef.nextElement();
-
- HandlerTableItem[] handlers = (HandlerTableItem[]) wsRefsToHandlersArray.get(wsRefName);
- // process the handlersTable
- orderedHandlers_ = new Vector();
- for (int i = 0; i < handlers.length; i++) {
- orderedHandlers_.add(handlers[i]);
- }
- wsRefsToHandlers_.put(wsRefName, orderedHandlers_);
-
- }
- }
- populateHandlersTable();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
- public void setServiceRefName(String wsRefName) {
- serviceRefName_ = wsRefName;
- }
-
- public void setRefNameToServiceRef(Hashtable refName2SF) {
- this.refNameToServiceRef_ = refName2SF;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigServiceHandlersTableWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigServiceHandlersTableWidget.java
deleted file mode 100644
index eaa9bb5..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ConfigServiceHandlersTableWidget.java
+++ /dev/null
@@ -1,633 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.j2ee.webservice.wsdd.PortComponent;
-import org.eclipse.jst.j2ee.webservice.wsdd.WebServiceDescription;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.HandlerTableItem;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-/**
- * ConfigServiceHandlersTreeWidget
- *
- */
-public class ConfigServiceHandlersTableWidget extends SimpleWidgetDataContributor {
-
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- private MessageUtils msgUtils_ = null;
- private Listener statusListener_;
- private Composite parent_;
- private boolean isGenSkeletonEnabled_;
- private String outputLocation_;
-
- private Table handlersTable_;
- private TableViewer tableViewer_;
- private Combo webServiceDescCombo_;
- private Button addButton_;
- private Button removeButton_;
- private Button genSkeletonRadioButton_;
- private Combo sourceLocationCombo_;
- private Text text_; // selected Text
-
- private HandlerTableItem[] handlers;
- private Hashtable pathsTable_ = new Hashtable();
- private Hashtable wsDescToHandlers_;
- private Hashtable wsDescToPorts_;
- private Hashtable serviceDescNameToDescObj_;
- private String descriptionName_ = null;
-
- private Vector orderedHandlers_;
-
- private int DEFAULT_COLUMN_WIDTH = 90;
-
- // ----TOOLTIPS Section----
- /* CONTEXT_ID SHLD0001 for the Handler Config Page */
- private final String INFOPOP_HDLR_WS_HANDLERS = "SHDL0001"; //$NON-NLS-1$
- private final String TOOLTIP_EDIT_WS_HANDLERS = "TOOLTIP_EDIT_WS_HANDLERS";
-
- /* CONTEXT_ID SHDL0002 for the Handler Config Page */
- private final String INFOPOP_HDLR_GEN_SKELETON = "SHDL0002"; //$NON-NLS-1$
- private final String TOOLTIP_BUTTON_GEN_SKELETON = "TOOLTIP_BUTTON_GEN_SKELETON";
-
- /* CONTEXT_ID SHDL0003 for the Handler Config Page */
- private final String INFOPOP_COMBO_SOURCE_LOC = "SHDL0003"; //$NON-NLS-1$
- private final String TOOLTIP_COMBO_SOURCE_LOC = "TOOLTIP_COMBO_SOURCE_LOC";
-
- /* CONTEXT_ID SHDL0004 for the Handler Config Page */
- private final String INFOPOP_WS_SERVICE_DESC = "SHDL0004"; //$NON-NLS-1$
- private final String TOOLTIP_WS_SERVICE_DESC = "TOOLTIP_WS_SERVICE_DESC";
-
- // ------------------------
-
- public ConfigServiceHandlersTableWidget() {
- super();
- }
-
- public WidgetDataEvents addControls(Composite parent, Listener statusListener) {
- msgUtils_ = new MessageUtils(WebServiceConsumptionUIPlugin.ID + ".plugin", this);
- UIUtils uiUtils = new UIUtils(msgUtils_, pluginId_);
-
- parent_ = parent;
- statusListener_ = statusListener;
-
- // Web service reference combo
- Composite webServiceRefComp = uiUtils.createComposite(parent_, 2);
- webServiceDescCombo_ = uiUtils.createCombo(webServiceRefComp, "LABEL_COMBO_WS_SERVICE_DESC", TOOLTIP_WS_SERVICE_DESC, TOOLTIP_WS_SERVICE_DESC,
- SWT.READ_ONLY);
- webServiceDescCombo_.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent evt) {
- handleWebServiceDescCombo(evt);
- }
- });
-
- Composite displayComp = new Composite(parent, SWT.NONE);
-
- GridLayout gridlayout = new GridLayout(2, false);
- displayComp.setLayout(gridlayout);
- displayComp.setLayoutData(uiUtils.createFillAll());
-
- Composite handlersComp = uiUtils.createComposite(displayComp, 1);
- GridData griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING
- | GridData.VERTICAL_ALIGN_FILL);
- handlersComp.setLayoutData(griddata);
- handlersComp.setSize(130, 600);
-
- Composite buttonsComp = uiUtils.createComposite(displayComp, 1);
- griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- buttonsComp.setLayoutData(griddata);
-
- Text handlersText = new Text(handlersComp, SWT.READ_ONLY);
- handlersText.setText(msgUtils_.getMessage("LABEL_HANDLERS_CONFIG"));
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 2;
- handlersText.setLayoutData(gd);
-
- handlersTable_ = uiUtils.createTable(handlersComp, TOOLTIP_EDIT_WS_HANDLERS, INFOPOP_HDLR_WS_HANDLERS, SWT.MULTI | SWT.FULL_SELECTION);
- handlersTable_.setHeaderVisible(true);
- handlersTable_.setLinesVisible(true);
-
- // empty space
- Label wsLabel = new Label(buttonsComp, SWT.NONE);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 2;
- wsLabel.setLayoutData(gd);
-
- Button moveUpButton = uiUtils.createPushButton(buttonsComp, "LABEL_BUTTON_MOVE_UP", null, null);
- griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- moveUpButton.setLayoutData(griddata);
- moveUpButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent event) {
- handleMoveUpButtonSelected(event);
- }
-
- public void widgetDefaultSelected(SelectionEvent event) {
- }
- });
-
- Button moveDownButton = uiUtils.createPushButton(buttonsComp, "LABEL_BUTTON_MOVE_DOWN", null, null);
- griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- moveDownButton.setLayoutData(griddata);
- moveDownButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent event) {
- handleMoveDownButtonSelected(event);
- }
-
- public void widgetDefaultSelected(SelectionEvent event) {
- }
- });
-
- // empty space
- wsLabel = new Label(buttonsComp, SWT.NONE);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 2;
- wsLabel.setLayoutData(gd);
-
- addButton_ = uiUtils.createPushButton(buttonsComp, "LABEL_BUTTON_ADD", null, null);
- griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- addButton_.setLayoutData(griddata);
- addButton_.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent event) {
- handleAddButtonSelected(event);
- }
-
- public void widgetDefaultSelected(SelectionEvent event) {
- }
- });
-
- removeButton_ = uiUtils.createPushButton(buttonsComp, "LABEL_BUTTON_REMOVE", null, null);
- griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- removeButton_.setLayoutData(griddata);
- removeButton_.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent event) {
- handleRemoveButtonSelected(event);
- }
-
- public void widgetDefaultSelected(SelectionEvent event) {
- }
- });
- enableRemove(false);
-
- // table stuff here
- String[] columns_ = new String[] { msgUtils_.getMessage("LABEL_HANDLER_NAME"), msgUtils_.getMessage("LABLE_HANDLER_CLASS"),
- msgUtils_.getMessage("LABEL_HANDLER_PORT")};
-
- for (int i = 0; i < columns_.length; i++) {
- TableColumn tableColumn = new TableColumn(handlersTable_, i);
- tableColumn.setText(columns_[i]);
- tableColumn.setAlignment(SWT.LEFT);
- tableColumn.setWidth(DEFAULT_COLUMN_WIDTH);
- tableColumn.setResizable(true);
- }
-
- tableViewer_ = new TableViewer(handlersTable_);
- Control control = tableViewer_.getControl();
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- control.setLayoutData(data);
-
- tableViewer_.setColumnProperties(columns_);
- tableViewer_.setContentProvider(new ListContentProvider());
- tableViewer_.setLabelProvider(new ListLabelProvider());
- tableViewer_.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- enableRemove(true);
- }
- });
-
- genSkeletonRadioButton_ = uiUtils.createCheckbox(parent_, "LABEL_BUTTON_GEN_SKELETON", TOOLTIP_BUTTON_GEN_SKELETON, INFOPOP_HDLR_GEN_SKELETON);
- genSkeletonRadioButton_.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent evt) {
- handleGenSkeletonRadioButton();
- }
- });
-
- Composite sourceLocationComp = uiUtils.createComposite(parent_, 2);
- sourceLocationCombo_ = uiUtils.createCombo(sourceLocationComp, "LABEL_COMBO_SOURCE_LOC", TOOLTIP_COMBO_SOURCE_LOC, INFOPOP_COMBO_SOURCE_LOC,
- SWT.READ_ONLY);
- sourceLocationCombo_.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent evt) {
- handleSourceLocationCombo(evt);
- }
- });
-
- return this;
- }
-
- // Called at start
- private void populateHandlersTable() {
- try {
-
- int sizeOfHandlers = wsDescToHandlers_.size();
- String[] wsRefs = new String[sizeOfHandlers];
-
- String[] wsRefNames = (String[]) wsDescToHandlers_.keySet().toArray(new String[0]);
- webServiceDescCombo_.setItems(wsRefNames);
-
- if (sizeOfHandlers < 1) {
- webServiceDescCombo_.select(0);
- webServiceDescCombo_.setEnabled(false);
- }
- else {
- if (descriptionName_ != null) {
- int index = webServiceDescCombo_.indexOf(descriptionName_);
- if (index != -1) webServiceDescCombo_.select(index);
- }
- else
- webServiceDescCombo_.select(0);
- }
- // get webServiceRef hint
- String wsRef = webServiceDescCombo_.getText();
-
- if (wsDescToHandlers_.get(wsRef) != null) {
- orderedHandlers_ = (Vector) wsDescToHandlers_.get(wsRef);
- tableViewer_.setInput(orderedHandlers_);
- tableViewer_.refresh();
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
- /**
- * @return Returns the handlers.
- */
- public List getHandlersList() {
- // convert to a ArrayList and return as List
- List list = new ArrayList();
- if (orderedHandlers_ != null && !orderedHandlers_.isEmpty()) list.addAll(orderedHandlers_);
-
- return list;
- }
-
- public Hashtable getWsDescToHandlers() {
- return this.wsDescToHandlers_;
- }
-
- /**
- * @param handlers
- * The handlers to set.
- */
- public void setHandlers(HandlerTableItem[] handlers) {
- this.handlers = handlers;
- populateHandlersTable();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus()
- */
- public Status getStatus() {
- Status finalStatus = new SimpleStatus("");
-
- return finalStatus;
- }
-
- private void handleAddButtonSelected(SelectionEvent event) {
-
- String descName = webServiceDescCombo_.getText();
- WebServiceDescription serviceDesc = (WebServiceDescription) serviceDescNameToDescObj_.get(descName);
-
- AddHandlerDialog dialog = dialog = new AddHandlerDialog(parent_.getShell(), false);
- dialog.create();
-
- String[] portNames = getPortComponentNames(serviceDesc);
- dialog.setPortNames(portNames);
- dialog.getShell().setSize( 500, 200 );
-
- int result = dialog.open();
-
- if (result == Window.OK) {
- String name = dialog.getName();
- String className = dialog.getClassName();
- String port = dialog.getPortName();
-
- HandlerTableItem hi = new HandlerTableItem();
- hi.setHandlerName(name);
- hi.setHandlerClassName(className);
- hi.setPortName(port);
-
-
- hi.setWsDescRef(serviceDesc);
-
- orderedHandlers_ = (Vector) wsDescToHandlers_.get(descName);
- orderedHandlers_.add(hi);
-
- }
-
- refresh();
- }
-
- private String[] getPortComponentNames(WebServiceDescription webServiceDesc) {
-
- List ports = webServiceDesc.getPortComponents();
- if (ports!=null){
- String[] portNames = new String[ports.size()];
- for(int i=0;i<ports.size();i++){
- PortComponent pc = (PortComponent)ports.get(i);
- String pcName = pc.getPortComponentName();
- portNames[i] = pcName;
- }
- return portNames;
- }
- return new String[0];
- }
-
- private void handleRemoveButtonSelected(SelectionEvent event) {
- handleDeleteKeyPressed();
- }
-
- private void handleMoveUpButtonSelected(SelectionEvent event) {
-
- int index = tableViewer_.getTable().getSelectionIndex();
- ISelection selected = tableViewer_.getSelection();
- if (index != -1) {
- if (index > 0) {
- orderedHandlers_ = (Vector) wsDescToHandlers_.get(webServiceDescCombo_.getText());
- Object object = orderedHandlers_.remove(index);
- orderedHandlers_.insertElementAt(object, index - 1);
- tableViewer_.refresh();
- }
- }
-
- }
-
- private void handleMoveDownButtonSelected(SelectionEvent event) {
-
- int index = tableViewer_.getTable().getSelectionIndex();
- ISelection selected = tableViewer_.getSelection();
- if (index != -1) {
- if (index < orderedHandlers_.size() - 1) {
- orderedHandlers_ = (Vector) wsDescToHandlers_.get(webServiceDescCombo_.getText());
- Object object = orderedHandlers_.remove(index);
- orderedHandlers_.insertElementAt(object, index + 1);
- tableViewer_.refresh();
- }
- }
-
- }
-
- public void handleSourceLocationCombo(SelectionEvent event) {
- outputLocation_ = sourceLocationCombo_.getText();
- }
-
- public void handleGenSkeletonRadioButton() {
- if (genSkeletonRadioButton_.isEnabled()) {
- if (genSkeletonRadioButton_.getSelection())
- this.isGenSkeletonEnabled_ = true;
- else
- this.isGenSkeletonEnabled_ = false;
- }
- }
-
- public void handleWebServiceDescCombo(SelectionEvent event) {
-
- if (webServiceDescCombo_.isEnabled()) {
- String webServiceRefName = webServiceDescCombo_.getText();
- Vector hndlers = (Vector) wsDescToHandlers_.get(webServiceRefName);
- if (hndlers != null) {
- tableViewer_.setInput(hndlers);
- tableViewer_.refresh();
- }
- }
- }
-
- /**
- * @return Returns the isGenSkeletonEnabled_.
- */
- public boolean isGenSkeletonEnabled_() {
- return isGenSkeletonEnabled_;
- }
-
- protected class ListLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object object, int columnIndex) {
-
- if (object instanceof HandlerTableItem) {
- HandlerTableItem hti = (HandlerTableItem) object;
- if (columnIndex == 0) {
- return hti.getHandlerName() != null ? hti.getHandlerName() : "";
- }
- else if (columnIndex == 1) {
- return hti.getHandlerClassName() != null ? hti.getHandlerClassName() : "";
- }
- else {
- return hti.getPortName() != null ? hti.getPortName() : "";
- }
- }
- return null;
- }
-
- }
-
- private void enableRemove(boolean enabled) {
- removeButton_.setEnabled(enabled && !tableViewer_.getSelection().isEmpty());
- }
-
- protected class ListContentProvider implements IStructuredContentProvider {
-
- public Object[] getElements(Object element) {
- if (element instanceof Vector) { return ((Vector) element).toArray(); }
- return null;
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object old, Object newobj) {
- }
-
- public boolean isDeleted(Object object) {
- return false;
- }
- }
-
- private void handleDeleteKeyPressed() {
- //internalDispose();
- ISelection selection = tableViewer_.getSelection();
- if (selection != null && !selection.isEmpty() && (selection instanceof IStructuredSelection)) {
- int selectionIndex = handlersTable_.getSelectionIndex();
- int selectionCount = handlersTable_.getItemCount();
-
- orderedHandlers_ = (Vector) wsDescToHandlers_.get(webServiceDescCombo_.getText());
- orderedHandlers_.remove(selectionIndex);
- refresh();
- }
- }
-
- public void refresh() {
- try {
- tableViewer_.setInput(null);
- if (orderedHandlers_ != null) tableViewer_.setInput(orderedHandlers_);
- tableViewer_.refresh();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public void setGenSkeletonEnabled(boolean isGenSkeletonEnabled) {
- this.isGenSkeletonEnabled_ = isGenSkeletonEnabled;
- genSkeletonRadioButton_.setSelection(isGenSkeletonEnabled);
-
- }
-
- public boolean getGenSkeletonEnabled() {
- return this.isGenSkeletonEnabled_;
- }
-
- public void setSourceOutputLocation(IPath[] locations) {
- this.outputLocation_ = locations[0].toString();
-
- String[] paths = new String[locations.length];
- for (int i = 0; i < locations.length; i++) {
- paths[i] = locations[i].toString();
- pathsTable_.put(paths[i], locations[i]);
- }
- sourceLocationCombo_.setItems(paths);
- sourceLocationCombo_.select(0);
-
- }
-
- public IPath getSourceOutputLocation() {
- IPath outputPath = (IPath) pathsTable_.get(outputLocation_);
- return outputPath;
- }
-
- /**
- * @return Returns the handlerClassNames.
- */
- public String[] getHandlerClassNames() {
-
- Vector handlerClasses = new Vector();
- Enumeration e = wsDescToHandlers_.keys();
- while (e.hasMoreElements()) {
-
- String wsDescName = (String)e.nextElement();
- orderedHandlers_ = (Vector) wsDescToHandlers_.get(wsDescName);
-
- if (orderedHandlers_ != null) {
-
- for (int i = 0; i < orderedHandlers_.size(); i++) {
- HandlerTableItem hti = (HandlerTableItem) orderedHandlers_.get(i);
- handlerClasses.add(hti.getHandlerClassName());
- }
- }
- }
- return (String[])handlerClasses.toArray(new String[0]);
- }
-
- /**
- * @param wsDescToHandlersArray_
- * The wsDescToHandlersArray_ to set.
- */
- public void setWsRefsToHandlers(Hashtable wsDescToHandlersArray) {
-
- wsDescToHandlers_ = new Hashtable();
- wsDescToPorts_ = new Hashtable();
- try {
-
- if (wsDescToHandlersArray != null) {
- int sizeOfHandlers = wsDescToHandlersArray.size();
- String[] wsRefs = new String[sizeOfHandlers];
- // store the wsRefs
- Enumeration wsDesc = wsDescToHandlersArray.keys();
- while (wsDesc.hasMoreElements()) {
- String wsDescName = (String) wsDesc.nextElement();
-
- HandlerTableItem[] handlers = (HandlerTableItem[]) wsDescToHandlersArray.get(wsDescName);
- // process the handlersTable
- orderedHandlers_ = new Vector();
- HashSet portNameVector = new HashSet();
-
- for (int i = 0; i < handlers.length; i++) {
- orderedHandlers_.add(handlers[i]);
- String portName = handlers[i].getPortName();
- portNameVector.add(new String(portName));
- }
- wsDescToHandlers_.put(wsDescName, orderedHandlers_);
- wsDescToPorts_.put(wsDescName, (String[]) portNameVector.toArray(new String[0]));
- }
- }
- populateHandlersTable();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
- public void setDescriptionName(String wsDescName) {
- descriptionName_ = wsDescName;
- }
-
- public void setServiceDescNameToDescObj(Hashtable serviceDescNameToDescObj) {
- this.serviceDescNameToDescObj_ = serviceDescNameToDescObj;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/HandlersDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/HandlersDefaultingCommand.java
deleted file mode 100644
index a66b01d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/HandlersDefaultingCommand.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.internal.webservice.WebServiceNavigatorGroupType;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.wsdl.Service;
-
-
-/**
- * HandlersDefaultingCommand
- *
- * Determine if Handlers belongs to service or client side
- */
-public class HandlersDefaultingCommand extends AbstractHandlersWidgetDefaultingCmd {
-
- private MessageUtils msgUtils_;
-
- private boolean isClientHandler_ = false;
- private boolean isServiceHandler_ = false;
-
- public Status execute(Environment env) {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- Status status = new SimpleStatus("");
-
- IStructuredSelection selection = getInitialSelection();
- if (selection != null && selection.size() == 1) {
- Object obj = selection.getFirstElement();
-
- if (obj instanceof WebServiceNavigatorGroupType) {
- WebServiceNavigatorGroupType wsngt = (WebServiceNavigatorGroupType) obj;
- Service service = wsngt.getWsdlService();
- if (wsngt.getWsdlService()!=null){
- isServiceHandler_ = true;
- }
-
- if (wsngt.getServiceRef()!=null){
- isClientHandler_ = true;
- }
-
- }
- }
- else {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- return status;
-
- }
-
-
-/**
- * @return Returns the isClientHandler_.
- */
-public boolean getIsClientHandler() {
- return isClientHandler_;
-}
-/**
- * @return Returns the isServiceHandler_.
- */
-public boolean getIsServiceHandler() {
- return isServiceHandler_;
-}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ImportWSILWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ImportWSILWidget.java
deleted file mode 100644
index 6a56f47..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ImportWSILWidget.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef;
-import org.eclipse.jst.ws.internal.common.J2EEActionAdapterFactory;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.consumption.ui.wsil.Arguments;
-import org.eclipse.jst.ws.internal.consumption.ui.wsil.TableViewerEditor;
-import org.eclipse.jst.ws.internal.consumption.wsil.AddWSDLToWSILCommand;
-import org.eclipse.jst.ws.internal.ui.common.DialogResourceBrowser;
-import org.eclipse.jst.ws.internal.ui.common.FileExtensionFilter;
-import org.eclipse.swt.SWT;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-import org.eclipse.wst.wsdl.internal.impl.ServiceImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl;
-
-/**
-* Page for importing WSDL references into a WSIL in the workbench.
-*/
-public class ImportWSILWidget extends SimpleWidgetDataContributor
-{
- /*CONTEXT_ID WSIL0001 for the WSIL Import Page*/
- private final String INFOPOP_WSIL_IMPORT_PAGE = WebServiceConsumptionUIPlugin.ID + ".WSIL0001";
-
- /*CONTEXT_ID WSIL0002 for the WSIL text field*/
- private final String INFOPOP_WSIL_TEXT_WSIL = WebServiceConsumptionUIPlugin.ID + ".WSIL0002";
-
- /*CONTEXT_ID WSIL0003 for the WSIL browse button*/
- private final String INFOPOP_WSIL_BUTTON_BROWSE_WSIL = WebServiceConsumptionUIPlugin.ID + ".WSIL0003";
-
- /*CONTEXT_ID WSIL0004 for the WSDL table*/
- private final String INFOPOP_WSIL_TABLE_WSDL = WebServiceConsumptionUIPlugin.ID + ".WSIL0004";
-
- private final String INSPECTION_WSIL = "inspection.wsil";
-
- private Text wsil_;
- private Button browse_;
- private TableViewerEditor wsdls_;
-
- private MessageUtils msgUtils;
- private IStructuredSelection selection;
-
- /**
- * Constructs a new page.
- */
- public ImportWSILWidget()
- {
- msgUtils = new MessageUtils(WebServiceConsumptionUIPlugin.ID + ".plugin", this);
- //super(msgUtils.getMessage("PAGE_WSIL_IMPORT"), msgUtils.getMessage("TITLE_WSIL_IMPORT"), msgUtils.getMessage("DESC_WSIL_IMPORT"));
- }
-
- public WidgetDataEvents addControls(Composite parent, Listener statusListener)
- {
- parent.setToolTipText(msgUtils.getMessage("TOOLTIP_WSIL_IMPORT_PAGE"));
- WorkbenchHelp.setHelp(parent, INFOPOP_WSIL_IMPORT_PAGE);
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout();
- gl.numColumns = 3;
- composite.setLayout(gl);
- GridData gd = new GridData(GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_BEGINNING | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
- gd.grabExcessVerticalSpace = true;
- gd.grabExcessHorizontalSpace = true;
- composite.setLayoutData(gd);
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText(msgUtils.getMessage("LABEL_WSIL_URI"));
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
- wsil_ = new Text(composite, SWT.WRAP | SWT.SINGLE | SWT.BORDER);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- gd.widthHint = 256;
- wsil_.setLayoutData(gd);
- wsil_.addListener(SWT.Modify, statusListener);
- wsil_.setToolTipText(msgUtils.getMessage("TOOLTIP_WSIL_TEXT_WSIL"));
- WorkbenchHelp.setHelp(wsil_, INFOPOP_WSIL_TEXT_WSIL);
-
- browse_ = new Button(composite, SWT.PUSH);
- browse_.setText(msgUtils.getMessage("LABEL_BROWSE"));
- browse_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- browse_.addListener(SWT.Selection,
- new Listener()
- {
- public void handleEvent(Event event)
- {
- handleBrowseEvent(event);
- }
- }
- );
- browse_.setToolTipText(msgUtils.getMessage("TOOLTIP_WSIL_BUTTON_BROWSE_WSIL"));
- WorkbenchHelp.setHelp(browse_, INFOPOP_WSIL_BUTTON_BROWSE_WSIL);
-
- Composite wsdlComposite = new Composite(composite, SWT.NONE);
- wsdlComposite.setLayout(new GridLayout());
- gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 3;
- wsdlComposite.setLayoutData(gd);
- label = new Label(wsdlComposite, SWT.WRAP);
- label.setText(msgUtils.getMessage("LABEL_WSDL"));
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- String[] columns = {msgUtils.getMessage("LABEL_WSDL_URI")};
- wsdls_ = new TableViewerEditor(wsdlComposite, columns, new ArrayList(), "http://");
- wsdls_.setToolTipText(msgUtils.getMessage("TOOLTIP_WSIL_TABLE_WSDL"));
- wsdls_.setInfopop(INFOPOP_WSIL_TABLE_WSDL);
- return this;
- }
-
- private IResource[] getWSDLResources()
- {
- ArrayList list = new ArrayList();
- if (selection != null && !selection.isEmpty())
- {
- for (Iterator it = selection.iterator(); it.hasNext();)
- {
- Object object = it.next();
- if ((object instanceof IFile) && ((IFile)object).getFileExtension() != null && ((IFile)object).getFileExtension().equals("wsdl"))
- list.add(object);
- }
- }
- IResource[] res = new IResource[list.size()];
- for (int i = 0; i < res.length; i++)
- res[i] = (IResource)list.get(i);
- return res;
- }
-
- public void handleBrowseEvent(Event event)
- {
- DialogResourceBrowser dialog = new DialogResourceBrowser(browse_.getShell(), null, new FileExtensionFilter(new String[] {"wsil"}));
- dialog.open();
- IResource res = dialog.getFirstSelection();
- if (res != null)
- {
- if (res instanceof IFile)
- wsil_.setText(res.getFullPath().toString());
- else
- wsil_.setText(res.getFullPath().addTrailingSeparator().append(INSPECTION_WSIL).toString());
- }
- }
-
- public Status getStatus()
- {
- if (!wsil_.getText().endsWith(".wsil"))
- return new SimpleStatus("", msgUtils.getMessage("PAGE_MSG_INVALID_WSIL_FILE_NAME"), Status.ERROR);
- else
- return new SimpleStatus("");
- }
-
- public void setInitialSelection(IStructuredSelection selection)
- {
- this.selection = selection;
- ArrayList list = new ArrayList();
- if (selection != null && !selection.isEmpty())
- {
- for (Iterator it = selection.iterator(); it.hasNext();)
- {
- Object object = it.next();
- if ((object instanceof IFile) && ((IFile)object).getFileExtension() != null && ((IFile)object).getFileExtension().equals("wsdl"))
- list.add(((IFile)object).getFullPath().toString());
- if (object instanceof ServiceImpl)
- list.add(J2EEActionAdapterFactory.getWSILPath(((ServiceImpl)(object))));
- if (object instanceof ServiceRef)
- list.add(J2EEActionAdapterFactory.getWSILPath(((ServiceRef)(object))));
- if (object instanceof WSDLResourceImpl)
- list.add(J2EEActionAdapterFactory.getWSILPath(((WSDLResourceImpl)(object))));
- }
- }
- wsdls_.setInput(list);
- wsdls_.refresh();
- if (list.size() > 0)
- {
- StringBuffer path = new StringBuffer(list.get(0).toString());
- // change extension from .wsdl to .wsil
- int length = path.length();
- path = path.replace(length-4, length, "wsil");
- wsil_.setText(path.toString());
- }
- }
-
- public Arguments getGenWSILArguments()
- {
- Arguments args = new Arguments();
- String wsilPath = wsil_.getText();
- if (wsilPath.indexOf(':') < 0)
- args.add(AddWSDLToWSILCommand.ARG_WSIL, URI.createPlatformResourceURI(wsil_.getText()).toString());
- else
- args.add(AddWSDLToWSILCommand.ARG_WSIL, wsilPath);
- TableItem[] items = wsdls_.getItems();
- for (int i = 0; i < items.length; i++)
- {
- String uri = items[i].getText(0);
- if (uri.indexOf(':') < 0)
- {
- IResource res = ResourceUtils.findResource(uri);
- if (res != null)
- {
- try
- {
- uri = res.getLocation().toFile().toURL().toString();
- }
- catch (MalformedURLException murle)
- {
- murle.getMessage();
- }
- }
- }
- args.add(AddWSDLToWSILCommand.ARG_WSDL, uri);
- }
- args.add(AddWSDLToWSILCommand.ARG_RESOLVE_WSDL, null);
- return args;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/PreferencesSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/PreferencesSelectionWidget.java
deleted file mode 100644
index f108433..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/PreferencesSelectionWidget.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class PreferencesSelectionWidget extends SimpleWidgetDataContributor
-{
- private ResourceContext context_;
-
- /*CONTEXT_ID PWPR0003 for the Overwrite Files check box of the Project Page*/
- private String INFOPOP_PWPR_CHECKBOX_OVERWRITE_FILES = "PWPR0003";
- private Button overwriteFilesCheckbox_;
-
- /*CONTEXT_ID PWPR0004 for the Create Folders check box of the Project Page*/
- private String INFOPOP_PWPR_CHECKBOX_CREATE_FOLDERS = "PWPR0004";
- private Button createFoldersCheckbox_;
-
- /*CONTEXT_ID PWPR0015 for the Check Out Files check box of the Project Page*/
- private String INFOPOP_PWPR_CHECKBOX_CHECKOUT_FILES = "PWPR0015";
- private Button checkoutFilesCheckbox_;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#addControls(org.eclipse.swt.widgets.Composite, org.eclipse.swt.widgets.Listener)
- */
- public WidgetDataEvents addControls( Composite parent, Listener statusListener)
- {
- String pluginId = "org.eclipse.jst.ws.ui";
- String conPluginId = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId + ".plugin", this );
- UIUtils utils = new UIUtils( msgUtils, conPluginId );
-
- Composite resourcesGroup = utils.createComposite( parent, 1 );
-
- overwriteFilesCheckbox_ = utils.createCheckbox( resourcesGroup, "BUTTON_OVERWRITE_FILES",
- "TOOLTIP_PPRM_CHECKBOX_OVERWRITE_FILES",
- INFOPOP_PWPR_CHECKBOX_OVERWRITE_FILES );
-
- createFoldersCheckbox_ = utils.createCheckbox( resourcesGroup, "BUTTON_CREATE_FOLDERS",
- "TOOLTIP_PPRM_CHECKBOX_CREATE_FOLDERS" ,
- INFOPOP_PWPR_CHECKBOX_CREATE_FOLDERS );
-
- checkoutFilesCheckbox_ = utils.createCheckbox( resourcesGroup, "BUTTON_CHECKOUT_FILES",
- "TOOLTIP_PPRM_CHECKBOX_CHECK_OUT",
- INFOPOP_PWPR_CHECKBOX_CHECKOUT_FILES );
-
- return this;
- }
-
- public void setResourceContext( ResourceContext context )
- {
- overwriteFilesCheckbox_.setSelection( context.isOverwriteFilesEnabled() );
- createFoldersCheckbox_.setSelection( context.isCreateFoldersEnabled() );
- checkoutFilesCheckbox_.setSelection( context.isCheckoutFilesEnabled() );
-
- context_ = context;
- }
-
- public ResourceContext getResourceContext()
- {
- context_.setOverwriteFilesEnabled( overwriteFilesCheckbox_.getSelection() );
- context_.setCreateFoldersEnabled( createFoldersCheckbox_.getSelection() );
- context_.setCheckoutFilesEnabled( checkoutFilesCheckbox_.getSelection() );
-
- return context_;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/PublishToPrivateUDDICommandFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/PublishToPrivateUDDICommandFragment.java
deleted file mode 100644
index 5c761a5..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/PublishToPrivateUDDICommandFragment.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.PrivateUDDIRegistryTypeRegistry;
-import org.eclipse.wst.command.env.core.CommandFactory;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.AbstractCommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class PublishToPrivateUDDICommandFragment extends AbstractCommandFragment
-{
- private DataMappingRegistry dataMappingRegistry;
- private CanFinishRegistry canFinishRegistry;
- private WidgetRegistry widgetRegistry;
- private boolean publishToPrivateUDDI;
- private CommandWidgetBinding privateUDDIBinding;
-
- public PublishToPrivateUDDICommandFragment()
- {
- super((CommandFactory)null, "");
- privateUDDIBinding = PrivateUDDIRegistryTypeRegistry.getInstance().getPrivateUDDIRegistryType().getBinding();
- }
-
- /**
- * Gets the first child fragment for this fragment.
- *
- * @return returns the first child fragment for this fragment. Returns
- * null when there is no first child.
- **/
- public CommandFragment getFirstSubFragment()
- {
- if (privateUDDIBinding != null && publishToPrivateUDDI && !PrivateUDDIRegistryTypeRegistry.getInstance().getPrivateUDDIRegistryType().isPrivateUDDIRegistryInstalled())
- {
- privateUDDIBinding.registerCanFinish(canFinishRegistry);
- privateUDDIBinding.registerDataMappings(dataMappingRegistry);
- privateUDDIBinding.registerWidgetMappings(widgetRegistry);
- return privateUDDIBinding.create().create();
- }
- else
- return null;
- }
-
- /**
- * Gets the next child fragment for this fragment.
- *
- * @return returns the next child fragment for this fragment. Returns null
- * when there is no next child.
- **/
- public CommandFragment getNextSubFragment(CommandFragment fragment)
- {
- return null;
- }
-
- /*
- * This method is called to retrieve the data mappings for this command fragment.
- */
- public void registerDataMappings(DataMappingRegistry registry)
- {
- dataMappingRegistry = registry;
- }
-
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- this.canFinishRegistry = canFinishRegistry;
- }
-
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- this.widgetRegistry = widgetRegistry;
- }
-
- /**
- * All wizard fragments need to be cloneable.
- **/
- public Object clone()
- {
- PublishToPrivateUDDICommandFragment fragment = new PublishToPrivateUDDICommandFragment();
- fragment.registerDataMappings(dataMappingRegistry);
- fragment.registerCanFinish(canFinishRegistry);
- fragment.registerWidgetMappings(widgetRegistry);
- fragment.setPublishToPrivateUDDI(publishToPrivateUDDI);
- return fragment;
- }
-
- public void setPublishToPrivateUDDI(boolean publish)
- {
- publishToPrivateUDDI = publish;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/PublishWSWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/PublishWSWidget.java
deleted file mode 100644
index a175fa8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/PublishWSWidget.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import java.util.Vector;
-
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.PrivateUDDIRegistryTypeRegistry;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.PublicUDDIRegistryTypeRegistry;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryType;
-import org.eclipse.jst.ws.internal.ui.uddi.PrivateUDDIRegistryType;
-import org.eclipse.jst.ws.internal.ui.wse.LaunchOption;
-import org.eclipse.jst.ws.internal.ui.wse.WSExplorerType;
-import org.eclipse.swt.SWT;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class PublishWSWidget extends SimpleWidgetDataContributor
-{
- /* CONTEXT_ID PWPB0001 for the UDDI Publish Page */
- private String INFOPOP_PWPB_PAGE = WebServiceConsumptionUIPlugin.ID + ".PWPB0001";
- /* CONTEXT_ID PWPB0002 for the UDDI Launch check box of the UDDI Publish Page */
- private String INFOPOP_PWPB_CHECKBOX_WS_LAUNCH = WebServiceConsumptionUIPlugin.ID + ".PWPB0002";
- private Button launchUDDICheckbox_;
- private Button launchPrivateUDDICheckbox_;
- private Label pubilcUDDIRegComboLabel_;
- private Combo publicUDDIRegCombo_;
- private MessageUtils msgUtils;
- private Listener statusListener;
- private Boolean publish;
-
- public PublishWSWidget(boolean publish)
- {
- msgUtils = new MessageUtils(WebServiceConsumptionUIPlugin.ID + ".plugin", this);
- this.publish = new Boolean(publish);
- }
-
- public WidgetDataEvents addControls(Composite parent, Listener statusListener)
- {
- this.statusListener = statusListener;
- Listener selListener = new Listener()
- {
- public void handleEvent(Event event)
- {
- handleSelectionEvent(event);
- }
- };
- parent.setToolTipText(msgUtils.getMessage("TOOLTIP_PWPB_PAGE"));
- WorkbenchHelp.setHelp(parent, INFOPOP_PWPB_PAGE);
- launchPrivateUDDICheckbox_ = new Button(parent, SWT.CHECK);
- if (publish.booleanValue())
- launchPrivateUDDICheckbox_.setText(msgUtils.getMessage("BUTTON_WS_PUBLISH_PRIVATE_UDDI"));
- else
- launchPrivateUDDICheckbox_.setText(msgUtils.getMessage("BUTTON_WS_FIND_PRIVATE_UDDI"));
- launchPrivateUDDICheckbox_.setToolTipText(msgUtils.getMessage("TOOLTIP_PWPB_CHECKBOX_WS_LAUNCH"));
- launchPrivateUDDICheckbox_.addListener(SWT.Selection, selListener);
- WorkbenchHelp.setHelp(launchPrivateUDDICheckbox_, INFOPOP_PWPB_CHECKBOX_WS_LAUNCH);
- launchUDDICheckbox_ = new Button(parent, SWT.CHECK);
- if (publish.booleanValue())
- launchUDDICheckbox_.setText(msgUtils.getMessage("BUTTON_WS_PUBLISH"));
- else
- launchUDDICheckbox_.setText(msgUtils.getMessage("BUTTON_WS_FIND"));
- launchUDDICheckbox_.setToolTipText(msgUtils.getMessage("TOOLTIP_PWPB_CHECKBOX_WS_LAUNCH"));
- launchUDDICheckbox_.addListener(SWT.Selection, selListener);
- WorkbenchHelp.setHelp(launchUDDICheckbox_, INFOPOP_PWPB_CHECKBOX_WS_LAUNCH);
- Composite c = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout();
- gl.numColumns = 3;
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- c.setLayout(gl);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- c.setLayoutData(gd);
- new Label(c, SWT.WRAP);
- pubilcUDDIRegComboLabel_ = new Label(c, SWT.WRAP);
- pubilcUDDIRegComboLabel_.setText(msgUtils.getMessage("LABEL_PUBLIC_UDDI_REGISTRIES"));
- publicUDDIRegCombo_ = new Combo(c, SWT.DROP_DOWN | SWT.READ_ONLY);
- publicUDDIRegCombo_.setEnabled(false);
- initPublicUDDI();
- initPrivateUDDI();
- return this;
- }
-
- private void initPublicUDDI()
- {
- PublicUDDIRegistryTypeRegistry reg = PublicUDDIRegistryTypeRegistry.getInstance();
- PublicUDDIRegistryType[] types = reg.getAllPublicUDDIRegistryTypes();
- for (int i = 0; i < types.length; i++)
- {
- if (publish.booleanValue())
- {
- // Ignore read-only registries.
- String publishURL = types[i].getPublishURL();
- if (publishURL == null || publishURL.indexOf("://") == -1)
- continue;
- }
- publicUDDIRegCombo_.add(types[i].getName());
- }
- if (types.length > 0)
- publicUDDIRegCombo_.setText(publicUDDIRegCombo_.getItem(0));
- }
-
- private void initPrivateUDDI()
- {
- if (!publish.booleanValue() && !PrivateUDDIRegistryTypeRegistry.getInstance().getPrivateUDDIRegistryType().isPrivateUDDIRegistryInstalled())
- launchPrivateUDDICheckbox_.setEnabled(false);
- }
-
- private void handleSelectionEvent(Event event)
- {
- if (launchUDDICheckbox_ == event.widget)
- publicUDDIRegCombo_.setEnabled(launchUDDICheckbox_.getSelection());
- statusListener.handleEvent(event);
- }
-
- public void setPublishToPublicUDDI(boolean publish)
- {
- launchUDDICheckbox_.setSelection(publish);
- publicUDDIRegCombo_.setEnabled(publish);
- }
-
- public void setPublishToPublicUDDI(Boolean publish)
- {
- setPublishToPublicUDDI(publish.booleanValue());
- }
-
- public void setPublishToPrivateUDDI(boolean publish)
- {
- launchPrivateUDDICheckbox_.setSelection(publish);
- }
-
- public void setPublishToPrivateUDDI(Boolean publish)
- {
- setPublishToPrivateUDDI(publish.booleanValue());
- }
-
- public boolean getPublishToPublicUDDI()
- {
- return launchUDDICheckbox_.getSelection();
- }
-
- public boolean getPublishToPrivateUDDI()
- {
- return launchPrivateUDDICheckbox_.getSelection();
- }
-
- public boolean getForceLaunchOutsideIDE()
- {
- return false;
- }
-
- public LaunchOption[] getLaunchOptions()
- {
- Vector launchOptionVector = new Vector();
- if (launchUDDICheckbox_.getSelection())
- {
- PublicUDDIRegistryTypeRegistry reg = PublicUDDIRegistryTypeRegistry.getInstance();
- int UDDIRegSelectionIndex = publicUDDIRegCombo_.getSelectionIndex();
- if (UDDIRegSelectionIndex != -1)
- {
- String name = publicUDDIRegCombo_.getItem(UDDIRegSelectionIndex);
- String id = reg.getPublicUDDIRegistryTypeIDByName(name);
- PublicUDDIRegistryType type = reg.getPublicUDDIRegistryTypeByID(id);
- launchOptionVector.add(new LaunchOption(WSExplorerType.INQUIRY_URL, type.getInquiryURL()));
- launchOptionVector.add(new LaunchOption(WSExplorerType.PUBLISH_URL, type.getPublishURL()));
- }
- }
- if (launchPrivateUDDICheckbox_.getSelection())
- {
- PrivateUDDIRegistryTypeRegistry privateReg = PrivateUDDIRegistryTypeRegistry.getInstance();
- PrivateUDDIRegistryType privateType = privateReg.getPrivateUDDIRegistryType();
- String[] privateInquiryURL = privateType.getPrivateUDDIRegistryInquiryAPI();
- String[] privatePublishURL = privateType.getPrivateUDDIRegistryPublishAPI();
- for (int i = 0; i < privateInquiryURL.length; i++)
- {
- launchOptionVector.add(new LaunchOption(WSExplorerType.INQUIRY_URL, privateInquiryURL[i]));
- launchOptionVector.add(new LaunchOption(WSExplorerType.PUBLISH_URL, privatePublishURL[i]));
- }
- }
- return (LaunchOption[]) launchOptionVector.toArray(new LaunchOption[0]);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetDefaultingCommand.java
deleted file mode 100644
index c54dcb4..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetDefaultingCommand.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.internal.webservice.WebServiceNavigatorGroupType;
-import org.eclipse.jst.j2ee.internal.webservices.WebServiceEditModel;
-import org.eclipse.jst.j2ee.internal.webservices.WebServicesManager;
-import org.eclipse.jst.j2ee.webservice.wsdd.Handler;
-import org.eclipse.jst.j2ee.webservice.wsdd.PortComponent;
-import org.eclipse.jst.j2ee.webservice.wsdd.WebServiceDescription;
-import org.eclipse.jst.j2ee.webservice.wsdd.WebServices;
-import org.eclipse.jst.j2ee.webservice.wsdd.WsddResource;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.HandlerTableItem;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.internal.impl.ServiceImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl;
-
-import com.ibm.wtp.emf.workbench.ProjectUtilities;
-
-/**
- * ServiceHandlersWidgetDefaultingCommand
- *
- * Initialize and load the handlers data
- */
-public class ServiceHandlersWidgetDefaultingCommand extends AbstractHandlersWidgetDefaultingCmd {
-
- private HandlerTableItem[] handlers_;
- private MessageUtils msgUtils_;
- private boolean isGenSkeletonEnabled_;
- private IPath sourceOutputLocation_;
- private WebServiceDescription wsDescription_;
- private WsddResource wsddResource_;
- private WebServicesManager webServicesManager_;
- private IProject project_;
- private Hashtable wsDescToHandlers_;
- private Hashtable serviceDescNameToDescObj_;
- private String descriptionName_ = null;
-
- public Status execute(Environment env) {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- Status status = new SimpleStatus("");
-
- webServicesManager_ = new WebServicesManager();
- IStructuredSelection selection = getInitialSelection();
- if (selection == null) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- status = processHandlers(env);
- return status;
-
- }
-
- public Status processHandlers(Environment env) {
- try {
- Vector handlers = new Vector();
- wsDescToHandlers_ = new Hashtable();
- serviceDescNameToDescObj_ = new Hashtable();
-
- WebServiceEditModel wsed = getWebServiceEditModel();
- if (wsed == null)
- wsddResource_ = getWsddResourceFromSelection();
- else
- wsddResource_ = wsed.getWebServicesXmlResource();
-
- if (wsddResource_ == null) {
- Status status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- WebServices webServices = wsddResource_.getWebServices();
- if (webServices != null) {
- List wsDescriptions = wsddResource_.getWebServices().getWebServiceDescriptions();
- for (int i = 0; i < wsDescriptions.size(); i++) {
-
- wsDescription_ = (WebServiceDescription) wsDescriptions.get(i);
-
- List wsPortComponents = wsDescription_.getPortComponents();
- for (int j = 0; j < wsPortComponents.size(); j++) {
- PortComponent wsPort = (PortComponent) wsPortComponents.get(j);
- String portName = wsPort.getPortComponentName();
- List wsHandlers = wsPort.getHandlers();
- HandlerTableItem[] handlerItems = new HandlerTableItem[wsHandlers.size()];
- for (int k = 0; k < wsHandlers.size(); k++) {
-
- Handler wsHandler = (Handler) wsHandlers.get(k);
-
- HandlerTableItem handlerItem = new HandlerTableItem();
- handlerItem.setHandler(wsHandler);
- handlerItem.setHandlerName(wsHandler.getHandlerName());
- handlerItem.setHandlerClassName(wsHandler.getHandlerClass());
- handlerItem.setPort(wsPort);
- handlerItem.setPortName(portName);
- handlerItem.setWsDescRef(wsDescription_);
- handlerItems[k] = handlerItem;
-
- handlers.add(handlerItem);
- }
- String wsDescName = wsDescription_.getWebServiceDescriptionName();
- wsDescToHandlers_.put(wsDescName, handlerItems);
- serviceDescNameToDescObj_.put(wsDescName, wsDescription_);
-
- }
-
- }
-
- handlers_ = (HandlerTableItem[]) handlers.toArray(new HandlerTableItem[0]);
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED"), Status.ERROR, e);
- }
- return new SimpleStatus("");
- }
-
- public HandlerTableItem[] getHandlers() {
- return this.handlers_;
- }
-
- /**
- * @return Returns the isGenSkeletonEnabled_.
- */
- public boolean getGenSkeletonEnabled() {
- return true;
- }
-
- /**
- * @return Returns the sourceOutputLocation_.
- */
- public IPath[] getSourceOutputLocation() {
- IPath[] locations = null;
- IProject project = getProject();
-
- if (project != null) {
- locations = ResourceUtils.getAllJavaSourceLocations(project);
- }
- else {
- project = project_;
- if (project != null) {
- locations = ResourceUtils.getAllJavaSourceLocations(project);
- }
- }
- return locations;
- }
-
- public WsddResource getWsddResource() {
- return wsddResource_;
- }
-
- private WsddResource getWsddResourceFromSelection() {
- IStructuredSelection initSel = getInitialSelection();
- if (initSel != null && initSel.size() == 1) {
- Object obj = initSel.getFirstElement();
- if (obj instanceof ServiceImpl) {
- // Service object
- Service service = (Service) obj;
- descriptionName_ = service.getQName().getLocalPart();
- project_ = ProjectUtilities.getProject(service);
- return webServicesManager_.getWsddResource(service);
- }
- else if (obj instanceof WSDLResourceImpl) {
- // WSDL resource
- WSDLResourceImpl res = (WSDLResourceImpl) obj;
- project_ = ProjectUtilities.getProject(res);
- List wsdlResources = webServicesManager_.getWSDLServices(res);
- return webServicesManager_.getWsddResource((Service) wsdlResources.get(0));
- }
- else if (obj instanceof WebServiceNavigatorGroupType) {
- WebServiceNavigatorGroupType wsngt = (WebServiceNavigatorGroupType) obj;
- Service service = wsngt.getWsdlService();
- descriptionName_ = service.getQName().getLocalPart();
- project_ = ProjectUtilities.getProject(service);
- return webServicesManager_.getWsddResource(service);
- }
- }
-
- return null;
-
- }
-
- /**
- * @deprecated
- */
- public WebServiceDescription getWsDescription() {
- return wsDescription_;
- }
-
- public String getDescriptionName(){
- return descriptionName_;
- }
-
- public Hashtable getWsRefsToHandlers(){
- return wsDescToHandlers_;
- }
-
- public Hashtable getServiceDescNameToDescObj(){
- return this.serviceDescNameToDescObj_;
- }
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetOutputCommand.java
deleted file mode 100644
index 257ca44..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/ServiceHandlersWidgetOutputCommand.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.eclipse.jst.j2ee.webservice.wsdd.Handler;
-import org.eclipse.jst.j2ee.webservice.wsdd.PortComponent;
-import org.eclipse.jst.j2ee.webservice.wsdd.WebServiceDescription;
-import org.eclipse.jst.j2ee.webservice.wsdd.WsddFactory;
-import org.eclipse.jst.j2ee.webservice.wsdd.WsddResource;
-import org.eclipse.jst.j2ee.webservice.wsdd.impl.WsddFactoryImpl;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.HandlerTableItem;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.common.emf.utilities.EtoolsCopyUtility;
-
-/*
- * Provide a way to externalize the edited fields and create new handlers
- *
- */
-public class ServiceHandlersWidgetOutputCommand extends SimpleCommand {
-
- private List handlerTableItems;
- private WebServiceDescription wsDescription_;
- private WsddResource wsddResource_;
- private Hashtable wsDescToHandlers_;
- private Hashtable serviceDescNameToDescObj_;
-
- public Status execute(Environment env) {
-
- Status status = new SimpleStatus("");
- try {
- Enumeration e = wsDescToHandlers_.keys();
- while (e.hasMoreElements()) {
-
- Hashtable wsPortsTable = new Hashtable();
- Hashtable wsPortToHandlerTable = new Hashtable();
-
- String serviceDescName = (String) e.nextElement();
- // load PortName -> PortComponent table
- WebServiceDescription wsDescription_ = (WebServiceDescription) serviceDescNameToDescObj_.get(serviceDescName);
- if (wsDescription_ != null) {
-
- List wsPorts = wsDescription_.getPortComponents();
- for (int k = 0; k < wsPorts.size(); k++) {
- PortComponent port = (PortComponent) wsPorts.get(k);
- wsPortsTable.put(port.getPortComponentName(), port);
- wsPortToHandlerTable.put(port.getPortComponentName(), new ArrayList());
- }
- }
-
- List handlerTableItems = (List) wsDescToHandlers_.get(serviceDescName);
- if (handlerTableItems != null) {
-
- WsddFactory wsddFactory = new WsddFactoryImpl();
-
- //form port components tables first
- for (int i = 0; i < handlerTableItems.size(); i++) {
-
- HandlerTableItem hti = (HandlerTableItem) handlerTableItems.get(i);
- PortComponent wsPort = (PortComponent) hti.getPort();
- if (wsPort == null) {
- //find it
- if (wsPortsTable.get(hti.getPortName()) != null)
- wsPort = (PortComponent) wsPortsTable.get(hti.getPortName());
- else {
- // create it; should not get into here
- wsPort = wsddFactory.createPortComponent();
- wsPort.setPortComponentName(hti.getPortName());
- wsPortsTable.put(wsPort.getPortComponentName(), wsPort);
- }
- }
- wsPortToHandlerTable.put(wsPort.getPortComponentName(), new ArrayList());
- }
-
- // form Handler and ports table
- for (int i = 0; i < handlerTableItems.size(); i++) {
-
- HandlerTableItem hti = (HandlerTableItem) handlerTableItems.get(i);
- String portName = hti.getPortName();
-
- PortComponent port = (PortComponent) wsPortsTable.get(portName);
- if (port == null) return status;
-
- List existingHandlers = port.getHandlers();
-
- Object handler = hti.getHandler();
- if (!existingHandlers.contains(handler)) {
- // create it
- Handler newHandler = wsddFactory.createHandler();
- newHandler.setHandlerName(hti.getHandlerName());
- newHandler.setHandlerClass(hti.getHandlerClassName());
- ((List) wsPortToHandlerTable.get(portName)).add(newHandler);
-
- }
- else if (handler instanceof Handler) {
- // clone it
- EtoolsCopyUtility copyUtil = new EtoolsCopyUtility();
- copyUtil.setCopyAdapters(true);
- Handler clonedHandler = (Handler) copyUtil.copy((Handler) handler);
- ((List) wsPortToHandlerTable.get(portName)).add(clonedHandler);
- }
- }
-
- }
-
- // remove existing handlers from ports
- removeExistingHandlers(wsPortsTable, wsPortToHandlerTable);
-
- // add ports to wsDescription
- addPortsToDescriptions(wsPortsTable, wsDescription_);
-
- // add handlers to ports
- addHandlersToPorts(wsPortsTable, wsPortToHandlerTable);
- }
- if (wsddResource_ != null) {
- wsddResource_.save(new HashMap());
- }
-
- }
- catch (Exception e) {
- //status = new
- e.printStackTrace();
- }
- return status;
- }
-
- private void removeExistingHandlers(Hashtable portsTable, Hashtable portsToHandlersTable) {
- try {
- int key = 0;
- Enumeration ports = portsToHandlersTable.keys();
- while (ports.hasMoreElements()) {
- String portName = (String) ports.nextElement();
- Object port = portsTable.get(portName);
- if (port != null && port instanceof PortComponent) {
- List handlers = ((PortComponent) port).getHandlers();
- handlers.clear();
- }
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void addPortsToDescriptions(Hashtable portsTable, WebServiceDescription wsDescription_) {
- try {
- Enumeration ports = portsTable.keys();
- while (ports.hasMoreElements()) {
- String portName = (String) ports.nextElement();
- // newly edited port
- Object port = portsTable.get(portName);
-
- // existing port
- List emfPorts = wsDescription_.getPortComponents();
- if (!emfPorts.contains(port) && port != null && port instanceof PortComponent) {
- emfPorts.add((PortComponent) port);
- }
- }
- }
-
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void addHandlersToPorts(Hashtable portsTable, Hashtable portsToHandlersTable) {
- try {
- int key = 0;
- Enumeration ports = portsToHandlersTable.keys();
- while (ports.hasMoreElements()) {
- String portName = (String) ports.nextElement();
- Object port = portsTable.get(portName);
- if (port != null && port instanceof PortComponent) {
- List handlers = (List) portsToHandlersTable.get(portName);
-
- List modelHandlers = ((PortComponent) port).getHandlers();
- modelHandlers.addAll(handlers);
- }
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @param handlerTableItems
- * The handlerTableItems to set.
- */
- public void setHandlersList(List handlerTableItems) {
- this.handlerTableItems = handlerTableItems;
- }
-
- public void setWsDescToHandlers(Hashtable wsDescToHandlers) {
- this.wsDescToHandlers_ = wsDescToHandlers;
- }
-
-// public void setWsDescription(WebServiceDescription wsDesc) {
-// this.wsDescription_ = wsDesc;
-// }
-
- public void setWsddResource(WsddResource wsddRes) {
- this.wsddResource_ = wsddRes;
- }
-
- public void setServiceDescNameToDescObj(Hashtable serviceDescNameToDescObj) {
- this.serviceDescNameToDescObj_ = serviceDescNameToDescObj;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/TableViewerWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/TableViewerWidget.java
deleted file mode 100644
index c4d8144..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/TableViewerWidget.java
+++ /dev/null
@@ -1,619 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.common.PropertiesResourceFilter;
-import org.eclipse.jst.ws.internal.ui.dialog.DialogUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.TableEditor;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-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.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class TableViewerWidget extends SimpleWidgetDataContributor
-{
- private int DEFAULT_TABLE_HEIGHT_HINT = 100;
- private int DEFAULT_COLUMN_WIDTH = 80;
-
- public static byte MAP_ONE_TO_ONE = 3;
- public static byte MAP_MANY_TO_ONE = 1;
- public static byte MAP_MANY_TO_MANY = 0;
-
- private String[] columns_;
- private TableViewer tableViewer_;
- private Table table_;
- private TableEditor editor_;
- private TableEditorListener tableEditorListener_;
- private Text text_;
- private Button import_;
- private Button add_;
- private Button remove_;
-
- private Composite parent_;
- private Listener statusListener_;
-
- private String message = null;
- private byte rescriction = MAP_MANY_TO_MANY;
-
- private List values_;
- private Object defaultValue_;
-
- private PropertiesResourceFilter filter_ = new PropertiesResourceFilter();
-
- public TableViewerWidget(String[] columns, List initValues, Object defaultValue, byte rescriction)
- {
- columns_ = columns;
- values_ = new ArrayList();
- if (initValues != null && initValues.size() > 0)
- values_.addAll(initValues);
- defaultValue_ = (defaultValue != null) ? defaultValue : new String("");
- this.rescriction = rescriction;
- }
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- parent_ = parent;
- statusListener_ = statusListener;
-
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId + ".plugin", this );
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout();
-
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- composite.setLayout(gl);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- table_ = new Table(composite, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = DEFAULT_TABLE_HEIGHT_HINT;
- table_.setLayoutData(gd);
- table_.setHeaderVisible(true);
- table_.setLinesVisible(true);
- TableLayout tableLayout = new TableLayout();
- int maxWidth = DEFAULT_COLUMN_WIDTH;
- for (int i = 0; i < columns_.length; i++)
- {
- TableColumn tableColumn = new TableColumn(table_, SWT.NONE);
- tableColumn.setText(columns_[i]);
- tableColumn.pack();
- int tableColumnWidth = Math.max(DEFAULT_COLUMN_WIDTH, tableColumn.getWidth());
- maxWidth = Math.max(maxWidth, tableColumnWidth);
- ColumnWeightData columnData = new ColumnWeightData(tableColumnWidth, tableColumnWidth, true);
- tableLayout.addColumnData(columnData);
- }
- table_.setLayout(tableLayout);
- // initialize the table editor
- editor_ = new TableEditor(table_);
- // The editor must have the same size as the cell and must
- // not be any smaller than 50 pixels.
- editor_.horizontalAlignment = SWT.LEFT;
- editor_.grabHorizontal = true;
- editor_.minimumWidth = maxWidth;
- tableEditorListener_ = new TableEditorListener();
- table_.addMouseListener(tableEditorListener_);
- tableViewer_ = new TableViewer(table_);
- tableViewer_.getControl().addKeyListener(
- new KeyListener()
- {
- public void keyPressed(KeyEvent e)
- {
- int asciiDel = (int)e.character;
- // Del
- if (asciiDel == 127)
- handleDeleteKeyPressed();
- // Enter or space
- if (((int)e.character) == 13 || ((int)e.character) == 32)
- tableEditorListener_.editSelection();
- }
- public void keyReleased(KeyEvent e)
- {
- }
- }
- );
- tableViewer_.setContentProvider(new ListContentProvider());
- tableViewer_.setLabelProvider(new ListLabelProvider());
- tableViewer_.setInput(values_);
- tableViewer_.addSelectionChangedListener(
- new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- enableRemove(true);
- }
- }
- );
-
- Composite buttonComposite = new Composite(composite, SWT.NONE);
- gl = new GridLayout();
- gl.numColumns = 3;
- gl.makeColumnsEqualWidth = true;
- buttonComposite.setLayout(gl);
- buttonComposite.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- import_ = new Button(buttonComposite, SWT.PUSH);
- import_.setText(msgUtils.getMessage("LABEL_IMPORT"));
- import_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- import_.addSelectionListener(
- new SelectionListener()
- {
- public void widgetSelected(SelectionEvent event)
- {
- handleImportButtonSelected(event);
- }
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
- }
- );
-
- add_ = new Button(buttonComposite, SWT.PUSH);
- add_.setText(msgUtils.getMessage("LABEL_ADD"));
- add_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- add_.addSelectionListener(
- new SelectionListener()
- {
- public void widgetSelected(SelectionEvent event)
- {
- handleAddButtonSelected(event);
- }
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
- }
- );
-
-
- remove_ = new Button(buttonComposite, SWT.PUSH);
- remove_.setText(msgUtils.getMessage("LABEL_REMOVE"));
- remove_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- remove_.addSelectionListener(
- new SelectionListener()
- {
- public void widgetSelected(SelectionEvent event)
- {
- handleRemoveButtonSelected(event);
- }
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
- }
- );
- enableRemove(false);
-
- return this;
- }
-
- private void enableRemove(boolean enabled)
- {
- remove_.setEnabled(enabled && !tableViewer_.getSelection().isEmpty());
- }
-
- private void handleImportButtonSelected(SelectionEvent event)
- {
- IResource resource = DialogUtils.browseResources(
- parent_.getShell(),
- ResourceUtils.getWorkspaceRoot(),
- null,
- filter_
- );
- if (resource != null && resource instanceof IFile)
- {
- try
- {
- Properties props = new Properties();
- props.load(((IFile)resource).getContents());
- Set set = props.entrySet();
- java.util.List list = new LinkedList();
- Iterator i = set.iterator();
- while (i.hasNext())
- {
- Map.Entry me = (Map.Entry)i.next();
- String key = (String)me.getKey();
- String val = (String)me.getValue();
- list.add(new String[] {key,val});
- }
- values_.addAll(list);
- }
- catch (Exception e)
- {
- // TODO Report some error here.
- }
- }
- refresh();
- }
-
- private void handleAddButtonSelected(SelectionEvent event)
- {
- values_.add(defaultValue_);
- refresh();
- setSelectionAsObject(values_.get(table_.getItemCount()-1));
- tableEditorListener_.editSelection();
- }
-
- private void handleRemoveButtonSelected(SelectionEvent event)
- {
- handleDeleteKeyPressed();
- }
-
- private void handleDeleteKeyPressed()
- {
- internalDispose();
- ISelection selection = tableViewer_.getSelection();
- if (selection != null && !selection.isEmpty() && (selection instanceof IStructuredSelection))
- {
- int selectionIndex = table_.getSelectionIndex();
- int selectionCount = table_.getItemCount();
- values_.remove(selectionIndex);
- if (selectionIndex < selectionCount-1)
- setSelectionAsObject(values_.get(selectionIndex));
- else if (selectionCount -2 >= 0)
- setSelectionAsObject(values_.get(selectionCount-2));
- refresh();
- }
- }
-
- private void internalRefresh()
- {
- // synchronize text field, previously selected table cell and model (inputObject)
- if (text_ != null)
- {
- TableItem oldTableItem = editor_.getItem();
- int oldColumnIndex = editor_.getColumn();
- if (oldTableItem != null && oldColumnIndex >= 0 && oldColumnIndex < columns_.length)
- {
- String oldText = text_.getText();
- oldTableItem.setText(oldColumnIndex, oldText);
- int oldRowIndex = table_.indexOf(oldTableItem);
- values_.set(oldRowIndex, new String[] {oldTableItem.getText(0), oldTableItem.getText(1)});
- }
- }
- checkMappingConstraints();
- statusListener_.handleEvent( null );
- }
-
- private void checkMappingConstraints() {
-
- HashMap map = new HashMap();
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId + ".plugin", this );
-
- for(int cnt=0; cnt<values_.size(); cnt++){
- String[] value = (String[])values_.get(cnt);
- if(map.containsKey(value[0]) && ((rescriction & 1)!=0)){
- message = msgUtils.getMessage("MSG_MAPPING_DUPLICATE_ENTRIES", new String[]{columns_[0],columns_[1]});
- return;
- }
- if(map.containsValue(value[1]) && ((rescriction & 2)!=0)){
- message = msgUtils.getMessage("MSG_MAPPING_DUPLICATE_ENTRIES", new String[]{columns_[1],columns_[0]});
- return;
- }
- map.put(value[0],value[1]);
-
- }
- message = null;
-
- }
-
- public Status getStatus()
- {
- return message == null ? new SimpleStatus("") :
- new SimpleStatus( "", message, Status.ERROR );
- }
-
- private void setSelectionAsObject(Object object)
- {
- tableViewer_.setSelection(new StructuredSelection(object), true);
- }
-
- public void refresh()
- {
- internalRefresh();
- tableViewer_.refresh();
- }
-
- public TableItem[] getItems()
- {
- //internalRefresh();
- return table_.getItems();
- }
-
- public void setEnabled(boolean enabled)
- {
- add_.setEnabled(enabled);
- enableRemove(enabled);
- }
-
- public void dispose()
- {
- internalDispose();
- if (editor_ != null)
- editor_.dispose();
- if (table_ != null)
- table_.dispose();
- if (add_ != null)
- add_.dispose();
- if (remove_ != null)
- remove_.dispose();
- }
-
- private void internalDispose()
- {
- if (text_ != null)
- text_.dispose();
- text_ = null;
- }
-
- protected class TableEditorListener implements MouseListener
- {
- private int currSelectionIndex_;
- private int editRow_;
- private int editColumn_;
-
- public TableEditorListener()
- {
- super();
- currSelectionIndex_ = -1;
- editRow_ = -1;
- editColumn_ = -1;
- }
-
- public void mouseDoubleClick(MouseEvent e)
- {
- mouseDown(e);
- }
-
- public void mouseDown(MouseEvent e)
- {
- // refresh table
- internalRefresh();
- // Clean up previous text editor control
- internalDispose();
- // update table
- if (table_.isFocusControl())
- {
- int selectedRowIndex = getSelectedRow(table_, e.y);
- if (currSelectionIndex_ != -1 && selectedRowIndex != -1 && currSelectionIndex_ == selectedRowIndex)
- {
- TableItem tableItem = table_.getItem(selectedRowIndex);
- int selectedColumnIndex = getSelectedColumn(tableItem, e.x, e.y);
- if (selectedColumnIndex != -1 && (text_ == null || text_.isDisposed() || selectedColumnIndex != editor_.getColumn()))
- editSelection(selectedRowIndex, selectedColumnIndex);
- }
- currSelectionIndex_ = selectedRowIndex;
- }
- }
-
- public void mouseUp(MouseEvent e)
- {
- }
-
- private int getSelectedRow(Table table, int y)
- {
- TableItem[] tableItems = table.getItems();
- for (int i = 0; i < tableItems.length; i++)
- {
- Rectangle rectangle = tableItems[i].getBounds(0);
- if (rectangle != null && y >= rectangle.y && y < (rectangle.y + rectangle.height))
- return i;
- }
- return -1;
- }
-
- private int getSelectedColumn(TableItem tableItem, int x, int y)
- {
- for (int i = 0; i < columns_.length; i++)
- {
- if (tableItem.getBounds(i).contains(x, y))
- return i;
- }
- return -1;
- }
-
- private void editSelection(int row, int column)
- {
- editRow_ = row;
- editColumn_ = column;
- TableItem tableItem = table_.getItem(row);
- // Setup adapter for the new selection
- text_ = new Text(table_, SWT.NONE);
- String text = tableItem.getText(column);
- text_.setText((text != null) ? text : "");
- text_.addKeyListener(new KeyListener()
- {
- public void keyPressed(KeyEvent e)
- {
- // Esc
- if (((int)e.character) == 27)
- cancelSelection();
- }
- public void keyReleased(KeyEvent e)
- {
- }
- }
- );
- text_.addTraverseListener(new TraverseListener()
- {
- public void keyTraversed(TraverseEvent e)
- {
- if (e.detail == SWT.TRAVERSE_TAB_NEXT)
- traverseTabNext();
- else if (e.detail == SWT.TRAVERSE_TAB_PREVIOUS)
- traverseTabPrevious();
- }
- }
- );
- editor_.setEditor(text_, tableItem, column);
- text_.setFocus();
- text_.selectAll();
- }
-
- protected void traverseTabNext()
- {
- internalRefresh();
- internalDispose();
- if (!(editRow_ == table_.getItems().length-1 && editColumn_ == columns_.length-1))
- {
- if (editColumn_ < columns_.length-1)
- editColumn_++;
- else
- {
- editColumn_ = 0;
- editRow_++;
- table_.select(editRow_);
- }
- editSelection(editRow_, editColumn_);
- }
- }
-
- protected void traverseTabPrevious()
- {
- internalRefresh();
- internalDispose();
- if (!(editRow_ == 0 && editColumn_ == 0))
- {
- if (editColumn_ > 0)
- editColumn_--;
- else
- {
- editColumn_ = columns_.length-1;
- editRow_--;
- table_.select(editRow_);
- }
- editSelection(editRow_, editColumn_);
- }
- }
-
- public void cancelSelection()
- {
- internalDispose();
- internalRefresh();
- }
-
- public void editSelection()
- {
- int selectedRowIndex = table_.getSelectionIndex();
- if (selectedRowIndex != -1 && columns_.length > 0)
- {
- // refresh table
- internalRefresh();
- // Clean up any previous editor control
- internalDispose();
- editSelection(selectedRowIndex, 0);
- }
- currSelectionIndex_ = selectedRowIndex;
- }
- }
-
- protected class ListContentProvider implements IStructuredContentProvider
- {
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- tableViewer_.add(getElements(newInput));
- }
-
- public Object[] getElements(Object inputElement)
- {
- if (inputElement instanceof List)
- {
- List list = (List)inputElement;
- Object[] objects = new Object[list.size()];
- for (int i = 0; i < objects.length; i++)
- objects[i] = list.get(i);
- return objects;
- }
- else
- return new Object[0];
- }
- }
-
- protected class ListLabelProvider implements ITableLabelProvider
- {
- public Image getColumnImage(Object element, int columnIndex)
- {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex)
- {
- return ((String[])element)[columnIndex];
- }
-
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return true;
- }
-
- public void dispose()
- {
- }
- }
- }
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionConditionCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionConditionCommand.java
deleted file mode 100644
index b585ce9..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionConditionCommand.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.jst.ws.internal.consumption.ui.wsil.DialogWWWAuthentication;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WWWAuthenticationException;
-import org.eclipse.wst.ws.parser.wsil.WebServiceEntity;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-public class WSDLSelectionConditionCommand extends SimpleCommand implements Condition
-{
- private String pluginId_;
- private MessageUtils msgUtils_;
- private WebServicesParser webServicesParser;
- private String webServiceURI;
- private String httpBasicAuthUsername;
- private String httpBasicAuthPassword;
- private boolean needWSDLSelectionTreeWidget;
-
- public WSDLSelectionConditionCommand()
- {
- pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- msgUtils_ = new MessageUtils( pluginId_ + ".plugin", this );
- }
-
- public void setWebServicesParser(WebServicesParser webServicesParser)
- {
- this.webServicesParser = webServicesParser;
- }
-
- public WebServicesParser getWebServicesParser()
- {
- if (webServicesParser == null)
- webServicesParser = new WebServicesParserExt();
- return webServicesParser;
- }
-
- public Status execute(Environment env)
- {
- needWSDLSelectionTreeWidget = false;
- WebServicesParser parser = getWebServicesParser();
- parser.setURI(webServiceURI);
- try
- {
- parser.parse(WebServicesParser.PARSE_WSIL | WebServicesParser.PARSE_DISCO | WebServicesParser.PARSE_LINKS);
- }
- catch (WWWAuthenticationException wwwae)
- {
- DialogWWWAuthentication dialog = new DialogWWWAuthentication(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
- dialog.handleWWWAuthentication(wwwae);
- String username = dialog.getUsername();
- String password = dialog.getPassword();
- httpBasicAuthUsername = username;
- httpBasicAuthPassword = password;
- if (username != null && password != null)
- {
- parser.setHTTPBasicAuthUsername(username);
- parser.setHTTPBasicAuthPassword(password);
- try
- {
- parser.parse(WebServicesParser.PARSE_WSIL | WebServicesParser.PARSE_DISCO | WebServicesParser.PARSE_LINKS);
- }
- catch (Throwable t)
- {
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_URI_NOT_RESOLVABLE", new Object[] {webServiceURI}), Status.ERROR, t);
- }
- finally
- {
- parser.setHTTPBasicAuthUsername(null);
- parser.setHTTPBasicAuthPassword(null);
- }
- }
- }
- catch (Throwable t)
- {
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_URI_NOT_RESOLVABLE", new Object[] {webServiceURI}), Status.ERROR, t);
- }
- WebServiceEntity wsEntity = parser.getWebServiceEntityByURI(webServiceURI);
- if (wsEntity != null)
- {
- int type = wsEntity.getType();
- if (type != WebServiceEntity.TYPE_WSDL)
- needWSDLSelectionTreeWidget = true;
- }
- return new SimpleStatus("");
- }
-
- public boolean evaluate()
- {
- return needWSDLSelectionTreeWidget;
- }
-
- public String getWebServiceURI()
- {
- return webServiceURI;
- }
-
- public void setWebServiceURI(String webServiceURI)
- {
- this.webServiceURI = webServiceURI;
- }
-
- public String getWsdlURI()
- {
- return getWebServiceURI();
- }
-/**
- * @return Returns the httpBasicAuthPassword.
- */
-public String getHttpBasicAuthPassword() {
- return httpBasicAuthPassword;
-}
-/**
- * @return Returns the httpBasicAuthUsername.
- */
-public String getHttpBasicAuthUsername() {
- return httpBasicAuthUsername;
-}
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionOutputCommand.java
deleted file mode 100644
index 0a20fab..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionOutputCommand.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-public class WSDLSelectionOutputCommand extends SimpleCommand
-{
- private WebServicesParser webServicesParser;
- private String wsdlURI;
- private IProject project;
-
- /**
- * @return Returns the project.
- */
- public IProject getProject()
- {
- return project;
- }
-
- /**
- * @param project
- * The project to set.
- */
- public void setProject(IProject project)
- {
- this.project = project;
- }
-
- public String getWsdlURI()
- {
- return wsdlURI;
- }
-
- public void setWsdlURI(String wsdlURI)
- {
- this.wsdlURI = wsdlURI;
- }
-
- /**
- * @return Returns the webServicesParser.
- */
- public WebServicesParser getWebServicesParser()
- {
- if (webServicesParser != null)
- return webServicesParser;
- else
- return new WebServicesParserExt();
- }
-
- /**
- * @param webServicesParser to set.
- */
- public void setWebServicesParser(WebServicesParser webServicesParser)
- {
- this.webServicesParser = webServicesParser;
- }
-
- public Status execute(Environment env)
- {
- if (wsdlURI != null && getWebServicesParser().getWSDLDefinition(wsdlURI) != null)
- return new SimpleStatus("");
- else
- {
- MessageUtils msgUtils = new MessageUtils("org.eclipse.jst.ws.consumption.ui.plugin", this);
- Status status = new SimpleStatus("", msgUtils.getMessage("PAGE_MSG_SELECTION_MUST_BE_WSDL"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionTreeWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionTreeWidget.java
deleted file mode 100644
index dd5619d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionTreeWidget.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-import org.eclipse.wst.ws.parser.wsil.WebServiceEntity;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-/**
-* This wizard page allows the user to select the WSDL URI for consumption
-*/
-public class WSDLSelectionTreeWidget extends SimpleWidgetDataContributor
-{
- private String pluginId_;
- private MessageUtils msgUtils_;
-
- /*CONTEXT_ID PWWS0001 for the WSDL Selection Page*/
- private final String INFOPOP_PWWS_PAGE = ".PWWS0001";
-
- /*CONTEXT_ID PWWS0002 for the WSDL Document text field of the WSDL Selection Page*/
- private final String INFOPOP_PWWS_TEXT_WSDL = ".PWWS0002";
-
- /*CONTEXT_ID PWWS0003 for the WSDL Resource Browse button of the WSDL Selection Page*/
- private final String INFOPOP_PWWS_BUTTON_BROWSE_WSDL = ".PWWS0003";
-
- private WebServicesParser webServicesParser;
- private String webServiceURI;
-
- private Composite parent;
- private Listener statusListener;
- private TreeViewer treeViewer_;
- private TreeContentProvider treeContentProvider;
- private Tree tree_;
- private int pageWidth_;
-
- /**
- * Default constructor.
- */
- public WSDLSelectionTreeWidget()
- {
- pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- msgUtils_ = new MessageUtils( pluginId_ + ".plugin", this );
- }
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- this.parent = parent;
- this.statusListener = statusListener;
- parent.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWWS_PAGE"));
- WorkbenchHelp.setHelp(parent, pluginId_ + INFOPOP_PWWS_PAGE);
-
- Label wsdlLabel = new Label(parent, SWT.WRAP);
- wsdlLabel.setText(msgUtils_.getMessage("LABEL_SELECT_WSDL"));
- wsdlLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
- tree_ = new Tree(parent, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 200;
- tree_.setLayoutData(gd);
- pageWidth_ = tree_.getShell().getSize().x;
- treeViewer_ = new TreeViewer(tree_);
- treeContentProvider = new TreeContentProvider();
- treeViewer_.setContentProvider(treeContentProvider);
- treeViewer_.setLabelProvider(new TreeLabelProvider());
- treeViewer_.addSelectionChangedListener(
- new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- handleTreeSelectionChangedEvent(event);
- }
- }
- );
- return this;
- }
-
- private void handleTreeSelectionChangedEvent(SelectionChangedEvent event)
- {
- statusListener.handleEvent(new Event());
- }
-
- /**
- * @return Returns the webServicesParser.
- */
- public WebServicesParser getWebServicesParser()
- {
- return webServicesParser;
- }
- /**
- * @param webServicesParser The webServicesParser to set.
- */
- public void setWebServicesParser(WebServicesParser webServicesParser)
- {
- this.webServicesParser = webServicesParser;
- treeViewer_.setInput(this.webServicesParser);
- refreshTreeViewer();
- }
-
- public void setWebServiceURI(String wsURI)
- {
- webServiceURI = wsURI;
- treeContentProvider.setWebServiceURI(webServiceURI);
- refreshTreeViewer();
- }
-
- public void refreshTreeViewer()
- {
- if (webServicesParser != null && webServiceURI != null)
- {
- treeViewer_.refresh();
- Control shell = tree_.getShell();
- if (tree_.getSize().x > pageWidth_ || shell.getSize().x > pageWidth_)
- {
- tree_.setSize(pageWidth_, tree_.getSize().y);
- shell.setSize(pageWidth_, shell.getSize().y);
- shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- shell.redraw();
- }
- }
- }
-
- public void setEnabled(boolean enabled)
- {
- tree_.setEnabled(enabled);
- }
-
- public boolean isEnabled()
- {
- return tree_.isEnabled();
- }
-
- public String getWsdlURI()
- {
- WebServiceEntity entity = getSelectionAsWebServiceEntity();
- if (entity != null)
- return entity.getURI();
- else
- return webServiceURI;
- }
-
- private WebServiceEntity getSelectionAsWebServiceEntity()
- {
- if (treeViewer_ != null)
- {
- ISelection sel = treeViewer_.getSelection();
- if (!sel.isEmpty() && (sel instanceof IStructuredSelection))
- {
- IStructuredSelection ssel = (IStructuredSelection)sel;
- Object object = ssel.getFirstElement();
- if (object instanceof WebServiceEntity)
- return (WebServiceEntity)object;
- }
- }
- return null;
- }
-
- public Status getStatus()
- {
- WebServiceEntity wsEntity = getSelectionAsWebServiceEntity();
- if (wsEntity == null || wsEntity.getType() != WebServiceEntity.TYPE_WSDL)
- return new SimpleStatus("", msgUtils_.getMessage("PAGE_MSG_SELECTION_MUST_BE_WSDL"), Status.ERROR);
- else
- return new SimpleStatus("");
- }
-
- private class TreeContentProvider implements ITreeContentProvider
- {
- private String webServiceURI;
-
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
-
- public Object[] getElements(Object inputElement)
- {
- if (inputElement instanceof WebServicesParser)
- {
- WebServicesParser parser = (WebServicesParser)inputElement;
- Object wsEntity = parser.getWebServiceEntityByURI(webServiceURI);
- if (wsEntity != null)
- return new Object[] {wsEntity};
- }
- return new Object[0];
- }
-
- public Object[] getChildren(Object parentElement)
- {
- if (parentElement instanceof WebServiceEntity)
- {
- List list = ((WebServiceEntity)parentElement).getChildren();
- Object[] objects = new Object[list.size()];
- for (int i = 0; i < objects.length; i++)
- objects[i] = list.get(i);
- return objects;
- }
- return new Object[0];
- }
-
- public Object getParent(Object element)
- {
- if (element instanceof WebServiceEntity)
- return ((WebServiceEntity)element).getParent();
- return new Object[0];
- }
-
- public boolean hasChildren(Object element)
- {
- return (getChildren(element).length > 0);
- }
-
- public void setWebServiceURI(String wsURI)
- {
- webServiceURI = wsURI;
- }
- }
-
- private class TreeLabelProvider implements ILabelProvider
- {
- public Image getImage(Object element)
- {
- switch (((WebServiceEntity)element).getType())
- {
- case WebServiceEntity.TYPE_HTML:
- return WebServiceConsumptionUIPlugin.getImageDescriptor("icons/wsil/html.gif").createImage();
- case WebServiceEntity.TYPE_WSIL:
- return WebServiceConsumptionUIPlugin.getImageDescriptor("icons/wsil/wsil.gif").createImage();
- case WebServiceEntity.TYPE_WSDL:
- return WebServiceConsumptionUIPlugin.getImageDescriptor("icons/wsil/wsdl.gif").createImage();
- default:
- return null;
- }
- }
-
- public String getText(Object element)
- {
- return ((WebServiceEntity)element).getURI();
- }
-
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return true;
- }
-
- public void dispose()
- {
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java
deleted file mode 100644
index 5c441d0..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef;
-import org.eclipse.jst.ws.internal.common.J2EEActionAdapterFactory;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.wsdl.internal.impl.ServiceImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl;
-
-public class WSDLSelectionWidgetDefaultingCommand extends SimpleCommand
-{
- private IStructuredSelection selection_;
-
- public String getWebServiceURI()
- {
- if (selection_ != null && !selection_.isEmpty())
- {
- Object firstSel = selection_.getFirstElement();
- if (firstSel instanceof IFile)
- {
- IFile ifile = (IFile)firstSel;
- String ext = ifile.getFileExtension();
- if (ext != null && (ext.equals("wsdl") || ext.equals("wsil") || ext.equals("html")))
- {
- return ifile.getFullPath().toString();
- }
- }
- if (firstSel instanceof ServiceImpl)
- {
- ServiceImpl serviceImpl = (ServiceImpl)firstSel;
- return J2EEActionAdapterFactory.getWSDLURI(serviceImpl);
- }
- if (firstSel instanceof ServiceRef)
- {
- ServiceRef serviceRef = (ServiceRef)firstSel;
- return J2EEActionAdapterFactory.getWSDLURI(serviceRef);
- }
- if (firstSel instanceof WSDLResourceImpl)
- {
- WSDLResourceImpl wsdlRI = (WSDLResourceImpl)firstSel;
- return J2EEActionAdapterFactory.getWSDLURI(wsdlRI);
- }
- if (firstSel instanceof String)
- return (String)firstSel;
- }
- return "";
- }
-
- public void setInitialSelection( IStructuredSelection selection )
- {
- selection_ = selection;
- }
-
- public boolean getGenWSIL()
- {
- return false;
- }
-
- public String getWsilURI()
- {
- String wsURI = getWebServiceURI();
- if (wsURI != null && wsURI.length() > 0 && wsURI.endsWith("wsdl"))
- {
- StringBuffer sb = new StringBuffer(wsURI.substring(0, wsURI.length()-4));
- sb.append("wsil");
- return sb.toString();
- }
- return "";
- }
-
- public IProject getProject()
- {
- IProject p = getProjectFromInitialSelection(selection_);
- return p;
- }
-
- private IProject getProjectFromInitialSelection(IStructuredSelection selection)
- {
- if (selection != null && selection.size() == 1)
- {
- Object obj = selection.getFirstElement();
- if (obj != null)
- {
- try
- {
- IResource resource = ResourceUtils.getResourceFromSelection(obj);
- if (resource==null)
- return null;
- IProject p = ResourceUtils.getProjectOf(resource.getFullPath());
- return p;
- } catch(CoreException e)
- {
- return null;
- }
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetWrapper.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetWrapper.java
deleted file mode 100644
index 2a08dc0..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetWrapper.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.WSDLSelectionWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.WSDLSelectionWrapper;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-public class WSDLSelectionWidgetWrapper extends SimpleWidgetDataContributor
-{
- private String pluginId;
- private MessageUtils msgUtils;
-
- private Composite parent;
- private Listener statusListener;
-
- private WSDLSelectionWidget wsdlSelectionWidget;
- private String webServiceURI;
- private IProject project;
-
- public WSDLSelectionWidgetWrapper()
- {
- pluginId = "org.eclipse.jst.ws.consumption.ui";
- msgUtils = new MessageUtils(pluginId + ".plugin", this);
- }
-
- public WidgetDataEvents addControls(Composite parent, Listener statusListener)
- {
- this.parent = parent;
- this.statusListener = statusListener;
- wsdlSelectionWidget = new WSDLSelectionWidget();
- wsdlSelectionWidget.addControls(parent, statusListener);
- return this;
- }
-
- public Status getStatus()
- {
- return wsdlSelectionWidget.getStatus();
- }
-
- public void setWebServiceURI(String wsUri)
- {
- IStructuredSelection sel;
- if (wsUri != null)
- sel = new StructuredSelection(wsUri);
- else
- sel = new StructuredSelection();
- wsdlSelectionWidget.setInitialSelection(sel);
- }
-
- public String getWebServiceURI()
- {
- IStructuredSelection sel = wsdlSelectionWidget.getObjectSelection();
- Object object = sel.getFirstElement();
- String result = null;
-
- if (object != null )
- {
- if( object instanceof WSDLSelectionWrapper )
- {
- // Get at the inner structured selection object.
- WSDLSelectionWrapper wrapper = (WSDLSelectionWrapper)object;
- IStructuredSelection innerSelection = wrapper.wsdlSelection;
- Object innerObject = innerSelection.getFirstElement();
-
- result = innerObject == null ? null : innerObject.toString();
- }
- else
- {
- result = object.toString();
- }
- }
-
- return result;
- }
-
- public String getWsdlURI()
- {
- return getWebServiceURI();
- }
-
- public WebServicesParser getWebServicesParser()
- {
- return wsdlSelectionWidget.getWebServicesParser();
- }
-
- public void setProject(IProject project)
- {
- this.project = project;
- }
-
- public IProject getProject()
- {
- IProject p = wsdlSelectionWidget.getProject();
- if (p==null)
- {
- return project;
- }
- else
- return p;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WebServiceClientTypeWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WebServiceClientTypeWidget.java
deleted file mode 100644
index 33d83c8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WebServiceClientTypeWidget.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets;
-
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceClientTypeRegistry;
-import org.eclipse.jst.ws.internal.data.LabelsAndIds;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class WebServiceClientTypeWidget extends SimpleWidgetDataContributor
-{
- /*CONTEXT_ID PWPR0013 for the Wizard Scenario Client group of the Project Page*/
- private String INFOPOP_PWPR_GROUP_SCENARIO_CLIENT = "PWPR0013";
-
- /*CONTEXT_ID PWPR0014 for the Web Service Client Type combo box of the Project Page*/
- private String INFOPOP_PWPR_COMBO_CLIENTTYPE = "PWPR0014";
- private Combo clientTypeCombo_;
-
- /*CONTEXT_ID PWPR0006 for the Test Proxy check box of the Project Page*/
- private String INFOPOP_PWPR_CHECKBOX_TEST_PROXY = "PWPR0006";
- private Button testProxyCheckbox_;
-
- private TypeRuntimeServer ids_;
- private LabelsAndIds labelIds_;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#addControls(org.eclipse.swt.widgets.Composite, org.eclipse.swt.widgets.Listener)
- */
- public WidgetDataEvents addControls( Composite parent, Listener statusListener)
- {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId + ".plugin", this );
- UIUtils utils = new UIUtils( msgUtils, pluginId );
-
- Group clientGroup = utils.createGroup( parent,
- "GROUP_SCENARIO_CLIENT",
- "TOOLTIP_PWPR_GROUP_SCENARIO_CLIENT",
- INFOPOP_PWPR_GROUP_SCENARIO_CLIENT,
- 2, 10, 10 );
-
-
- int comboStyle = SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY;
- clientTypeCombo_ = utils.createCombo( clientGroup,
- "LABEL_WEBSERVICECLIENTTYPE",
- "TOOLTIP_PWPR_COMBO_CLIENTTYPE",
- INFOPOP_PWPR_COMBO_CLIENTTYPE,
- comboStyle );
-
-
-
- return this;
- }
-
- public void enableWidget( boolean enable )
- {
- clientTypeCombo_.setEnabled( enable );
- }
-
- public void setTypeRuntimeServer( TypeRuntimeServer ids )
- {
- WebServiceClientTypeRegistry registry = WebServiceClientTypeRegistry.getInstance();
- LabelsAndIds labelIds = registry.getClientTypeLabels();
- int selection = 0;
- String[] clientIds = labelIds.getIds_();
- String selectedId = ids.getTypeId();
-
- clientTypeCombo_.setItems( labelIds.getLabels_() );
-
- // Now find the selected one.
- for( int index = 0; index < clientIds.length; index++ )
- {
- if( selectedId.equals( clientIds[index ]) )
- {
- selection = index;
- break;
- }
- }
-
- clientTypeCombo_.select( selection );
- ids_ = ids;
- labelIds_ = labelIds;
- }
-
- public TypeRuntimeServer getTypeRuntimeServer()
- {
- int selectionIndex = clientTypeCombo_.getSelectionIndex();
-
- ids_.setTypeId( labelIds_.getIds_()[selectionIndex] );
-
- return ids_;
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ClientWidgetBinding.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ClientWidgetBinding.java
deleted file mode 100644
index 88c6e85..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ClientWidgetBinding.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.binding;
-
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.command.common.ClientServerDeployableConfigCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.CreateClientProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.GetMonitorCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.command.CheckForServiceProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.command.data.EclipseIPath2URLStringTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.command.data.ServerInstToIServerTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.common.FinishFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientWizardWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientWizardWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientWizardWidgetOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.WSDLSelectionOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.WSDLSelectionWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.WSDLSelectionWidgetWrapper;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.AddModuleDependenciesCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestDelegateCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishDefaultCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishJavaTestFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishTestFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.TestDefaultingFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WebServiceClientTestArrivalCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceClientTypeRegistry;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.SelectionCommand;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class ClientWidgetBinding implements CommandWidgetBinding
-{
- private CanFinishRegistry canFinishRegistry_;
- private WidgetRegistry widgetRegistry_;
- private DataMappingRegistry dataMappingRegistry_;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create()
- */
- public CommandFragmentFactory create()
- {
- return new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- return new ClientRootCommandFragment();
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- canFinishRegistry_ = canFinishRegistry;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- dataMappingRegistry_ = dataRegistry;
-
- // Before ClientWizardWidget
- dataRegistry.addMapping(ClientWizardWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ClientWizardWidget.class);
- dataRegistry.addMapping(ClientWizardWidgetDefaultingCommand.class, "TestService", ClientWizardWidget.class );
- dataRegistry.addMapping(ClientWizardWidgetDefaultingCommand.class, "MonitorService", ClientWizardWidget.class);
- dataRegistry.addMapping(ClientWizardWidgetDefaultingCommand.class, "ResourceContext", ClientWizardWidget.class );
-
- // After ClientWizardWidget
- dataRegistry.addMapping(ClientWizardWidget.class, "ClientTypeRuntimeServer", ClientWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientWizardWidget.class, "TestService", ClientWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientWizardWidget.class, "MonitorService", ClientWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientWizardWidget.class, "ResourceContext", ClientWizardWidgetOutputCommand.class);
-
- // Before ClientRuntimeSelectionWidget
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ClientRuntimeSelectionWidget.class);
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "ClientJ2EEVersion", ClientRuntimeSelectionWidget.class, "J2EEVersion", null);
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "Runtime2ClientTypes", ClientRuntimeSelectionWidget.class);
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "ClientNeedEAR", ClientRuntimeSelectionWidget.class,"NeedEAR",null);
-
- // After ClientRuntimeSelectionWidget
- dataRegistry.addMapping(ClientRuntimeSelectionWidget.class, "ClientTypeRuntimeServer", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ClientRuntimeSelectionWidget.class, "J2EEVersion", ClientExtensionDefaultingCommand.class, "ClientJ2EEVersion", null);
- dataRegistry.addMapping(ClientRuntimeSelectionWidget.class, "Runtime2ClientTypes", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ClientRuntimeSelectionWidget.class, "ClientNeedEAR", ClientExtensionDefaultingCommand.class);
-
- // The ClientRuntimeSelectionWidget can control what client extension comes up.
- dataRegistry.addMapping(ClientRuntimeSelectionWidget.class, "ClientTypeRuntimeServer", ClientExtensionFragment.class);
-
- // Before WSDLSelectionWidgetWrapper
- dataRegistry.addMapping(WSDLSelectionWidgetDefaultingCommand.class, "WebServiceURI", WSDLSelectionWidgetWrapper.class );
- dataRegistry.addMapping(WSDLSelectionWidgetDefaultingCommand.class, "Project", WSDLSelectionWidgetWrapper.class );
-
- // After WSDLSelectionWidgetWrapper
- dataRegistry.addMapping(WSDLSelectionWidgetWrapper.class, "WsdlURI", WSDLSelectionOutputCommand.class);
- dataRegistry.addMapping(WSDLSelectionWidgetWrapper.class, "WebServicesParser", WSDLSelectionOutputCommand.class);
- dataRegistry.addMapping(WSDLSelectionWidgetWrapper.class, "Project", WSDLSelectionOutputCommand.class);
-
- // Before Client Test widget.
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "TestService",FinishTestFragment.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "TestService", ClientTestWidget.class );
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ClientTestWidget.class );
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject", ClientTestWidget.class );
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR", ClientTestWidget.class );
- dataRegistry.addMapping(TestDefaultingFragment.class, "TestFacility",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Folder",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "JspFolder",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "RunClientTest",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Methods",ClientTestWidget.class);
-
- // After the client test widget
- dataRegistry.addMapping(ClientTestWidget.class, "SampleProjectEAR",FinishDefaultCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "SampleProject",FinishDefaultCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "TestFacility",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "Folder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "JspFolder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "RunClientTest",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "SampleMethods",ClientTestDelegateCommand.class);
-
- dataRegistry.addMapping(ClientTestWidget.class, "TestService",FinishTestFragment.class);
- dataRegistry.addMapping(ClientTestWidget.class, "TestID",FinishTestFragment.class);
- dataRegistry.addMapping(ClientTestWidget.class, "IsTestWidget",FinishTestFragment.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
-
- widgetRegistry_ = widgetRegistry;
-
- widgetRegistry.add( "ClientWizardWidget",
- msgUtils.getMessage("PAGE_TITLE_WS_PROJECT"),
- msgUtils.getMessage("PAGE_DESC_WS_PROJECT"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new ClientWizardWidget();
- }
- } );
-
- widgetRegistry.add( "ClientRuntimeSelectionWidget",
- msgUtils.getMessage("PAGE_TITLE_WS_CLIENT_RUNTIME_SELECTION"),
- msgUtils.getMessage("PAGE_DESC_WS_CLIENT_RUNTIME_SELECTION"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new ClientRuntimeSelectionWidget();
- }
- } );
-
- widgetRegistry.add( "WSDLSelectionWidgetWrapper",
- msgUtils.getMessage("PAGE_TITLE_WS_SELECTION"),
- msgUtils.getMessage("PAGE_DESC_WS_SELECTION"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new WSDLSelectionWidgetWrapper();
- }
- } );
-
- widgetRegistry.add( "ClientTestWidget",
- msgUtils.getMessage("PAGE_TITLE_WS_SAMPLE"),
- msgUtils.getMessage("PAGE_DESC_WS_SAMPLE"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new ClientTestWidget();
- }
- });
- }
-
- private class InitClientRegistry extends SimpleCommand
- {
- private WebServiceClientTypeRegistry clientRegistry_ = WebServiceClientTypeRegistry.getInstance();
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.Command#execute(org.eclipse.wst.command.env.core.common.Environment)
- */
- public Status execute(Environment environment)
- {
- clientRegistry_.setDataMappingRegistry( dataMappingRegistry_ );
- clientRegistry_.setWidgetRegistry( widgetRegistry_ );
- clientRegistry_.setCanFinishRegistry( canFinishRegistry_ );
-
- return new SimpleStatus( "" );
- }
- }
-
- private class ClientRootCommandFragment extends SequenceFragment
- {
- public ClientRootCommandFragment()
- {
- add( new SimpleFragment( new ClientWizardWidgetDefaultingCommand(), "" ) );
- add( new SimpleFragment( new InitClientRegistry(), "" ));
- add( new SimpleFragment( "ClientWizardWidget" ) );
- add( new SimpleFragment( new ClientWizardWidgetOutputCommand(), "" ));
- add( new SimpleFragment( new WSDLSelectionWidgetDefaultingCommand(), ""));
- add( new SimpleFragment( "WSDLSelectionWidgetWrapper" ) );
- add( new SimpleFragment( new WSDLSelectionOutputCommand(), ""));
- add( new SimpleFragment( new ClientRuntimeSelectionWidgetDefaultingCommand(), ""));
- add( new SimpleFragment( "ClientRuntimeSelectionWidget" ) );
- add( new SimpleFragment( new CheckForServiceProjectCommand(), ""));
- add( new SimpleFragment( new ClientExtensionDefaultingCommand( true ), ""));
- add(new SimpleFragment(new ClientServerDeployableConfigCommand(false), "")); //Note: added here for client
- add( new SimpleFragment( new CreateClientProjectCommand(), ""));
- add( new ClientExtensionFragment() );
- add( new SimpleFragment( new ClientExtensionOutputCommand(), "" ) );
- add( new SimpleFragment(new GetMonitorCommand(), ""));
- add( new SimpleFragment(new TestDefaultingFragment(),""));
- add( new ClientTestFragment( "ClientTestWidget") );
- add(new FinishFragment());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragment#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- //Map SelectionCommand
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ClientRuntimeSelectionWidgetDefaultingCommand.class, "InitialInitialSelection", null);
-
- // Map ClientWizardWidgetDefaultingCommand command.
- dataRegistry.addMapping(ClientWizardWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ClientWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientWizardWidgetDefaultingCommand.class, "TestService", ClientWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientWizardWidgetDefaultingCommand.class, "MonitorService", ClientWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientWizardWidgetDefaultingCommand.class, "ResourceContext", ClientWizardWidgetOutputCommand.class);
-
- // Map ClientWizardWidgetOutputCommand command.
- dataRegistry.addMapping(ClientWizardWidgetOutputCommand.class, "ClientTypeRuntimeServer", ClientRuntimeSelectionWidgetDefaultingCommand.class);
- dataRegistry.addMapping(ClientWizardWidgetOutputCommand.class, "TestService", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ClientWizardWidgetOutputCommand.class, "ResourceContext", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ClientWizardWidgetOutputCommand.class, "MonitorService", GetMonitorCommand.class);
-
- // Map ClientRuntimeSelectionWidgetDefaultingCommand command
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "Runtime2ClientTypes", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "ClientJ2EEVersion", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "ClientNeedEAR", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "Runtime2ClientTypes", CheckForServiceProjectCommand.class);
-
- // Map WSDLSelectionWidgetDefaultingCommand command.
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", WSDLSelectionWidgetDefaultingCommand.class );
- dataRegistry.addMapping(WSDLSelectionWidgetDefaultingCommand.class, "GenWSIL", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(WSDLSelectionWidgetDefaultingCommand.class, "WsilURI", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(WSDLSelectionWidgetDefaultingCommand.class, "WebServiceURI", WSDLSelectionOutputCommand.class, "WsdlURI", new EclipseIPath2URLStringTransformer());
- dataRegistry.addMapping(WSDLSelectionWidgetDefaultingCommand.class, "Project", WSDLSelectionOutputCommand.class);
-
- // WSDLSelectionOutputCommand
- dataRegistry.addMapping(WSDLSelectionOutputCommand.class, "WsdlURI", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(WSDLSelectionOutputCommand.class, "WebServicesParser", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(WSDLSelectionOutputCommand.class, "WsdlURI", GetMonitorCommand.class);
- dataRegistry.addMapping(WSDLSelectionOutputCommand.class, "WebServicesParser", GetMonitorCommand.class);
- dataRegistry.addMapping(WSDLSelectionOutputCommand.class, "Project", ClientRuntimeSelectionWidgetDefaultingCommand.class, "ClientInitialProject", null);
- dataRegistry.addMapping(WSDLSelectionOutputCommand.class, "WsdlURI", ClientRuntimeSelectionWidgetDefaultingCommand.class);
- dataRegistry.addMapping(WSDLSelectionOutputCommand.class, "WebServicesParser", ClientRuntimeSelectionWidgetDefaultingCommand.class);
- dataRegistry.addMapping(WSDLSelectionOutputCommand.class, "WsdlURI", CheckForServiceProjectCommand.class);
- dataRegistry.addMapping(WSDLSelectionOutputCommand.class, "WebServicesParser", CheckForServiceProjectCommand.class);
-
- //ServerDeployableConfigurationCommand for client
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", ClientServerDeployableConfigCommand.class, "SampleProject", new StringToIProjectTransformer());
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", ClientServerDeployableConfigCommand.class, "ClientTypeRuntimeServer", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServerInstance", ClientServerDeployableConfigCommand.class,"SampleExistingServer", new ServerInstToIServerTransformer());
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServer", ClientServerDeployableConfigCommand.class,"SampleServerTypeID", null);
-
- // Map ClientExtensionDefaultingCommand command.
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", ClientExtensionFragment.class);
-
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", CreateClientProjectCommand.class, "ProxyProject", new StringToIProjectTransformer());
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", CreateClientProjectCommand.class, "ProxyProjectEAR", new StringToIProjectTransformer());
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectType", CreateClientProjectCommand.class, "ClientProjectTypeId", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServer", CreateClientProjectCommand.class, "ServerFactoryId", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientJ2EEVersion", CreateClientProjectCommand.class, "J2EEVersion", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientNeedEAR", CreateClientProjectCommand.class, "NeedEAR", null);
-
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "Runtime2ClientTypes", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", WebServiceClientTestArrivalCommand.class, "ClientIds", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientJ2EEVersion", WebServiceClientTestArrivalCommand.class, "J2eeVersion", null);
-
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "GenerateProxy", ClientTestFragment.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "TestService", ClientTestFragment.class );
-
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", FinishDefaultCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServer", ClientTestDelegateCommand.class);
-
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", AddModuleDependenciesCommand.class );
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientJ2EEVersion", AddModuleDependenciesCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "WsdlURI", ClientTestDelegateCommand.class);
-
- // Map ClientExtensionOutputCommand command.
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "ProxyBean", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", ClientTestFragment.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", FinishTestFragment.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", FinishJavaTestFragment.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "SetEndpointMethod", ClientTestDelegateCommand.class);
-
- // GetMonitorCommand
- dataRegistry.addMapping(GetMonitorCommand.class, "Endpoints", ClientTestDelegateCommand.class);
-
- // MAP post server config call
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", ClientExtensionOutputCommand.class, "EarProjectName", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServerInstance", ClientExtensionOutputCommand.class, "ExistingServerId", null);
- dataRegistry.addMapping(ClientServerDeployableConfigCommand.class, "SampleExistingServerInstId", ClientExtensionOutputCommand.class, "ExistingServerId", null);
-
-
- // Map ClientServerDeployableConfigCommand
- dataRegistry.addMapping(ClientServerDeployableConfigCommand.class, "SampleExistingServerInstId", CreateClientProjectCommand.class, "ExistingServerId", null);
- dataRegistry.addMapping(ClientServerDeployableConfigCommand.class, "AddedProjectToServer", CreateClientProjectCommand.class);
- dataRegistry.addMapping(ClientServerDeployableConfigCommand.class, "SampleExistingServerInstId", FinishDefaultCommand.class, "ExistingServerId", null);
-
- // Map WebServiceClientTestArrivalCommand command.
- dataRegistry.addMapping(TestDefaultingFragment.class, "TestFacility",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "ProxyBean",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "TestFacility",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Folder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "JspFolder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "RunClientTest",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Methods",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR",ClientTestDelegateCommand.class);
-
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject",AddModuleDependenciesCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR",AddModuleDependenciesCommand.class);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ConfigClientHandlersWidgetBinding.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ConfigClientHandlersWidgetBinding.java
deleted file mode 100644
index 9eca864..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ConfigClientHandlersWidgetBinding.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.binding;
-
-import org.eclipse.jst.ws.internal.consumption.ui.command.GenerateHandlerSkeletonCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.command.OpenJavaEditorCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientHandlersWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientHandlersWidgetOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ConfigClientHandlersTableWidget;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.SelectionCommand;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-/**
- *
- * Handler Configuration Window - Preferences - Java - Code Generation - Code
- * and Comments
- */
-public class ConfigClientHandlersWidgetBinding implements CommandWidgetBinding {
-
- private CanFinishRegistry canFinishRegistry_;
- private WidgetRegistry widgetRegistry_;
- private DataMappingRegistry dataMappingRegistry_;
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry) {
-
- String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils(pluginId_ + ".plugin", this);
- widgetRegistry_ = widgetRegistry;
-
- widgetRegistry.add("ConfigClientHandlersTableWidget",
- msgUtils.getMessage("PAGE_TITLE_CLIENT_HDLR_CONFIG"),
- msgUtils.getMessage("PAGE_DESC_CLIENT_HDLR_CONFIG"),
- new WidgetContributorFactory() {
-
- public WidgetContributor create() {
- return new ConfigClientHandlersTableWidget();
- }
- });
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry) {
- dataMappingRegistry_ = dataRegistry;
-
-
-// dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"AllHandlers", ConfigClientHandlersTableWidget.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"Handlers", ConfigClientHandlersTableWidget.class,"WsRefsToHandlers", null);
-
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"GenSkeletonEnabled", ConfigClientHandlersTableWidget.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"SourceOutputLocation", ConfigClientHandlersTableWidget.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"ServiceRefName", ConfigClientHandlersTableWidget.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"RefNameToServiceRef", ConfigClientHandlersTableWidget.class);
-
- //dataRegistry.addMapping(ConfigClientHandlersTableWidget.class,"AllHandlersList", ClientHandlersWidgetOutputCommand.class);
- dataRegistry.addMapping(ConfigClientHandlersTableWidget.class,"WsRefsToHandlers", ClientHandlersWidgetOutputCommand.class,"HandlersTable",null);
-
- dataRegistry.addMapping(ConfigClientHandlersTableWidget.class,"SourceOutputLocation", GenerateHandlerSkeletonCommand.class,"OutputLocation",null);
- dataRegistry.addMapping(ConfigClientHandlersTableWidget.class,"HandlerClassNames", GenerateHandlerSkeletonCommand.class,"HandlerNames",null);
- dataRegistry.addMapping(ConfigClientHandlersTableWidget.class,"GenSkeletonEnabled", GenerateHandlerSkeletonCommand.class);
-
- dataRegistry.addMapping(GenerateHandlerSkeletonCommand.class,"Project", OpenJavaEditorCommand.class);
- dataRegistry.addMapping(GenerateHandlerSkeletonCommand.class,"ClassNames", OpenJavaEditorCommand.class);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry) {
- canFinishRegistry_ = canFinishRegistry;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragmentFactoryFactory#create()
- */
- public CommandFragmentFactory create() {
- return new CommandFragmentFactory() {
-
- public CommandFragment create() {
-
- return new ClientHandlersConfigCommandFragment();
- }
- };
- }
-
- private class ClientHandlersConfigCommandFragment extends SequenceFragment{
-
- public ClientHandlersConfigCommandFragment()
- {
- add( new SimpleFragment( new ClientHandlersWidgetDefaultingCommand(), "" ));
- add( new SimpleFragment( "ConfigClientHandlersTableWidget" ) );
- add( new SimpleFragment( new ClientHandlersWidgetOutputCommand(), "" ));
- add( new SimpleFragment( new GenerateHandlerSkeletonCommand(), ""));
- add( new SimpleFragment( new OpenJavaEditorCommand(), ""));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragment#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ClientHandlersWidgetDefaultingCommand.class);
-
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"WsClientResource", ClientHandlersWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"WsServiceRefs", ClientHandlersWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"ClientProject", ClientHandlersWidgetOutputCommand.class);
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ConfigServiceHandlersWidgetBinding.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ConfigServiceHandlersWidgetBinding.java
deleted file mode 100644
index 0167bb5..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ConfigServiceHandlersWidgetBinding.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.binding;
-
-import org.eclipse.jst.ws.internal.consumption.ui.command.GenerateHandlerSkeletonCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.command.OpenJavaEditorCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ConfigServiceHandlersTableWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ServiceHandlersWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ServiceHandlersWidgetOutputCommand;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.SelectionCommand;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-/**
- *
- * Handler Configuration Window - Preferences - Java - Code Generation - Code
- * and Comments
- */
-public class ConfigServiceHandlersWidgetBinding implements CommandWidgetBinding {
-
- private CanFinishRegistry canFinishRegistry_;
- private WidgetRegistry widgetRegistry_;
- private DataMappingRegistry dataMappingRegistry_;
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry) {
-
- String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils(pluginId_ + ".plugin", this);
- widgetRegistry_ = widgetRegistry;
-
- widgetRegistry.add("ConfigServiceHandlersTableWidget",
- msgUtils.getMessage("PAGE_TITLE_SERVICE_HDLR_CONFIG"),
- msgUtils.getMessage("PAGE_DESC_SERVICE_HDLR_CONFIG"),
- new WidgetContributorFactory() {
-
- public WidgetContributor create() {
- return new ConfigServiceHandlersTableWidget();
- }
- });
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry) {
- dataMappingRegistry_ = dataRegistry;
-
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class,"WsRefsToHandlers", ConfigServiceHandlersTableWidget.class);
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class,"GenSkeletonEnabled", ConfigServiceHandlersTableWidget.class);
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class,"SourceOutputLocation", ConfigServiceHandlersTableWidget.class);
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class,"ServiceDescNameToDescObj", ConfigServiceHandlersTableWidget.class);
-
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class,"DescriptionName", ConfigServiceHandlersTableWidget.class);
-
-
- dataRegistry.addMapping(ConfigServiceHandlersTableWidget.class,"HandlersList", ServiceHandlersWidgetOutputCommand.class);
- dataRegistry.addMapping(ConfigServiceHandlersTableWidget.class,"WsDescToHandlers", ServiceHandlersWidgetOutputCommand.class);
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class,"ServiceDescNameToDescObj", ServiceHandlersWidgetOutputCommand.class);
-
- dataRegistry.addMapping(ConfigServiceHandlersTableWidget.class,"SourceOutputLocation", GenerateHandlerSkeletonCommand.class,"OutputLocation",null);
- dataRegistry.addMapping(ConfigServiceHandlersTableWidget.class,"HandlerClassNames", GenerateHandlerSkeletonCommand.class,"HandlerNames",null);
- dataRegistry.addMapping(ConfigServiceHandlersTableWidget.class,"GenSkeletonEnabled", GenerateHandlerSkeletonCommand.class);
-
- dataRegistry.addMapping(GenerateHandlerSkeletonCommand.class,"Project", OpenJavaEditorCommand.class);
- dataRegistry.addMapping(GenerateHandlerSkeletonCommand.class,"ClassNames", OpenJavaEditorCommand.class);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry) {
- canFinishRegistry_ = canFinishRegistry;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragmentFactoryFactory#create()
- */
- public CommandFragmentFactory create() {
- return new CommandFragmentFactory() {
-
- public CommandFragment create() {
-
- return new ServiceHandlersConfigCommandFragment();
- }
- };
- }
-
- private class ServiceHandlersConfigCommandFragment extends SequenceFragment{
-
- public ServiceHandlersConfigCommandFragment()
- {
- add( new SimpleFragment( new ServiceHandlersWidgetDefaultingCommand(), "" ));
- add( new SimpleFragment( "ConfigServiceHandlersTableWidget" ) );
- add( new SimpleFragment( new ServiceHandlersWidgetOutputCommand(), "" ));
- add( new SimpleFragment( new GenerateHandlerSkeletonCommand(), ""));
- add( new SimpleFragment( new OpenJavaEditorCommand(), ""));
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragment#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ServiceHandlersWidgetDefaultingCommand.class);
-
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class, "WsddResource", ServiceHandlersWidgetOutputCommand.class);
-
-
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ConfigureHandlersWidgetBinding.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ConfigureHandlersWidgetBinding.java
deleted file mode 100644
index 8ef9270..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ConfigureHandlersWidgetBinding.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.binding;
-
-import org.eclipse.jst.ws.internal.consumption.ui.command.GenerateHandlerSkeletonCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientHandlersWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientHandlersWidgetOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ConfigClientHandlersTableWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ConfigServiceHandlersTableWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.HandlersDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ServiceHandlersWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ServiceHandlersWidgetOutputCommand;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.SelectionCommand;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class ConfigureHandlersWidgetBinding implements CommandWidgetBinding {
-
- private CanFinishRegistry canFinishRegistry_;
-
- private WidgetRegistry widgetRegistry_;
-
- private DataMappingRegistry dataMappingRegistry_;
-
- public ConfigureHandlersWidgetBinding() {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create()
- */
- public CommandFragmentFactory create() {
- return new CommandFragmentFactory() {
-
- public CommandFragment create() {
- return new HandlersCommandFragment();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry) {
- canFinishRegistry_ = canFinishRegistry;
- }
-
- /*
- * (non-Javadoc),
- *
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry) {
- dataMappingRegistry_ = dataRegistry;
-
- // Map client-side widgets to commands
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class, "Handlers", ConfigClientHandlersTableWidget.class, "WsRefsToHandlers", null);
-
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class, "GenSkeletonEnabled", ConfigClientHandlersTableWidget.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class, "SourceOutputLocation", ConfigClientHandlersTableWidget.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class, "ServiceRefName", ConfigClientHandlersTableWidget.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class, "RefNameToServiceRef", ConfigClientHandlersTableWidget.class);
-
- dataRegistry.addMapping(ConfigClientHandlersTableWidget.class, "WsRefsToHandlers", ClientHandlersWidgetOutputCommand.class, "HandlersTable", null);
-
- dataRegistry.addMapping(ConfigClientHandlersTableWidget.class, "SourceOutputLocation", GenerateHandlerSkeletonCommand.class, "OutputLocation", null);
- dataRegistry.addMapping(ConfigClientHandlersTableWidget.class, "HandlerClassNames", GenerateHandlerSkeletonCommand.class, "HandlerNames", null);
- dataRegistry.addMapping(ConfigClientHandlersTableWidget.class, "GenSkeletonEnabled", GenerateHandlerSkeletonCommand.class);
-
- // Map service-side widgets to commands
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class, "WsRefsToHandlers", ConfigServiceHandlersTableWidget.class);
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class, "GenSkeletonEnabled", ConfigServiceHandlersTableWidget.class);
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class, "SourceOutputLocation", ConfigServiceHandlersTableWidget.class);
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class, "ServiceDescNameToDescObj", ConfigServiceHandlersTableWidget.class);
-
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class, "DescriptionName", ConfigServiceHandlersTableWidget.class);
-
- dataRegistry.addMapping(ConfigServiceHandlersTableWidget.class, "HandlersList", ServiceHandlersWidgetOutputCommand.class);
- dataRegistry.addMapping(ConfigServiceHandlersTableWidget.class, "WsDescToHandlers", ServiceHandlersWidgetOutputCommand.class);
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class, "ServiceDescNameToDescObj", ServiceHandlersWidgetOutputCommand.class);
-
- dataRegistry.addMapping(ConfigServiceHandlersTableWidget.class, "SourceOutputLocation", GenerateHandlerSkeletonCommand.class, "OutputLocation", null);
- dataRegistry.addMapping(ConfigServiceHandlersTableWidget.class, "HandlerClassNames", GenerateHandlerSkeletonCommand.class, "HandlerNames", null);
- dataRegistry.addMapping(ConfigServiceHandlersTableWidget.class, "GenSkeletonEnabled", GenerateHandlerSkeletonCommand.class);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry) {
- String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils(pluginId_ + ".plugin", this);
-
- widgetRegistry.add("ConfigServiceHandlersTableWidget", msgUtils.getMessage("PAGE_TITLE_SERVICE_HDLR_CONFIG"), msgUtils
- .getMessage("PAGE_DESC_SERVICE_HDLR_CONFIG"), new WidgetContributorFactory() {
-
- public WidgetContributor create() {
- return new ConfigServiceHandlersTableWidget();
- }
- });
-
- widgetRegistry.add("ConfigClientHandlersTableWidget", msgUtils.getMessage("PAGE_TITLE_CLIENT_HDLR_CONFIG"), msgUtils
- .getMessage("PAGE_DESC_CLIENT_HDLR_CONFIG"), new WidgetContributorFactory() {
-
- public WidgetContributor create() {
- return new ConfigClientHandlersTableWidget();
- }
- });
-
- }
-
- private class HandlersCommandFragment extends SequenceFragment {
-
- public HandlersCommandFragment() {
-
- add(new SimpleFragment(new HandlersDefaultingCommand(), ""));
-
- add(new ServiceHandlersFragment());
- add(new ClientHandlersFragment());
- }
-
- public void registerDataMappings(DataMappingRegistry dataRegistry) {
-
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", HandlersDefaultingCommand.class);
-
- dataRegistry.addMapping(HandlersDefaultingCommand.class, "IsClientHandler", ClientHandlersFragment.class, "ClientHandlersEnabled", null);
- dataRegistry.addMapping(HandlersDefaultingCommand.class, "IsServiceHandler", ServiceHandlersFragment.class, "ServiceHandlersEnabled", null);
-
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"WsClientResource", ClientHandlersWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"WsServiceRefs", ClientHandlersWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class,"ClientProject", ClientHandlersWidgetOutputCommand.class);
-
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class, "WsddResource", ServiceHandlersWidgetOutputCommand.class);
-
- }
-
- public void registerCanFinish(CanFinishRegistry canFinishRegistry) {
- canFinishRegistry_ = canFinishRegistry;
- }
- }
-
- private class ClientHandlersFragment extends BooleanFragment {
-
- boolean isClient_ = false;
-
- public ClientHandlersFragment() {
- setCondition(new Condition() {
-
- public boolean evaluate() {
- return isClient_;
- }
- });
-
- SequenceFragment clientHandlersRootFragment = new SequenceFragment();
-
- clientHandlersRootFragment.add(new SimpleFragment(new ClientHandlersWidgetDefaultingCommand(), ""));
-
- clientHandlersRootFragment.add(new SimpleFragment("ConfigClientHandlersTableWidget"));
- clientHandlersRootFragment.add(new SimpleFragment(new ClientHandlersWidgetOutputCommand(), ""));
- clientHandlersRootFragment.add(new SimpleFragment(new GenerateHandlerSkeletonCommand(), ""));
-
- setTrueFragment(clientHandlersRootFragment);
- }
-
- public void setClientHandlersEnabled(boolean isClient) {
- isClient_ = isClient;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragment#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry) {
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ClientHandlersWidgetDefaultingCommand.class);
-
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class, "WsClientResource", ClientHandlersWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientHandlersWidgetDefaultingCommand.class, "ClientProject", ClientHandlersWidgetOutputCommand.class);
-
- }
-
- }
-
- private class ServiceHandlersFragment extends BooleanFragment {
-
- boolean isService_ = false;
-
- public ServiceHandlersFragment() {
- setCondition(new Condition() {
-
- public boolean evaluate() {
- return isService_;
- }
- });
-
- SequenceFragment serviceHandlersRootFragment = new SequenceFragment();
- serviceHandlersRootFragment.add(new SimpleFragment(new ServiceHandlersWidgetDefaultingCommand(), ""));
-
- SequenceFragment serviceHandlersFragment = new SequenceFragment();
- serviceHandlersFragment.add(new SimpleFragment("ConfigServiceHandlersTableWidget"));
- serviceHandlersFragment.add(new SimpleFragment(new ServiceHandlersWidgetOutputCommand(), ""));
- serviceHandlersFragment.add(new SimpleFragment(new GenerateHandlerSkeletonCommand(), ""));
-
- serviceHandlersRootFragment.add(serviceHandlersFragment);
-
- setTrueFragment(serviceHandlersRootFragment);
- }
-
- public void setServiceHandlersEnabled(boolean isService) {
- isService_ = isService;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragment#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry) {
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ServiceHandlersWidgetDefaultingCommand.class);
-
- dataRegistry.addMapping(ServiceHandlersWidgetDefaultingCommand.class, "WsddResource", ServiceHandlersWidgetOutputCommand.class);
-
- }
-
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/GenSampleWidgetBinding.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/GenSampleWidgetBinding.java
deleted file mode 100644
index 820545b..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/GenSampleWidgetBinding.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.binding;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.command.data.EclipseIPath2URLStringTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.common.FinishFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientWizardWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientWizardWidgetOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.WSDLSelectionWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.AddModuleDependenciesCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestDelegateCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishDefaultCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishJavaTestFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishTestFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.TestDefaultingFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WebServiceClientTestArrivalCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceClientTypeRegistry;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.data.Transformer;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.SelectionCommand;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class GenSampleWidgetBinding implements CommandWidgetBinding
-{
- private CanFinishRegistry canFinishRegistry_;
- private WidgetRegistry widgetRegistry_;
- private DataMappingRegistry dataMappingRegistry_;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create()
- */
- public CommandFragmentFactory create()
- {
- return new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- return new GenSampleRootCommandFragment();
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- canFinishRegistry_ = canFinishRegistry;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- dataMappingRegistry_ = dataRegistry;
-
- // Before Client Test widget.
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "TestService",FinishTestFragment.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "TestService", ClientTestWidget.class );
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ClientTestWidget.class );
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject", ClientTestWidget.class );
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR", ClientTestWidget.class );
- dataRegistry.addMapping(TestDefaultingFragment.class, "TestFacility",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Folder",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "JspFolder",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "RunClientTest",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Methods",ClientTestWidget.class);
-
- // After the client test widget
- dataRegistry.addMapping(ClientTestWidget.class, "SampleProjectEAR",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "SampleProject",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "TestFacility",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "Folder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "JspFolder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "RunClientTest",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "SampleMethods",ClientTestDelegateCommand.class);
-
- dataRegistry.addMapping(ClientTestWidget.class, "TestService",FinishTestFragment.class);
- dataRegistry.addMapping(ClientTestWidget.class, "TestID",FinishTestFragment.class);
- dataRegistry.addMapping(ClientTestWidget.class, "IsTestWidget",FinishTestFragment.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
-
- widgetRegistry_ = widgetRegistry;
-
- widgetRegistry.add( "ClientTestWidget",
- msgUtils.getMessage("PAGE_TITLE_WS_SAMPLE"),
- msgUtils.getMessage("PAGE_DESC_WS_SAMPLE"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new ClientTestWidget();
- }
- });
- }
-
- private class InitClientRegistry extends SimpleCommand
- {
- private WebServiceClientTypeRegistry clientRegistry_ = WebServiceClientTypeRegistry.getInstance();
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.Command#execute(org.eclipse.wst.command.env.core.common.Environment)
- */
- public Status execute(Environment environment)
- {
- clientRegistry_.setDataMappingRegistry( dataMappingRegistry_ );
- clientRegistry_.setWidgetRegistry( widgetRegistry_ );
- clientRegistry_.setCanFinishRegistry( canFinishRegistry_ );
-
- return new SimpleStatus( "" );
- }
- }
-
- private class InitializeProxyCommand extends SimpleCommand
- {
- private IStructuredSelection selection_;
-
- public String getProxyBean()
- {
- String proxyBean = "";
-
- try
- {
- IResource resource = ResourceUtils.getResourceFromSelection( selection_.getFirstElement() );
- String beanPackage = ResourceUtils.getJavaResourcePackageName( resource.getFullPath() );
-
- if( beanPackage==null )
- beanPackage = "";
- else
- beanPackage = beanPackage + ".";
-
- proxyBean = beanPackage + resource.getName();
-
- if( proxyBean.toLowerCase().endsWith(".java") || proxyBean.toLowerCase().endsWith(".class"))
- {
- proxyBean = proxyBean.substring(0,proxyBean.lastIndexOf('.'));
- }
- }
- catch( CoreException exc )
- {
- }
-
- return proxyBean;
- }
-
- public boolean getGenerateProxy()
- {
- return true;
- }
-
- public void setInitialSelection( IStructuredSelection selection )
- {
- selection_ = selection;
- }
- }
-
- private class GenSampleRootCommandFragment extends SequenceFragment
- {
- public GenSampleRootCommandFragment()
- {
- add( new SimpleFragment( new ClientWizardWidgetDefaultingCommand(), "" ) );
- add( new SimpleFragment( new InitClientRegistry(), "" ));
- add( new SimpleFragment( new ClientWizardWidgetOutputCommand(), "" ));
- add( new SimpleFragment( new WSDLSelectionWidgetDefaultingCommand(), ""));
- add( new SimpleFragment( new ClientRuntimeSelectionWidgetDefaultingCommand(), ""));
- add( new SimpleFragment( new ClientExtensionDefaultingCommand( true ), ""));
- add( new SimpleFragment( new InitializeProxyCommand(), "" ));
- add( new SimpleFragment( new ClientExtensionOutputCommand(), "" ) );
- add( new SimpleFragment( new TestDefaultingFragment(),""));
- add( new ClientTestFragment( "ClientTestWidget") );
- add( new FinishFragment() );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragment#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- //Map SelectionCommand
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ClientRuntimeSelectionWidgetDefaultingCommand.class, "ClientInitialSelection", null);
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", InitializeProxyCommand.class );
-
- // Map ClientWizardWidgetDefaultingCommand command.
- dataRegistry.addMapping(ClientWizardWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ClientWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ClientWizardWidgetDefaultingCommand.class, "TestService", ClientWizardWidgetOutputCommand.class, "TestService", new ForceTrue() );
- dataRegistry.addMapping(ClientWizardWidgetDefaultingCommand.class, "ResourceContext", ClientWizardWidgetOutputCommand.class);
-
- // Map ClientWizardWidgetOutputCommand command.
- dataRegistry.addMapping(ClientWizardWidgetOutputCommand.class, "ClientTypeRuntimeServer", ClientRuntimeSelectionWidgetDefaultingCommand.class);
- dataRegistry.addMapping(ClientWizardWidgetOutputCommand.class, "TestService", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ClientWizardWidgetOutputCommand.class, "ResourceContext", ClientExtensionDefaultingCommand.class);
-
- // Map ClientRuntimeSelectionWidgetDefaultingCommand command
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "Runtime2ClientTypes", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ClientRuntimeSelectionWidgetDefaultingCommand.class, "ClientJ2EEVersion", ClientExtensionDefaultingCommand.class);
-
- // Map WSDLSelectionWidgetDefaultingCommand command.
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", WSDLSelectionWidgetDefaultingCommand.class );
- dataRegistry.addMapping(WSDLSelectionWidgetDefaultingCommand.class, "GenWSIL", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(WSDLSelectionWidgetDefaultingCommand.class, "WsilURI", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(WSDLSelectionWidgetDefaultingCommand.class, "WebServiceURI", ClientExtensionDefaultingCommand.class, "WsdlURI", new EclipseIPath2URLStringTransformer());
-
- // Map ClientExtensionDefaultingCommand command.
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", ClientExtensionFragment.class);
-
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "Runtime2ClientTypes", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", WebServiceClientTestArrivalCommand.class, "ClientIds", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientJ2EEVersion", WebServiceClientTestArrivalCommand.class, "J2eeVersion", null);
-
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "GenerateProxy", ClientTestFragment.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "TestService", ClientTestFragment.class );
-
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", FinishDefaultCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServer", ClientTestDelegateCommand.class);
-
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", AddModuleDependenciesCommand.class );
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientJ2EEVersion", AddModuleDependenciesCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "WsdlURI", ClientTestDelegateCommand.class);
-
- // Map InitializeProxyCommand command.
- dataRegistry.addMapping(InitializeProxyCommand.class, "ProxyBean", ClientExtensionOutputCommand.class);
- dataRegistry.addMapping(InitializeProxyCommand.class, "GenerateProxy", ClientExtensionOutputCommand.class);
-
- // Map ClientExtensionOutputCommand command.
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "ProxyBean", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", ClientTestFragment.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", FinishTestFragment.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", FinishJavaTestFragment.class);
-
- // MAP post server config call
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", ClientExtensionOutputCommand.class, "EARProjectName", new StringToIProjectTransformer());
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServerInstance", ClientExtensionOutputCommand.class, "ExistingServerId", null);
-
-
- // Map WebServiceClientTestArrivalCommand command.
- dataRegistry.addMapping(TestDefaultingFragment.class, "TestFacility",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "ProxyBean",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "TestFacility",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Folder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "JspFolder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "RunClientTest",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Methods",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR",ClientTestDelegateCommand.class);
-
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject",AddModuleDependenciesCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR",AddModuleDependenciesCommand.class);
- }
- }
-
- private class ForceTrue implements Transformer
- {
- public Object transform(Object value)
- {
- return new Boolean(true);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ImportWSILWidgetBinding.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ImportWSILWidgetBinding.java
deleted file mode 100644
index 3854afa..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ImportWSILWidgetBinding.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.binding;
-
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ImportWSILWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.wsil.AddWSDLToWSILWrapperCommand;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.SelectionCommand;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class ImportWSILWidgetBinding implements CommandWidgetBinding
-{
- private CanFinishRegistry canFinishRegistry;
- private WidgetRegistry widgetRegistry;
- private DataMappingRegistry dataMappingRegistry;
-
- public ImportWSILWidgetBinding()
- {
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create()
- */
- public CommandFragmentFactory create()
- {
- return new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- SequenceFragment root = new SequenceFragment();
- root.add(new SimpleFragment("ImportWSILWidget"));
- root.add(new SimpleFragment(new AddWSDLToWSILWrapperCommand(), ""));
- return root;
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- this.canFinishRegistry = canFinishRegistry;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- this.dataMappingRegistry = dataRegistry;
-
- // ImportWSILWidget
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ImportWSILWidget.class);
-
- // AddWSDLToWSILWrapperCommand
- dataRegistry.addMapping(ImportWSILWidget.class, "GenWSILArguments", AddWSDLToWSILWrapperCommand.class, "Args", null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- this.widgetRegistry = widgetRegistry;
-
- widgetRegistry.add("ImportWSILWidget",
- msgUtils.getMessage("TITLE_WSIL_IMPORT"),
- msgUtils.getMessage("DESC_WSIL_IMPORT"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new ImportWSILWidget();
- }
- }
- );
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ImportWSWidgetBinding.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ImportWSWidgetBinding.java
deleted file mode 100644
index 52db5b2..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/ImportWSWidgetBinding.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.binding;
-
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.PublishToPrivateUDDICommandFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.PublishWSWidget;
-import org.eclipse.jst.ws.internal.ui.wse.LaunchWebServicesExplorerCommand;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class ImportWSWidgetBinding implements CommandWidgetBinding
-{
- private CanFinishRegistry canFinishRegistry;
- private WidgetRegistry widgetRegistry;
- private DataMappingRegistry dataMappingRegistry;
- private PublishToPrivateUDDICommandFragment publishToPrivateUDDICmdFrag;
-
- public ImportWSWidgetBinding()
- {
- publishToPrivateUDDICmdFrag = new PublishToPrivateUDDICommandFragment();
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create()
- */
- public CommandFragmentFactory create()
- {
- return new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- SequenceFragment root = new SequenceFragment();
- root.add(new SimpleFragment("WSImport"));
- root.add(publishToPrivateUDDICmdFrag);
- root.add(new SimpleFragment(new LaunchWebServicesExplorerCommand(), ""));
- return root;
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- this.canFinishRegistry = canFinishRegistry;
- publishToPrivateUDDICmdFrag.registerCanFinish(this.canFinishRegistry);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- this.dataMappingRegistry = dataRegistry;
- publishToPrivateUDDICmdFrag.registerDataMappings(this.dataMappingRegistry);
-
- // PublishToPrivateUDDICommandFragment
- dataMappingRegistry.addMapping(PublishWSWidget.class, "PublishToPrivateUDDI", PublishToPrivateUDDICommandFragment.class);
-
- // LaunchWebServicesExplorerCommand
- dataMappingRegistry.addMapping(PublishWSWidget.class, "ForceLaunchOutsideIDE", LaunchWebServicesExplorerCommand.class);
- dataMappingRegistry.addMapping(PublishWSWidget.class, "LaunchOptions", LaunchWebServicesExplorerCommand.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- this.widgetRegistry = widgetRegistry;
- publishToPrivateUDDICmdFrag.registerWidgetMappings(this.widgetRegistry);
-
- widgetRegistry.add("WSImport",
- msgUtils.getMessage("PAGE_TITLE_WS_FIND"),
- msgUtils.getMessage("PAGE_DESC_WS_FIND"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new PublishWSWidget(false);
- }
- }
- );
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionDefaultingCommand.java
deleted file mode 100644
index 5fe173e..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionDefaultingCommand.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions;
-
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-public class ClientExtensionDefaultingCommand extends SimpleCommand
-{
- // ClientWizardWidget
- private TypeRuntimeServer clientIds_;
- private Boolean testService;
- private ResourceContext resourceContext;
-
- // ClientRuntimeSelectionWidget
- private SelectionListChoices clientChoices_;
- private String j2eeVersion;
- private boolean clientNeedEAR_;
-
- // WSDLSelectionWidget
- private boolean genWSIL;
- private String wsilURI;
-
- // WSDLSelectionConditionCommand
- private WebServicesParser webServicesParser;
-
- // WSDLSelectionTreeWidget
- private String wsdlURI;
-
- private boolean isClientScenario_;
- private boolean genProxy_ = true;
- private String launchedServiceTestName;
-
- //ServerDeployableConfigurationCommand
- private String serverInstId_;
-
- public ClientExtensionDefaultingCommand( boolean isClientScenario )
- {
- isClientScenario_ = isClientScenario;
- }
-
- public boolean getIsClientScenario()
- {
- return isClientScenario_;
- }
-
- public void setRuntime2ClientTypes( SelectionListChoices choices )
- {
- clientChoices_ = choices;
- }
-
- public SelectionListChoices getRuntime2ClientTypes()
- {
- return clientChoices_;
- }
-
- public void setClientTypeRuntimeServer(TypeRuntimeServer ids)
- {
- clientIds_ = ids;
- }
-
- public TypeRuntimeServer getClientTypeRuntimeServer()
- {
- return clientIds_;
- }
-
- public void setServiceExistingServerInstId(String serverInstId) {
- this.serverInstId_ = serverInstId;
- }
-
- public String getServiceExistingServerInstId(){
- return this.serverInstId_;
- }
-
- /**
- * @return Returns the clientIsExistingServer.
- */
- public boolean isClientIsExistingServer()
- {
- return clientIds_.getServerInstanceId() != null;
- }
-
- /**
- * @return Returns the clientProject.
- */
- public String getClientProject()
- {
- return clientChoices_.getChoice().getChoice().getList().getSelection();
- }
-
- /**
- * @return Returns the clientProjectEAR.
- */
- public String getClientProjectEAR()
- {
- return clientChoices_.getChoice().getChoice().getChoice().getList().getSelection();
- }
-
- /**
- * @return Returns the clientProjectType.
- */
- public String getClientProjectType()
- {
- return clientChoices_.getChoice().getList().getSelection();
- }
-
- /**
- * @return Returns the clientRuntime.
- */
- public String getClientRuntime()
- {
- return clientIds_.getRuntimeId();
- }
-
- /**
- * @return Returns the clientServer.
- */
- public String getClientServer()
- {
- return clientIds_.getServerId();
- }
-
- public String getClientServerInstance()
- {
- return clientIds_.getServerInstanceId();
- }
-
- public void setClientExistingServerInstanceId(String serverInstId){
-
- if (clientIds_.getServerInstanceId()==null)
- clientIds_.setServerInstanceId(serverInstId);
- }
-
- /**
- * @return Returns the genWSIL.
- */
- public boolean isGenWSIL()
- {
- return genWSIL;
- }
-
- /**
- * @param genWSIL
- * The genWSIL to set.
- */
- public void setGenWSIL(boolean genWSIL)
- {
- this.genWSIL = genWSIL;
- }
-
- /**
- * @return Returns the resourceContext.
- */
- public ResourceContext getResourceContext()
- {
- return resourceContext;
- }
-
- /**
- * @param resourceContext
- * The resourceContext to set.
- */
- public void setResourceContext(ResourceContext resourceContext)
- {
- this.resourceContext = resourceContext;
- }
-
- /**
- * @return Returns the testProxySelected.
- */
- public Boolean getTestService()
- {
- return testService;
- }
-
- /**
- * @param testProxySelected
- * The testProxySelected to set.
- */
- public void setTestService(Boolean testService)
- {
- this.testService = testService;
- }
-
- /**
- * @return Returns the wsdlURI.
- */
- public String getWsdlURI()
- {
- return wsdlURI;
- }
-
- /**
- * @param wsdlURI
- * The wsdlURI to set.
- */
- public void setWsdlURI(String wsdlURI)
- {
- this.wsdlURI = wsdlURI;
- }
-
- /**
- * @return Returns the wsilURI.
- */
- public String getWsilURI()
- {
- return wsilURI;
- }
-
- /**
- * @param wsilURI
- * The wsilURI to set.
- */
- public void setWsilURI(String wsilURI)
- {
- this.wsilURI = wsilURI;
- }
-
- /**
- * @return Returns the webServicesParser.
- */
- public WebServicesParser getWebServicesParser()
- {
- if (webServicesParser != null)
- return webServicesParser;
- else
- return new WebServicesParserExt();
- }
-
- /**
- * @param webServicesParser
- * The webServicesParser to set.
- */
- public void setWebServicesParser(WebServicesParser webServicesParser)
- {
- this.webServicesParser = webServicesParser;
- }
-
- /**
- * @return Returns the j2eeVersion.
- */
- public String getClientJ2EEVersion()
- {
- return j2eeVersion;
- }
-
- /**
- * @param version The j2eeVersion to set.
- */
- public void setClientJ2EEVersion(String version)
- {
- j2eeVersion = version;
- }
-
- public boolean getGenerateProxy()
- {
- return genProxy_;
- }
-
- public void setGenerateProxy( boolean genProxy )
- {
- genProxy_ = genProxy;
- }
-
- public void setLaunchedServiceTestName(String launchedServiceTestName)
- {
- this.launchedServiceTestName = launchedServiceTestName;
- }
-
- public String getLaunchedServiceTestName()
- {
- return launchedServiceTestName;
- }
-
- public boolean getClientNeedEAR()
- {
- return clientNeedEAR_;
- }
-
- public void setClientNeedEAR(boolean clientNeedEAR)
- {
- clientNeedEAR_ = clientNeedEAR;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionFragment.java
deleted file mode 100644
index 0576027..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionFragment.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions;
-
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceClientTypeRegistry;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.fragment.ExtensionFragment;
-
-
-public class ClientExtensionFragment extends ExtensionFragment
-{
- public ClientExtensionFragment()
- {
- setExtensionRegistry( WebServiceClientTypeRegistry.getInstance() );
- }
-
- protected ClientExtensionFragment( ClientExtensionFragment fragment )
- {
- super( fragment );
- }
-
- public void setClientTypeRuntimeServer( TypeRuntimeServer ids )
- {
- setExtensionIds( new String[]{ ids.getTypeId(), ids.getRuntimeId(), ids.getServerId() } );
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#clone()
- */
- public Object clone()
- {
- return new ClientExtensionFragment( this );
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionOutputCommand.java
deleted file mode 100644
index 7ecf5f1..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ClientExtensionOutputCommand.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/**
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.consumption.command.common.AbstractStartServer;
-import org.eclipse.jst.ws.internal.consumption.common.WebServiceStartServerRegistry;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-
-public class ClientExtensionOutputCommand extends SimpleCommand
-{
- private String proxyBean_;
- private boolean genProxy_;
- private String setEndpointMethod;
-
- private String existingServerId_;
- private String earProjectName_;
- private IServer fExistingServer = null;
-
- public boolean isUndoable(){
- return true;
- }
-
- public Status undo(Environment env){
- Status stat = new SimpleStatus("");
-
- try {
-
- // check existingServer
- if (fExistingServer!=null) {
-
- // get EAR project
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject earProject = null;
- if (earProjectName_!=null && earProjectName_.length()>0) {
- earProject = root.getProject(earProjectName_);
- }
-
- AbstractStartServer startServerCommand = null;
- WebServiceStartServerRegistry reg = WebServiceStartServerRegistry.getInstance();
- startServerCommand = (AbstractStartServer)reg.getServerStartByTypeId(fExistingServer.getServerType().getId());
- if (earProject!=null) {
- startServerCommand.runPreServerConfig(fExistingServer, earProject);
- }
- }
- }
- catch (CoreException ce ) {
- IStatus embeddedStatus = ce.getStatus();
- stat = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- env.getStatusHandler().reportError(stat);
- return stat;
- }
-
- return stat;
- }
-
- public Status execute(Environment env){
-
- Status status = new SimpleStatus("");
-
- IServer[] servers = ServerCore.getServers();
- IServer existingServer = null;
- fExistingServer = null;
- for (int i=0; i<servers.length; i++)
- {
- IServer thisServer = (IServer)servers[i];
- IServerWorkingCopy wc = null;
- String thisServerId = null;
- if (thisServer!=null) {
- wc = thisServer.createWorkingCopy();
- thisServerId = (wc!=null ? wc.getId() : null);
- }
-
- if (thisServerId.equals(existingServerId_))
- existingServer = thisServer;
- }
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject earProject = null;
- if (earProjectName_!=null && earProjectName_.length()>0)
- {
- earProject = root.getProject(earProjectName_);
- }
-
- if (existingServer!=null){
- AbstractStartServer startServerCommand = null;
- WebServiceStartServerRegistry reg = WebServiceStartServerRegistry.getInstance();
- startServerCommand = (AbstractStartServer)reg.getServerStartByTypeId(existingServer.getServerType().getId());
- if (earProject!=null){
- startServerCommand.runPostServerConfig(existingServer, earProject);
- fExistingServer = existingServer;
- }
- }
- }
- catch (CoreException ce ) {
- IStatus embeddedStatus = ce.getStatus();
- status = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- return status;
- }
-
- /**
- * @return Returns the proxyBean.
- */
-
- public String getProxyBean()
- {
- return proxyBean_;
- }
- /**
- * @param proxyBean The proxyBean to set.
- */
- public void setProxyBean(String proxyBean)
- {
- this.proxyBean_ = proxyBean;
- }
-
- public boolean getGenerateProxy()
- {
- return genProxy_;
- }
-
- public void setGenerateProxy( boolean genProxy )
- {
- genProxy_ = genProxy;
- }
-
- /**
- * @return Returns the setEndpointMethod.
- */
- public String getSetEndpointMethod()
- {
- return setEndpointMethod;
- }
- /**
- * @param setEndpointMethod The setEndpointMethod to set.
- */
- public void setSetEndpointMethod(String setEndpointMethod)
- {
- this.setEndpointMethod = setEndpointMethod;
- }
-
- /**
- * @param earProjectName The earProjectName to set.
- */
- public void setEarProjectName(String earProjectName) {
- this.earProjectName_ = earProjectName;
- }
- /**
- * @param existingServerId The existingServerId to set.
- */
- public void setExistingServerId(String existingServerId) {
- this.existingServerId_ = existingServerId;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionDefaultingCommand.java
deleted file mode 100644
index 30290de..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionDefaultingCommand.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions;
-
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-public class ServerExtensionDefaultingCommand extends SimpleCommand
-{
- private Boolean startService;
- private Boolean testService;
- private Boolean publishService;
- private TypeRuntimeServer serviceIds_;
- private SelectionListChoices serviceChoices_;
- private String j2eeVersion;
- private boolean serviceNeedEAR_;
- private WebServicesParser wsdlParser_;
-
-
- public void setServiceTypeRuntimeServer(TypeRuntimeServer ids)
- {
- serviceIds_ = ids;
- }
-
- public void setServiceExistingServerInstanceId(String serverInstId){
-
- if (serviceIds_.getServerInstanceId()==null)
- serviceIds_.setServerInstanceId(serverInstId);
- }
-
- /**
- *
- * @return returns the TypeRuntimeService object that the user has selected on
- * page 3 of the wizard.
- */
- public TypeRuntimeServer getServiceTypeRuntimeServer()
- {
- return serviceIds_;
- }
-
- public void setServiceProject2EARProject(SelectionListChoices choices)
- {
- serviceChoices_ = choices;
- }
-
-
- /**
- * @return Returns the publishService.
- */
- public Boolean getPublishService()
- {
- return publishService;
- }
-
- /**
- * @param publishService
- * The publishService to set.
- */
- public void setPublishService(Boolean publishService)
- {
- this.publishService = publishService;
- }
-
- /**
- * @return Returns the serverIsExistingServer.
- */
- public boolean getServerIsExistingServer()
- {
- return serviceIds_.getServerInstanceId() != null;
- }
-
- /**
-
- * @return Returns the serverInstanceId
- */
- public String getServiceServerInstanceId()
- {
- return serviceIds_.getServerInstanceId();
- }
-
- /**
- * @return Returns the serverProject.
- */
- public String getServerProject()
- {
- return serviceChoices_.getList().getSelection();
- }
-
- /**
- * @return Returns the serverProjectEAR.
- */
- public String getServerProjectEAR()
- {
- return serviceChoices_.getChoice().getList().getSelection();
- }
-
- /**
- * @return Returns the serverRuntime.
- */
- public String getServerRuntime()
- {
- return serviceIds_.getRuntimeId();
- }
-
- /**
- * @return Returns the serverServer.
- */
- public String getServerServer()
- {
- return serviceIds_.getServerId();
- }
-
- /**
- * @return Returns the serviceScenarioId.
- */
- public String getServiceScenarioId()
- {
- return serviceIds_.getTypeId();
- }
-
- /**
- * @return Returns the startService.
- */
- public Boolean getStartService()
- {
- return startService;
- }
-
- /**
- * @param startService
- * The startService to set.
- */
- public void setStartService(Boolean startService)
- {
- this.startService = startService;
- }
-
- /**
- * @return Returns the testService.
- */
- public Boolean getTestService()
- {
- return testService;
- }
-
- /**
- * @param testService
- * The testService to set.
- */
- public void setTestService(Boolean testService)
- {
- this.testService = testService;
- }
-
- public Boolean getPublish()
- {
- return new Boolean(true);
- }
-
- /**
- * @return Returns the j2eeVersion.
- */
- public String getServiceJ2EEVersion()
- {
- return j2eeVersion;
- }
-
- /**
- * @param version The j2eeVersion to set.
- */
- public void setServiceJ2EEVersion(String version)
- {
- j2eeVersion = version;
- }
-
- /**
- *
- * @return returns true if the web service project needs to be in an EAR project.
- */
- public boolean getServiceNeedEAR()
- {
- return serviceNeedEAR_;
- }
-
- public void setServiceNeedEAR(boolean serviceNeedEAR)
- {
- serviceNeedEAR_ = serviceNeedEAR;
- }
-
- /**
- *
- * @return returns true if the web service project is an EJB project.
- */
- public boolean getIsServiceProjectEJB()
- {
- //If the type/server/runtime suggests that an EJB project
- //is required, return true.
- boolean ejbRequired = false;
- boolean ejbRequired2 = false;
- WebServiceServerRuntimeTypeRegistry wssrtRegistry = WebServiceServerRuntimeTypeRegistry.getInstance();
- if (serviceIds_ != null)
- {
- String serverTypeId = wssrtRegistry.getWebServiceServerByFactoryId(serviceIds_.getServerId()).getId();
- ejbRequired = wssrtRegistry.requiresEJBModuleFor(serverTypeId, serviceIds_.getRuntimeId(), serviceIds_.getTypeId());
- ejbRequired2 = wssrtRegistry.requiresEJBProject(serviceIds_.getTypeId());
- }
-
- return (ejbRequired || ejbRequired2);
- }
-
- /**
- * @return Returns the wsdlParser_.
- */
- public WebServicesParser getWebServicesParser()
- {
- if( wsdlParser_ == null )
- {
- wsdlParser_ = new WebServicesParserExt();
- }
-
- return wsdlParser_;
- }
- /**
- * @param wsdlParser_ The wsdlParser_ to set.
- */
- public void setWebServicesParser(WebServicesParser wsdlParser )
- {
- wsdlParser_ = wsdlParser;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionFragment.java
deleted file mode 100644
index f89cace..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionFragment.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions;
-
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.fragment.ExtensionFragment;
-
-
-public class ServerExtensionFragment extends ExtensionFragment
-{
- public ServerExtensionFragment()
- {
- setExtensionRegistry( WebServiceServerRuntimeTypeRegistry.getInstance() );
- }
-
- protected ServerExtensionFragment( ServerExtensionFragment fragment )
- {
- super( fragment );
- }
-
- public void setServiceTypeRuntimeServer( TypeRuntimeServer ids )
- {
- setExtensionIds( new String[]{ ids.getTypeId(), ids.getRuntimeId(), ids.getServerId() } );
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#clone()
- */
- public Object clone()
- {
- return new ServerExtensionFragment( this );
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionOutputCommand.java
deleted file mode 100644
index 0689274..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/extensions/ServerExtensionOutputCommand.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/**
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.consumption.command.common.AbstractStartServer;
-import org.eclipse.jst.ws.internal.consumption.common.WebServiceStartServerRegistry;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-public class ServerExtensionOutputCommand extends SimpleCommand
-{
- private String wsdlURI_;
- private WebServicesParser wsdlParser_;
-
- private String existingServerId_;
- private String earProjectName_;
- private boolean isWebProjectStartupRequested_ = false;
-
- private IServer fExistingServer = null;
-
- public boolean isUndoable(){
- return true;
- }
-
- public Status undo(Environment env){
- Status stat = new SimpleStatus("");
-
- try {
-
- // check existingServer
- if (fExistingServer!=null) {
-
- // get EAR project
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject earProject = null;
- if (earProjectName_!=null && earProjectName_.length()>0) {
- earProject = root.getProject(earProjectName_);
- }
-
- AbstractStartServer startServerCommand = null;
- WebServiceStartServerRegistry reg = WebServiceStartServerRegistry.getInstance();
- startServerCommand = (AbstractStartServer)reg.getServerStartByTypeId(fExistingServer.getServerType().getId());
- if (earProject!=null) {
- startServerCommand.runPreServerConfig(fExistingServer, earProject);
- }
- }
- }
- catch (CoreException ce ) {
- IStatus embeddedStatus = ce.getStatus();
- stat = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- env.getStatusHandler().reportError(stat);
- return stat;
- }
-
- return stat;
- }
-
- public Status execute(Environment env){
-
- Status status = new SimpleStatus("");
-
- IServer[] servers = ServerCore.getServers();
- IServer existingServer =null;
- fExistingServer = null;
- for (int i=0; i<servers.length; i++)
- {
- IServer thisServer = (IServer)servers[i];
- IServerWorkingCopy wc = null;
- String thisServerId = null;
- if (thisServer!=null) {
- wc = thisServer.createWorkingCopy();
- thisServerId = (wc!=null ? wc.getId() : null);
- }
-
- if (thisServerId.equals(existingServerId_))
- existingServer = thisServer;
- }
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject earProject = null;
- if (earProjectName_!=null && earProjectName_.length()>0)
- {
- earProject = root.getProject(earProjectName_);
- }
-
- AbstractStartServer startServerCommand = null;
- WebServiceStartServerRegistry reg = WebServiceStartServerRegistry.getInstance();
- startServerCommand = (AbstractStartServer)reg.getServerStartByTypeId(existingServer.getServerType().getId());
- if (earProject!=null) {
- startServerCommand.runPostServerConfig(existingServer, earProject);
- fExistingServer = existingServer;
- }
- }
- catch (CoreException ce ) {
- IStatus embeddedStatus = ce.getStatus();
- status = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- return status;
- }
-
-
- /**
- * @return Returns the wsdlURI.
- */
- public String getWsdlURI()
- {
- return wsdlURI_;
- }
-
- /**
- * @param wsdlURI
- * The wsdlURI to set.
- */
- public void setWsdlURI(String wsdlURI)
- {
- wsdlURI_ = wsdlURI;
- }
-
- /**
- * @return Returns the wsdlParser_.
- */
- public WebServicesParser getWebServicesParser()
- {
- if( wsdlParser_ == null )
- {
- wsdlParser_ = new WebServicesParserExt();
- }
-
- return wsdlParser_;
- }
- /**
- * @param wsdlParser_ The wsdlParser_ to set.
- */
- public void setWebServicesParser(WebServicesParser wsdlParser_)
- {
- this.wsdlParser_ = wsdlParser_;
- }
-/**
- * @param earProjectName The earProjectName to set.
- */
-public void setEarProjectName(String earProjectName) {
- this.earProjectName_ = earProjectName;
-}
-/**
- * @param existingServerId The existingServerId to set.
- */
-public void setExistingServerId(String existingServerId) {
- this.existingServerId_ = existingServerId;
-}
-
-/**
- * @return Returns the isRestartProjectNeeded.
- */
-public boolean getIsWebProjectStartupRequested() {
- return isWebProjectStartupRequested_;
-}
-/**
- * @param isRestartProjectNeeded The isRestartProjectNeeded to set.
- */
-public void setIsWebProjectStartupRequested(boolean isRestartProjectNeeded) {
- this.isWebProjectStartupRequested_ = isRestartProjectNeeded;
-}
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/AbstractObjectSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/AbstractObjectSelectionWidget.java
deleted file mode 100644
index a9b313a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/AbstractObjectSelectionWidget.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-
-
-public abstract class AbstractObjectSelectionWidget extends SimpleWidgetDataContributor implements IObjectSelectionWidget
-{
- public void setInitialSelection(IStructuredSelection initialSelection)
- {
- // subclass should override this method
- }
-
- public IStructuredSelection getObjectSelection()
- {
- // subclass should override this method
- return new StructuredSelection();
- }
-
- public Status validateSelection(IStructuredSelection objectSelection)
- {
- // subclass should override this method
- return new SimpleStatus("");
- }
-
- public IProject getProject()
- {
- // subclass should override this method
- return null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/EJBSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/EJBSelectionWidget.java
deleted file mode 100644
index 93e450e..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/EJBSelectionWidget.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.Session;
-import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
-import org.eclipse.jst.j2ee.internal.earcreation.IEARNatureConstants;
-import org.eclipse.jst.j2ee.internal.ejb.project.EJBNatureRuntime;
-import org.eclipse.jst.j2ee.internal.ejb.project.EJBProjectResources;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-public class EJBSelectionWidget extends AbstractObjectSelectionWidget implements IObjectSelectionWidget
-{
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- private Combo earList;
- private EJBTableViewer beanList;
- private EARNatureRuntime[] earProjects;
- private Integer selectedBeanIndex = null;
- private Vector ejbBeanNames;
- private Vector ejbProjectNames;
- private Listener statusListener_;
- /* CONTEXT_ID PEBD0001 for the EAR Projects drop-down box */
- private String INFOPOP_PEBD_EAR_PROJECTS = "org.eclipse.jst.ws.consumption.ui.PEBD0001";
- /* CONTEXT_ID PEBD0002 for the table containing all of the bean names */
- private String INFOPOP_PEBD_TABLE_BEAN_NAMES = "org.eclipse.jst.ws.consumption.ui.PEBD0002";
-
- public EJBSelectionWidget()
- {
- IProject[] projects = J2EEUtils.getEARProjects();
- Vector earVector = new Vector();
- for (int i = 0; i < projects.length; i++)
- {
- try
- {
- earVector.add(projects[i].getNature(IEARNatureConstants.NATURE_ID));
- }
- catch (CoreException ce)
- {
- }
- }
- earProjects = (EARNatureRuntime[]) earVector.toArray(new EARNatureRuntime[0]);
- }
-
- public String getSelectedBean()
- {
- if (selectedBeanIndex != null)
- {
- return (String) (ejbBeanNames.elementAt(selectedBeanIndex.intValue()));
- }
- return null;
- }
-
- public String getSelectedProject()
- {
- if (selectedBeanIndex != null)
- {
- return (String) (ejbProjectNames.elementAt(selectedBeanIndex.intValue()));
- }
- return null;
- }
-
- public WidgetDataEvents addControls(Composite parent, Listener statusListener)
- {
- MessageUtils msgUtils = new MessageUtils(pluginId_ + ".plugin", this);
- statusListener_ = statusListener;
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- GridData gd = new GridData(GridData.FILL_BOTH);
- composite.setLayout(layout);
- composite.setLayoutData(gd);
- Composite projectComposite = new Composite(composite, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 2;
- projectComposite.setLayout(layout);
- projectComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
- new Label(projectComposite, SWT.NULL).setText(msgUtils.getMessage("LABEL_EAR_PROJECTS"));
- earList = new Combo(projectComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
- earList.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- earList.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent evt)
- {
- Combo widget = (Combo) (evt.widget);
- setBeanList(earProjects[widget.getSelectionIndex()]);
- selectedBeanIndex = null;
- statusListener_.handleEvent(null);
- }
- });
- addEARNamesToList();
- earList.setToolTipText(msgUtils.getMessage("TOOLTIP_EAR_PROJECTS"));
- WorkbenchHelp.setHelp(earList, new Object[]{INFOPOP_PEBD_EAR_PROJECTS});
- Group beanComposite = new Group(composite, SWT.NONE);
- layout = new GridLayout();
- beanComposite.setLayout(layout);
- beanComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
- beanComposite.setText(msgUtils.getMessage("LABEL_EJB_BEAN_NAME"));
- beanList = new EJBTableViewer(beanComposite);
- Table beanTable = beanList.getTable();
- gd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- gd.heightHint = 100;
- beanTable.setLayoutData(gd);
- beanTable.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent evt)
- {
- Table table = (Table) (evt.widget);
- selectedBeanIndex = new Integer(table.getSelectionIndex());
- statusListener_.handleEvent(null);
- }
- });
- beanTable.setToolTipText(msgUtils.getMessage("TOOLTIP_TABLE_BEAN_NAMES"));
- WorkbenchHelp.setHelp(beanTable, new Object[]{INFOPOP_PEBD_TABLE_BEAN_NAMES});
- if (earProjects != null && earProjects.length > 0)
- {
- setBeanList(earProjects[0]);
- }
- beanTable.getColumn(0).pack();
- beanTable.getColumn(1).pack();
- // This is a dummy label that forces the status label into the second
- // column.
- new Label(composite, SWT.NULL).setText("");
- return this;
- }
-
- private void addEARNamesToList()
- {
- if (earProjects != null && earProjects.length > 0)
- {
- for (int index = 0; index < earProjects.length; index++)
- {
- earList.add(earProjects[index].getProject().getName());
- }
- earList.setText(earList.getItem(0));
- }
- }
-
- private void setBeanList(EARNatureRuntime earProject)
- {
- Vector ejbProjects = J2EEUtils.getEJBProjects(earProject);
- Table beanTable = beanList.getTable();
- beanTable.removeAll();
- ejbBeanNames = new Vector();
- ejbProjectNames = new Vector();
- for (int index = 0; index < ejbProjects.size(); index++)
- {
- EJBNatureRuntime ejbNature = (EJBNatureRuntime) (ejbProjects.elementAt(index));
- EJBProjectResources ejbResource = new EJBProjectResources(ejbNature.getProject());
- EJBJar jar = ejbResource.getEJBJar();
- Vector beans = J2EEUtils.getBeanNames(jar);
- String projectName = ejbNature.getProject().getName();
- ejbBeanNames.addAll(beans);
- ejbProjectNames.addAll(Collections.nCopies(beans.size(), projectName));
- ejbResource.cleanup();
- }
- beanList.setData(ejbBeanNames, ejbProjectNames);
- beanList.setInput(ejbBeanNames);
- }
-
- public void setInitialSelection(IStructuredSelection initialSelection)
- {
- if (initialSelection != null && !initialSelection.isEmpty())
- {
- Object object = initialSelection.getFirstElement();
- if (object instanceof Session)
- {
- Session session = (Session) object;
- EJBJar jar = session.getEjbJar();
- if (jar != null)
- {
- for (int i = 0; i < earProjects.length; i++)
- {
- Vector ejbProjects = J2EEUtils.getEJBProjects(earProjects[i]);
- for (Iterator it = ejbProjects.iterator(); it.hasNext();)
- {
- EJBProjectResources ejbResource = new EJBProjectResources(((EJBNatureRuntime) it.next()).getProject());
- if (ejbResource.getEJBJar() == jar)
- {
- earList.setText(earProjects[i].getProject().getName());
- setBeanList(earProjects[i]);
- beanList.setSelection(new StructuredSelection(new Integer[]{new Integer(ejbBeanNames.indexOf(session.getName()))}));
- selectedBeanIndex = new Integer(ejbBeanNames.indexOf(session.getName()));
- ejbResource.cleanup();
- return;
- }
- ejbResource.cleanup();
- }
- }
- }
- }
- }
- }
-
- public IStructuredSelection getObjectSelection()
- {
- IStructuredSelection sel = (IStructuredSelection) beanList.getSelection();
- if (sel != null && !sel.isEmpty())
- {
- Object object = sel.getFirstElement();
- if (object instanceof Integer)
- {
- String selEJBName = (String) ejbBeanNames.get(((Integer) object).intValue());
- if (selEJBName != null)
- {
- Vector ejbProjects = J2EEUtils.getEJBProjects(earProjects[earList.getSelectionIndex()]);
- for (Iterator it = ejbProjects.iterator(); it.hasNext();)
- {
- EJBProjectResources ejbResource = new EJBProjectResources(((EJBNatureRuntime) it.next()).getProject());
- EJBJar jar = ejbResource.getEJBJar();
- java.util.List sessions = jar.getSessionBeans();
- for (Iterator it2 = sessions.iterator(); it2.hasNext();)
- {
- Session session = (Session) it2.next();
- if (selEJBName.equals(session.getName()))
- {
- ejbResource.cleanup();
- return new StructuredSelection(new Session[]{session});
- }
- }
- ejbResource.cleanup();
- }
- }
- }
- }
- return new StructuredSelection(new Object[0]);
- }
-
- public IProject getProject()
- {
- String projectName = getSelectedProject();
- if (projectName != null && projectName.length() > 0)
- return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- else
- return null;
- }
-
- public Status validateSelection(IStructuredSelection objectSelection)
- {
- return new SimpleStatus("");
- }
-
- public Status getStatus()
- {
- if (selectedBeanIndex == null)
- {
- return new SimpleStatus("","",Status.ERROR);
- }
-
- return new SimpleStatus("");
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/EJBTableViewer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/EJBTableViewer.java
deleted file mode 100644
index b189f39..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/EJBTableViewer.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-
-public class EJBTableViewer extends TableViewer
-{
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- private Vector beanNames;
- private Vector projectNames;
-
- public EJBTableViewer(Composite parent)
- {
- super(parent, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- String columnProperties[] = {msgUtils.getMessage("TABLE_TITLE_EJB_BEAN_NAMES"), msgUtils.getMessage("TABLE_TITLE_EJB_PROJECT_NAME")};
- Table table = getTable();
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- TableLayout layout = new TableLayout();
- for (int i = 0; i < columnProperties.length; i++)
- {
- TableColumn column = new TableColumn(table, i);
- column.setText(columnProperties[i]);
- column.setAlignment(SWT.LEFT);
- layout.addColumnData(new ColumnWeightData(50, 80, true));
- }
- table.setLayout(layout);
- setColumnProperties(columnProperties);
- setContentProvider(new EJBContentProvider());
- setLabelProvider(new EJBLabelProvider());
- }
-
- public void setData(Vector beanNames, Vector projectNames)
- {
- this.beanNames = beanNames;
- this.projectNames = projectNames;
- }
- private class EJBLabelProvider extends LabelProvider implements ITableLabelProvider
- {
- public String getColumnText(Object object, int columnIndex)
- {
- String result = null;
- if (object instanceof Integer)
- {
- int index = ((Integer) object).intValue();
- if (columnIndex == 0)
- {
- return (String) (beanNames.elementAt(index));
- }
- else if (columnIndex == 1)
- {
- return (String) (projectNames.elementAt(index));
- }
- }
- return result;
- }
-
- public Image getColumnImage(Object object, int columnIndex)
- {
- return null;
- }
- }
- public class EJBContentProvider implements IStructuredContentProvider
- {
- public Object[] getElements(Object element)
- {
- if (beanNames != null)
- {
- int size = beanNames.size();
- Object[] result = new Object[size];
- for (int index = 0; index < size; index++)
- {
- result[index] = new Integer(index);
- }
- return result;
- }
- return null;
- }
-
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object old, Object newobj)
- {
- }
-
- public boolean isDeleted(Object object)
- {
- return false;
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/HandlerTableItem.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/HandlerTableItem.java
deleted file mode 100644
index a7be6f4..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/HandlerTableItem.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import org.eclipse.jst.j2ee.webservice.wsdd.PortComponent;
-
-
-
-public class HandlerTableItem {
-
- private String handlerClassName;
- private String handlerName;
- private String portName;
- private int index;
-
- private PortComponent port;
- private Object handler;
- private Object wsDescRef;
-
- /**
- * @return Returns the handlerClassName.
- */
- public String getHandlerClassName() {
- return handlerClassName;
- }
- /**
- * @param handlerClassName The handlerClassName to set.
- */
- public void setHandlerClassName(String handlerClassName) {
- this.handlerClassName = handlerClassName;
- }
- /**
- * @return Returns the handlerName.
- */
- public String getHandlerName() {
- return handlerName;
- }
- /**
- * @param handlerName The handlerName to set.
- */
- public void setHandlerName(String handlerName) {
- this.handlerName = handlerName;
- }
- /**
- * @return Returns the port.
- */
- public PortComponent getPort() {
- return port;
- }
- /**
- * @param port The port to set.
- */
- public void setPort(PortComponent port) {
- this.port = port;
- }
- /**
- * @return Returns the handler.
- */
- public Object getHandler() {
- return handler;
- }
- /**
- * @param handler The handler to set.
- */
- public void setHandler(Object handler) {
- this.handler = handler;
- }
- /**
- * @return Returns the portName.
- */
- public String getPortName() {
- return portName;
- }
- /**
- * @param portName The portName to set.
- */
- public void setPortName(String portName) {
- this.portName = portName;
- }
-
- /**
- * @return Returns the index.
- */
- public int getIndex() {
- return index;
- }
- /**
- * @param index The index to set.
- */
- public void setIndex(int index) {
- this.index = index;
- }
- /**
- * @return Returns the wsDescRef.
- */
- public Object getWsDescRef() {
- return wsDescRef;
- }
- /**
- * @param wsDescRef The wsDescRef to set.
- */
- public void setWsDescRef(Object wsDescRef) {
- this.wsDescRef = wsDescRef;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/IObjectSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/IObjectSelectionWidget.java
deleted file mode 100644
index b3219ea..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/IObjectSelectionWidget.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataContributor;
-
-
-public interface IObjectSelectionWidget extends WidgetDataContributor
-{
- public void setInitialSelection(IStructuredSelection initialSelection);
- public IStructuredSelection getObjectSelection();
- public Status validateSelection(IStructuredSelection objectSelection);
- public IProject getProject();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/JavaBeanSelectionTransformer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/JavaBeanSelectionTransformer.java
deleted file mode 100644
index da8148b..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/JavaBeanSelectionTransformer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.command.env.core.data.Transformer;
-
-public class JavaBeanSelectionTransformer implements Transformer
-{
- public Object transform(Object value)
- {
- if (value instanceof IStructuredSelection)
- {
- Object sel = ((IStructuredSelection)value).getFirstElement();
- if (sel instanceof IFile)
- {
- return new StructuredSelection(computeFullyQualifiedJavaName((IFile)sel));
- }
- else if (sel instanceof ICompilationUnit)
- {
- IResource res = ((ICompilationUnit)sel).getResource();
- if (res instanceof IFile)
- return new StructuredSelection(computeFullyQualifiedJavaName((IFile)res));
- }
- }
- return value;
- }
-
- private String computeFullyQualifiedJavaName(IFile resource)
- {
- IPath path = resource.getFullPath();
- String basename = path.lastSegment();
- String beanClass = "";
- if (basename != null && basename.length() > 0)
- {
- String beanPackage = org.eclipse.jst.ws.internal.common.ResourceUtils.getJavaResourcePackageName(path);
- beanClass = (beanPackage == null ? basename : (beanPackage + "." + basename));
- if (beanClass.toLowerCase().endsWith(".java") || beanClass.toLowerCase().endsWith(".class"))
- beanClass = beanClass.substring(0, beanClass.lastIndexOf('.'));
- }
- return beanClass;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/JavaBeanSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/JavaBeanSelectionWidget.java
deleted file mode 100644
index 6fcb25f..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/JavaBeanSelectionWidget.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.jst.j2ee.webservice.wsdd.BeanLink;
-import org.eclipse.jst.j2ee.webservice.wsdd.impl.PortComponentImpl;
-import org.eclipse.jst.j2ee.webservice.wsdd.impl.ServiceImplBeanImpl;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.common.JavaResourceFilter;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.jst.ws.internal.ui.dialog.DialogUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-public class JavaBeanSelectionWidget extends AbstractObjectSelectionWidget implements IObjectSelectionWidget
-{
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- private IProject serverProject_ = null;
- private Composite parent_ = null;
- private IWizardContainer context_ = null;
- private JavaResourceFilter filter_ = new JavaResourceFilter();
- private IResource initialResource_ = null;
- private Listener statusListener;
-
- /*CONTEXT_ID PBCL0001 for the Bean Selection Page*/
- private String INFOPOP_PBCL_PAGE = "PBCL0001";
-
- private Text beanClassText_;
- /*CONTEXT_ID PBCL0002 for the Bean Selection field of the Bean Selection Page*/
- private String INFOPOP_PBCL_TEXT_BEAN_CLASS = "PBCL0002";
-
- private Button beanClassBrowseButton_;
- /*CONTEXT_ID PBCL0003 for the Bean Class Browse button of the Bean Selection Page*/
- private String INFOPOP_PBCL_BUTTON_BEAN_CLASS_BROWSE = "PBCL0003";
-
- private Button beanResourceBrowseButton_;
- /*CONTEXT_ID PBCL0004 for the Bean Resource Browse button of the Bean Selection Page*/
- private String INFOPOP_PBCL_BUTTON_BEAN_RESOURCE_BROWSE = "PBCL0004";
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- this.statusListener = statusListener;
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- UIUtils uiUtils = new UIUtils(msgUtils, pluginId_ );
-
- parent_ = parent;
-
- Composite group = uiUtils.createComposite( parent, 4 );
-
- group.setToolTipText( msgUtils.getMessage("TOOLTIP_PBCL_PAGE") );
- WorkbenchHelp.setHelp( group, pluginId_ + "." + INFOPOP_PBCL_PAGE );
-
- beanClassText_ = uiUtils.createText( group, "LABEL_BEAN_CLASS_NAME",
- "TOOLTIP_PBCL_TEXT_BEAN_CLASS",
- INFOPOP_PBCL_TEXT_BEAN_CLASS,
- SWT.SINGLE | SWT.BORDER);
- beanClassText_.addModifyListener(
- new ModifyListener()
- {
- public void modifyText(ModifyEvent e)
- {
- handleModifyBeanClassText();
- }
- }
- );
-
- beanClassBrowseButton_ = uiUtils.createPushButton( group, "BUTTON_BROWSE_CLASSES",
- "TOOLTIP_PBCL_BUTTON_BEAN_CLASS_BROWSE",
- INFOPOP_PBCL_BUTTON_BEAN_CLASS_BROWSE );
- beanClassBrowseButton_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleBrowseClasses();
- }
- } );
-
- beanResourceBrowseButton_ = uiUtils.createPushButton( group, "BUTTON_BROWSE_FILES",
- "TOOLTIP_PBCL_BUTTON_BEAN_RESOURCE_BROWSE",
- INFOPOP_PBCL_BUTTON_BEAN_RESOURCE_BROWSE );
- beanResourceBrowseButton_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleBrowseFiles();
- }
- } );
- return this;
- }
-
- private void handleModifyBeanClassText()
- {
- statusListener.handleEvent(null);
- serverProject_ = null;
- }
-
- private void handleBrowseClasses()
- {
- Shell shell = parent_.getShell();
- IType itype = DialogUtils.browseClassesAsIType(shell, ResourcesPlugin.getWorkspace().getRoot().getProjects(), new ProgressMonitorDialog(shell));
- if (itype != null)
- {
- beanClassText_.setText(itype.getFullyQualifiedName());
- try
- {
- IResource res = itype.getCorrespondingResource();
- if (res != null)
- serverProject_ = res.getProject();
- else
- serverProject_ = null;
- }
- catch (JavaModelException jme)
- {
- serverProject_ = null;
- }
- }
- }
-
- private void handleBrowseFiles()
- {
- IResource topResource = ResourceUtils.getWorkspaceRoot();
- IResource resource = DialogUtils.browseResources( parent_.getShell(), topResource, initialResource_, filter_ );
- setBeanClass(resource);
- }
-
- private void setBeanClass(IResource resource)
- {
- if( resource != null && resource instanceof IFile )
- {
- IPath path = resource.getFullPath();
- String basename = path.lastSegment();
-
- if( basename != null && basename.length() > 0 )
- {
- String beanPackage = org.eclipse.jst.ws.internal.common.ResourceUtils.getJavaResourcePackageName(path);
- String beanClass = (beanPackage == null ? basename : (beanPackage + "." + basename));
-
- if( beanClass.toLowerCase().endsWith(".java") || beanClass.toLowerCase().endsWith(".class" ) )
- {
- beanClass = beanClass.substring( 0, beanClass.lastIndexOf('.') );
- }
-
- beanClassText_.setText(beanClass);
- serverProject_ = resource.getProject();
- }
- }
- }
-
- private void setBeanClass(ServiceImplBeanImpl serviceImpl)
- {
- if( serviceImpl != null )
- {
- EObject eObject = serviceImpl.eContainer();
- if(eObject instanceof PortComponentImpl){
- PortComponentImpl pci = (PortComponentImpl)eObject;
- String beanClass = pci.getServiceEndpointInterface();
- beanClassText_.setText(beanClass);
- }
- }
- }
-
- private void setBeanClass(BeanLink serviceImpl)
- {
- if( serviceImpl != null )
- {
- EObject eObject = serviceImpl.eContainer();
- if(eObject instanceof ServiceImplBeanImpl){
- setBeanClass((ServiceImplBeanImpl)eObject);
- }
- }
- }
-
- public void setInitialSelection(IStructuredSelection initialSelection)
- {
- if (initialSelection != null && !initialSelection.isEmpty())
- {
- Object object = initialSelection.getFirstElement();
- if (object instanceof IFile)
- {
- IFile iFile = (IFile)object;
- String fileExt = iFile.getFileExtension().toLowerCase();
- if (fileExt.equals("java") || fileExt.equals("class"))
- setBeanClass(iFile);
- }
- else if (object instanceof ICompilationUnit)
- setBeanClass(((ICompilationUnit)object).getResource());
- else if (object instanceof ServiceImplBeanImpl)
- setBeanClass((ServiceImplBeanImpl)object);
- else if(object instanceof BeanLink)
- setBeanClass((BeanLink)object);
- }
- }
-
- public IStructuredSelection getObjectSelection()
- {
- return new StructuredSelection(beanClassText_.getText());
- }
-
- public IProject getProject()
- {
- return serverProject_;
- }
-
- public Status getStatus()
- {
- String beanClassName = beanClassText_.getText().trim();
- if (beanClassName == null || beanClassName.length() <= 0)
- {
- MessageUtils msgUtils = new MessageUtils(pluginId_ + ".plugin", this);
- return new SimpleStatus("", msgUtils.getMessage("PAGE_MSG_BEAN_CANNOT_BE_EMPTY"), Status.ERROR);
- }
- return new SimpleStatus("");
- }
-
- public Status validateSelection(IStructuredSelection objectSelection)
- {
- return new SimpleStatus("");
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionFragment.java
deleted file mode 100644
index f345790..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionFragment.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.IWebServiceType;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.SelectionCommand;
-
-
-public class ObjectSelectionFragment extends SequenceFragment implements Condition
-{
- private TypeRuntimeServer typeRuntimeServer;
- private boolean hasObjectSelectionWidget;
-
- public ObjectSelectionFragment()
- {
- super();
- BooleanFragment boolFragment = new BooleanFragment(new SimpleFragment("ObjectSelectionWidget"), new SimpleFragment(""), this);
- add(boolFragment);
- add(new SimpleFragment(new ObjectSelectionOutputCommand(), ""));
- hasObjectSelectionWidget = false;
- }
-
- /**
- * This method is called retrieve the data mappings for this command fragment.
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ObjectSelectionWidget.class );
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ObjectSelectionOutputCommand.class, "ObjectSelection", null);
- dataRegistry.addMapping(ObjectSelectionFragment.class, "TypeRuntimeServer", ObjectSelectionWidget.class);
- dataRegistry.addMapping(ObjectSelectionFragment.class, "TypeRuntimeServer", ObjectSelectionOutputCommand.class);
-
- dataRegistry.addMapping(ObjectSelectionWidget.class, "ObjectSelection", ObjectSelectionOutputCommand.class);
- dataRegistry.addMapping(ObjectSelectionWidget.class, "Project", ObjectSelectionOutputCommand.class);
- }
-
- public boolean evaluate()
- {
- return hasObjectSelectionWidget;
- }
-
- public TypeRuntimeServer getTypeRuntimeServer()
- {
- return typeRuntimeServer;
- }
-
- /**
- * @param typeRuntimeServer The typeRuntimeServer to set.
- */
- public void setTypeRuntimeServer(TypeRuntimeServer typeRuntimeServer)
- {
- this.typeRuntimeServer = typeRuntimeServer;
- if (typeRuntimeServer != null)
- {
- IWebServiceType wst = WebServiceServerRuntimeTypeRegistry.getInstance().getWebServiceTypeById(typeRuntimeServer.getTypeId());
- if (wst != null)
- {
- String objectSelectionWidgetId = wst.getObjectSelectionWidget();
- hasObjectSelectionWidget = objectSelectionWidgetId != null && objectSelectionWidgetId.length() > 0;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionOutputCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionOutputCommand.java
deleted file mode 100644
index 358f655..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionOutputCommand.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.IWebServiceType;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusException;
-import org.eclipse.wst.command.env.core.data.Transformer;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-
-public class ObjectSelectionOutputCommand extends SimpleCommand
-{
- private String objectSelectionWidgetId_;
- private IStructuredSelection objectSelection_;
- private IObjectSelectionWidget objectSelectionWidget_;
- private IProject project_;
- private WebServicesParser parser_;
-
- public Status execute(Environment env)
- {
- // Transformation
- if (objectSelectionWidgetId_ != null && objectSelectionWidgetId_.length() > 0)
- {
- IConfigurationElement[] elements = ObjectSelectionRegistry.getInstance().getConfigurationElements();
- for (int i = 0; i < elements.length; i++)
- {
- if (objectSelectionWidgetId_.equals(elements[i].getAttribute("id")))
- {
- String transformerId = elements[i].getAttribute("transformer");
- if (transformerId != null && transformerId.length() > 0)
- {
- try
- {
- Object transformer = elements[i].createExecutableExtension("transformer");
- if (transformer instanceof Transformer)
- {
- Object transformedSelection = ((Transformer)transformer).transform(objectSelection_);
- if (transformedSelection instanceof IStructuredSelection)
- objectSelection_ = (IStructuredSelection)transformedSelection;
- }
- }
- catch (CoreException ce)
- {
- }
- }
- }
- }
- }
- // Validation
- Status status = (objectSelectionWidget_ != null) ? objectSelectionWidget_.validateSelection(getObjectSelection()) : new SimpleStatus("");
- if (status.getSeverity() != Status.OK)
- {
- try
- {
- env.getStatusHandler().report(status);
- }
- catch (StatusException se)
- {
- }
- }
- return status;
- }
-
- /**
- * @param typeRuntimeServer The typeRuntimeServer to set.
- */
- public void setTypeRuntimeServer(TypeRuntimeServer typeRuntimeServer)
- {
- if (typeRuntimeServer != null)
- {
- IWebServiceType wst = WebServiceServerRuntimeTypeRegistry.getInstance().getWebServiceTypeById(typeRuntimeServer.getTypeId());
- if (wst != null)
- {
- objectSelectionWidgetId_ = wst.getObjectSelectionWidget();
-
- if (objectSelectionWidgetId_ != null && objectSelectionWidgetId_.length() > 0)
- {
- IConfigurationElement[] elements = ObjectSelectionRegistry.getInstance().getConfigurationElements();
- for (int i = 0; i < elements.length; i++)
- {
- if (objectSelectionWidgetId_.equals(elements[i].getAttribute("id")))
- {
- try
- {
- Object object = elements[i].createExecutableExtension("class");
- if (object instanceof IObjectSelectionWidget)
- {
- objectSelectionWidget_ = (IObjectSelectionWidget)object;
- return;
- }
- }
- catch (CoreException ce)
- {
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * @return Returns the selection.
- */
- public IStructuredSelection getObjectSelection()
- {
- return objectSelection_;
- }
- /**
- * @param selection The selection to set.
- */
- public void setObjectSelection(IStructuredSelection objectSelection)
- {
- objectSelection_ = objectSelection;
-
- //Set the project if you can
- if (project_==null)
- {
- project_ = getProjectFromObjectSelection(objectSelection);
- }
-
- // Check if this is a WSDL selection object. If it is we need
- // to unwrap it.
- if( objectSelection != null && !objectSelection.isEmpty() )
- {
- Object object = objectSelection.getFirstElement();
-
- if( object instanceof WSDLSelectionWrapper )
- {
- WSDLSelectionWrapper wsdlWrapper = (WSDLSelectionWrapper)object;
-
- objectSelection_ = wsdlWrapper.wsdlSelection;
- parser_ = wsdlWrapper.parser;
- }
- }
- }
-
- public IProject getProject()
- {
- return project_;
- }
-
- public void setProject(IProject project)
- {
- this.project_ = project;
- }
-
- /**
- * @return Returns the parser_.
- */
- public WebServicesParser getWebServicesParser()
- {
- return parser_;
- }
-
- private IProject getProjectFromObjectSelection(IStructuredSelection selection)
- {
- if (selection != null && selection.size() == 1)
- {
- Object obj = selection.getFirstElement();
- if (obj != null)
- {
- try
- {
- IResource resource = ResourceUtils.getResourceFromSelection(obj);
- if (resource==null)
- return null;
- IProject p = ResourceUtils.getProjectOf(resource.getFullPath());
- return p;
- } catch(CoreException e)
- {
- return null;
- }
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionRegistry.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionRegistry.java
deleted file mode 100644
index 0b97648..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionRegistry.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-
-public class ObjectSelectionRegistry
-{
- private static ObjectSelectionRegistry instance;
- private static IConfigurationElement[] elements;
-
- private ObjectSelectionRegistry()
- {
- elements = Platform.getPluginRegistry().getConfigurationElementsFor("org.eclipse.jst.ws.consumption.ui", "objectSelectionWidget");
- }
-
- public static ObjectSelectionRegistry getInstance()
- {
- if (instance == null)
- instance = new ObjectSelectionRegistry();
- return instance;
- }
-
- public IConfigurationElement[] getConfigurationElements()
- {
- return elements;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionWidget.java
deleted file mode 100644
index 8e66ddc..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/ObjectSelectionWidget.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.IWebServiceType;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class ObjectSelectionWidget extends AbstractObjectSelectionWidget implements IObjectSelectionWidget
-{
- private IConfigurationElement[] elements;
- private Composite parent;
- private Listener statusListener;
- private Composite composite;
- private TypeRuntimeServer typeRuntimeServer;
- private IStructuredSelection initialSelection;
- private IProject project;
- private IObjectSelectionWidget child;
-
- public WidgetDataEvents addControls(Composite parent, Listener statusListener)
- {
- elements = ObjectSelectionRegistry.getInstance().getConfigurationElements();
- this.parent = parent;
- this.statusListener = statusListener;
- composite = null;
- return this;
- }
-
- /**
- * @param typeRuntimeServer The typeRuntimeServer to set.
- */
- public void setTypeRuntimeServer(TypeRuntimeServer typeRuntimeServer)
- {
- this.typeRuntimeServer = typeRuntimeServer;
- if (composite != null)
- {
- composite.dispose();
- child = null;
- }
- if (typeRuntimeServer != null)
- {
- IWebServiceType wst = WebServiceServerRuntimeTypeRegistry.getInstance().getWebServiceTypeById(typeRuntimeServer.getTypeId());
- if (wst != null)
- {
- String objectSelectionWidgetId = wst.getObjectSelectionWidget();
- if (objectSelectionWidgetId != null && objectSelectionWidgetId.length() > 0)
- {
- for (int i = 0; i < elements.length; i++)
- {
- if (objectSelectionWidgetId.equals(elements[i].getAttribute("id")))
- {
- try
- {
- Object object = elements[i].createExecutableExtension("class");
- if (object instanceof IObjectSelectionWidget)
- {
- Control shell = parent.getShell();
- int x = shell.getSize().x;
- composite = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout();
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- GridData gd = new GridData(GridData.FILL_BOTH);
- composite.setLayout(gl);
- composite.setLayoutData(gd);
- child = (IObjectSelectionWidget)object;
- child.addControls(composite, statusListener);
- child.setInitialSelection(initialSelection);
- composite.setSize(x-20, composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
- parent.setSize(x-10, parent.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
- shell.setSize(x, shell.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
- shell.setRedraw(true);
- shell.redraw();
- shell.update();
- return;
- }
- }
- catch (CoreException ce)
- {
- }
- }
- }
- }
- }
- }
- }
-
- public Status getStatus()
- {
- return (child != null) ? child.getStatus() : new SimpleStatus("");
- }
-
- public void setInitialSelection(IStructuredSelection initialSelection)
- {
- this.initialSelection = initialSelection;
- project = getProjectFromInitialSelection(initialSelection);
- if (child != null)
- child.setInitialSelection(initialSelection);
- }
-
- public IStructuredSelection getObjectSelection()
- {
- return (child != null) ? child.getObjectSelection() : null;
- }
-
- public Status validateSelection(IStructuredSelection objectSelection)
- {
- return (child != null) ? child.validateSelection(objectSelection) : new SimpleStatus("");
- }
-
- public IProject getProject()
- {
- if (child != null)
- {
- IProject p = child.getProject();
- if (p != null)
- return p;
- else
- return project;
- }
- else
- {
- return null;
- }
- }
-
- private IProject getProjectFromInitialSelection(IStructuredSelection selection)
- {
- if (selection != null && selection.size() == 1)
- {
- Object obj = selection.getFirstElement();
- if (obj != null)
- {
- try
- {
- IResource resource = ResourceUtils.getResourceFromSelection(obj);
- if (resource==null)
- return null;
- IProject p = ResourceUtils.getProjectOf(resource.getFullPath());
- return p;
- } catch(CoreException e)
- {
- return null;
- }
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/Timer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/Timer.java
deleted file mode 100644
index 546120c..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/Timer.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import java.util.Calendar;
-
-import org.eclipse.swt.widgets.Display;
-
-public class Timer extends Thread
-{
- private static Timer instance = null;
- private final long ONE_SECOND = 1000;
- private long refreshTime;
- private Display display;
- private Runnable runnable;
-
- private Timer(Display display, Runnable runnable)
- {
- this.display = display;
- this.runnable = runnable;
- }
-
- public synchronized static Timer newInstance(Display display, Runnable runnable)
- {
- if (instance == null)
- instance = new Timer(display, runnable);
- return instance;
- }
-
- public synchronized static boolean isRunning()
- {
- return instance != null;
- }
-
- public synchronized void startTimer()
- {
- refreshTime = getCurrentTime() + ONE_SECOND;
- if (!isAlive())
- this.start();
- }
-
- private long getCurrentTime()
- {
- return Calendar.getInstance().getTime().getTime();
- }
-
- public void run()
- {
- long currTime = getCurrentTime();
- while (currTime < refreshTime)
- {
- try
- {
- sleep(refreshTime - currTime);
- }
- catch (InterruptedException ie)
- {
- }
- currTime = getCurrentTime();
- }
- instance = null;
- display.syncExec(runnable);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionTransformer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionTransformer.java
deleted file mode 100644
index b000bcb..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionTransformer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import java.net.MalformedURLException;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.j2ee.webservice.wsclient.impl.ServiceRefImpl;
-import org.eclipse.jst.ws.internal.common.J2EEActionAdapterFactory;
-import org.eclipse.wst.command.env.core.data.Transformer;
-import org.eclipse.wst.wsdl.internal.impl.ServiceImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl;
-
-public class WSDLSelectionTransformer implements Transformer
-{
- public Object transform(Object value)
- {
- if (value instanceof IStructuredSelection)
- {
- Object sel = ((IStructuredSelection)value).getFirstElement();
- if (sel instanceof IResource)
- {
- try
- {
- return new StructuredSelection(((IResource)sel).getLocation().toFile().toURL().toString());
- }
- catch (MalformedURLException murle)
- {
- }
- }
- else if (sel instanceof ServiceImpl)
- {
- return new StructuredSelection(J2EEActionAdapterFactory.getWSDLURI((ServiceImpl)sel));
- }
- else if (sel instanceof ServiceRefImpl)
- {
- return new StructuredSelection(J2EEActionAdapterFactory.getWSDLURI((ServiceRefImpl)sel));
- }
- else if (sel instanceof WSDLResourceImpl)
- {
- return new StructuredSelection(J2EEActionAdapterFactory.getWSDLURI((WSDLResourceImpl)sel));
- }
- }
- return value;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java
deleted file mode 100644
index f29d972..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import java.io.File;
-import java.net.MalformedURLException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef;
-import org.eclipse.jst.ws.internal.common.J2EEActionAdapterFactory;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.WSDLSelectionConditionCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.WSDLSelectionTreeWidget;
-import org.eclipse.jst.ws.internal.ui.common.DialogResourceBrowser;
-import org.eclipse.jst.ws.internal.ui.common.FileExtensionFilter;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-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.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WebServiceEntity;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-import org.eclipse.wst.wsdl.internal.impl.ServiceImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl;
-
-public class WSDLSelectionWidget extends AbstractObjectSelectionWidget implements IObjectSelectionWidget, Runnable
-{
- private String pluginId_;
- private MessageUtils msgUtils_;
- private FileExtensionFilter wsFilter_;
- private WebServicesParser webServicesParser;
-
- private Composite parent_;
- private Listener statusListener_;
- private WSDLSelectionTreeWidget tree;
-
- /*CONTEXT_ID PCON0001 for the WSDL Selection Page*/
- private final String INFOPOP_PCON_PAGE = "PCON0001";
-
- /*CONTEXT_ID PCON0002 for the WSDL Document text field of the WSDL Selection Page*/
- private final String INFOPOP_PCON_TEXT_WSDL = "PCON0002";
- private Text webServiceURI;
-
- /*CONTEXT_ID PCON0003 for the WSDL Resource Browse button of the WSDL Selection Page*/
- private final String INFOPOP_PCON_BUTTON_BROWSE_WSDL = "PCON0003";
- private Button wsBrowseButton_;
-
- public WSDLSelectionWidget()
- {
- pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- msgUtils_ = new MessageUtils( pluginId_ + ".plugin", this );
- wsFilter_ = new FileExtensionFilter(new String[] {"wsdl", "wsil", "html"});
- webServicesParser = new WebServicesParserExt();
- }
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- UIUtils uiUtils = new UIUtils( msgUtils_, pluginId_ );
- parent_ = parent;
- statusListener_ = statusListener;
-
- parent.setToolTipText( msgUtils_.getMessage( "TOOLTIP_PCON_PAGE" ) );
- WorkbenchHelp.setHelp( parent, pluginId_ + "." + INFOPOP_PCON_PAGE );
-
- Composite wsdlGroup = uiUtils.createComposite( parent, 2, 5, 0 );
-
- Label wsLabel = new Label( wsdlGroup, SWT.WRAP);
- wsLabel.setText( msgUtils_.getMessage("LABEL_WS_SELECTION"));
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 2;
- wsLabel.setLayoutData(gd);
- wsLabel.setToolTipText( msgUtils_.getMessage("TOOLTIP_PCON_TEXT_WS") );
-
- webServiceURI = uiUtils.createText( wsdlGroup, null, "TOOLTIP_PCON_TEXT_WS", INFOPOP_PCON_TEXT_WSDL, SWT.SINGLE | SWT.BORDER );
- webServiceURI.addModifyListener(
- new ModifyListener()
- {
- public void modifyText(ModifyEvent event)
- {
- handleWebServiceURIModifyEvent();
- }
- });
- webServiceURI.addListener( SWT.Modify, statusListener );
-
- wsBrowseButton_ = uiUtils.createPushButton( wsdlGroup, "BUTTON_BROWSE", "TOOLTIP_PCON_BUTTON_BROWSE_WS", INFOPOP_PCON_BUTTON_BROWSE_WSDL );
- wsBrowseButton_.addSelectionListener(
- new SelectionListener()
- {
- public void widgetDefaultSelected(SelectionEvent event)
- {
- handleWSDLButton();
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- handleWSDLButton();
- }
- });
-
- tree = new WSDLSelectionTreeWidget();
- tree.addControls(parent, statusListener);
- tree.setWebServicesParser(webServicesParser);
- return this;
- }
-
- private void handleWebServiceURIModifyEvent()
- {
- if (webServiceURI.getText().indexOf(':') > 0)
- Timer.newInstance(Display.getCurrent(), this).startTimer();
- else
- handleWebServiceURI();
- statusListener_.handleEvent(null);
- }
-
- private void handleWebServiceURI()
- {
- String wsURI = webServiceURI.getText();
- if (wsURI.indexOf(':') < 0)
- {
- IFile file = uri2IFile(wsURI);
- if (file != null)
- wsURI = iFile2URI(file);
- }
- if (wsURI != null && wsURI.indexOf(':') >= 0 && webServicesParser.getWebServiceEntityByURI(wsURI) == null)
- {
- WSDLSelectionConditionCommand cmd = new WSDLSelectionConditionCommand();
- cmd.setWebServicesParser(webServicesParser);
- cmd.setWebServiceURI(wsURI);
- cmd.execute(null);
- }
- WebServiceEntity entity = webServicesParser.getWebServiceEntityByURI(wsURI);
- if (entity != null && entity.getType() == WebServiceEntity.TYPE_WSDL)
- tree.setEnabled(false);
- else
- tree.setEnabled(true);
- tree.setWebServiceURI(wsURI);
- tree.refreshTreeViewer();
- }
-
- public void run()
- {
- handleWebServiceURI();
- statusListener_.handleEvent(null);
- }
-
- private void handleWSDLButton()
- {
- DialogResourceBrowser dialog = new DialogResourceBrowser( parent_.getShell(), null, wsFilter_);
- dialog.open();
- IResource res = dialog.getFirstSelection();
- if( res != null ) webServiceURI.setText( res.getFullPath().toString() );
- statusListener_.handleEvent(null);
- }
-
- public Status getStatus()
- {
- // Timer validation
- /*
- * Commenting out because we don't want to block fast typers from hitting Next/Finish
- if (Timer.isRunning())
- return new SimpleStatus("", msgUtils_.getMessage("PAGE_MSG_LOADING_WEB_SERVICE_URI"), Status.ERROR);
- */
-
- // Validate the String representation of the Web service URI
- // For example, is it pointing to an existing resource in the workspace?
- String wsPath = webServiceURI.getText();
- if( wsPath == null || wsPath.length() <= 0 )
- return new SimpleStatus("", msgUtils_.getMessage("PAGE_MSG_INVALID_WEB_SERVICE_URI"), Status.ERROR);
- else if( wsPath.indexOf(':') < 0 )
- {
- IResource res = ResourceUtils.findResource(wsPath);
- if( res == null )
- return new SimpleStatus("", msgUtils_.getMessage("PAGE_MSG_NO_SUCH_FILE", new Object[] {wsPath}), Status.ERROR);
- else if( res.getType() != IResource.FILE )
- return new SimpleStatus("", msgUtils_.getMessage("PAGE_MSG_INVALID_WEB_SERVICE_URI"), Status.ERROR);
- }
-
- // Validate the content of the Web service URI
- // For example, is selection a WSDL URI?
- if (!Timer.isRunning() && tree.isEnabled())
- {
- Status status = tree.getStatus();
- if (status != null)
- {
- int severity = status.getSeverity();
- if (severity == Status.ERROR || severity == Status.WARNING)
- return status;
- }
- }
- else
- {
- if( wsPath.indexOf(':') < 0 )
- {
- String wsdlURI = iFile2URI((IFile)ResourceUtils.findResource(wsPath));
- if (webServicesParser.getWSDLDefinition(wsdlURI) == null)
- return new SimpleStatus("", msgUtils_.getMessage("PAGE_MSG_SELECTION_MUST_BE_WSDL"), Status.ERROR);
- }
- }
-
- // OK status
- return new SimpleStatus( "" );
- }
-
- private IFile uri2IFile(String uri)
- {
- IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(uri);
- if (res instanceof IFile)
- return (IFile)res;
- else
- return null;
- }
-
- private String iFile2URI(IFile file)
- {
- File f = file.getLocation().toFile();
- try
- {
- return f.toURL().toString();
- }
- catch (MalformedURLException murle)
- {
- }
- return f.toString();
- }
-
- public void setInitialSelection(IStructuredSelection initialSelection)
- {
- if (initialSelection != null && !initialSelection.isEmpty())
- {
- Object object = initialSelection.getFirstElement();
- String wsdlURI = toWsdlURI(object);
- if (wsdlURI != null)
- {
- webServiceURI.setText(wsdlURI);
- handleWebServiceURI();
- }
- }
- }
-
- private String toWsdlURI(Object object)
- {
- if (object instanceof ServiceImpl)
- return J2EEActionAdapterFactory.getWSDLURI((ServiceImpl)object);
- else if (object instanceof WSDLResourceImpl)
- return J2EEActionAdapterFactory.getWSDLURI((WSDLResourceImpl)object);
- else if (object instanceof ServiceRef)
- return J2EEActionAdapterFactory.getWSDLURI((ServiceRef)object);
- else if (object instanceof IFile)
- return ((IFile)object).getFullPath().toString();
- else if (object instanceof String)
- return (String)object;
- else
- return null;
- }
-
- private String toAbsoluteWsdlURI(Object object)
- {
- if (object instanceof IFile)
- {
- try
- {
- return ((IFile)object).getLocation().toFile().toURL().toString();
- }
- catch (MalformedURLException murle)
- {
- }
- }
- return toWsdlURI(object);
- }
-
- public IStructuredSelection getObjectSelection()
- {
- return new StructuredSelection(
- new WSDLSelectionWrapper( webServicesParser,
- new StructuredSelection(tree.getWsdlURI()) ) );
- }
-
- public WebServicesParser getWebServicesParser()
- {
- return webServicesParser;
- }
-
- public Status validateSelection(IStructuredSelection objectSelection)
- {
- return new SimpleStatus("");
- }
-
- public IProject getProject()
- {
- String wsdlURI = tree.getWsdlURI();
- if (wsdlURI != null)
- {
- IProject p = getProjectFromURI(wsdlURI);
- if (p!=null && p.exists())
- return p;
-
- String wsRelPath = webServiceURI.getText();
- IResource wsRes = ResourceUtils.findResource(wsRelPath);
- if (wsRes!=null && wsRes instanceof IFile)
- {
- IProject p2 = ((IFile)wsRes).getProject();
- return p2;
- }
-
- }
- return null;
- }
-
- private IProject getProjectFromURI(String uri)
- {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- String wkspcRootLoc = root.getLocation().toString();
- int idx = uri.indexOf(wkspcRootLoc);
- if (idx != -1)
- {
- String relPath = uri.substring(wkspcRootLoc.length()+idx);
- IResource res = root.findMember(new Path(relPath));
- if (res instanceof IFile)
- {
- IProject p = ((IFile)res).getProject();
- return p;
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWrapper.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWrapper.java
deleted file mode 100644
index 341ddf8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWrapper.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-/**
- * This class is a very simple wrapper that binds a WSDL parser with
- * a wsdlSelection object.
- */
-public class WSDLSelectionWrapper
-{
- public WebServicesParser parser;
- public IStructuredSelection wsdlSelection;
-
- public WSDLSelectionWrapper( WebServicesParser parser,
- IStructuredSelection selection )
- {
- this.parser = parser;
- this.wsdlSelection = selection;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidget.java
deleted file mode 100644
index 79798e7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidget.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime;
-
-import org.eclipse.jst.ws.internal.consumption.ui.common.ValidationUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.ClientProjectTypeRegistry;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.SelectionList;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class ClientRuntimeSelectionWidget extends SimpleWidgetDataContributor
-{
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
-
- /* CONTEXT_ID PWRS0003 for the Wizard Scenario Client configuration of the Runtime Selection Page */
- private String INFOPOP_PWRS_GROUP_CLIENT = pluginId_ + ".PWRS0003";
-
- private String clientScenarioId;
- private Group clientGroup_;
- private RuntimeServerSelectionWidget runtimeWidget_;
- private SelectionListChoices runtime2ClientTypes_;
- private Combo clientType_;
- private SelectionAdapter clientTypeSelListener;
- private ProjectSelectionWidget projectWidget_;
- private boolean isVisible_;
-
- // rsk revisit - Putting this in temporarily. The RuntimeSelectionDialog needs the server
- // information even when it is launched for the client half of the configuration.
- private String serviceScenarioId;
- //
-
-
- public WidgetDataEvents addControls( Composite parent, final Listener statusListener )
- {
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- UIUtils uiUtils = new UIUtils(msgUtils, pluginId_ );
-
- clientGroup_ = uiUtils.createGroup( parent, "LABEL_CLIENT_SELECTION_VIEW_TITLE",
- null, INFOPOP_PWRS_GROUP_CLIENT, 2, 5, 5 );
-
- runtimeWidget_ = new RuntimeServerSelectionWidget( true );
- runtimeWidget_.addControls( clientGroup_, statusListener );
- runtimeWidget_.addModifyListener( new ModifyListener()
- {
- public void modifyText(ModifyEvent e)
- {
- handleRuntime2ClientTypesEvent();
- handleUpdateProjectWidget();
- }
- });
-
- clientType_ = uiUtils.createCombo( clientGroup_, "LABEL_CLIENT_TYPE",
- "TOOLTIP_PWCR_COMBO_CLIENT_TYPE",
- INFOPOP_PWRS_GROUP_CLIENT,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
-
- clientTypeSelListener = new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleSetProjects( clientType_.getSelectionIndex() );
- statusListener.handleEvent(null);
- }
- };
-
- clientType_.addSelectionListener(clientTypeSelListener);
-
- projectWidget_ = new ProjectSelectionWidget(true);
- projectWidget_.addControls( clientGroup_, statusListener );
-
- //projectWidget_.addModifyListener(new ModifyListener(){
- // public void modifyText(ModifyEvent e){
- // getProjectSelections();
- // }
- // });
-
- return this;
- }
-
- // This method is called by the creator of this widget to control
- // whether it is visible or not.
- public void setVisible( boolean value )
- {
- clientGroup_.setVisible( value );
- isVisible_ = value;
- }
-
- public boolean isVisible(){
- return this.isVisible_;
- }
-
- public void setClientTypeRuntimeServer( TypeRuntimeServer ids )
- {
- runtimeWidget_.setTypeRuntimeServer( ids );
- projectWidget_.setTypeRuntimeServer(ids);
- }
-
- public TypeRuntimeServer getClientTypeRuntimeServer()
- {
- return runtimeWidget_.getTypeRuntimeServer();
- }
-
- public String getJ2EEVersion()
- {
- return runtimeWidget_.getJ2EEVersion();
- }
-
- public void setJ2EEVersion(String j2eeVersion)
- {
- runtimeWidget_.setJ2EEVersion(j2eeVersion);
- projectWidget_.setJ2EEVersion(j2eeVersion);
- }
-
- public boolean getClientNeedEAR()
- {
- return projectWidget_.getNeedEAR();
- }
-
- public void setClientNeedEAR(boolean b)
- {
- projectWidget_.setNeedEAR(b);
- }
-
- /**
- * @param runtime2ClientTypes The runtime2ClientTypes to set.
- */
- public void setRuntime2ClientTypes(SelectionListChoices runtime2ClientTypes)
- {
- runtime2ClientTypes_ = runtime2ClientTypes;
- handleRuntime2ClientTypesEvent();
- }
-
- public SelectionListChoices getRuntime2ClientTypes()
- {
- ClientProjectTypeRegistry registry = ClientProjectTypeRegistry.getInstance();
-
- String runtime = runtimeWidget_.getTypeRuntimeServer().getRuntimeId();
- String clientProject = projectWidget_.getProjectChoices().getList().getSelection();
- String earProject = projectWidget_.getProjectChoices().getChoice().getList().getSelection();
-
- SelectionList runtimeList = runtime2ClientTypes_.getList();
- runtimeList.setSelectionValue( runtime );
-
- SelectionList projTypeList = runtime2ClientTypes_.getChoice().getList();
- projTypeList.setIndex( clientType_.getSelectionIndex() );
-
- SelectionListChoices clientProjChoice = runtime2ClientTypes_.getChoice().getChoice();
- SelectionList clientProjList = clientProjChoice.getList();
- clientProjList.setSelectionValue( clientProject );
-
- SelectionList earProjList = clientProjChoice.getChoice().getList();
- earProjList.setSelectionValue( earProject );
-
- return runtime2ClientTypes_;
- }
-
- private void handleRuntime2ClientTypesEvent()
- {
- if (runtime2ClientTypes_ != null)
- {
- //If the runtimeId from runtimeWidget_ is already selected in
- //in runtime2ClientTypes_, do nothing.
- String currentRuntimeId = runtime2ClientTypes_.getList().getSelection();
- String newRuntimeId = runtimeWidget_.getTypeRuntimeServer().getRuntimeId();
- if (currentRuntimeId != newRuntimeId)
- {
- SelectionList runtimes = runtime2ClientTypes_.getList();
- runtimes.setSelectionValue( runtimeWidget_.getTypeRuntimeServer().getRuntimeId() );
- }
-
- String[] clientTypeIds = runtime2ClientTypes_.getChoice().getList().getList();
- int selectedClientTypeIdx = runtime2ClientTypes_.getChoice().getList().getIndex();
-
- clientType_.removeSelectionListener(clientTypeSelListener);
- clientType_.setItems( getClientTypeLabels( clientTypeIds ));
- clientType_.select(selectedClientTypeIdx);
- clientType_.addSelectionListener(clientTypeSelListener);
- handleSetProjects(selectedClientTypeIdx);
-
- }
- }
-
-
- private void handleUpdateProjectWidget()
- {
- projectWidget_.setTypeRuntimeServer(runtimeWidget_.getTypeRuntimeServer());
- projectWidget_.setJ2EEVersion(runtimeWidget_.getJ2EEVersion());
- }
-
-
- private void handleSetProjects( int clientTypeIndex )
- {
- SelectionListChoices clientType2Projects = runtime2ClientTypes_.getChoice();
- clientType2Projects.getList().setIndex( clientTypeIndex );
-
- // Make sure that the project name and EAR name are kept the same
- // even if the client type is changed. Note: the project and EAR lists
- // will be updated according to what is set by the client type.
- SelectionListChoices currentProjects = projectWidget_.getProjectChoices();
-
- if( currentProjects != null )
- {
- String projectName = currentProjects.getList().getSelection();
- String earName = currentProjects.getChoice().getList().getSelection();
-
- // Set the project to it's original state.
- clientType2Projects.getChoice().getList().setSelectionValue( projectName );
-
- // Set the EAR name to it's original state.
- clientType2Projects.getChoice().getChoice().getList().setSelectionValue( earName );
- }
-
- projectWidget_.setProjectTypeId(clientType2Projects.getList().getSelection());
- projectWidget_.setProjectChoices( clientType2Projects.getChoice() );
- }
-
- private String[] getClientTypeLabels( String[] types )
- {
- ClientProjectTypeRegistry registry = ClientProjectTypeRegistry.getInstance();
- String[] clientTypeLabels = new String[types.length];
-
- for( int index = 0; index < types.length; index++ )
- {
- clientTypeLabels[index] = registry.getElementById(types[index]).getAttribute("label");
- }
-
- return clientTypeLabels;
- }
-
- public ProjectSelectionWidget getProjectSelectionWidget() {
- return this.projectWidget_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus()
- */
- public Status getStatus()
- {
- Status finalStatus = new SimpleStatus( "" );
- Status projectStatus = projectWidget_.getStatus();
- Status runtimeStatus = runtimeWidget_.getStatus();
-
- if( runtimeStatus.getSeverity() == Status.ERROR )
- {
- finalStatus = runtimeStatus;
- }
- else if( projectStatus.getSeverity() == Status.ERROR )
- {
- finalStatus = projectStatus;
- }
- else
- {
- SelectionListChoices clientProjects = getProjectSelectionWidget().getProjectChoices();
- ValidationUtils valUtils = new ValidationUtils();
- if (clientProjects != null)
- {
- String clientEARName = clientProjects.getChoice().getList().getSelection();
- String clientProjName = clientProjects.getList().getSelection();
-
- //Validate that the selected client project is of the type indicated by client project type.
- Status clientProjectTypeStatus = valUtils.validateProjectType(clientProjName, runtime2ClientTypes_);
- if (clientProjectTypeStatus.getSeverity() == Status.ERROR)
- {
- finalStatus = clientProjectTypeStatus;
- }
-
- //Validate client side server targets and J2EE levels
- String clientServerFactoryId = getClientTypeRuntimeServer().getServerId();
- String clientJ2EElevel = getJ2EEVersion();
- Status clientProjectStatus = valUtils.validateProjectTargetAndJ2EE(clientProjName, clientEARName, clientServerFactoryId,
- clientJ2EElevel);
- if (clientProjectStatus.getSeverity() == Status.ERROR)
- {
- finalStatus = clientProjectStatus;
- }
- }
- }
- return finalStatus;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidgetDefaultingCommand.java
deleted file mode 100644
index 043f278..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ClientRuntimeSelectionWidgetDefaultingCommand.java
+++ /dev/null
@@ -1,766 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime;
-
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.common.ClientServerSelectionUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.common.ServerSelectionUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.common.ValidationUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.consumption.ui.preferences.PersistentServerRuntimeContext;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.ClientProjectTypeRegistry;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.IWebServiceRuntime;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceClientTypeRegistry;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.SelectionList;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-public class ClientRuntimeSelectionWidgetDefaultingCommand extends SimpleCommand
-{
- protected MessageUtils msgUtils_;
- // clientRuntimeJ2EEType contains the default client runtime and J2EE level based on the initial selection.
- // If the initialSeleciton does not result in a valid client runtime and J2EE level, clientRuntimeJ2EEType
- // should remain null for the life of this instance.
- private WSRuntimeJ2EEType clientRuntimeJ2EEType_;
-
- private TypeRuntimeServer clientIds_;
- private SelectionListChoices runtimeClientTypes_;
-
- //A note on initialSelections ...
- //The difference between clientInitialSelection_ and initialInitialSelection is that
- //clientInitialSelection_ comes from the ObjectSelectionOutputCommand while initialInitialSelection
- //is the actual thing that was selected before the wizard was launched. In the runtime/j2ee/project
- //defaulting algorithm, clientInitialSelection will be given first priority. If, however, it is
- //deemed that clientInitialProject is not a valid initial selection, initialInitialSelection
- //will be given second priority. Things that could make an initialSelection invalid include
- //1. The containing project contains the Web service for which we are trying to create a client
- //2. The containing project has a J2EE level, server target, and project type combination which
- // is not supported by any of the registered Web service runtimes.
- private IStructuredSelection clientInitialSelection_;
- private IProject clientInitialProject_;
- private IStructuredSelection initialInitialSelection_;
- private IProject initialInitialProject_;
-
- private String clientJ2EEVersion_;
- protected boolean clientNeedEAR_ = true;
-
- private String wsdlURI_;
- private WebServicesParser parser_;
-
-
- public ClientRuntimeSelectionWidgetDefaultingCommand()
- {
- super();
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- }
-
- public void setClientTypeRuntimeServer( TypeRuntimeServer ids )
- {
- clientIds_ = ids;
- }
-
- public TypeRuntimeServer getClientTypeRuntimeServer()
- {
- return clientIds_;
- }
-
- public SelectionListChoices getRuntime2ClientTypes()
- {
- return runtimeClientTypes_;
- }
-
- public String getClientJ2EEVersion()
- {
- return clientJ2EEVersion_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.Command#execute(org.eclipse.wst.command.env.core.common.Environment)
- */
- public Status execute(Environment environment)
- {
- try
- {
- WebServiceClientTypeRegistry reg = WebServiceClientTypeRegistry.getInstance();
- String[] runtimeIds = gatherAttributeValues(reg.getConfigurationElement(clientIds_.getTypeId()), "runtime");
- SelectionList list = new SelectionList(runtimeIds, 0);
- Vector choices = new Vector();
- for (int i = 0; i < runtimeIds.length; i++)
- choices.add(getClientTypesChoice(runtimeIds[i]));
-
- runtimeClientTypes_ = new SelectionListChoices(list, choices);
- setClientDefaultRuntimeFromPreference();
- setClientDefaultJ2EEVersionFromPreference();
- clientRuntimeJ2EEType_ = getClientRuntimeAndJ2EEFromProject(clientInitialProject_);
- if (clientRuntimeJ2EEType_ != null)
- {
- clientJ2EEVersion_ = clientRuntimeJ2EEType_.getJ2eeVersionId();
- setClientRuntimeId(clientRuntimeJ2EEType_.getWsrId());
- setClientProjectType(clientRuntimeJ2EEType_.getClientProjectTypeId());
- }
- //If clientInitialProject is the service project, check the initialInitialProject
- //to see if it is valid.
- ValidationUtils vu = new ValidationUtils();
- if (vu.isProjectServiceProject(clientInitialProject_, wsdlURI_, parser_))
- {
- clientRuntimeJ2EEType_ = getClientRuntimeAndJ2EEFromProject(initialInitialProject_);
- if (clientRuntimeJ2EEType_ != null)
- {
- clientJ2EEVersion_ = clientRuntimeJ2EEType_.getJ2eeVersionId();
- setClientRuntimeId(clientRuntimeJ2EEType_.getWsrId());
- setClientProjectType(clientRuntimeJ2EEType_.getClientProjectTypeId());
- //Since the original clientIntialProject was invalid but initialInitialProject is valid,
- //reset clientInitalProject_ to be initialInitialProject for the benefit of
- //downstream project defaulting.
- clientInitialProject_ = initialInitialProject_;
- }
- }
-
- setClientDefaultProject();
- setClientDefaultEAR();
- setClientDefaultServer();
- updateClientEARs();
- return new SimpleStatus("");
- } catch (Exception e)
- {
- //Catch all Exceptions in order to give some feedback to the user
- Status errorStatus = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED",new String[]{e.getMessage()}),Status.ERROR, e);
- environment.getStatusHandler().reportError(errorStatus);
- return errorStatus;
- }
-
- }
-
-
-
- private SelectionListChoices getClientTypesChoice(String runtimeId)
- {
- WebServiceClientTypeRegistry reg = WebServiceClientTypeRegistry.getInstance();
- ClientProjectTypeRegistry cptr = ClientProjectTypeRegistry.getInstance();
- String[] clientTypes;
- String[] clientProjectTypes = gatherAttributeValues(reg.getConfigurationElement(clientIds_.getTypeId(), runtimeId), "clientProjectType");
- if (clientProjectTypes.length > 0)
- {
- StringTokenizer st = new StringTokenizer(clientProjectTypes[0]);
- clientTypes = new String[st.countTokens()];
- for (int i = 0; i < clientTypes.length; i++)
- clientTypes[i] = st.nextToken();
- }
- else
- clientTypes = new String[] {cptr.getDefaultElement().getAttribute("id")};
-
-
- SelectionList list = new SelectionList(clientTypes, 0);
- Vector choices = new Vector();
- for (int i = 0; i < clientTypes.length; i++)
- choices.add(getProjectChoice(clientTypes[i]));
- return new SelectionListChoices(list, choices);
- }
-
- private SelectionListChoices getProjectChoice(String clientType)
- {
- IProject[] projects = ClientProjectTypeRegistry.getInstance().getProjects(clientType);
- String[] projectNames = new String[projects.length];
- for (int i = 0; i < projects.length; i++)
- projectNames[i] = projects[i].getName();
- SelectionList list = new SelectionList(projectNames, 0);
- Vector choices = new Vector();
- for (int i = 0; i < projects.length; i++)
- choices.add(getProjectEARChoice(projects[i]));
- return new SelectionListChoices(list, choices, getEARProjects());
- }
-
- protected SelectionListChoices getProjectEARChoice(IProject project)
- {
- Vector v = new Vector();
- EARNatureRuntime[] earNatures = J2EEUtils.getEARProjects(project);
- if (earNatures != null)
- for(int i = 0; i < earNatures.length; i++)
- v.add(earNatures[i].getProject().getName());
- IProject[] earProjects = J2EEUtils.getEARProjects();
- if (earProjects != null)
- {
- for (int i = 0; i < earProjects.length; i++)
- {
- String earProjectName = earProjects[i].getName();
- if (!v.contains(earProjectName))
- v.add(earProjectName);
- }
- }
- SelectionList list = new SelectionList((String[])v.toArray(new String[0]), 0);
- return new SelectionListChoices(list, null);
- }
-
- protected SelectionList getEARProjects()
- {
- IProject[] earProjects = J2EEUtils.getEARProjects();
- String[] earProjectNames = new String[earProjects.length];
- for (int i=0; i<earProjects.length; i++)
- {
- earProjectNames[i] = earProjects[i].getName();
- }
- return new SelectionList(earProjectNames, 0);
- }
-
- private String[] gatherAttributeValues(IConfigurationElement[] elements, String key)
- {
- Vector v = new Vector();
- for (int i = 0; i < elements.length; i++)
- {
- String value = elements[i].getAttribute(key);
- if (value != null && value.length() > 0)
- {
- if (!v.contains(value))
- v.add(value);
- }
- }
- return (String [])v.toArray(new String[0]);
- }
-
-
- private void setClientDefaultRuntimeFromPreference()
- {
- PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- String pRuntimeId = context.getRuntimeId();
-
- //set the client runtime to be the preferred runtime if the client type allows.
- setClientRuntimeId(pRuntimeId);
- }
-
- private void setClientRuntimeId(String id)
- {
- String[] clientRuntimeIds = getRuntime2ClientTypes().getList().getList();
- for (int i=0; i<clientRuntimeIds.length;i++)
- {
- if(clientRuntimeIds[i].equals(id))
- {
- getClientTypeRuntimeServer().setRuntimeId(id);
- getRuntime2ClientTypes().getList().setIndex(i);
- break;
- }
- }
- }
-
- private void setClientProjectType(String id)
- {
- String[] clientProjectTypeIds = getRuntime2ClientTypes().getChoice().getList().getList();
- for (int i=0; i<clientProjectTypeIds.length;i++)
- {
- if(clientProjectTypeIds[i].equals(id))
- {
- getRuntime2ClientTypes().getChoice().getList().setIndex(i);
- break;
- }
- }
- }
-
- protected void setClientDefaultJ2EEVersionFromPreference()
- {
- if (clientIds_ != null)
- {
- String runtimeId = clientIds_.getRuntimeId();
- if (runtimeId != null)
- {
- IWebServiceRuntime wsr = WebServiceServerRuntimeTypeRegistry.getInstance().getWebServiceRuntimeById(runtimeId);
- if (wsr != null)
- {
- String[] versions = wsr.getJ2EEVersions();
- if (versions != null && versions.length > 0)
- {
- PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- String pJ2EE = context.getJ2EEVersion();
- if (pJ2EE!=null && pJ2EE.length()>0)
- {
- for (int i=0;i<versions.length;i++)
- {
- if (versions[i].equals(pJ2EE))
- {
- clientJ2EEVersion_ = versions[i];
- return;
- }
- }
- }
- clientJ2EEVersion_ = versions[0];
- return;
- }
- }
- }
- }
- }
-
- private WSRuntimeJ2EEType getClientRuntimeAndJ2EEFromProject(IProject project)
- {
- WSRuntimeJ2EEType cRJ2EE = null;
- //If there is a valid initial selection, use it to determine
- //reasonable J2EE version and Web service runtime values
-
- if (project != null && project.exists())
- {
- if (ResourceUtils.isWebProject(project) || ResourceUtils.isEJBProject(project) || ResourceUtils.isAppClientProject(project) || ResourceUtils.isTrueJavaProject(project))
- {
- WebServiceClientTypeRegistry wsctReg = WebServiceClientTypeRegistry.getInstance();
-
- //Get the J2EE level
- String versionString = null;
- if (!ResourceUtils.isTrueJavaProject(project))
- {
- int versionId = J2EEUtils.getJ2EEVersion(project);
- versionString = String.valueOf(versionId);
- }
-
- //Get the runtime target of the project
- IRuntime runtimeTarget = ServerSelectionUtils.getRuntimeTarget(project.getName());
- String runtimeTargetId = null;
- if (runtimeTarget != null)
- runtimeTargetId = runtimeTarget.getRuntimeType().getId();
-
- //Get the client project type
- String clientProjectTypeId = getClientProjectTypeFromRuntimeId(project, clientIds_.getRuntimeId());
-
- //If the preferred runtime supports this J2EE level and server target, keep it
- if ((versionString == null || wsctReg.doesRuntimeSupportJ2EELevel(versionString, clientIds_.getRuntimeId())) &&
- ((runtimeTarget == null) ||
- ((runtimeTarget != null) && wsctReg.doesRuntimeSupportServerTarget(runtimeTargetId, clientIds_.getRuntimeId()))) &&
- (clientProjectTypeId != null)
- )
- {
- //Set the J2EE level and web service runtime to match the project
- cRJ2EE = new WSRuntimeJ2EEType();
- cRJ2EE.setJ2eeVersionId(versionString);
- cRJ2EE.setWsrId(clientIds_.getRuntimeId());
- cRJ2EE.setClientProjectTypeId(clientProjectTypeId);
- return cRJ2EE;
- } else
- {
- //Look for a runtime that matches
- String[] validRuntimes = wsctReg.getRuntimesByType(clientIds_.getTypeId());
- for (int i = 0; i < validRuntimes.length; i++)
- {
- String thisClientProjectTypeId = getClientProjectTypeFromRuntimeId(project, validRuntimes[i]);
- if ((versionString == null || wsctReg.doesRuntimeSupportJ2EELevel(versionString, validRuntimes[i])) &&
- ((runtimeTarget == null) ||
- ((runtimeTarget != null) && wsctReg.doesRuntimeSupportServerTarget(runtimeTargetId, validRuntimes[i]))) &&
- (thisClientProjectTypeId != null)
- )
- {
- cRJ2EE = new WSRuntimeJ2EEType();
- cRJ2EE.setJ2eeVersionId(versionString);
- cRJ2EE.setWsrId(validRuntimes[i]);
- cRJ2EE.setClientProjectTypeId(thisClientProjectTypeId);
- return cRJ2EE;
- }
- }
- }
- }
- }
- return cRJ2EE;
- }
-
- private void setClientDefaultProject()
- {
- //Handle the case where no valid initial selection exists
- if (clientInitialProject_ == null || (clientInitialProject_!=null && clientRuntimeJ2EEType_==null))
- {
- //Select the first existing project that is valid.
- setClientProjectToFirstValid();
- return;
- }
-
- ValidationUtils vu = new ValidationUtils();
- if (!vu.isProjectServiceProject(clientInitialProject_, wsdlURI_, parser_))
- {
- getRuntime2ClientTypes().getChoice().getChoice().getList().setSelectionValue(clientInitialProject_.getName());
- }
- else
- {
- setClientProjectToFirstValid();
- }
-
- }
-
- private void setClientProjectToFirstValid()
- {
- WebServiceClientTypeRegistry wsctReg = WebServiceClientTypeRegistry.getInstance();
- ValidationUtils vu = new ValidationUtils();
- String[] projectNames = getRuntime2ClientTypes().getChoice().getChoice().getList().getList();
- for (int i=0;i<projectNames.length; i++)
- {
- IProject project = (IProject)((new StringToIProjectTransformer().transform(projectNames[i])));
- if (project.isOpen() && (ResourceUtils.isWebProject(project) || ResourceUtils.isEJBProject(project) || ResourceUtils.isAppClientProject(project)))
- {
- //Get the J2EE level
- int versionId = J2EEUtils.getJ2EEVersion(project);
- String versionString = String.valueOf(versionId);
-
- //Get the runtime target of the project
- IRuntime runtimeTarget = ServerSelectionUtils.getRuntimeTarget(project.getName());
- String runtimeTargetId = null;
- if (runtimeTarget != null)
- runtimeTargetId = runtimeTarget.getRuntimeType().getId();
-
- if (clientJ2EEVersion_ != null && clientJ2EEVersion_.length()>0 && clientJ2EEVersion_.equals(versionString))
- {
- if (wsctReg.doesRuntimeSupportJ2EELevel(versionString, clientIds_.getRuntimeId()) &&
- ((runtimeTarget == null) ||
- ((runtimeTarget!=null) && wsctReg.doesRuntimeSupportServerTarget(runtimeTargetId, clientIds_.getRuntimeId())))
- )
- {
- if (!vu.isProjectServiceProject(project, wsdlURI_, parser_))
- {
- getRuntime2ClientTypes().getChoice().getChoice().getList().setSelectionValue(projectNames[i]);
- return;
- }
- }
- }
- }
- }
-
- //No valid project was found. Enter a new project name.
- getRuntime2ClientTypes().getChoice().getChoice().getList().setSelectionValue(ResourceUtils.getDefaultWebProjectName());
- }
-
- protected IResource getResourceFromInitialSelection(IStructuredSelection selection)
- {
- if (selection != null && selection.size() == 1)
- {
- Object obj = selection.getFirstElement();
- if (obj != null)
- {
- try
- {
- IResource resource = ResourceUtils.getResourceFromSelection(obj);
- return resource;
- } catch(CoreException e)
- {
- return null;
- }
- }
- }
- return null;
- }
-
- private void setClientDefaultEAR()
- {
- //Client-side
- String initialClientProjectName = getRuntime2ClientTypes().getChoice().getChoice().getList().getSelection();
- IProject initialClientProject = (IProject)((new StringToIProjectTransformer()).transform(initialClientProjectName));
- IProject defaultClientEAR = getDefaultEARFromClientProject(initialClientProject);
- getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setSelectionValue(defaultClientEAR.getName());
- }
-
- protected IProject getDefaultEARFromClientProject(IProject project)
- {
- if (project!=null && project.exists())
- {
- IServer[] configuredServers = ServerUtil.getServersByModule(ResourceUtils.getModule(project), null);
- IServer firstSupportedServer = ClientServerSelectionUtils.getFirstSupportedServer(configuredServers, clientIds_.getTypeId() );
-
- EARNatureRuntime[] earProjects = J2EEUtils.getEARProjects(project, firstSupportedServer);
- if (earProjects!=null && earProjects[0] instanceof EARNatureRuntime)
- return earProjects[0].getProject();
- }
-
- int versionId = -1;
- if (clientJ2EEVersion_ != null && clientJ2EEVersion_.length()>0)
- {
- versionId = Integer.parseInt(clientJ2EEVersion_);
- }
- EARNatureRuntime newEAR = J2EEUtils.getEAR(versionId);
-
- IProject earProject = ResourceUtils.getWorkspaceRoot().getProject(ResourceUtils.getDefaultClientEARProjectName());
-
- if (newEAR!=null)
- earProject = newEAR.getProject();
-
- return earProject;
- }
-
- private void setClientDefaultServer()
- {
- //Calculate reasonable default server based on initial project selection.
- String initialClientProjectName = runtimeClientTypes_.getChoice().getChoice().getList().getSelection();
- IProject initialClientProject = (IProject)((new StringToIProjectTransformer()).transform(initialClientProjectName));
- if (initialClientProject.exists())
- {
- String[] serverInfo = ClientServerSelectionUtils.getServerInfoFromExistingProject(initialClientProject, clientIds_.getTypeId(), clientIds_.getRuntimeId(), true);
- if (serverInfo!=null)
- {
- if (serverInfo[0]!=null && serverInfo[0].length()>0)
- {
- clientIds_.setServerId(serverInfo[0]);
- }
- if (serverInfo[1]!=null && serverInfo[1].length()>0)
- {
- clientIds_.setServerInstanceId(serverInfo[1]);
- }
- }
- }
- else //the project does not exist.
- {
- //Does the EAR exist?
- String initialClientEARProjectName = runtimeClientTypes_.getChoice().getChoice().getChoice().getList().getSelection();
- IProject initialClientEARProject = (IProject)((new StringToIProjectTransformer()).transform(initialClientEARProjectName));
- if (initialClientEARProject.exists())
- {
- String[] serverInfo = ClientServerSelectionUtils.getServerInfoFromExistingProject(initialClientEARProject, clientIds_.getTypeId(), clientIds_.getRuntimeId(), false);
- if (serverInfo!=null)
- {
- if (serverInfo[0]!=null && serverInfo[0].length()>0)
- {
- clientIds_.setServerId(serverInfo[0]);
- }
- if (serverInfo[1]!=null && serverInfo[1].length()>0)
- {
- clientIds_.setServerInstanceId(serverInfo[1]);
- }
- }
- }
- else
- {
- String[] serverInfo = ClientServerSelectionUtils.getServerFromClientRuntimeAndJ2EE(clientIds_.getRuntimeId(), clientJ2EEVersion_);
- if (serverInfo!=null)
- {
- if (serverInfo[0]!=null && serverInfo[0].length()>0)
- {
- clientIds_.setServerId(serverInfo[0]);
- }
- if (serverInfo[1]!=null && serverInfo[1].length()>0)
- {
- clientIds_.setServerInstanceId(serverInfo[1]);
- }
- }
- }
-
- }
- }
-
-
- protected void updateClientEARs()
- {
- //Set EAR selection to null if the project/server defaults imply an EAR should not be created
- String clientProjectName = getRuntime2ClientTypes().getChoice().getChoice().getList().getSelection();
- IProject clientProject = (IProject)((new StringToIProjectTransformer()).transform(clientProjectName));
- if (clientProject != null && clientProject.exists())
- {
- //Get the runtime target on the serviceProject
- IRuntime clientTarget = ClientServerSelectionUtils.getRuntimeTarget(clientProjectName);
- String j2eeVersion = String.valueOf(J2EEUtils.getJ2EEVersion(clientProject));
- if (clientTarget != null)
- {
- if (!ServerUtils.isTargetValidForEAR(clientTarget.getRuntimeType().getId(),j2eeVersion))
- {
- //Default the EAR selection to be empty
- getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setIndex(-1);
- clientNeedEAR_ = false;
- }
- }
-
- }
- else
- {
- //Use the server type
- String clientServerTargetId = ServerUtils.getRuntimeTargetIdFromFactoryId(clientIds_.getServerId());
- if (clientServerTargetId!=null && clientServerTargetId.length()>0)
- {
- if (!ServerUtils.isTargetValidForEAR(clientServerTargetId,clientJ2EEVersion_))
- {
- //Default the EAR selection to be empty
- getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setIndex(-1);
- clientNeedEAR_ = false;
- }
- }
- }
- }
-
- public void setClientInitialSelection(IStructuredSelection selection)
- {
- clientInitialSelection_ = selection;
- if (clientInitialProject_ == null)
- {
- clientInitialProject_ = getProjectFromInitialSelection(selection);
- }
- }
-
- public void setClientInitialProject(IProject clientInitialProject)
- {
- clientInitialProject_ = clientInitialProject;
- }
-
- /**
- * @param initialInitialSelection_ The initialInitialSelection_ to set.
- */
- public void setInitialInitialSelection(IStructuredSelection initialInitialSelection)
- {
- initialInitialSelection_ = initialInitialSelection;
- initialInitialProject_ = getProjectFromInitialSelection(initialInitialSelection);
- }
-
- public boolean getClientNeedEAR()
- {
- return clientNeedEAR_;
- }
-
- /**
- * @param parser_ The parser_ to set.
- */
- public void setWebServicesParser(WebServicesParser parser) {
- parser_ = parser;
- }
-
- public void setWsdlURI(String wsdlURI)
- {
- wsdlURI_ = wsdlURI;
- }
-
- private IProject getProjectFromInitialSelection(IStructuredSelection selection)
- {
- if (selection != null && selection.size() == 1)
- {
- Object obj = selection.getFirstElement();
- if (obj != null)
- {
- try
- {
- IResource resource = ResourceUtils.getResourceFromSelection(obj);
- if (resource==null)
- return null;
- IProject p = ResourceUtils.getProjectOf(resource.getFullPath());
- return p;
- } catch(CoreException e)
- {
- return null;
- }
- }
- }
- return null;
- }
-
- private String getClientProjectTypeFromRuntimeId(IProject p, String runtimeId)
- {
- //Navigate the runtimeClientTypes to see if we can navigate from the provided
- //runtime to the provided project's name.
- String pName = p.getName();
- String[] runtimeIds = getRuntime2ClientTypes().getList().getList();
- int numberOfRuntimes = runtimeIds.length;
- //Get the index of the runtimeId we are interested in
- for (int i=0; i<numberOfRuntimes; i++)
- {
- if (runtimeIds[i].equals(runtimeId))
- {
- //Get the list of client project types for this runtimeId
- SelectionListChoices clientProjectTypesToProjects= getRuntime2ClientTypes().getChoice(i);
- String[] clientProjectTypes = clientProjectTypesToProjects.getList().getList();
- for (int j=0; j<clientProjectTypes.length; j++)
- {
- //Get the list of projects for this clientProjectType. If pName
- //is in this list, we know the runtimeId supports this project
- //and we know the client project type.
- String[] clientProjects = clientProjectTypesToProjects.getChoice(j).getList().getList();
- for (int k=0; k<clientProjects.length; k++)
- {
- if (clientProjects[k].equals(pName))
- {
- //Found the project!!
- return clientProjectTypes[j];
- }
- }
- }
-
- }
- }
-
- //We didn't find the project under any of this runtimes client project types.
- //This means that this runtime does not support that client type. Return null
- return null;
- }
- /**
- * This inner class is being used to pass around Web service runtime
- * and J2EE level information.
- *
- */
- protected class WSRuntimeJ2EEType
- {
- private String wsrId_;
- private String j2eeVersionId_;
- private String clientProjectTypeId; //only used for client-side defaulting
-
- public WSRuntimeJ2EEType()
- {
- //making this ctor public so that subclasses can instantiate.
- }
- /**
- * @return Returns the j2eeVersionId_.
- */
- public String getJ2eeVersionId()
- {
- return j2eeVersionId_;
- }
- /**
- * @param versionId_ The j2eeVersionId_ to set.
- */
- public void setJ2eeVersionId(String versionId_)
- {
- j2eeVersionId_ = versionId_;
- }
- /**
- * @return Returns the wsrId_.
- */
- public String getWsrId()
- {
- return wsrId_;
- }
- /**
- * @param wsrId_ The wsrId_ to set.
- */
- public void setWsrId(String wsrId_)
- {
- this.wsrId_ = wsrId_;
- }
-
- /**
- * @return Returns the clientProjectTypeId.
- */
- public String getClientProjectTypeId()
- {
- return clientProjectTypeId;
- }
- /**
- * @param clientProjectTypeId The clientProjectTypeId to set.
- */
- public void setClientProjectTypeId(String clientProjectTypeId)
- {
- this.clientProjectTypeId = clientProjectTypeId;
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ProjectSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ProjectSelectionWidget.java
deleted file mode 100644
index 5b91f38..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/ProjectSelectionWidget.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.common.ServerSelectionUtils;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.SelectionList;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-import org.eclipse.wst.server.core.IRuntime;
-
-public class ProjectSelectionWidget extends SimpleWidgetDataContributor {
-
- private final String EAR_PERMITTED_PROJECT_TYPE = "EAR_PERMITTED_PROJECT_TYPE";
- private final String JAVA_PROJECT_TYPE_ID = "org.eclipse.jst.ws.consumption.ui.clientProjectType.Containerless";
-
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
-
- private SelectionListChoices projects_;
-
- private boolean needEAR_;
-
- private TypeRuntimeServer trsIds_;
-
- private String j2eeVersion_;
-
- private String projectTypeId_ = EAR_PERMITTED_PROJECT_TYPE;
-
- private ModifyListener projectListener_;
-
- private Listener statusListener_;
-
- private Text messageText_;
-
- private boolean isClient_ = false;
-
- private MessageUtils msgUtils;
-
- private byte CREATE_PROJECT = (byte) 1;
-
- private byte CREATE_EAR = (byte) 2;
-
- private byte ADD_EAR_ASSOCIATION = (byte) 4;
-
- /*
- * CONTEXT_ID PWRS0006 for the service-side Web project combo box of the
- * runtime selection Page
- */
- private String INFOPOP_PWRS_COMBO_PROJECT = pluginId_ + ".PWRS0006";
-
- private Combo project_;
-
- /* CONTEXT_ID PWRS0012 for the EAR combo box of the runtime selection Page */
- private String INFOPOP_PWRS_COMBO_EAR = pluginId_ + ".PWRS0012";
-
- private Combo ear_;
-
- /*
- * Default Constructor
- */
- public ProjectSelectionWidget() {
- }
-
- /*
- * ProjectSelectionWidget @param isClient
- */
- public ProjectSelectionWidget(boolean isClient) {
- this.isClient_ = isClient;
- }
-
- public WidgetDataEvents addControls(Composite parent, Listener statusListener) {
- msgUtils = new MessageUtils(pluginId_ + ".plugin", this);
- UIUtils uiUtils = new UIUtils(msgUtils, pluginId_);
-
- statusListener_ = statusListener;
- // project
- projectListener_ = new ModifyListener() {
-
- public void modifyText(ModifyEvent evt) {
- handleSetEarProjects();
- // handleSetMessageText();
- }
- };
-
- if (isClient_){
- project_ = uiUtils.createCombo(parent, "LABEL_CLIENT_PROJECT", "TOOLTIP_PWRS_COMBO_PROJECT", INFOPOP_PWRS_COMBO_PROJECT, SWT.SINGLE | SWT.BORDER);
- }
- else {
- project_ = uiUtils.createCombo(parent, "LABEL_SERVICE_WEB_MODULE", "TOOLTIP_PWRS_COMBO_PROJECT", INFOPOP_PWRS_COMBO_PROJECT, SWT.SINGLE | SWT.BORDER);
- }
- project_.addModifyListener(projectListener_);
-
- ear_ = uiUtils.createCombo(parent, "LABEL_SERVICE_EAR_PROJECT", "TOOLTIP_PWRS_COMBO_PROJECT", INFOPOP_PWRS_COMBO_EAR, SWT.SINGLE | SWT.BORDER);
- //ear_.addModifyListener(earListener_);
- ear_.addListener(SWT.Modify, statusListener);
- // message area
- messageText_ = uiUtils.createText(parent, "LABEL_NO_LABEL", "LABEL_NO_LABEL", null, SWT.WRAP | SWT.MULTI | SWT.READ_ONLY);
- return this;
- }
-
- public void setProjectChoices(SelectionListChoices projects) {
- projects_ = projects;
- SelectionList projectList = projects_.getList();
- // We remove listener here so that modifications to the Combo will
- // NOT trigger a
- // modifcation event.
- project_.removeModifyListener(projectListener_);
- project_.removeListener(SWT.Modify, statusListener_);
- project_.setItems(projectList.getList());
- project_.setText(projectList.getSelection());
- project_.addModifyListener(projectListener_);
- project_.addListener(SWT.Modify, statusListener_);
-
- handleSetEarProjects();
-
- }
-
- public SelectionListChoices getProjectChoices() {
- if (projects_ != null) {
- SelectionList projectList = projects_.getList();
- projectList.setSelectionValue(project_.getText());
- SelectionListChoices ears = projects_.getChoice();
- if (ears != null) ears.getList().setSelectionValue(ear_.getText());
- }
- return projects_;
- }
-
- public boolean getNeedEAR()
- {
- return needEAR_;
- }
-
- public void setNeedEAR(boolean b)
- {
- needEAR_ = b;
- }
-
-
- public void setTypeRuntimeServer(TypeRuntimeServer trs)
- {
- trsIds_ = trs;
- updateEAREnabledState();
-
- }
-
- public void setJ2EEVersion(String j2eeVersion)
- {
- j2eeVersion_ = j2eeVersion;
- updateEAREnabledState();
- }
-
- public void setProjectTypeId(String id)
- {
- projectTypeId_ = id;
- }
-
- private void handleSetEarProjects() {
- SelectionList projectList = projects_.getList();
- projectList.setSelectionValue(project_.getText());
- SelectionList earList = projects_.getChoice().getList();
- ear_.removeListener(SWT.Modify, statusListener_);
- ear_.setItems(earList.getList());
- ear_.setText(earList.getSelection());
- ear_.addListener(SWT.Modify, statusListener_);
- updateEAREnabledState();
- handleSetMessageText();
- }
-
- private void updateEAREnabledState()
- {
- ear_.removeListener(SWT.Modify, statusListener_);
- if (projects_ != null)
- {
- SelectionList earList = projects_.getChoice().getList();
- if(!projectNeedsEAR(project_.getText()))
- {
- earList.setIndex(-1);
- ear_.setText("");
- needEAR_ = false;
- ear_.setEnabled(false);
- }
- else
- {
- needEAR_ = true;
- ear_.setEnabled(true);
- }
- }
- ear_.addListener(SWT.Modify, statusListener_);
- }
-
- private boolean projectNeedsEAR(String projectName)
- {
- if (projectTypeId_.equals(JAVA_PROJECT_TYPE_ID))
- return false;
-
- if (projectName == null || projectName.length()==0)
- return true;
-
- IProject project = (IProject)((new StringToIProjectTransformer()).transform(projectName));
- if (project != null && project.exists())
- {
- //Get the runtime target on the project
- IRuntime target = ServerSelectionUtils.getRuntimeTarget(projectName);
- String j2eeVersion = String.valueOf(J2EEUtils.getJ2EEVersion(project));
- if (target != null)
- {
- if (!ServerUtils.isTargetValidForEAR(target.getRuntimeType().getId(),j2eeVersion))
- {
- return false;
- }
-
- }
- }
- else
- {
- //Use the server type
- if (trsIds_ != null)
- {
- String targetId = ServerUtils.getRuntimeTargetIdFromFactoryId(trsIds_.getServerId());
- if (targetId!=null && targetId.length()>0)
- {
- if (!ServerUtils.isTargetValidForEAR(targetId,j2eeVersion_))
- {
- return false;
- }
- }
- }
- }
-
- return true;
- }
-
- private Status handleSetMessageText() {
- Status status = new SimpleStatus("");
- try {
- byte result = (byte) 0;
- if (project_.getText().length() != 0 && ear_.getText().length() != 0) {
- String projectText = project_.getText();
- String earText = ear_.getText();
- IProject project = ResourceUtils.getWorkspaceRoot().getProject(projectText);
- IProject ear = ResourceUtils.getWorkspaceRoot().getProject(earText);
- if (project != null) {
- if (!project.exists()) {
- result = (byte) (result | CREATE_PROJECT);
- }
- if (!ear.exists()) {
- result = (byte) (result | CREATE_EAR);
- }
- if (project.exists() && ear.exists()) {
- if (!J2EEUtils.isEARAssociated(project, ear)) result = (byte) (result | ADD_EAR_ASSOCIATION);
- }
- }
- }
- if (isClient_) {
- messageText_.setText(getValidationMessage(result, msgUtils.getMessage("MSG_CLIENT_SUB")));
- }
- else {
- messageText_.setText(getValidationMessage(result, msgUtils.getMessage("MSG_SERVICE_SUB")));
- }
- }
- catch (Exception e) {
- return new SimpleStatus("", msgUtils.getMessage("PAGE_MSG_VALIDATION_INTERNAL_ERROR"), Status.ERROR);
- }
- return status;
- }
-
- private String getValidationMessage(byte result, String serviceOrClient) {
- String msg = null;
- switch (result) {
- case 0:
- return "";
- case 1:
- case 5:
- msg = "MSG_PROJECT_WILL_BE_CREATED";
- break;
- case 2:
- case 6:
- msg = "MSG_EAR_WILL_BE_CREATED";
- break;
- case 3:
- case 7:
- msg = "MSG_PROJECT_AND_EAR_CREATED";
- break;
- case 4:
- msg = "MSG_EAR_WILL_BE_ASSOCIATED";
- break;
- }
- return msg != null ? msgUtils.getMessage(msg, new Object[] { serviceOrClient}) : "";
- }
-
- public Status getStatus() {
- Status finalStatus = new SimpleStatus("");
- handleSetMessageText();
- String projectText = project_.getText();
- String earText = ear_.getText();
- if (projectText==null || projectText.length()==0)
- {
- if (isClient_)
- return new SimpleStatus("",msgUtils.getMessage("MSG_CLIENT_PROJECT_EMPTY"),Status.ERROR);
- else
- return new SimpleStatus("",msgUtils.getMessage("MSG_SERVICE_PROJECT_EMPTY"),Status.ERROR);
- }
-
- if (needEAR_ && (earText==null || earText.length()==0))
- {
- if (isClient_)
- return new SimpleStatus("",msgUtils.getMessage("MSG_CLIENT_EAR_EMPTY"),Status.ERROR);
- else
- return new SimpleStatus("",msgUtils.getMessage("MSG_SERVICE_EAR_EMPTY"),Status.ERROR);
- }
-
- return finalStatus;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/RuntimeServerSelectionWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/RuntimeServerSelectionWidget.java
deleted file mode 100644
index 61bb531..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/runtime/RuntimeServerSelectionWidget.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.RuntimeServerSelectionDialog;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceClientTypeRegistry;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServer;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-
-public class RuntimeServerSelectionWidget extends SimpleWidgetDataContributor
-{
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- private Text runtime_;
- private Text server_;
- private Text j2eeVersionText;
- private Composite parent_;
- private boolean isClientContext_;
- private TypeRuntimeServer ids_;
- private String j2eeVersion_;
- private MessageUtils msgUtils_;
- private Listener statusListener_;
-
- /* CONTEXT_ID PWRS0004 for the service-side runtime selection of the runtime selection Page */
- private String INFOPOP_PWRS_GROUP_SERVICE_RUNTIME = pluginId_ + ".PWRS0004";
-
- /* CONTEXT_ID PWRS0005 for the service-sdie server selection of the runtime selection Page */
- private String INFOPOP_PWRS_GROUP_SERVICE_SERVER = pluginId_ + ".PWRS0005";
-
- /* CONTEXT_ID PWRS0009 for the J2EE version selection of the runtime selection Page */
- private String INFOPOP_PWRS_J2EE_VERSION = pluginId_ + ".PWRS0009";
-
- public RuntimeServerSelectionWidget( boolean isClientScenario )
- {
- isClientContext_ = isClientScenario;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#addControls(org.eclipse.swt.widgets.Composite, org.eclipse.swt.widgets.Listener)
- */
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- msgUtils_ = new MessageUtils( pluginId_ + ".plugin", this );
- UIUtils uiUtils = new UIUtils(msgUtils_, pluginId_ );
-
- parent_ = parent;
- statusListener_ = statusListener;
-
- // Runtime label and text
- runtime_ = uiUtils.createText( parent, "LABEL_RUNTIMES_LIST",
- "TOOLTIP_PWRS_TEXT_RUNTIME",
- INFOPOP_PWRS_GROUP_SERVICE_RUNTIME, SWT.READ_ONLY );
-
- // Server label and text
- server_ = uiUtils.createText( parent, "LABEL_SERVERS_LIST",
- "TOOLTIP_PWRS_TEXT_SERVER",
- INFOPOP_PWRS_GROUP_SERVICE_SERVER, SWT.READ_ONLY );
-
- j2eeVersionText = uiUtils.createText(parent, "LABEL_J2EE_VERSION", "TOOLTIP_PWRS_J2EE_VERSION", INFOPOP_PWRS_J2EE_VERSION, SWT.READ_ONLY);
-
- Button editButton = new Button( parent, SWT.NONE );
- editButton.setText( msgUtils_.getMessage("LABEL_EDIT_BUTTON"));
- editButton.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleEditButton();
- }
- } );
-
- // Dummy label that goes on the right side of the edit button.
- new Label( parent, SWT.NONE );
-
- return this;
- }
-
- public TypeRuntimeServer getTypeRuntimeServer()
- {
- return ids_;
- }
-
- public void setTypeRuntimeServer( TypeRuntimeServer ids )
- {
- ids_ = ids;
- setLabels();
- }
-
- public String getJ2EEVersion()
- {
- return j2eeVersion_;
- }
-
- public void setJ2EEVersion(String j2eeVersion)
- {
- this.j2eeVersion_ = j2eeVersion;
- j2eeVersionText.setText((j2eeVersion_ != null) ? J2EEUtils.getLabelFromJ2EEVersion(j2eeVersion_) : msgUtils_.getMessage("LABEL_NA"));
- //setLabels();
- }
-
- private void setLabels()
- {
- WebServiceClientTypeRegistry registry = WebServiceClientTypeRegistry.getInstance();
- String runtimeLabel = registry.getRuntimeLabelById( ids_.getRuntimeId() );
- String serverLabel = null;
-
- if( ids_.getServerInstanceId() == null )
- {
- // Get the label for the general server type.
- WebServiceServer server = registry.getWebServiceServerByFactoryId( ids_.getServerId() );
- serverLabel = server == null ? "" : server.getLabel();
- }
- else
- {
- // Get the label for the server instance.
- serverLabel = registry.getServerInstanceLabelFromInstanceId( ids_.getServerInstanceId() );
- }
-
- runtimeLabel = runtimeLabel == null ? "" : runtimeLabel;
-
- runtime_.setText( runtimeLabel );
- server_.setText( serverLabel );
- j2eeVersionText.setText((j2eeVersion_ != null) ? J2EEUtils.getLabelFromJ2EEVersion(j2eeVersion_) : msgUtils_.getMessage("LABEL_NA"));
- }
-
- public void handleEditButton()
- {
- byte mode = isClientContext_ ? (byte)1 : (byte)0;
-
- RuntimeServerSelectionDialog dialog
- = dialog = new RuntimeServerSelectionDialog( parent_.getShell(), mode, ids_, j2eeVersion_ );
- dialog.create();
- dialog.handleServerViewSelectionEvent();
- int result = dialog.open();
-
- if (result == Window.OK)
- {
- ids_ = dialog.getTypeRuntimeServer();
- j2eeVersion_ = dialog.getJ2EEVersion();
- setLabels();
- statusListener_.handleEvent(null);
- }
- }
-
- public void addModifyListener(ModifyListener listener)
- {
- if (runtime_ != null)
- runtime_.addModifyListener(listener);
- }
-
- public void removeModifyListener(ModifyListener listener)
- {
- if (runtime_ != null)
- runtime_.removeModifyListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus()
- */
- public Status getStatus()
- {
- Status status = new SimpleStatus( "" );
- String scenario = isClientContext_ ? msgUtils_.getMessage( "MSG_CLIENT_SUB" )
- : msgUtils_.getMessage( "MSG_SERVICE_SUB" );
-
- // Kludge!!! We shouldn't have to check for blank labels. The defaulting commands should be setting the
- // ids to null if there isn't a valid one. This code should be removed in C4.
- WebServiceClientTypeRegistry wsctRegistry = WebServiceClientTypeRegistry.getInstance();
- String runtimeLabel = wsctRegistry.getRuntimeLabelById( ids_.getRuntimeId() );
- WebServiceServer server = wsctRegistry.getWebServiceServerByFactoryId( ids_.getServerId() );
- String serverLabel = server == null ? "" : server.getLabel();
-
- if( ids_.getRuntimeId() == null || runtimeLabel == null || runtimeLabel.equals("" ))
- {
- status = new SimpleStatus( "", msgUtils_.getMessage( "MSG_NO_RUNTIME", new String[]{ scenario } ), Status.ERROR );
- }
- else if( ids_.getServerId() == null || serverLabel.equals( "" ))
- {
- status = new SimpleStatus( "", msgUtils_.getMessage( "MSG_NO_SERVER", new String[]{ scenario } ), Status.ERROR );
- }
-
- //--------- check if WSCT exists for these selections
- if (!(ids_.getServerId() == null) && !(ids_.getRuntimeId() == null) && isClientContext_)
- {
- WebServiceServer wss = wsctRegistry.getWebServiceServerByFactoryId(ids_.getServerId());
- if (wss != null)
- {
- String serverTypeId = wss.getId();
- String runtimeId = ids_.getTypeId();
- if (!wsctRegistry.webServiceClientRuntimeTypeExists( serverTypeId, ids_.getRuntimeId(), runtimeId)) {
- status = new SimpleStatus( "", msgUtils_.getMessage( "MSG_INVALID_SRT_SELECTIONS", new String[]{ scenario } ), Status.ERROR );
- }
- }
- else
- status = new SimpleStatus( "", msgUtils_.getMessage( "MSG_INVALID_SRT_SELECTIONS", new String[]{ scenario } ), Status.ERROR );
- }
-
- //--------- check if WSSRT exists for these selections
- if (!(ids_.getServerId() == null) && !(ids_.getRuntimeId() == null) && !isClientContext_)
- {
- WebServiceServerRuntimeTypeRegistry wssrtRegistry = WebServiceServerRuntimeTypeRegistry.getInstance();
- String serverTypeId = wsctRegistry.getWebServiceServerByFactoryId(ids_.getServerId()).getId();
- if (!wssrtRegistry.isServerRuntimeTypeSupported(serverTypeId, ids_.getRuntimeId(), ids_.getTypeId())) {
- status = new SimpleStatus( "", msgUtils_.getMessage( "MSG_INVALID_SRT_SELECTIONS", new String[]{ scenario } ), Status.ERROR );
- }
- }
-
-
-
- return status;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/AddModuleDependenciesCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/AddModuleDependenciesCommand.java
deleted file mode 100644
index 130a62b..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/AddModuleDependenciesCommand.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.j2ee.applicationclient.creation.IApplicationClientNatureConstants;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest;
-import org.eclipse.jst.j2ee.internal.earcreation.AddUtilityJARMapCommand;
-import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
-import org.eclipse.jst.j2ee.internal.project.IEJBNatureConstants;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.project.J2EENature;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-
-public class AddModuleDependenciesCommand extends SimpleCommand
-{
- private String sampleProject;
- private String sampleEAR;
- private String clientProject;
- private String sampleServerTypeID;
- private IServer sampleExistingServer;
- private String clientJ2EEVersion;
-
- public AddModuleDependenciesCommand()
- {
- super("org.eclipse.jst.ws.internal.consumption.command.common.AddModuleDependenciesTask", "org.eclipse.jst.ws.internal.consumption.command.common.AddModuleDependenciesTask");
- }
-
- /**
- * Execute WebServerDefaultingTask Set the default server name and id given a
- * deployable.
- */
- public Status execute(Environment env)
- {
- try
- {
- IResource res = (IProject)ResourceUtils.findResource(sampleProject);
- IProject sampleIProject = null;
- if (res instanceof IProject)
- sampleIProject = (IProject)res;
- if (sampleIProject == null)
- {
- CreateSampleProjectCommand createSample = new CreateSampleProjectCommand();
- createSample.setSampleProject(sampleProject);
- createSample.setSampleProjectEAR(sampleEAR);
- if (sampleEAR!=null && sampleEAR.length()>0)
- createSample.setNeedEAR(true);
- createSample.setExistingServer(sampleExistingServer);
- createSample.setServerFactoryId(sampleServerTypeID);
- createSample.setJ2eeVersion(clientJ2EEVersion);
- Status status = createSample.execute(env);
- }
- res = ResourceUtils.findResource(sampleProject);
- if (res instanceof IProject)
- sampleIProject = (IProject)res;
- res = ResourceUtils.findResource(sampleEAR);
- IProject sampleIEAR = null;
- if (res instanceof IProject)
- sampleIEAR = (IProject)res;
- if (sampleIProject == null)
- return new SimpleStatus("", "", Status.ERROR);
- res = ResourceUtils.findResource(clientProject);
- IProject clientIProject = null;
- if (res instanceof IProject)
- clientIProject = (IProject)res;
- if (clientIProject != null && !ResourceUtils.isWebProject(clientIProject))
- {
- String uri = clientIProject.getName() + ".jar";
- if (ResourceUtils.isTrueJavaProject(clientIProject))
- addJavaProjectAsUtilityJar(clientIProject, sampleIEAR, uri);
- addJAROrModuleDependency(sampleIProject, uri);
- addBuildPath(sampleIProject, clientIProject);
- }
- }
- catch (IOException ioe)
- {
- }
- catch (CoreException ce)
- {
- }
- return new SimpleStatus("");
- }
-
- private void addJavaProjectAsUtilityJar(IProject javaProject, IProject earProject, String uri)
- {
- AddUtilityJARMapCommand cmd = new AddUtilityJARMapCommand(earProject, uri, javaProject);
- cmd.execute();
- }
-
- private void addJAROrModuleDependency(IProject project, String uri) throws IOException, CoreException
- {
- J2EENature nature = null;
- if (ResourceUtils.isWebProject(project))
- nature = getWebNature(project);
- else if (ResourceUtils.isAppClientProject(project))
- nature = getAppClientNature(project);
- else if (ResourceUtils.isEJBProject(project))
- nature = getEJBNature(project);
- if (nature != null)
- {
- ArchiveManifest manifest = J2EEProjectUtilities.readManifest(project);
- manifest.mergeClassPath(new String[]{uri});
- J2EEProjectUtilities.writeManifest(project, manifest);
- }
- }
-
- private void addBuildPath(IProject referencingProject, IProject referencedProject) throws JavaModelException
- {
- IJavaProject javaProject = JavaCore.create(referencingProject);
- if (javaProject != null)
- {
- IClasspathEntry[] oldCp = javaProject.getRawClasspath();
- IClasspathEntry[] newCp = new IClasspathEntry[oldCp.length];
- for (int i = 0; i < oldCp.length; i++)
- newCp[i] = oldCp[i];
- newCp[newCp.length - 1] = JavaCore.newProjectEntry(referencedProject.getFullPath());
- javaProject.setRawClasspath(newCp, new NullProgressMonitor());
- }
- }
-
- private J2EENature getWebNature(IProject project)
- {
- try
- {
- return (J2EENature)project.getNature(IWebNatureConstants.J2EE_NATURE_ID);
- }
- catch (CoreException ce)
- {
- }
- return null;
- }
-
- private J2EENature getAppClientNature(IProject project)
- {
- for (int i = 0; i < IApplicationClientNatureConstants.APPCLIENT_NATURE_IDS.length; i++)
- {
- try
- {
- return (J2EENature)project.getNature(IApplicationClientNatureConstants.APPCLIENT_NATURE_IDS[i]);
- }
- catch (CoreException ce)
- {
- }
- }
- return null;
- }
-
- private J2EENature getEJBNature(IProject project)
- {
- try
- {
- // ksc return
- // (J2EENature)project.getNature(IEJBNatureConstants.EJB_20_NATURE_ID);
- return (J2EENature)project.getNature(IEJBNatureConstants.NATURE_ID);
- }
- catch (CoreException ce)
- {
- }
- try
- {
- return (J2EENature)project.getNature(IEJBNatureConstants.NATURE_ID);
- }
- catch (CoreException ce)
- {
- }
- return null;
- }
-
- private IProject getEARProject(IProject sampleProject)
- {
- EARNatureRuntime[] natures = J2EEUtils.getEARProjects(sampleProject);
- if (natures != null && natures.length > 0)
- return natures[0].getProject();
- else
- return null;
- }
-
- /**
- * @param proxyProject
- * The proxyProject to set.
- */
- public void setSampleProject(String sampleProject)
- {
- this.sampleProject = sampleProject;
- }
-
- public String getSampleProject()
- {
- return sampleProject;
- }
-
- public void setSampleProjectEAR(String sampleEAR)
- {
- this.sampleEAR = sampleEAR;
- }
-
- public void setClientProject(String clientProject)
- {
- this.clientProject = clientProject;
- }
-
- public void setSampleServerTypeID(String sampleServerTypeID)
- {
- this.sampleServerTypeID = sampleServerTypeID;
- }
-
- public void setSampleExistingServer(IServer sampleExistingServer)
- {
- this.sampleExistingServer = sampleExistingServer;
- }
-
- public void setClientJ2EEVersion(String clientJ2EEVersion)
- {
- this.clientJ2EEVersion = clientJ2EEVersion;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestDelegateCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestDelegateCommand.java
deleted file mode 100644
index 968bc55..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestDelegateCommand.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jst.ws.internal.context.ScenarioContext;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.ext.WebServiceExecutable;
-import org.eclipse.jst.ws.internal.ext.test.JavaProxyTestCommand;
-import org.eclipse.jst.ws.internal.ext.test.WSDLTestFinishCommand;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestExtension;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestFinishCommand;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-import org.eclipse.wst.command.env.core.selection.BooleanSelection;
-import org.eclipse.wst.command.env.core.selection.SelectionList;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-
-
-/*
-* The JSPGeneration task runs the jsp generation engine found in the
-* JBWizard Plugin
-*
-*
-*/
-public class ClientTestDelegateCommand extends SimpleCommand
-{
- private String LABEL = "JSPGenerationTask";
- private String DESCRIPTION = "Run the JSP Generation";
-
- private ScenarioContext scenarioContext;
- private WebServiceTestRegistry testRegistry;
- private SelectionList testFacilities;
- private String folder;
- private String jspFolder;
- private BooleanSelection[] methods;
- private boolean runClientTest=true;
- private String sampleServerTypeID;
- private IServer sampleExistingServer;
- private String proxyBean;
- private String sampleProject;
- private String clientProject;
- private String clientServer;
- private TypeRuntimeServer clientIds;
- private TypeRuntimeServer serverIds;
- private String serviceProject;
- private String wsdlServiceURL;
- private boolean generateProxy;
- private boolean isTestWidget = false;
- private String setEndpointMethod;
- private List endpoints;
-
- public ClientTestDelegateCommand ()
- {
- setDescription(DESCRIPTION);
- setName(LABEL);
- scenarioContext = WebServicePlugin.getInstance().getScenarioContext().copy();
- testRegistry = WebServiceTestRegistry.getInstance();
- }
-
- public Status execute(Environment env)
- {
- Status status = new SimpleStatus( "" );
- String clientTestID = testFacilities.getSelection();
- WebServiceTestFinishCommandFactory wtfcf = new WebServiceTestFinishCommandFactory();
- WebServiceTestFinishCommand command = wtfcf.getWebServiceTestFinishCommand(clientTestID,env);
-
- command.setExistingServer(sampleExistingServer);
- command.setServerTypeID(sampleServerTypeID);
- status = command.execute(env);
- if(status.getSeverity() == Status.ERROR){
- StatusHandler sHandler = env.getStatusHandler();
- sHandler.reportError(status);
- return status;
- }
- return status;
- }
-
- private class WebServiceTestFinishCommandFactory
- {
-
- private WebServiceTestFinishCommand getWebServiceTestFinishCommand(String clientTestID,Environment env)
- {
- WebServiceTestExtension wscte = (WebServiceTestExtension)testRegistry.getWebServiceExtensionsByName(clientTestID);
- boolean isJava = true;
- if(wscte.isJava() && !generateProxy){
- isJava = false;
- wscte = (WebServiceTestExtension)testRegistry.getWebServiceExtensionsByName(scenarioContext.getNonJavaTestService());
- }
- if(!wscte.isJava())
- isJava = false;
- WebServiceExecutable wse = wscte.getWebServiceExecutableExtension();
-
- if(isJava){
- JavaProxyTestCommand command = (JavaProxyTestCommand)wse.getFinishCommand();
- command.setProxyBean(proxyBean);
- command.setSampleProject(sampleProject);
- command.setClientProject(clientProject);
- command.setRunClientTest(runClientTest);
- command.setJspFolder(jspFolder);
- command.setSetEndpointMethod(setEndpointMethod);
- command.setMethods(methods);
- command.setEndpoint(endpoints);
- if (clientIds.getServerInstanceId() != null)
- sampleExistingServer = ServerCore.findServer(clientIds.getServerInstanceId());
- if (sampleExistingServer != null)
- sampleServerTypeID = sampleExistingServer.getServerType().getId();
- else
- sampleServerTypeID = clientIds.getServerId();
- // server will be created in ServerDeployableConfigurationCommand
-
- return command;
- }
- else{
- WSDLTestFinishCommand wtfc = (WSDLTestFinishCommand)wse.getFinishCommand();
- wtfc.setServiceProject(getWSDLProject());
- wtfc.setWsdlServiceURL(wsdlServiceURL);
- wtfc.setExternalBrowser(false);
- wtfc.setEndpoint(endpoints);
- if(serverIds != null){
- if (serverIds.getServerInstanceId() != null)
- sampleExistingServer = ServerCore.findServer(serverIds.getServerInstanceId());
- if (sampleExistingServer != null)
- sampleServerTypeID = sampleExistingServer.getServerType().getId();
- else
- sampleServerTypeID = serverIds.getServerId();
- // server will be created in ServerDeployableConfigurationCommand
- }
- else if(clientIds != null)
- {
- if (clientIds.getServerInstanceId() != null)
- sampleExistingServer = ServerCore.findServer(clientIds.getServerInstanceId());
- if (sampleExistingServer != null)
- sampleServerTypeID = sampleExistingServer.getServerType().getId();
- else
- sampleServerTypeID = clientIds.getServerId();
- // server will be created in ServerDeployableConfigurationCommand
-
- }
- return wtfc;
- }
- }
-
- public Status getStatus()
- {
- return new SimpleStatus("");
- }
-
- }
-
- //The test facilities retrieved from the extension
- //plus the default
- public void setTestFacility(SelectionList selection)
- {
- testFacilities = selection;
- }
-
- public void setFolder(String folder)
- {
- this.folder = folder;
- }
-
- public void setJspFolder(String jspFolder)
- {
- this.jspFolder = jspFolder;
- }
-
- public void setMethods(BooleanSelection[] methods)
- {
- this.methods = methods;
- }
-
- public void setRunClientTest(boolean runClientTest)
- {
- this.runClientTest = runClientTest;
- }
-
- public void setProxyBean(String proxyBean)
- {
- this.proxyBean = proxyBean;
- }
-
- public void setSampleProject(String sampleProject)
- {
- this.sampleProject = sampleProject;
- }
-
- public void setClientProject(String clientProject)
- {
- this.clientProject = clientProject;
- }
-
- public void setScenarioContext(ScenarioContext scenarioContext)
- {
- this.scenarioContext = scenarioContext;
- }
-
- public void setClientTestRegistry(WebServiceTestRegistry testRegistry)
- {
- this.testRegistry = testRegistry;
- }
-
- public void setSampleServerTypeID(String sampleServerTypeID)
- {
- this.sampleServerTypeID = sampleServerTypeID;
- }
-
- public void setSampleExistingServer(IServer sampleExistingServer)
- {
- this.sampleExistingServer = sampleExistingServer;
- }
-
- public void setClientTypeRuntimeServer(TypeRuntimeServer ids)
- {
- clientIds = ids;
- }
-
- public void setServiceTypeRuntimeServer(TypeRuntimeServer ids)
- {
- serverIds = ids;
- }
-
- public String getSampleServerTypeID()
- {
- return sampleServerTypeID;
- }
-
- public IServer getSampleExistingServer()
- {
- return sampleExistingServer;
- }
-
- public void setClientServer(String clientServer)
- {
- this.clientServer = clientServer;
- }
-
- public void setServerProject(String serviceProject)
- {
- this.serviceProject = serviceProject;
- }
-
- public String getWSDLProject()
- {
- if(serviceProject != null)
- return serviceProject;
-
- return clientProject;
- }
-
- public void setWsdlURI(String wsdlServiceURL)
- {
- this.wsdlServiceURL = wsdlServiceURL;
- }
-
- public void setGenerateProxy(boolean generateProxy)
- {
- this.generateProxy = generateProxy;
- }
-
- public boolean getIsTestWidget()
- {
- return isTestWidget;
- }
-
- /**
- * @param setEndpointMethod The setEndpointMethod to set.
- */
- public void setSetEndpointMethod(String setEndpointMethod)
- {
- this.setEndpointMethod = setEndpointMethod;
- }
- /**
- * @param endpoint The endpoint to set.
- */
- public void setEndpoint(String endpoint)
- {
- if (endpoint != null && endpoint.length() > 0)
- {
- Vector v = new Vector();
- v.add(endpoint);
- setEndpoints(v);
- }
- }
-
- public void setEndpoints(List endpoints)
- {
- this.endpoints = endpoints;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestFragment.java
deleted file mode 100644
index 1c53134..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestFragment.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/**
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-
-
-public class ClientTestFragment extends BooleanFragment
-{
- private boolean testService;
- private boolean genProxy;
- private boolean launchedTest = false;
-
- public ClientTestFragment( String id )
- {
- SequenceFragment clientTestRoot = new SequenceFragment();
- Condition condition = new Condition()
- {
- public boolean evaluate()
- {
- return testService && genProxy;
- }
- };
- setCondition( condition );
-
- clientTestRoot.add( new SimpleFragment( new WebServiceClientTestArrivalCommand(), "" ) );
- clientTestRoot.add( new SimpleFragment( id ) );
- setTrueFragment( clientTestRoot );
-
- }
-
- public void setGenerateProxy( boolean genProxy )
- {
- this.genProxy = genProxy;
- }
-
- public void setTestService( Boolean testService )
- {
- this.testService = testService.booleanValue();
- }
-
- public boolean getLaunchedTest()
- {
- return launchedTest;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestWidget.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestWidget.java
deleted file mode 100644
index 1f7c914..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestWidget.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/**
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.common.FolderResourceFilter;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.jst.ws.internal.ui.dialog.DialogUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.selection.BooleanSelection;
-import org.eclipse.wst.command.env.core.selection.SelectionList;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class ClientTestWidget extends SimpleWidgetDataContributor
-{
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
-
- /*CONTEXT_ID PWSM0001 for the Sample Page*/
- private String INFOPOP_PWSM_PAGE = "PWSM0001";
- //
- private Button testCheckbox_;
- /*CONTEXT_ID PWSM0002 for the Test check box of the Sample Page*/
- private String INFOPOP_PWSM_CHECKBOX_TEST = "PWSM0002";
-
- private Combo testTypeCombo_;
- /*CONTEXT_ID PWSM0003 for the Test Type Combo box of the Sample Page*/
- private String INFOPOP_PWSM_COMBOBOX_TEST = "PWSM0003";
-
- private Text jspFolderText_;
- /*CONTEXT_ID PWSM0008 for the JSP Folder field of the Sample Page*/
- private String INFOPOP_PWSM_TEXT_JSP_FOLDER = "PWSM0008";
-
- private Button sampleFolderBrowseButton_;
- /*CONTEXT_ID PWSM0009 for the JSP Folder Browse button of the Sample Page*/
- private String INFOPOP_PWSM_BUTTON_JSP_FOLDER_BROWSE = "PWSM0009";
-
- private Combo projectCombo_;
- /*CONTEXT_ID PWSM0010 for the Project combo box of the Sample Page*/
- private String INFOPOP_PWSM_COMBO_PROJECT = "PWSM0010";
-
- private Tree methodsTree_;
- /*CONTEXT_ID PWSM0005 for the Methods tree of the Sample Page*/
- private String INFOPOP_PWSM_TREE_METHODS = "PWSM0005";
-
- private Button selectAllMethodsButton_;
- /*CONTEXT_ID PWSM0006 for the Select All button of the Sample Page*/
- private String INFOPOP_PWSM_BUTTON_SELECT_ALL = "PWSM0006";
-
- private Button deselectAllMethodsButton_;
- /*CONTEXT_ID PWSM0007 for the Deselect All button of the Sample Page*/
- private String INFOPOP_PWSM_BUTTON_DESELECT_ALL = "PWSM0007";
-
- private Text sampleFolderText_;
- /*CONTEXT_ID PWSM0014 for the Folder field of the Sample Page*/
- private String INFOPOP_PWSM_TEXT_SAMPLE_FOLDER = "PWSM0014";
- //
- private Button runTestCheckbox_;
- /*CONTEXT_ID PWSM0015 for the run test check box of the Sample Page*/
- private String INFOPOP_PWSM_CHECKBOX_LAUNCH = "PWSM0015";
- //
- private Combo earCombo_;
- /*CONTEXT_ID PWSM0016 for the EAR combo box of the Sample Page*/
- private String INFOPOP_PWSM_EAR_COMBO = "PWSM0016";
-
- private Label projectExistsLabel_;
- private Label earExistsLabel_;
- private Composite comboGroup_;
- private SelectionList testFacilities_;
- private FolderResourceFilter folderFilter_ = new FolderResourceFilter();
- private IStructuredSelection initialSelection_;
- private String launchedServiceTestName;
- private boolean isTestWidget = false;
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- isTestWidget = true;
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- UIUtils uiUtils = new UIUtils(msgUtils, pluginId_ );
-
- parent.setToolTipText( msgUtils.getMessage( "TOOLTIP_PWSM_PAGE" ) );
- WorkbenchHelp.setHelp( parent, pluginId_ + "." + INFOPOP_PWSM_PAGE );
-
- testCheckbox_ = uiUtils.createCheckbox( parent, "BUTTON_TEST",
- "TOOLTIP_PWSM_CHECKBOX_TEST",
- INFOPOP_PWSM_CHECKBOX_TEST );
- testCheckbox_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleTestButton();
- }
- });
-
- comboGroup_ = uiUtils.createComposite( parent, 3, 5, 0 );
-
- testTypeCombo_ = uiUtils.createCombo( comboGroup_, "LABEL_TEST_TYPES",
- "TOOLTIP_PWSM_COMBOBOX_TEST",
- INFOPOP_PWSM_COMBOBOX_TEST,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
- Label dummyLabel = new Label( comboGroup_, SWT.NONE );
-
- projectCombo_ = uiUtils.createCombo( comboGroup_, "LABEL_JSP_PROJECT_NAME",
- "TOOLTIP_PWSM_COMBO_PROJECT",
- INFOPOP_PWSM_COMBO_PROJECT,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
- projectCombo_.setEnabled( false );
- projectExistsLabel_ = new Label( comboGroup_, SWT.NONE );
-
-
- earCombo_ = uiUtils.createCombo( comboGroup_, "LABEL_EAR_PROJECT",
- "TOOLTIP_PWSM_EAR_PROJECT",
- INFOPOP_PWSM_EAR_COMBO,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
- earCombo_.setEnabled( false );
- earExistsLabel_ = new Label( comboGroup_, SWT.NONE );
-
-
-
- sampleFolderText_ = uiUtils.createText( comboGroup_, "LABEL_FOLDER_NAME",
- "TOOLTIP_PWSM_TEXT_SAMPLE_FOLDER",
- INFOPOP_PWSM_TEXT_SAMPLE_FOLDER,
- SWT.SINGLE | SWT.BORDER );
-
- sampleFolderText_.addModifyListener( new ModifyListener()
- {
- public void modifyText( ModifyEvent evt )
- {
- handleFolderText();
- }
- });
-
-
- sampleFolderBrowseButton_ = uiUtils.createPushButton( comboGroup_, "BUTTON_BROWSE",
- "TOOLTIP_PWSM_BUTTON_JSP_FOLDER_BROWSE",
- INFOPOP_PWSM_BUTTON_JSP_FOLDER_BROWSE );
- sampleFolderBrowseButton_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleSampleBrowse();
- }
- });
-
- jspFolderText_ = uiUtils.createText( comboGroup_, "LABEL_JSP_FOLDER_NAME",
- "TOOLTIP_PWSM_TEXT_JSP_FOLDER",
- INFOPOP_PWSM_TEXT_JSP_FOLDER,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
- jspFolderText_.setEnabled( false );
-
- Group methodsGroup = uiUtils.createGroup( parent, "LABEL_METHODS",
- "TOOLTIP_PWSM_TREE_METHODS", null );
-
- methodsGroup.setLayoutData( uiUtils.createFillAll() );
-
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- methodsGroup.setLayout( layout );
-
- // TODO No infopop for this tree.
- methodsTree_ = uiUtils.createTree( methodsGroup, "TOOLTIP_PWSM_TREE_METHODS",
- null,
- SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.CHECK );
-
- Composite selectButtons = uiUtils.createComposite( methodsGroup, 2 );
-
- selectAllMethodsButton_
- = uiUtils.createPushButton( selectButtons, "BUTTON_SELECT_ALL",
- "TOOLTIP_PWSM_BUTTON_SELECT_ALL",
- INFOPOP_PWSM_BUTTON_SELECT_ALL );
- selectAllMethodsButton_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleSelectAll( true );
- }
- });
-
- deselectAllMethodsButton_
- = uiUtils.createPushButton( selectButtons, "BUTTON_DESELECT_ALL",
- "TOOLTIP_PWSM_BUTTON_DESELECT_ALL",
- INFOPOP_PWSM_BUTTON_DESELECT_ALL );
- deselectAllMethodsButton_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleSelectAll( false );
- }
- });
-
- runTestCheckbox_ = uiUtils.createCheckbox( parent, "BUTTON_RUN_TEST",
- "TOOLTIP_PWSM_CHECKBOX_LAUNCH",
- INFOPOP_PWSM_CHECKBOX_LAUNCH );
-
- return this;
- }
-
- private void handleFolderText()
- {
- String folder = sampleFolderText_.getText();
- String jspFolder = jspFolderText_.getText();
- int index = jspFolder.lastIndexOf(Path.SEPARATOR);
- if(index == -1) return;
- jspFolder = jspFolder.substring(0,index + 1);
- jspFolder = jspFolder + folder;
- jspFolderText_.setText(jspFolder);
- }
-
- private void handleSampleBrowse()
- {
- IPath selectedPath = null;
- IResource initialResource = null;
- IPath projectPath = new Path( projectCombo_.getText() ).makeAbsolute();
- IResource project = ResourceUtils.findResource( projectPath );
- IContainer webModuleContainer = ResourceUtils.getWebModuleServerRoot( (IProject)project);
-
- try
- {
- initialResource = ResourceUtils.getResourceFromSelection( initialSelection_ );
- }
- catch( CoreException exc )
- {
- }
-
- if( initialResource == null )initialResource = project;
-
- IResource resource = DialogUtils.browseResources( comboGroup_.getShell(),
- project,
- initialResource,
- folderFilter_ );
-
- if( resource != null )
- {
- selectedPath = resource.getFullPath();
-
- int webModuleSegments = selectedPath.matchingFirstSegments(webModuleContainer.getFullPath());
-
- if ( webModuleSegments < 2 )
- {
- sampleFolderText_.setText("");
- handleFolderText();
- }
- else
- {
- sampleFolderText_.setText(selectedPath.removeFirstSegments(webModuleSegments).toString());
- handleFolderText();
- }
- }
- }
-
- private void handleTestButton()
- {
- boolean enabled = testCheckbox_.getSelection();
-
- testTypeCombo_.setEnabled( enabled );
- sampleFolderText_.setEnabled( enabled );
- methodsTree_.setEnabled( enabled );
- runTestCheckbox_.setEnabled( enabled );
- selectAllMethodsButton_.setEnabled( enabled );
- deselectAllMethodsButton_.setEnabled( enabled );
- sampleFolderBrowseButton_.setEnabled( enabled );
- }
-
- private void handleSelectAll( boolean value )
- {
- TreeItem[] items = methodsTree_.getItems();
-
- for( int i = 0; i < items.length; i++ )
- {
- items[i].setChecked(value);
- }
- }
-
- // Here are the getters and setters for this widget.
- public void setTestService( Boolean testService )
- {
- testCheckbox_.setSelection( testService.booleanValue() );
- handleTestButton();
- }
-
- public Boolean getTestService()
- {
- return new Boolean( testCheckbox_.getSelection() );
- }
-
- public void setTestFacility( SelectionList testFacilities )
- {
- testFacilities_ = testFacilities;
- testTypeCombo_.setItems( testFacilities.getList() );
- testTypeCombo_.select( testFacilities.getIndex() );
- }
-
- public SelectionList getTestFacility()
- {
- testFacilities_.setIndex( testTypeCombo_.getSelectionIndex() );
- return testFacilities_;
- }
-
- public String getTestID()
- {
- return testTypeCombo_.getText();
- }
-
- public void setSampleProject(String clientProject)
- {
- projectCombo_.setItems( new String[]{ clientProject } );
- projectCombo_.select(0);
- }
-
- public void setSampleProjectEAR(String clientProjectEAR)
- {
- earCombo_.setItems( new String[]{ clientProjectEAR } );
- earCombo_.select(0);
- }
-
- public String getFolder()
- {
- return sampleFolderText_.getText();
- }
-
- public void setFolder( String folder )
- {
- sampleFolderText_.setText( folder );
- }
-
- public boolean getIsTestWidget()
- {
- return isTestWidget;
- }
-
- public void setJspFolder( String folder )
- {
- jspFolderText_.setText( folder );
- }
-
- public void setLaunchedServiceTestName (String launchedServiceTestName)
- {
- this.launchedServiceTestName = launchedServiceTestName;
- }
-
- public boolean getRunClientTest()
- {
- return runTestCheckbox_.getSelection();
- }
-
- public void setRunClientTest( boolean value )
- {
- runTestCheckbox_.setSelection( value );
- }
-
- public BooleanSelection[] getMethods()
- {
- TreeItem[] items = methodsTree_.getItems();
- BooleanSelection[] methods = new BooleanSelection[items.length];
-
- for( int index = 0; index < items.length; index++ )
- {
- methods[index] = new BooleanSelection( items[index].getText(), items[index].getChecked() );
- }
-
- return methods;
- }
-
- public void setMethods( BooleanSelection[] methods )
- {
- methodsTree_.removeAll();
-
- for( int index = 0; index < methods.length; index++ )
- {
- if(methods[index] == null)continue;
- TreeItem item = new TreeItem( methodsTree_, SWT.NULL );
- item.setText( methods[index].getValue() );
- item.setChecked( methods[index].isSelected() );
- }
- }
-
- public void setInitialSelection( IStructuredSelection selection )
- {
- initialSelection_ = selection;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CopyWebServiceUtilsJarCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CopyWebServiceUtilsJarCommand.java
deleted file mode 100644
index 5ac392d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CopyWebServiceUtilsJarCommand.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.common.FileResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.core.context.TransientResourceContext;
-
-
-public class CopyWebServiceUtilsJarCommand extends SimpleCommand {
-
- private static java.lang.String DESCRIPTION = "Copy WebserviceUtils.jar";
- private static java.lang.String LABEL = "CopyWebserviceJarCommand";
- private String sampleProject;
- private MessageUtils msgUtils;
-
-/**
- * Default CTOR;
- */
-
-
-public CopyWebServiceUtilsJarCommand()
-{
- super(LABEL,DESCRIPTION);
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils = new MessageUtils(pluginId + ".plugin", this);
-}
-
-/**
- * Execute the command
- */
-public Status execute(Environment env)
-{
- try
- {
- env.getProgressMonitor().report( msgUtils.getMessage( "PROGRESS_INFO_COPY_WEBSERVICE_UTILS" ) );
- IProject sampleIProject = (IProject)ResourceUtils.findResource(sampleProject);
- IPath webModulePath = ResourceUtils.getWebModuleServerRoot(sampleIProject).getFullPath();
- if (webModulePath == null)
- return new SimpleStatus(WebServiceConsumptionUIPlugin.ID,msgUtils.getMessage("MSG_ERROR_PROJECT_NOT_FOUND"), Status.ERROR);
-
- Status status = copyIFile("webserviceutils.jar",webModulePath,"WEB-INF/lib/webserviceutils.jar", getPlugin("org.eclipse.jst.ws.consumption"),env);
- if(status.getSeverity() == Status.ERROR){
- StatusHandler sHandler = env.getStatusHandler();
- Status errorStatus = new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS"), Status.ERROR);
- sHandler.reportError(errorStatus);
- return status;
- }
-
-
- }
- catch (Exception e) {
- StatusHandler sHandler = env.getStatusHandler();
- Status errorStatus = new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS"), Status.ERROR);
- sHandler.reportError(errorStatus);
- return new SimpleStatus(WebServiceConsumptionUIPlugin.ID,msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS"),Status.ERROR,e);
- }
- return new SimpleStatus("");
-}
-
-/**
- *
- */
-private Status copyIFile(String source, IPath targetPath, String targetFile,Environment env)
-{
- return copyIFile(source, targetPath, targetFile, WebServicePlugin.getInstance(),env);
-}
-
-/**
- *
- */
-private Status copyIFile(String source, IPath targetPath, String targetFile, Plugin plugin,Environment env)
-{
-
- if (plugin != null)
- {
- IPath target = targetPath.append(new Path(targetFile));
-
- env.getProgressMonitor().report( msgUtils.getMessage( "PROGRESS_INFO_COPYING_FILE" ) );
- try
- {
- ResourceContext context = new TransientResourceContext();
- context.setOverwriteFilesEnabled(true);
- context.setCreateFoldersEnabled(true);
- context.setCheckoutFilesEnabled(true);
- IResource resource = FileResourceUtils.findResource(target);
- if(resource != null) return new SimpleStatus("");
- IFile file = FileResourceUtils.createFile(context,
- target,
- plugin.openStream(new Path(source)),
- env.getProgressMonitor(),
- env.getStatusHandler());
- }
- catch (Exception e) {
- return new SimpleStatus(WebServiceConsumptionUIPlugin.ID,msgUtils.getMessage("MSG_ERROR_FILECOPY_WEBSERVICE_UTILS"),Status.ERROR,e);
- }
- }
- return new SimpleStatus("");
-}
-
-/**
- *
- */
-private Plugin getPlugin(String pluginId)
-{
- try
- {
- return Platform.getPluginRegistry().getPluginDescriptor(pluginId).getPlugin();
- }
- catch (CoreException ce)
- {
- return null;
- }
-}
-
-public void setSampleProject(String sampleProject)
-{
- this.sampleProject = sampleProject;
-}
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CreateSampleProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CreateSampleProjectCommand.java
deleted file mode 100644
index 4ef2212..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/CreateSampleProjectCommand.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jst.ws.internal.consumption.command.common.CreateWebProjectCommand;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-
-public class CreateSampleProjectCommand extends SimpleCommand
-{
- private String sampleProject;
- private String sampleProjectEar;
- private IServer existingServer;
- private String serverFactoryId;
- private boolean needEAR;
- private String j2eeVersion;
-
-
- public CreateSampleProjectCommand()
- {
- super("org.eclipse.jst.ws.internal.consumption.ui.wizard.client.common.CreateSampleProjectCommand","org.eclipse.jst.ws.internal.consumption.ui.wizard.client.common.CreateSampleProjectCommand");
- }
-
- public Status execute(Environment env)
- {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- if (!root.getProject(sampleProject).exists() || !root.getProject(sampleProjectEar).exists())
- {
- CreateWebProjectCommand c = new CreateWebProjectCommand();
- c.setProjectName(sampleProject);
- c.setEarProjectName(sampleProjectEar);
- c.setExistingServer(existingServer);
- c.setServerFactoryId(serverFactoryId);
- c.setNeedEAR(needEAR);
- c.setJ2EEVersion(j2eeVersion);
- return c.execute(env);
- }
- return new SimpleStatus("");
- }
-
- public void setSampleProject(String sampleProject)
- {
- this.sampleProject = sampleProject;
- }
-
- public void setSampleProjectEAR(String sampleProjectEar)
- {
- this.sampleProjectEar = sampleProjectEar;
- }
-
- public void setExistingServer(IServer existingServer) {
-
- this.existingServer = existingServer;
- }
-
- public void setServerFactoryId(String serverFactoryId)
- {
- this.serverFactoryId = serverFactoryId;
- }
-
- /**
- * @param needEAR The needEAR to set.
- */
- public void setNeedEAR(boolean needEAR)
- {
- this.needEAR = needEAR;
- }
-
- /**
- * @param version The j2eeVersion to set.
- */
- public void setJ2eeVersion(String version)
- {
- j2eeVersion = version;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishDefaultCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishDefaultCommand.java
deleted file mode 100644
index aaaed6c..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishDefaultCommand.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-
-
-/*
-* The JSPGeneration task runs the jsp generation engine found in the
-* JBWizard Plugin
-*
-*
-*/
-public class FinishDefaultCommand extends SimpleCommand
-{
- private String LABEL = "JSPGenerationTask";
- private String DESCRIPTION = "Run the JSP Generation";
-
- private String sampleServerTypeID;
- private IServer sampleExistingServer;
- private String existingServerId_;
- private TypeRuntimeServer clientIds;
-
-
- public FinishDefaultCommand ()
- {
- setDescription(DESCRIPTION);
- setName(LABEL);
- }
-
- public Status execute(Environment env)
- {
- Status status = new SimpleStatus( "" );
- if(clientIds != null){
- if (clientIds.getServerInstanceId() != null)
- sampleExistingServer = ServerCore.findServer(clientIds.getServerInstanceId());
- if (sampleExistingServer==null && existingServerId_!=null && existingServerId_.length()>0)
- {
- //Use the existingServerId
- sampleExistingServer = ServerCore.findServer(existingServerId_);
- }
- if (sampleExistingServer != null)
- sampleServerTypeID = sampleExistingServer.getServerType().getId();
- else
- sampleServerTypeID = clientIds.getServerId();
- }
- return status;
-
- }
-
- public void setClientTypeRuntimeServer(TypeRuntimeServer ids)
- {
- clientIds = ids;
- }
-
- public String getSampleServerTypeID()
- {
- return sampleServerTypeID;
- }
-
- public IServer getSampleExistingServer()
- {
- return sampleExistingServer;
- }
-
- public void setExistingServerId(String existingServerId)
- {
- existingServerId_ = existingServerId;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishJavaTestFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishJavaTestFragment.java
deleted file mode 100644
index 4a8d3f7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishJavaTestFragment.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-
-
-/**
- * @author gilberta
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class FinishJavaTestFragment extends BooleanFragment
-{
- private boolean generateProxy;
-
- public FinishJavaTestFragment()
- {
- SequenceFragment javaTestRoot = new SequenceFragment();
- Condition condition = new Condition()
- {
- public boolean evaluate()
- {
- return generateProxy;
- }
- };
- setCondition(condition);
- javaTestRoot.add(new SimpleFragment(new TestClientDepartureInitCommand(), ""));
- javaTestRoot.add(new SimpleFragment(new AddModuleDependenciesCommand(), ""));
- javaTestRoot.add(new SimpleFragment(new BuildProjectCommand(), ""));
- setTrueFragment(javaTestRoot);
- }
-
- public void setGenerateProxy(boolean generateProxy)
- {
- this.generateProxy = generateProxy;
- }
-
- public void setIsJSPGen(boolean jspGen)
- {
-
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishTestFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishTestFragment.java
deleted file mode 100644
index 9dfd0aa..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishTestFragment.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import org.eclipse.jst.ws.internal.context.ScenarioContext;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestExtension;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-
-
-/**
- * @author gilberta
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class FinishTestFragment extends BooleanFragment{
-
- private boolean isTestWidget;
- private boolean launchedTest;
- private boolean generateProxy;
- private String launchedServiceTestName;
- private boolean testService;
- private String testID;
- public FinishTestFragment()
- {
- Condition condition = new Condition()
- {
- public boolean evaluate()
- {
- if(!testService) return false;
- if(launchedServiceTestName == null) return true;
- if(launchedServiceTestName != null)
- if((!launchedServiceTestName.equals("") && (!isPreferedAWSDLTest() || (isTestWidget && isClientTestJava())) && generateProxy) || launchedServiceTestName.equals("")) return true;
-
- return false;
- }
- };
-
- setTrueFragment(new WebServiceTestClientDepartureFragment());
- setCondition(condition);
- }
-
- public void setLaunchedServiceTestName(String launchedServiceTestName)
- {
- this.launchedServiceTestName = launchedServiceTestName;
- }
-
- public boolean isPreferedAWSDLTest()
- {
- ScenarioContext scenarioContext = WebServicePlugin.getInstance().getScenarioContext().copy();
- String[] testTypes = scenarioContext.getWebServiceTestTypes();
- WebServiceTestRegistry wsttRegistry = WebServiceTestRegistry.getInstance();
- WebServiceTestExtension wscte = (WebServiceTestExtension)wsttRegistry.getWebServiceExtensionsByName(testTypes[0]);
- if(!wscte.isJava())
- return true;
- return false;
- }
-
- public boolean isClientTestJava()
- {
- if(testID == null) return false;
- WebServiceTestRegistry wsttRegistry = WebServiceTestRegistry.getInstance();
- WebServiceTestExtension wscte = (WebServiceTestExtension)wsttRegistry.getWebServiceExtensionsByName(testID);
- if(wscte.isJava())
- return true;
- return false;
- }
-
-
- public void setTestService(boolean testService)
- {
- this.testService = testService;
- }
-
- public void setGenerateProxy(boolean generateProxy)
- {
- this.generateProxy = generateProxy;
- }
-
- public void setTestID(String testID)
- {
- this.testID = testID;
- }
-
- public void setIsTestWidget(boolean isTestWidget)
- {
- this.isTestWidget = isTestWidget;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/TestClientDepartureInitCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/TestClientDepartureInitCommand.java
deleted file mode 100644
index b75ee1f..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/TestClientDepartureInitCommand.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Mar 25, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import org.eclipse.wst.command.env.core.SimpleCommand;
-
-/**
- * @author gilberta
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-public class TestClientDepartureInitCommand extends SimpleCommand
-{
-
- private boolean forceBuild;
-
- public TestClientDepartureInitCommand()
- {
- forceBuild = true;
- }
-
- public boolean getForceBuild()
- {
- return forceBuild;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/TestDefaultingFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/TestDefaultingFragment.java
deleted file mode 100644
index 4d7095a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/TestDefaultingFragment.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import org.eclipse.jst.ws.internal.context.ScenarioContext;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.SelectionList;
-
-
-/**
- * @author gilberta
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class TestDefaultingFragment extends SimpleCommand
-{
-
- private WebServiceTestRegistry testRegistry;
- private SelectionList testFacilities;
- private String launchedServiceTestName;
- private ScenarioContext scenarioContext;
-
-
- public Status execute(Environment env)
- {
- SimpleStatus status = new SimpleStatus("");
-
- scenarioContext = WebServicePlugin.getInstance().getScenarioContext().copy();
- // test facilities
- selectTestFacility();
- return status;
- }
-
- // The test facilities retrieved from the extension
- // plus the default
- public SelectionList getTestFacility()
- {
- return testFacilities;
- }
-
-
-
- // ***********************
- // This method uses the preference to
- // select the correct test facility
- //
- //***********************
- private void selectTestFacility()
- {
- //if we find something we launched earlier
- //put it on the bottom
- String[] testTypes = scenarioContext.getWebServiceTestTypes();
- String[] newTestTypes = new String[testTypes.length];
- boolean launched = false;
- int j = 0;
- for(int i = 0;i<testTypes.length;i++){
- if(testTypes[i].equals(launchedServiceTestName))
- launched = true;
- else{
- newTestTypes[j] = testTypes[i];
- j++;
- }
- }
-
- if(launched)
- newTestTypes[testTypes.length - 1] = launchedServiceTestName;
-
- testFacilities = new SelectionList(newTestTypes,0);
- }
-
- public void setLaunchedServiceTestName(String launchedServiceTestName)
- {
- this.launchedServiceTestName = launchedServiceTestName;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WSDLFinishFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WSDLFinishFragment.java
deleted file mode 100644
index 170dd17..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WSDLFinishFragment.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-
-/**
- * @author gilberta
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class WSDLFinishFragment extends BooleanFragment{
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WSDLTestLaunchCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WSDLTestLaunchCommand.java
deleted file mode 100644
index fbcb106..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WSDLTestLaunchCommand.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 4, 2004
- *
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import java.util.List;
-
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.ext.WebServiceExecutable;
-import org.eclipse.jst.ws.internal.ext.test.WSDLTestFinishCommand;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestExtension;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-
-/**
- * @author gilberta
- *
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class WSDLTestLaunchCommand extends SimpleCommand
-{
- private String testID;
- private String launchedServiceTestName;
- private TypeRuntimeServer serviceids;
- private String serverProject;
- private String wsdlURI;
- private MessageUtils msgUtils;
- private boolean externalBrowser;
- private List endpoints;
-
- public WSDLTestLaunchCommand()
- {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- msgUtils = new MessageUtils(pluginId + ".plugin", this);
- }
-
- public Status execute(Environment env)
- {
- Status status = new SimpleStatus("");
- IServer serviceExistingServer = null;
- String serviceServerTypeID = null;
- WebServiceTestRegistry testRegistry = WebServiceTestRegistry.getInstance();
- WebServiceTestExtension wscte = (WebServiceTestExtension)testRegistry.getWebServiceExtensionsByName(testID);
- WebServiceExecutable wse = wscte.getWebServiceExecutableExtension();
- WSDLTestFinishCommand command = (WSDLTestFinishCommand)wse.getFinishCommand();
- launchedServiceTestName = wscte.getName();
-
- //get the server stuff
- if (serviceids.getServerInstanceId() != null)
- serviceExistingServer = ServerCore.findServer(serviceids.getServerInstanceId());
- if (serviceExistingServer != null)
- serviceServerTypeID = serviceExistingServer.getServerType().getId();
- else
- serviceServerTypeID = serviceids.getServerId();
- // server will be created in ServerDeployableConfigurationCommand
-
- command.setServerTypeID(serviceServerTypeID);
- command.setServiceProject(serverProject);
- command.setWsdlServiceURL(wsdlURI);
- command.setExternalBrowser(externalBrowser);
- command.setEndpoint(endpoints);
- status = command.execute(env);
-
- //Dont need to shut everything down because the wsdl test doesnt work
- if(status.getSeverity() != Status.OK){
- StatusHandler sHandler = env.getStatusHandler();
- Status infoStatus = new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_UNABLE_TO_LAUNCH_WSDL_TEST"), Status.INFO);
- sHandler.reportInfo(infoStatus);
- return infoStatus;
- }
- return status;
-
- }
-
- public void setTestID(String testID)
- {
- this.testID = testID;
- }
-
- public String getLaunchedServiceTestName()
- {
- return launchedServiceTestName;
- }
- public void setWsdlURI(String wsdlURI)
- {
- this.wsdlURI = wsdlURI;
- }
-
- public void setServerProject(String serverProject)
- {
- this.serverProject = serverProject;
- }
-
- public void setServiceTypeRuntimeServer(TypeRuntimeServer serviceids)
- {
- this.serviceids = serviceids;
- }
-
- public void setExternalBrowser(boolean externalBrowser)
- {
- this.externalBrowser = externalBrowser;
- }
-
- public void setEndpoint(List endpoints)
- {
- this.endpoints = endpoints;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WebServiceClientTestArrivalCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WebServiceClientTestArrivalCommand.java
deleted file mode 100644
index 6b74075..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WebServiceClientTestArrivalCommand.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.consumption.command.common.JavaMofReflectionCommand;
-import org.eclipse.jst.ws.internal.context.ScenarioContext;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-import org.eclipse.wst.command.env.core.selection.BooleanSelection;
-import org.eclipse.wst.command.env.core.selection.SelectionList;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-import org.eclipse.wst.server.core.IServer;
-
-
-/**
-* This task sets up all the defaults for the webservice test
-* client page
-*
-*/
-public class WebServiceClientTestArrivalCommand extends SimpleCommand
-{
- public static final String DEFAULT_WEB_MODULE_ROOT = "WebContent";
- public static final String DEFAULT_SAMPLE_WEB_PROJECT_EXT = "Sample";
- public static final String DEFAULT_SAMPLE_EAR_PROJECT_EXT = "EAR";
-
- private String LABEL = "WebServiceClientTestArrivalTask";
- private String DESCRIPTION = "default actions";
- private MessageUtils msgUtils;
- public static String SAMPLE_DIR = "sample";
- public String SET_ENDPOINT = "setEndPoint(java.net.URL)";
- public String GET_ENDPOINT = "getEndPoint()";
-
- private String PROXY = "Proxy";
-
- private ScenarioContext scenarioContext;
-
-
- private String clientProject;
- private IProject clientIProject;
- private String clientProjectEAR;
- private String sampleServerTypeID;
- private IServer sampleExistingServer;
- private WebServiceTestRegistry testRegistry;
- private SelectionList testFacilities;
- private String folder;
- private String jspFolder;
- private BooleanSelection[] methods;
- private String proxyBean;
- private SelectionListChoices runtime2ClientTypes;
- private String sampleProject;
- private String sampleEAR;
- private TypeRuntimeServer clientIds;
- private String j2eeVersion;
-
- private String launchedServiceTestName;
- private boolean runClientTest=true;
-
- /**
- * Constructs a new WebServiceClientTestArrivalTask object with the given label and description.
- */
- public WebServiceClientTestArrivalCommand ()
- {
- setDescription(DESCRIPTION);
- setName(LABEL);
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- msgUtils = new MessageUtils(pluginId + ".plugin", this);
-
- scenarioContext = WebServicePlugin.getInstance().getScenarioContext().copy();
- testRegistry = WebServiceTestRegistry.getInstance();
- }
-
- public Status execute(Environment env)
- {
- Status status = new SimpleStatus( "" );
- sampleProjectAndEarSetup();
-
- //Get the sample Folder ready
- StringBuffer sb = new StringBuffer();
- sb.append("/").append(sampleProject).append("/").append(DEFAULT_WEB_MODULE_ROOT).append("/");
- folder = SAMPLE_DIR + getBean();
-
- sb.append(folder);
- jspFolder = sb.toString();
-
- //get the method names ready
- //find the full path of the file in the project
- /*
- * Getting the method names using javamof introspection
- */
- if(proxyBean == null){
- StatusHandler sHandler = env.getStatusHandler();
- Status errorStatus = new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_JTS_PROXY_NOT_COMPILED"), Status.ERROR);
- sHandler.reportError(errorStatus);
- return errorStatus;
-
- }
-
-
- JavaMofReflectionCommand javamofcommand = new JavaMofReflectionCommand();
- javamofcommand.setProxyBean(proxyBean);
- javamofcommand.setClientProject(clientProject);
-
-
-
- try{
- Status mofStatus = javamofcommand.execute(env);
- if(mofStatus.getSeverity() == Status.ERROR)
- return mofStatus;
- }catch(Exception exc){
- StatusHandler sHandler = env.getStatusHandler();
- Status errorStatus = new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_JTS_PROXY_NOT_COMPILED"), Status.ERROR);
- sHandler.reportError(errorStatus);
- return errorStatus;
- }
- JavaHelpers javaHelpers = javamofcommand.getJavaClass();
- if (javaHelpers == null) return status;
-
- JavaClass javaClass = null;
- if(javaHelpers instanceof JavaClass)
- javaClass = (JavaClass)javaHelpers;
- else return status;
- List methodList = javaClass.getPublicMethods();
- BooleanSelection[] tempMethods = new BooleanSelection[methodList.size()];
- ListIterator listIterator = methodList.listIterator();
-
- int j = 0;
- while (listIterator.hasNext())
- {
- Method method = (Method)listIterator.next();
- if(method.isConstructor()) continue;
- String signature = method.getMethodElementSignature();
-
- tempMethods[j] = new BooleanSelection( method.getMethodElementSignature(), true);
- j++;
- }
- methods = tempMethods;
- return status;
- }
-
- /**
- * Helper method which sets up project stuff
- *
- */
- private String getClientProjectFolder()
- {
-
- //First the inital part of the path is project related
- String javaSourceLocation = "";
- if (clientProject != null) {
- IPath javaSourcePath = ResourceUtils.getJavaSourceLocation((IProject)clientIProject);
- if (javaSourcePath != null)
- javaSourceLocation = javaSourcePath.toString();
- else {
- javaSourceLocation = "/"+clientIProject.getName() + "/Java Source"; // to be updated by Web Tooling API
- }
- }
- return javaSourceLocation;
-
- }
- public static String WEBID = "org.eclipse.jst.ws.consumption.ui.clientProjectType.Web";
- public static String EJBID = "org.eclipse.jst.ws.consumption.ui.clientProjectType.EJB";
- public static String APPCLIENT = "org.eclipse.jst.ws.consumption.ui.clientProjectType.AppClient";
-
-
- private void sampleProjectAndEarSetup()
- {
- clientIProject = (IProject)ResourceUtils.findResource(clientProject);
- //move to the web level
- SelectionListChoices slc = runtime2ClientTypes.getChoice();
- String projectType = slc.getList().getSelection();
- if(projectType.equals(WEBID)){
- sampleProject = slc.getChoice().getList().getSelection();
- }
- else{
- sampleProject = (new StringBuffer(clientIProject.getName())).append(DEFAULT_SAMPLE_WEB_PROJECT_EXT).toString();
- }
- sampleEAR = slc.getChoice().getChoice().getList().getSelection();
- if (sampleEAR == null || sampleEAR.length()==0)
- {
- //Create a default name if an EAR is needed.
- //Use the server type
- String targetId = ServerUtils.getRuntimeTargetIdFromFactoryId(clientIds.getServerId());
- if (targetId!=null && targetId.length()>0)
- {
- if (ServerUtils.isTargetValidForEAR(targetId,j2eeVersion))
- {
- sampleEAR = (new StringBuffer(sampleProject)).append(DEFAULT_SAMPLE_EAR_PROJECT_EXT).toString();
- }
- }
- }
- }
-
- //getters and setters
-
- private String getBean()
- {
- int index = proxyBean.lastIndexOf(".");
- String end = "";
- if(index != -1){
- end = proxyBean.substring(index + 1);
- }
- String bean = end.substring(0,end.length());
-
- return bean;
- }
-
-
- public boolean getRunClientTest()
- {
- return runClientTest;
- }
-
- public String getFolder()
- {
- return folder;
- }
-
- public String getJspFolder()
- {
- return jspFolder;
- }
-
- public BooleanSelection[] getMethods()
- {
- return methods;
- }
-
- public String getSampleProjectEAR()
- {
- return sampleEAR;
- }
-
- public String getSampleProject()
- {
- return sampleProject;
- }
-
- public void setClientProject(String clientProject)
- {
- this.clientProject = clientProject;
- }
-
- public void setProxyBean(String proxyBean)
- {
- this.proxyBean = proxyBean;
- }
-
- public String getProxyBean()
- {
- return proxyBean;
- }
-
- public void setClientProjectEAR(String clientProjectEAR)
- {
- this.clientProjectEAR = clientProjectEAR;
- }
-
- public void setRuntime2ClientTypes( SelectionListChoices selectionList )
- {
- runtime2ClientTypes = selectionList;
- }
-
- public void setLaunchedServiceTestName(String launchedServiceTestName)
- {
- this.launchedServiceTestName = launchedServiceTestName;
- }
- /**
- * @param clientIds The clientIds to set.
- */
- public void setClientIds(TypeRuntimeServer clientIds)
- {
- this.clientIds = clientIds;
- }
-
- /**
- * @param version The j2eeVersion to set.
- */
- public void setJ2eeVersion(String version)
- {
- j2eeVersion = version;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WebServiceTestClientDepartureFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WebServiceTestClientDepartureFragment.java
deleted file mode 100644
index 795e7b4..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/WebServiceTestClientDepartureFragment.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Mar 25, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
-
-import org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-
-
-/**
- * @author gilberta
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-public class WebServiceTestClientDepartureFragment extends SequenceFragment
-{
- public WebServiceTestClientDepartureFragment()
- {
- add(new SimpleFragment(new FinishDefaultCommand(),""));
- add(new FinishJavaTestFragment());
- add(new SimpleFragment(new ClientTestDelegateCommand(),""));
- }
-
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- dataRegistry.addMapping(TestClientDepartureInitCommand.class, "ForceBuild",BuildProjectCommand.class);
- dataRegistry.addMapping(FinishDefaultCommand.class, "SampleServerTypeID",AddModuleDependenciesCommand.class);
- dataRegistry.addMapping(FinishDefaultCommand.class, "SampleExistingServer",AddModuleDependenciesCommand.class);
- dataRegistry.addMapping(FinishDefaultCommand.class, "SampleServerTypeID",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(FinishDefaultCommand.class, "SampleExistingServer",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(AddModuleDependenciesCommand.class, "sampleProject",BuildProjectCommand.class);
-
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/ExplorerServiceTestCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/ExplorerServiceTestCommand.java
deleted file mode 100644
index 1ab20a2..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/ExplorerServiceTestCommand.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test.explorer;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.command.common.StartProjectCommand;
-import org.eclipse.jst.ws.internal.ext.test.WSDLTestFinishCommand;
-import org.eclipse.jst.ws.internal.ui.wse.LaunchOption;
-import org.eclipse.jst.ws.internal.ui.wse.LaunchWebServicesExplorerCommand;
-import org.eclipse.jst.ws.internal.ui.wse.WSExplorerType;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-
-public class ExplorerServiceTestCommand extends SimpleCommand implements WSDLTestFinishCommand
-{
-
- private String LABEL = "ExplorerServiceTestCommand";
- private String DESCRIPTION = "Launch the Explorer";
- private boolean externalBrowser = true;
- private String wsdlServiceURL;
- private String serviceServerTypeID;
- private IServer serviceExistingServer;
- private String serviceProject;
- private List endpoints;
-
- /**
- * Constructs a new WebServiceExplorerLaunch object with the given label and description.
- */
- public ExplorerServiceTestCommand ()
- {
- setDescription(DESCRIPTION);
- setName(LABEL);
- }
-
- public Status execute(Environment env)
- {
- Status status = new SimpleStatus( "" );
-
- StartProjectCommand spc = new StartProjectCommand( true );
- spc.setServiceServerTypeID(serviceServerTypeID);
- spc.setServiceExistingServer(serviceExistingServer);
- IProject project = (IProject) ResourceUtils.findResource(serviceProject);
- spc.setServiceProject(project);
- spc.setIsWebProjectStartupRequested(true);
-
- status = spc.execute(env);
- if (status.getSeverity() == Status.ERROR)
- return status;
-
- LaunchWebServicesExplorerCommand launchCommand = new LaunchWebServicesExplorerCommand();
- launchCommand.setForceLaunchOutsideIDE(externalBrowser);
- Vector launchOptionVector = new Vector();
- launchOptionVector.add(new LaunchOption(WSExplorerType.WSDL_URL,wsdlServiceURL));
- if (endpoints != null)
- for (Iterator it = endpoints.iterator(); it.hasNext();)
- launchOptionVector.add(new LaunchOption(WSExplorerType.WEB_SERVICE_ENDPOINT, it.next().toString()));
- launchCommand.setLaunchOptions((LaunchOption[])launchOptionVector.toArray(new LaunchOption[0]));
- status = launchCommand.execute(env);
- return status;
- }
-
- public void setExternalBrowser(boolean externalBrowser)
- {
- this.externalBrowser = externalBrowser;
- }
-
- public void setWsdlServiceURL(String wsdlServiceURL)
- {
- this.wsdlServiceURL = wsdlServiceURL;
- }
-
- public void setServerTypeID(String serviceServerTypeID)
- {
- this.serviceServerTypeID = serviceServerTypeID;
- }
-
- public void setExistingServer(IServer serviceExistingServer)
- {
- this.serviceExistingServer = serviceExistingServer;
- }
-
- public void setServiceProject(String serviceProject)
- {
- this.serviceProject = serviceProject;
- }
-
- public void setEndpoint(List endpoints)
- {
- this.endpoints = endpoints;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/WebServiceExplorerExecutable.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/WebServiceExplorerExecutable.java
deleted file mode 100644
index 22b35f6..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/explorer/WebServiceExplorerExecutable.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test.explorer;
-
-import org.eclipse.jst.ws.internal.ext.WebServiceExecutable;
-import org.eclipse.jst.ws.internal.ext.WebServiceFinishCommand;
-
-/**
-* This is the interface for objects that represent a kind of
-* Web Service-Server-Runtime artifact. The primary purpose of a WebServiceServerRuntimeType
-* object is to manufacture the wizard pages that support the type, server, and runtime configuration.
-*/
-public class WebServiceExplorerExecutable implements WebServiceExecutable
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public WebServiceFinishCommand getFinishCommand()
- {
- return new ExplorerServiceTestCommand();
- }
-
-}
-
-
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/WSSampleFinishCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/WSSampleFinishCommand.java
deleted file mode 100644
index fd39ae7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/WSSampleFinishCommand.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test.wssample;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.command.common.PublishProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.StartProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.InputFileGenerator;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.MethodFileGenerator;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.ResultFileGenerator;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.TestClientFileGenerator;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.command.GeneratePageCommand;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.command.JavaToModelCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.CopyWebServiceUtilsJarCommand;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-import org.eclipse.jst.ws.internal.ext.test.JavaProxyTestCommand;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusException;
-import org.eclipse.wst.command.env.core.selection.BooleanSelection;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.internet.webbrowser.WebBrowser;
-
-public class WSSampleFinishCommand extends SimpleCommand implements JavaProxyTestCommand
-{
-
- public static String INPUT = "Input.jsp";
- public static String TEST_CLIENT = "TestClient.jsp";
- public static String RESULT = "Result.jsp";
- public static String METHOD = "Method.jsp";
-
- private static String LABEL = "JavaBeanToSampleActiveTask";
- private static String DESCRIPTION = "default actions";
- private MessageUtils msgUtils;
-
- private Model proxyModel;
- private String sampleServerTypeID;
- private IServer sampleExistingServer;
-
-
- private String clientProject;
- private String qname;
- private String jspFolder;
- private boolean runClientTest;
- private String sampleProject;
- private BooleanSelection[] methods;
- private String proxyBean;
- private String setEndpointMethod;
- private List endpoints;
-
- /**
- * Constructs a new JavaBeanToSampleActiveTask object with the given label and description.
- */
- public WSSampleFinishCommand ()
- {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- msgUtils = new MessageUtils(pluginId + ".plugin", this);
- setDescription(DESCRIPTION);
- setName(LABEL);
- }
-
- public Status execute(Environment env)
- {
- Status status = new SimpleStatus( "" );
- //setters and getters to be removed
- CopyWebServiceUtilsJarCommand copy = new CopyWebServiceUtilsJarCommand();
- copy.setSampleProject(sampleProject);
- status = copy.execute(env);
- if (status.getSeverity() == Status.ERROR) return status;
- status = createModel(env);
- if (status.getSeverity() == Status.ERROR) return status;
- status = generatePages(env);
- if (status.getSeverity() == Status.ERROR) return status;
- //if (!isSuccessful()) return;
- status = launchSample(env);
- return status;
- }
-
-
- /**
- * Generate the four jsps that make up this
- * sample app.
- */
- protected Status generatePages(Environment env)
- {
- Status status = new SimpleStatus( "" );
- IPath fDestinationFolderPath = new Path(jspFolder);
- fDestinationFolderPath = fDestinationFolderPath.makeAbsolute();
- IWorkspaceRoot fWorkspace = ResourcesPlugin.getWorkspace().getRoot();
-
- IPath pathTest = fDestinationFolderPath.append(TEST_CLIENT);
- IFile fileTest = fWorkspace.getFile(pathTest);
- GeneratePageCommand gpcTest = new GeneratePageCommand(EnvironmentUtils.getResourceContext(env), proxyModel,
- new TestClientFileGenerator(INPUT,METHOD,RESULT),fileTest);
- //gpcTest.setStatusMonitor(getStatusMonitor());
- status = gpcTest.execute(env);
- if (status.getSeverity() == Status.ERROR )
- return status;
-
-
- //input codegen
- IPath pathInput = fDestinationFolderPath.append(INPUT);
- IFile fileInput = fWorkspace.getFile(pathInput);
- InputFileGenerator inputGenerator = new InputFileGenerator(RESULT);
- GeneratePageCommand gpcInput = new GeneratePageCommand(EnvironmentUtils.getResourceContext(env), proxyModel,
- inputGenerator,fileInput);
- //gpcInput.setStatusMonitor(getStatusMonitor());
- status = gpcInput.execute(env);
- if (status.getSeverity() == Status.ERROR )
- return status;
-
- //method codegen
- IPath pathMethod = fDestinationFolderPath.append(METHOD);
- IFile fileMethod = fWorkspace.getFile(pathMethod);
- MethodFileGenerator methodGenerator = new MethodFileGenerator(INPUT);
- methodGenerator.setClientFolderPath(jspFolder);
- GeneratePageCommand gpcMethod = new GeneratePageCommand(EnvironmentUtils.getResourceContext(env), proxyModel,
- methodGenerator,fileMethod);
- //gpcMethod.setStatusMonitor(getStatusMonitor());
- status = gpcMethod.execute(env);
- if (status.getSeverity() == Status.ERROR )
- return status;
-
-
- //result codegen
- IPath pathResult = fDestinationFolderPath.append(RESULT);
- IFile fileResult = fWorkspace.getFile(pathResult);
- ResultFileGenerator rfg = new ResultFileGenerator();
- rfg.setClientFolderPath(jspFolder);
- rfg.setSetEndpointMethod(setEndpointMethod);
- GeneratePageCommand gpcResult = new GeneratePageCommand(EnvironmentUtils.getResourceContext(env), proxyModel,
- rfg,fileResult);
- //gpcResult.setStatusMonitor(getStatusMonitor());
- status = gpcResult.execute(env);
-
- return status;
- }
-
-
- protected Status launchSample (Environment env) {
-
- Status status = new SimpleStatus( "" );
- if (!runClientTest) return status;
-
-
- IPath fDestinationFolderPath = new Path(jspFolder);
- fDestinationFolderPath = fDestinationFolderPath.makeAbsolute();
-
- PublishProjectCommand ppc = new PublishProjectCommand();
- ppc.setServerTypeID(sampleServerTypeID);
- ppc.setExistingServer(sampleExistingServer);
- ppc.setProject(sampleProject);
- status = ppc.execute(env);
-
- StartProjectCommand spc = new StartProjectCommand(false );
- spc.setServiceServerTypeID(sampleServerTypeID);
- spc.setSampleExistingServer(sampleExistingServer);
- IProject project = (IProject) ResourceUtils.findResource(sampleProject);
- spc.setSampleProject(project);
- spc.setIsWebProjectStartupRequested(true);
-
- status = spc.execute(env);
- if (status.getSeverity() == Status.ERROR) return status;
-
- IPath newPath = new Path(ResourceUtils.getWebProjectURL(ResourceUtils.getProjectOf(fDestinationFolderPath),sampleServerTypeID,sampleExistingServer));
- newPath = newPath.append(fDestinationFolderPath.removeFirstSegments(2).makeAbsolute());
- StringBuffer urlString = new StringBuffer(newPath.append(TEST_CLIENT).toString());
- if (endpoints != null && !endpoints.isEmpty())
- {
- urlString.append("?endpoint=");
- urlString.append(endpoints.get(0).toString());
- }
-
- try{
- URL url;
- url = new URL(urlString.toString());
- int style = WebBrowser.LOCATION_BAR | WebBrowser.BUTTON_BAR;
-
- for( int retries = 0; retries < 10; retries++ )
- {
- try
- {
- // Test the URLs
- (new URL(newPath.append(RESULT).toString())).openStream();
- (new URL(newPath.append(METHOD).toString())).openStream();
- (new URL(newPath.append(INPUT).toString())).openStream();
- (new URL(newPath.append(TEST_CLIENT).toString())).openStream();
- // Looks good, exit loop
- break;
- }
- catch( IOException ioe )
- {
- try
- {
- Thread.sleep(1000);
- }
- catch (InterruptedException ie) {}
- }
- }
-
- WebBrowser.openURL(url,style,null);
- return status;
- }catch(MalformedURLException exc){
- env.getLog().log(Log.WARNING, 5048, this, "launchSample", exc);
- status = new SimpleStatus( "launchSample", msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), Status.WARNING );
- try {
- env.getStatusHandler().report(status);
- } catch (StatusException e) {
- status = new SimpleStatus( "launchSample", msgUtils.getMessage("MSG_ERROR_MALFORMED_URL"), Status.ERROR );
- }
- return status;
- }
- }
-
-
-
- protected Status createModel(Environment env) {
-
- //create the model from the resource
- JavaToModelCommand jtmc = new JavaToModelCommand();
- jtmc.setMethods(methods);
- jtmc.setClientProject(clientProject);
- jtmc.setProxyBean(proxyBean);
- //jtmc.setStatusMonitor(getStatusMonitor());
- Status status = jtmc.execute(env);
- if (status.getSeverity() == Status.ERROR) return status;
-
- proxyModel = jtmc.getDataModel();
- return status;
- }
-
- public void setServerTypeID(String sampleServerTypeID)
- {
- this.sampleServerTypeID = sampleServerTypeID;
- }
-
- public void setExistingServer(IServer sampleExistingServer)
- {
- this.sampleExistingServer = sampleExistingServer;
- }
-
- public void setJspFolder(String jspFolder)
- {
- this.jspFolder = jspFolder;
- }
-
- public void setRunClientTest(boolean runClientTest)
- {
- this.runClientTest = runClientTest;
- }
-
- public void setSampleProject(String sampleProject)
- {
- this.sampleProject = sampleProject;
- }
-
- public void setClientProject(String clientProject)
- {
- this.clientProject = clientProject;
- }
-
- public void setMethods(BooleanSelection[] methods)
- {
- this.methods = methods;
- }
-
- public void setProxyBean(String proxyBean)
- {
- this.proxyBean = proxyBean;
- }
-
- /**
- * @param setEndpointMethod The setEndpointMethod to set.
- */
- public void setSetEndpointMethod(String setEndpointMethod)
- {
- this.setEndpointMethod = setEndpointMethod;
- }
-
- public void setEndpoint(List endpoints)
- {
- this.endpoints = endpoints;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/WebServiceWSSampleExecutable.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/WebServiceWSSampleExecutable.java
deleted file mode 100644
index bec3401..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/WebServiceWSSampleExecutable.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.widgets.test.wssample;
-
-import org.eclipse.jst.ws.internal.ext.WebServiceExecutable;
-import org.eclipse.jst.ws.internal.ext.WebServiceFinishCommand;
-
-/**
-* This is the interface for objects that represent a kind of
-* Web Service-Server-Runtime artifact. The primary purpose of a WebServiceServerRuntimeType
-* object is to manufacture the wizard pages that support the type, server, and runtime configuration.
-*/
-public class WebServiceWSSampleExecutable implements WebServiceExecutable
-{
-
-
- public WebServiceFinishCommand getFinishCommand()
- {
- return new WSSampleFinishCommand();
- }
-
-}
-
-
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/ClientProjectTypeRegistry.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/ClientProjectTypeRegistry.java
deleted file mode 100644
index 2e444c9..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/ClientProjectTypeRegistry.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-
-public class ClientProjectTypeRegistry
-{
- private static ClientProjectTypeRegistry instance_;
- private IConfigurationElement[] configElements_;
-
- private ClientProjectTypeRegistry()
- {
- init();
- }
-
- /**
- * Returns a singleton instance of this class.
- * @return A singleton ClientProjectTypeRegistry object.
- */
- public static ClientProjectTypeRegistry getInstance()
- {
- if (instance_ == null)
- instance_ = new ClientProjectTypeRegistry();
- return instance_;
- }
-
- public void init()
- {
- IPluginRegistry reg = Platform.getPluginRegistry();
- configElements_ = reg.getConfigurationElementsFor("org.eclipse.jst.ws.consumption.ui", "clientProjectType");
- }
-
- public IConfigurationElement getDefaultElement()
- {
- return getElementById("org.eclipse.jst.ws.consumption.ui.clientProjectType.Web");
- }
-
- public IConfigurationElement getElementById(String id)
- {
- return getElementByAttribute("id", id);
- }
-
- public IConfigurationElement getElementByLabel(String label)
- {
- return getElementByAttribute("label", label);
- }
-
- public IConfigurationElement getElementByProject(IProject project)
- {
- for (int i = 0; i < configElements_.length; i++)
- if (include(project, configElements_[i].getAttribute("include")) && exclude(project, configElements_[i].getAttribute("exclude")))
- return configElements_[i];
- return null;
- }
-
- private IConfigurationElement getElementByAttribute(String name, String value)
- {
- for (int i = 0; i < configElements_.length; i++)
- if (configElements_[i].getAttribute(name).equals(value))
- return configElements_[i];
- return null;
- }
-
- public IProject[] getProjects(String id)
- {
- Vector v = new Vector();
- IConfigurationElement element = getElementById(id);
- if (element != null)
- {
- IProject[] workspaceProjs = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int i = 0; i < workspaceProjs.length; i++)
- if (include(workspaceProjs[i], element.getAttribute("include")) && exclude(workspaceProjs[i], element.getAttribute("exclude")))
- v.add(workspaceProjs[i]);
- }
- IProject[] projects = new IProject[v.size()];
- v.copyInto(projects);
- return projects;
- }
-
- private boolean include(IProject project, String include)
- {
- StringTokenizer st = new StringTokenizer(include);
- while(st.hasMoreTokens())
- {
- try
- {
- if (project.hasNature(st.nextToken()))
- return true;
- }
- catch (CoreException ce)
- {
- }
- }
- return false;
- }
-
- private boolean exclude(IProject project, String exclude)
- {
- StringTokenizer st = new StringTokenizer(exclude);
- while(st.hasMoreTokens())
- {
- try
- {
- if (project.hasNature(st.nextToken()))
- return false;
- }
- catch (CoreException ce)
- {
- }
- }
- return true;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/IWebServiceRuntime.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/IWebServiceRuntime.java
deleted file mode 100644
index 23c7d93..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/IWebServiceRuntime.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-
-/**
-* This is the interface for objects that represent a kind of
-* Web Service artifact.
-*/
-public interface IWebServiceRuntime
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Returns the id of this Web Service runtime.
- * @return id of this Web Service runtime.
- */
- public String getId ();
-
- /**
- * Returns a locale specific description of this Web Service runtime.
- * @return A locale specific description of this Web Service runtime.
- */
- public String getDescription ();
-
- /**
- * Returns a short, locale specific Label of this Web Service runtime.
- * @return A short, locale specific Label of this Web Service runtime.
- */
- public String getLabel ();
-
- /**
- * Returns a String, J2EE version
- * @return
- */
- public String[] getJ2EEVersions();
-
- /**
- * Returns the configuration element associated with
- * this runtime.
- *
- * @return org.eclipse.core.runtime.IConfigurationElement
- */
- public IConfigurationElement getConfigurationElement();
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/IWebServiceServer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/IWebServiceServer.java
deleted file mode 100644
index 580d960..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/IWebServiceServer.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-
-/**
-* This is the interface for objects that represent a kind of
-* Web Service artifact. The primary purpose of a WebServiceType
-* object is to manufacture the wizard pages that support the type.
-*/
-public interface IWebServiceServer
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Returns the id of this Web Service type.
- * @return id of this Web Service type.
- */
- public String getId ();
- /**
- * Returns a short, locale specific name of this Web Service type.
- * @return A short, locale specific name of this Web Service type.
- */
- public String getFactoryId ();
-
- /**
- * Returns a short, locale specific name of this Web Service type.
- * @return A short, locale specific name of this Web Service type.
- */
- public String getLabel ();
-
- /**
- * Returns true if set true in plugin.xml
- * @return boolean
- */
- public boolean getIsDefault();
-
- /**
- * Returns runtime target Id
- * @return String
- */
- public String getRuntimeTypeId();
-
- /**
- * Returns the configuration element associated with
- * this runtime.
- *
- * @return org.eclipse.core.runtime.IConfigurationElement
- */
- public IConfigurationElement getConfigurationElement();
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/IWebServiceType.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/IWebServiceType.java
deleted file mode 100644
index b149698..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/IWebServiceType.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-
-/**
-* This is the interface for objects that represent a kind of
-* Web Service artifact. The primary purpose of a WebServiceType
-* object is to manufacture the wizard pages that support the type.
-*/
-public interface IWebServiceType
-{
- /**
- * Returns the id of this Web Service type.
- * @return id of this Web Service type.
- */
- public String getId ();
- /**
- * Returns a short, locale specific name of this Web Service type.
- * @return A short, locale specific name of this Web Service type.
- */
- public String getLabel ();
-
- /**
- * Returns a locale specific description of this Web Service type's extension metadata.
- * @return A locale specific description of this Web Service type's extension metadata.
- */
- public String[] getExtensionMetadata ();
-
- /**
- * Returns a locale specific description of this Web Service type's resource metadata.
- * @return A locale specific description of this Web Service type's resource metadata.
- */
- public String[] getResourceTypeMetadata ();
-
- /**
- * Returns true if the plugin.xml contains an attribute of "canFinish" with a value of true. Otherwise,
- * false is returned. Note: if the "canFinish" attribute is not specified true is returned by default.
- * @return Returns whether or not the user can finish on the pages before the web service type pages.
- */
- public boolean getCanFinish();
-
- /**
- * Returns the configuration element associated with
- * this runtime.
- *
- * @return org.eclipse.core.runtime.IConfigurationElement
- */
- public IConfigurationElement getConfigurationElement();
-
- public String getObjectSelectionWidget();
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/PrivateUDDIRegistryTypeRegistry.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/PrivateUDDIRegistryTypeRegistry.java
deleted file mode 100644
index a1df6a2..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/PrivateUDDIRegistryTypeRegistry.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.ws.internal.ui.uddi.PrivateUDDIRegistryType;
-
-
-public class PrivateUDDIRegistryTypeRegistry
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- private static PrivateUDDIRegistryTypeRegistry instance_;
-
- private PrivateUDDIRegistryTypeRegistry() {
- }
-
- /**
- * Returns a singleton instance of this class.
- * @return A singleton WebServiceClientTypeRegistry object.
- */
- public static PrivateUDDIRegistryTypeRegistry getInstance() {
- if (instance_ == null) {
- instance_ = new PrivateUDDIRegistryTypeRegistry();
- }
-
- return instance_;
- }
-
- public PrivateUDDIRegistryType getPrivateUDDIRegistryType() {
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] config = reg.getConfigurationElementsFor(
- "org.eclipse.jst.ws.consumption.ui",
- "privateUDDIRegistryType");
-
- try {
- Object configElement = ((config.length > 0) ? config[0].createExecutableExtension("class") : null);
- if(configElement != null && configElement instanceof PrivateUDDIRegistryType)
- return (PrivateUDDIRegistryType)configElement;
- else
- return null;
- }
- catch (CoreException e) {
- return null;
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/PublicUDDIRegistryTypeRegistry.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/PublicUDDIRegistryTypeRegistry.java
deleted file mode 100644
index 8179a62..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/PublicUDDIRegistryTypeRegistry.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi.PublicUDDIRegistryType;
-
-
-public class PublicUDDIRegistryTypeRegistry
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- private static PublicUDDIRegistryTypeRegistry instance_;
- private Vector types_;
- private Vector configElements_;
-
- private PublicUDDIRegistryTypeRegistry() {
- types_ = new Vector();
- configElements_ = new Vector();
-
- init();
- }
-
- /**
- * Returns a singleton instance of this class.
- * @return A singleton WebServiceClientTypeRegistry object.
- */
- public static PublicUDDIRegistryTypeRegistry getInstance() {
- if (instance_ == null) {
- instance_ = new PublicUDDIRegistryTypeRegistry();
- }
-
- return instance_;
- }
-
- public void init() {
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] config = reg.getConfigurationElementsFor(
- "org.eclipse.jst.ws.consumption.ui",
- "publicUDDIRegistryType");
-
- for (int i = 0; i < config.length; i++) {
- try {
- Object configElement = config[i].createExecutableExtension("class");
-
- if( configElement instanceof PublicUDDIRegistryType) {
- types_.add(configElement);
- configElements_.add(config[i]);
- }
- }
- catch (CoreException e) {}
- }
- }
-
- public PublicUDDIRegistryType[] getAllPublicUDDIRegistryTypes() {
- PublicUDDIRegistryType[] types = new PublicUDDIRegistryType[types_.size()];
- for (int i = 0; i < types_.size(); i++) {
- types[i] = (PublicUDDIRegistryType)types_.elementAt(i);
- }
- return types;
- }
-
- public PublicUDDIRegistryType getPublicUDDIRegistryTypeByID(String id) {
- for (int i = 0; i < configElements_.size(); i++) {
- IConfigurationElement c = (IConfigurationElement)configElements_.elementAt(i);
- if (c.getAttribute("id").equals(id))
- return (PublicUDDIRegistryType)types_.elementAt(i);
- }
- return null;
- }
-
- public String getPublicUDDIRegistryTypeIDByName(String name) {
- for (int i = 0; i < types_.size(); i++) {
- PublicUDDIRegistryType type = (PublicUDDIRegistryType)types_.elementAt(i);
- if (type.getName().equals(name))
- return ((IConfigurationElement)configElements_.elementAt(i)).getAttribute("id");
- }
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/RuntimeServerSelectionDialog.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/RuntimeServerSelectionDialog.java
deleted file mode 100644
index 8ecee40..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/RuntimeServerSelectionDialog.java
+++ /dev/null
@@ -1,769 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-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.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.ui.ServerUICore;
-
-public class RuntimeServerSelectionDialog extends Dialog implements Listener {
-
- private Shell thisShell;
- private Group viewSelectionGroup_;
- private Text messageBanner_;
- private Composite primaryGroup_;
- private Group runtimesGroup_;
- private Group serversGroup_;
- private Tree runtimesList_;
- private Tree serverList_;
- private Button viewSelectionByRuntimeButton_;
- private Button viewSelectionByServerButton_;
- private Button viewSelectionByExploreButton_;
- private Combo j2eeVersionCombo;
- /*
- * CONTEXT_ID PWRS0001 for the selection of runtime, server and project combination
- */
- private String INFOPOP_PWRS_DIALOG = WebServiceConsumptionUIPlugin.ID + ".PWRS0001";
- /* CONTEXT_ID PWRS0002 for the runtime selection on in the dailog */
- private String INFOPOP_PWRS_LIST_RUNTIMES = WebServiceConsumptionUIPlugin.ID + ".PWRS0002";
- /* CONTEXT_ID PWRS0003 for the server selection in the dialog */
- private String INFOPOP_PWRS_LIST_SERVERS = WebServiceConsumptionUIPlugin.ID + ".PWRS0003";
- /*
- * CONTEXT_ID PWRS0004 for the EJB Project combo box of the runtime selection dialog
- */
- // private String INFOPOP_PWRS_EJB_PROJECT = WebServiceConsumptionUIPlugin.ID
- // + ".PWRS0004";
- /*
- * CONTEXT_ID PWRS0005 for the runtime view radio button of the runtime selection dialog
- */
- private String INFOPOP_PWRS_RADIO_RUNTIME = WebServiceConsumptionUIPlugin.ID + ".PWRS0005";
- /*
- * CONTEXT_ID PWRS0006 for the server view radio button of the runtime selection dialog
- */
- private String INFOPOP_PWRS_RADIO_SERVER = WebServiceConsumptionUIPlugin.ID + ".PWRS0006";
- /*
- * CONTEXT_ID PWRS0007 for the explore view radio button of the runtime selection dialog
- */
- private String INFOPOP_PWRS_RADIO_EXPLORE = WebServiceConsumptionUIPlugin.ID + ".PWRS0007";
- /*
- * CONTEXT_ID PWRS0008 for the Web Project combo box of the runtime selection dialog
- */
- // private String INFOPOP_PWRS_COMBO_PROJECT =
- // WebServiceConsumptionUIPlugin.ID + ".PWRS0008";
- /*
- * CONTEXT_ID PWRS0009 for the J2EE version combo box of the runtime selection dialog
- */
- private String INFOPOP_PWRS_J2EE_VERSION = WebServiceConsumptionUIPlugin.ID + ".PWRS0009";
-
- private WebServiceServerRuntimeTypeRegistry wssrtRegistry;
- private WebServiceClientTypeRegistry wsctRegistry;
- private Hashtable serverLabels_;
- private Hashtable existingServersTable_;
- private String defaultServer_;
- private String defaultRuntime_;
- private String typeId_;
- private String clientTypeId_;
- private IWebServiceRuntime selectedRuntime_;
- private IServer selectedServer_;
- private String selectedServerLabel_;
- private String selectedServerFactoryID_;
- private boolean isExistingServer_;
- private boolean validateOn_ = false;
- private byte selectionMode_;
- private final byte MODE_SERVICE = (byte) 0;
- private final byte MODE_CLIENT = (byte) 1;
- private final String SERVER_TYPES_ICON = "icons/servers/servers_obj.gif";
- private final String EXISTING_SERVERS_ICON = "icons/servers/existing_server_obj.gif";
- private String j2eeVersion;
- private String serverInstanceID_;
-
- public RuntimeServerSelectionDialog(Shell shell, byte mode, TypeRuntimeServer ids, String j2eeVersion) {
- super(shell);
- selectionMode_ = mode;
- typeId_ = ids.getTypeId();
- defaultRuntime_ = ids.getRuntimeId();
- defaultServer_ = ids.getServerId();
- serverInstanceID_ = ids.getServerInstanceId();
- setIsExistingServer(ids.getServerInstanceId() != null);
- serverLabels_ = new Hashtable();
- existingServersTable_ = new Hashtable();
- wsctRegistry = WebServiceClientTypeRegistry.getInstance();
- wssrtRegistry = WebServiceServerRuntimeTypeRegistry.getInstance();
- this.j2eeVersion = j2eeVersion;
- }
-
- public TypeRuntimeServer getTypeRuntimeServer() {
- TypeRuntimeServer ids = new TypeRuntimeServer();
-
- ids.setTypeId(typeId_);
- if (selectedRuntime_ != null)
- ids.setRuntimeId(selectedRuntime_.getId());
-
- if( selectedServerFactoryID_ == null )
- {
- ids.setServerId( defaultServer_ );
- ids.setServerInstanceId( serverInstanceID_ );
- }
- else
- {
- ids.setServerId(selectedServerFactoryID_);
-
- if (isExistingServer_ && selectedServer_ != null)
- {
- ids.setServerInstanceId(selectedServer_.getId());
- }
- }
-
- return ids;
- }
-
- public String getJ2EEVersion() {
- return j2eeVersion;
- }
-
- private boolean getIsExistingServer() {
- return isExistingServer_;
- }
-
- private void setIsExistingServer(boolean isExisting) {
- isExistingServer_ = isExisting;
- }
-
- protected Control createContents(Composite parent) {
- Composite comp = (Composite) super.createContents(parent);
- parent.getShell().pack();
- return comp;
- }
-
- protected Control createDialogArea(Composite parent) {
- validateOn_ = false;
- thisShell = parent.getShell();
- if (thisShell == null) {
- thisShell = createShell();
- }
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout gl;
- GridData gd;
- // Window title
- if (selectionMode_ == MODE_SERVICE)
- thisShell.setText(getMessage("%PAGE_TITLE_WS_RUNTIME_SELECTION"));
- else
- thisShell.setText(getMessage("%PAGE_TITLE_WS_CLIENT_RUNTIME_SELECTION"));
-
- WorkbenchHelp.setHelp(thisShell, new Object[] { INFOPOP_PWRS_DIALOG});
- // Dialog description banner
- messageBanner_ = new Text(composite, SWT.READ_ONLY | SWT.WRAP);
- messageBanner_.setText(getMessage("%PAGE_DESC_WS_RUNTIME_SELECTION") + "\n" + " "); // reserves a second line for message display
- messageBanner_.setToolTipText(getMessage("%PAGE_DESC_WS_RUNTIME_SELECTION"));
- gd = new GridData(GridData.FILL_HORIZONTAL);
- messageBanner_.setLayoutData(gd);
- // -----------------------------------------------------------------------//
- new Label(composite, SWT.HORIZONTAL);
- // -----------------------------------------------------------------------//
- // Selection
- thisShell.setToolTipText(getMessage("%TOOLTIP_PWRS_PAGE"));
- viewSelectionGroup_ = new Group(composite, SWT.NONE);
- gl = new GridLayout();
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- viewSelectionGroup_.setLayout(gl);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- viewSelectionGroup_.setLayoutData(gd);
- if (selectionMode_ == MODE_SERVICE)
- viewSelectionGroup_.setText(getMessage("%LABEL_SELECTION_VIEW_TITLE"));
- else
- viewSelectionGroup_.setText(getMessage("%LABEL_CLIENT_SELECTION_VIEW_TITLE"));
- viewSelectionByServerButton_ = new Button(viewSelectionGroup_, SWT.RADIO);
- viewSelectionByServerButton_.setText(getMessage("%LABEL_SELECTION_VIEW_SERVER"));
- viewSelectionByServerButton_.addListener(SWT.Selection, this);
- viewSelectionByServerButton_.setToolTipText(getMessage("%TOOLTIP_PWRS_RADIO_SERVER"));
- viewSelectionByServerButton_.setSelection(true);
- WorkbenchHelp.setHelp(viewSelectionByServerButton_, new Object[] { INFOPOP_PWRS_RADIO_SERVER});
- viewSelectionByRuntimeButton_ = new Button(viewSelectionGroup_, SWT.RADIO);
- viewSelectionByRuntimeButton_.setText(getMessage("%LABEL_SELECTION_VIEW_RUNTIME"));
- viewSelectionByRuntimeButton_.addListener(SWT.Selection, this);
- viewSelectionByRuntimeButton_.setToolTipText(getMessage("%TOOLTIP_PWRS_RADIO_RUNTIME"));
- WorkbenchHelp.setHelp(viewSelectionByRuntimeButton_, new Object[] { INFOPOP_PWRS_RADIO_RUNTIME});
- viewSelectionByExploreButton_ = new Button(viewSelectionGroup_, SWT.RADIO);
- viewSelectionByExploreButton_.setText(getMessage("%LABEL_SELECTION_VIEW_EXPLORE"));
- viewSelectionByExploreButton_.addListener(SWT.Selection, this);
- viewSelectionByExploreButton_.setToolTipText(getMessage("%TOOLTIP_PWRS_RADIO_EXPLORE"));
- WorkbenchHelp.setHelp(viewSelectionByExploreButton_, new Object[] { INFOPOP_PWRS_RADIO_EXPLORE});
- primaryGroup_ = new Composite(composite, SWT.NONE);
- gl = new GridLayout();
- gl.numColumns = 1;
- gl.makeColumnsEqualWidth = true;
- gd = new GridData(GridData.FILL_BOTH);
- primaryGroup_.setLayout(gl);
- primaryGroup_.setLayoutData(gd);
- runtimesGroup_ = new Group(primaryGroup_, SWT.NONE);
- gl = new GridLayout();
- runtimesGroup_.setLayout(gl);
- gd = new GridData(GridData.FILL_BOTH);
- runtimesGroup_.setLayoutData(gd);
- runtimesGroup_.setText(getMessage("%LABEL_RUNTIMES_LIST"));
- runtimesList_ = new Tree(runtimesGroup_, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- gd = new GridData(GridData.FILL_BOTH);
- runtimesList_.setLayoutData(gd);
- runtimesList_.addListener(SWT.Selection, this);
- runtimesList_.setToolTipText(getMessage("%TOOLTIP_PWRS_LIST_RUNTIMES"));
- WorkbenchHelp.setHelp(runtimesList_, new Object[] { INFOPOP_PWRS_LIST_RUNTIMES});
- // Server labels control
- serversGroup_ = new Group(primaryGroup_, SWT.NONE);
- gl = new GridLayout();
- serversGroup_.setLayout(gl);
- gd = new GridData(GridData.FILL_BOTH);
- serversGroup_.setLayoutData(gd);
- serversGroup_.setText(getMessage("%LABEL_SERVERS_LIST"));
- serverList_ = new Tree(serversGroup_, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- serverList_.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
- serverList_.addListener(SWT.Selection, this);
- serverList_.setToolTipText(getMessage("%TOOLTIP_PWRS_LIST_SERVERS"));
- ServersList serverList = new ServersList();
- serverList.setServerTreeItems(serverList_);
- WorkbenchHelp.setHelp(serverList_, new Object[] { INFOPOP_PWRS_LIST_SERVERS});
- setRuntimesGroup();
- // J2EE version
- Composite j2eeVersionComposite = new Composite(composite, SWT.NONE);
- gl = new GridLayout();
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- gl.numColumns = 2;
- gd = new GridData(GridData.FILL_HORIZONTAL);
- j2eeVersionComposite.setLayout(gl);
- j2eeVersionComposite.setLayoutData(gd);
- Label j2eeVersionLabel = new Label(j2eeVersionComposite, SWT.NONE);
- j2eeVersionLabel.setText(getMessage("%LABEL_J2EE_VERSION"));
- j2eeVersionCombo = new Combo(j2eeVersionComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
- gl = new GridLayout();
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- gd = new GridData(GridData.FILL_HORIZONTAL);
- j2eeVersionCombo.setLayout(gl);
- j2eeVersionCombo.setLayoutData(gd);
- j2eeVersionCombo.addListener(SWT.Selection, this);
- j2eeVersionCombo.setToolTipText(getMessage("%TOOLTIP_PWRS_J2EE_VERSION"));
- WorkbenchHelp.setHelp(j2eeVersionCombo, new Object[] { INFOPOP_PWRS_J2EE_VERSION});
- // -----------------------------------------------------------------------//
- new Label(composite, SWT.HORIZONTAL);
- validateOn_ = true;
- org.eclipse.jface.dialogs.Dialog.applyDialogFont(parent);
- setJ2EEVersions();
- return composite;
- }
-
- private void setJ2EEVersions() {
- j2eeVersionCombo.setEnabled(true);
- j2eeVersionCombo.removeAll();
- String[] versions = null;
- if (selectedRuntime_ != null)
- versions = selectedRuntime_.getJ2EEVersions();
- if (versions != null) {
- //j2eeVersionCombo.setItems(versions);
- setJ2EEComboItems(versions);
- j2eeVersionCombo.select(0);
- if (j2eeVersion != null) {
- int i = j2eeVersionCombo.indexOf(J2EEUtils.getLabelFromJ2EEVersion(j2eeVersion));
- if (i > 0)
- j2eeVersionCombo.select(i);
- }
- }
- else
- j2eeVersionCombo.setEnabled(false);
- }
-
- private void setJ2EEComboItems(String[] versions)
- {
- String[] j2eeLabels = new String[versions.length];
- for (int i = 0; i < versions.length; i++)
- {
- String label = J2EEUtils.getLabelFromJ2EEVersion(versions[i]);
- if (label != null && label.length() >0)
- j2eeLabels[i] = J2EEUtils.getLabelFromJ2EEVersion(versions[i]);
- else
- j2eeLabels[i] = getMessage("%LABEL_NA");
- }
- j2eeVersionCombo.setItems(j2eeLabels);
- }
-
- private void validateServerRuntimeSelection() {
- // Check if the extension exists
- if (selectionMode_ == MODE_SERVICE) {
- if (selectedServerFactoryID_!=null && selectedRuntime_!=null) {
- WebServiceServerRuntimeType wssrt = wssrtRegistry.getWebServiceServerRuntimeType(selectedServerFactoryID_, selectedRuntime_.getId(), typeId_);
- // rm WebServiceServerRuntimeType wssrt =
- // wssrtRegistry.getWebServiceServerRuntimeType(selectedServerFactoryID_,
- // selectedRuntime_.getId(), wse.getWebServiceType());
- // rm if (wssrt!=null &&
- // wssrtRegistry.isServerSupportedForChosenType(wse.getWebServiceType(),selectedServerFactoryID_))
- // {
- if (wssrt != null && wssrtRegistry.isServerSupportedForChosenType(typeId_, selectedServerFactoryID_)) {
- setOKStatusMessage();
- }
- else {
- setERRORStatusMessage("%MSG_INVALID_SRT_SELECTIONS");
- }
- }
- }
- else {
- // rm String clientId =
- // wsctRegistry.getClientTypeIdByName(clientScenarioId_);
- String clientId = typeId_;
- // rm String clientId =
- // wsctRegistry.getClientTypeIdByName(wse.getProxySelected());
- WebServiceServer wss = wsctRegistry.getWebServiceServerByFactoryId(selectedServerFactoryID_);
-
- if (wss == null || selectedRuntime_ == null || !wsctRegistry.webServiceClientRuntimeTypeExists(wss.getId(), selectedRuntime_.getId(), clientId)) {
- setERRORStatusMessage("%MSG_INVALID_SRT_SELECTIONS");
- }
- else {
- setOKStatusMessage();
- }
- }
- // Disable OK button if the runtime selection is invalid
- TreeItem[] runtimeSel = runtimesList_.getSelection();
- if (runtimeSel == null || runtimeSel.length <= 0 || runtimeSel[0].getText().length() == 0) {
- disableOKButton();
- }
- // Disable OK button if server selection is invalid
- TreeItem[] serverSel = serverList_.getSelection();
- String currentSelection = (serverSel != null && serverSel.length > 0) ? serverSel[0].getText() : "";
- if (serverSel == null || currentSelection.length() == 0) {
- disableOKButton();
- }
- if (!serverLabels_.containsKey(currentSelection) || !existingServersTable_.containsKey(currentSelection)) {
- disableOKButton();
- setOKStatusMessage();
- }
- // Disable OK button if category is selected rather than a server
- if (serverSel.length > 0 && serverSel[0].getItemCount()!=0) {
- disableOKButton();
- }
- else {
- enableOKButton();
- }
-
- }
-
- private void setOKStatusMessage() {
- messageBanner_.setText(getMessage("%PAGE_DESC_WS_RUNTIME_SELECTION"));
- Color black = new Color(thisShell.getDisplay(), 0x00, 0, 0);
- messageBanner_.setForeground(black);
- enableOKButton();
- }
-
- private void setERRORStatusMessage(String message) {
- messageBanner_.setText(getMessage(message));
- Color red = new Color(thisShell.getDisplay(), 0xFF, 0, 0);
- messageBanner_.setForeground(red);
- disableOKButton();
- }
-
- private void disableOKButton() {
- if (getButton(0) != null)
- getButton(0).setEnabled(false);
- }
-
- private void enableOKButton() {
- if (getButton(0) != null)
- getButton(0).setEnabled(true);
- }
-
- protected void okPressed() {
- setJ2EEVersionFromJ2EEVersionCombo();
- //j2eeVersion = (j2eeVersionCombo.getEnabled()) ? j2eeVersionCombo.getText() : null;
- setReturnCode(OK);
- close();
- }
-
- private void setJ2EEVersionFromJ2EEVersionCombo()
- {
- if (j2eeVersionCombo.getEnabled())
- {
- String j2eeLabel = j2eeVersionCombo.getText();
- String j2eeVersionString = J2EEUtils.getJ2EEVersionFromLabel(j2eeLabel);
- if (j2eeVersionString != null && j2eeVersionString.length() > 0)
- j2eeVersion = j2eeVersionString;
- else
- j2eeVersion = null;
- }
- else
- j2eeVersion = null;
- }
- /**
- * Called when an event occurs on the page. Handles the event and revalidates the page.
- *
- * @param event
- * The event that occured.
- */
- public void handleEvent(Event event) {
- if (!validateOn_)
- return;
- enableOKButton();
- if (viewSelectionByRuntimeButton_ == event.widget) {
- handleRuntimeViewSelectionEvent();
- return;
- }
- else if (viewSelectionByServerButton_ == event.widget) {
- handleServerViewSelectionEvent();
- return;
- }
- else if (viewSelectionByExploreButton_ == event.widget) {
- handleExploreViewSelectionEvent();
- return;
- }
- else if (j2eeVersionCombo == event.widget) {
- setJ2EEVersionFromJ2EEVersionCombo();
- //j2eeVersion = (j2eeVersionCombo.getEnabled()) ? j2eeVersionCombo.getText() : null;
- return;
- }
- else if (runtimesList_ == event.widget) {
- TreeItem[] runtimeSel = runtimesList_.getSelection();
- processRuntimeListSelection(runtimeSel[0].getText());
- validateServerRuntimeSelection();
- setJ2EEVersions();
- }
- else if (serverList_ == event.widget) {
- processServerListSelection();
- validateServerRuntimeSelection();
- }
- }
-
- private void handleRuntimeViewSelectionEvent() {
- GridLayout gl = new GridLayout();
- gl.numColumns = 1;
- gl.makeColumnsEqualWidth = true;
- GridData gd = new GridData(GridData.FILL_BOTH);
- primaryGroup_.setLayout(gl);
- primaryGroup_.setLayoutData(gd);
- primaryGroup_.layout();
-
- // TODO: Show all runtimes, and only servers supported by current type id
- }
-
- //
- // Called by handleEvent() when the user selects the layout to view
- //
- public void handleServerViewSelectionEvent() {
- GridLayout gl = new GridLayout();
- gl.numColumns = 1;
- gl.makeColumnsEqualWidth = true;
- GridData gd = new GridData(GridData.FILL_BOTH);
- primaryGroup_.setLayout(gl);
- primaryGroup_.setLayoutData(gd);
- primaryGroup_.layout();
- serversGroup_.setLocation(5, 5);
- runtimesGroup_.setLocation(4, 100);
- serversGroup_.layout();
- runtimesGroup_.layout();
-
- // TODO: Show all servers, and only runtimes supported by the current type id
- }
-
- //
- // Called by handleEvent() when the user selects the layout to view
- //
- private void handleExploreViewSelectionEvent() {
- GridLayout gl;
- gl = (GridLayout) primaryGroup_.getLayout();
- gl.numColumns = 2;
- gl.makeColumnsEqualWidth = true;
- GridData gd = new GridData(GridData.FILL_BOTH);
- primaryGroup_.setLayout(gl);
- primaryGroup_.setLayoutData(gd);
- primaryGroup_.layout();
-
- // TODO: Show all servers and runtimes from the type id
-
- }
-
- private void processRuntimeListSelection(String runtimeName) {
- if (selectionMode_ == MODE_SERVICE) {
- selectedRuntime_ = wssrtRegistry.getWebServiceRuntimeByLabel(runtimeName);
- }
- else {
- selectedRuntime_ = wsctRegistry.getWebServiceRuntimeByName(runtimeName);
- }
- }
-
- private void processServerListSelection() {
- String currentSelection;
- TreeItem[] serverSel = serverList_.getSelection();
- if (serverSel != null && serverSel.length > 0) {
- currentSelection = serverSel[0].getText();
- if (serverLabels_.containsKey(currentSelection) || existingServersTable_.containsKey(currentSelection)) {
- if (existingServersTable_.containsKey(currentSelection)) {
- selectedServer_ = (IServer) existingServersTable_.get(currentSelection);
- selectedServerLabel_ = currentSelection;
- selectedServerFactoryID_ = selectedServer_.getServerType().getId();
- }
- else if (serverLabels_.containsKey(currentSelection)) {
- TreeItem parentItem = serverSel[0].getParentItem();
- if (parentItem != null && !parentItem.getText().equalsIgnoreCase(getMessage("%LABEL_TREE_EXISTING_SERVERS"))) {
- selectedServerLabel_ = currentSelection;
- selectedServer_ = null;
- selectedServerFactoryID_ = (String) serverLabels_.get(currentSelection);
- }
- }
-
- // check if isExistingServer or new ServerType
- TreeItem parentItem = serverSel[0].getParentItem();
- if (parentItem != null && parentItem.getText().equalsIgnoreCase(getMessage("%LABEL_TREE_EXISTING_SERVERS"))) {
- setIsExistingServer(true);
- }
- else {
- setIsExistingServer(false);
- }
- }
- else {
- selectedServer_ = null;
- selectedServerLabel_ = null;
- selectedServerFactoryID_ = null;
- setIsExistingServer(false);
- return;
- }
- }
- }
-
- private static String getMessage(String key) {
- return WebServiceConsumptionUIPlugin.getMessage(key);
- }
-
- private static String getMessage(String key, Object[] args) {
- return WebServiceConsumptionUIPlugin.getMessage(key, args);
- }
-
- private void setRuntimesGroup() {
- runtimesList_.removeAll();
- String[] runtimes = null;
-
- if (selectionMode_ == MODE_SERVICE) {
- runtimes = wssrtRegistry.getRuntimesByType(typeId_);
- }
- else {
- runtimes = wsctRegistry.getAllClientRuntimes();
- }
-
- TreeItem[] runtimeName = new TreeItem[runtimes.length];
-
- if (runtimes != null) {
- for (int i = 0; i < runtimes.length; i++) {
- String runtimeLabel = getRuntimeLabel(runtimes[i]);
- runtimeName[i] = new TreeItem(runtimesList_, SWT.NONE);
- runtimeName[i].setText(runtimeLabel);
-
- if (runtimes[i].equalsIgnoreCase(defaultRuntime_)) {
- runtimesList_.setSelection(new TreeItem[] { runtimeName[i]});
- selectedRuntime_ = getRuntime(runtimes[i]);
- }
- }
- }
- }
-
- private String getRuntimeLabel(String type) {
- return getRuntime(type).getLabel();
- }
-
- private IWebServiceRuntime getRuntime(String type) {
- if (selectionMode_ == MODE_SERVICE) {
- return wssrtRegistry.getRuntimeById(type);
- }
- else {
- return wsctRegistry.getRuntimeById(type);
- }
- }
-
- // Returns the server Factory Id given a server name
- private String getServerSelectionFactoryId(String selectedServerName) {
- if (serverLabels_.containsKey(selectedServerName) && !isExistingServer_)
- return (String) serverLabels_.get(selectedServerName);
- else {
- return ((IServer) existingServersTable_.get(selectedServerName)).getServerType().getId();
- }
- }
-
- /**
- *
- * ServersList class
- *
- * Class which easily creates the Tree structure and entries for existing servers and server types
- */
- public class ServersList {
-
- private TreeItem[] existingServersTree;
- private TreeItem[] serverTypesTree;
- boolean existingServer = false;
-
- public void setServerTreeItems(Tree serversList) {
- this.setExistingServersTree(serversList);
- this.setServerTypesTree(serversList);
- }
-
- public void setExistingServersTree(Tree serverList) {
- String[] serverIds = this.getAllExistingServers();
- existingServersTree = new TreeItem[1];
- TreeItem[] existingServerItems = new TreeItem[serverIds.length];
- existingServersTree[0] = new TreeItem(serverList, SWT.NONE);
- existingServersTree[0].setText(getMessage("%LABEL_TREE_EXISTING_SERVERS"));
- ImageDescriptor id = WebServiceConsumptionUIPlugin.getImageDescriptor(EXISTING_SERVERS_ICON);
- if (id != null)
- existingServersTree[0].setImage(id.createImage());
- for (int k = 0; k < serverIds.length; k++) {
- IServerType serverType = ServerCore.findServerType(((IServer) existingServersTable_.get(serverIds[k])).getServerType().getId());
- if (serverType != null) {
- existingServerItems[k] = new TreeItem(existingServersTree[0], SWT.NONE);
- existingServerItems[k].setText(serverIds[k]);
- if (serverIds[k].equalsIgnoreCase(defaultServer_) && getIsExistingServer()) {
- existingServersTree[0].setExpanded(true);
- serverList.setSelection(new TreeItem[] { existingServerItems[k]});
- existingServer = true;
- RuntimeServerSelectionDialog.this.setIsExistingServer(true);
- selectedServer_ = (IServer) existingServersTable_.get(defaultServer_);
- selectedServerLabel_ = serverIds[k];
- selectedServerFactoryID_ = selectedServer_.getServerType().getId();
- }
- existingServerItems[k].setImage(ServerUICore.getLabelProvider().getImage(serverType));
- }
- }
- }
-
- public void setServerTypesTree(Tree serverList) {
-
- TreeItem[] serverTypesTree = new TreeItem[1];
- serverTypesTree[0] = new TreeItem(serverList, SWT.NONE);
- serverTypesTree[0].setText(getMessage("%LABEL_TREE_SERVER_TYPES"));
- ImageDescriptor id = WebServiceConsumptionUIPlugin.getImageDescriptor(SERVER_TYPES_ICON);
- if (id != null)
- serverTypesTree[0].setImage(id.createImage());
- Hashtable categories_ = new Hashtable();
- Hashtable categoryTreeItem = new Hashtable();
- String[] serverIds = null;
- // rm String wst = wse.getWebServiceType();
- if (selectionMode_ == MODE_SERVICE) {
- serverIds = wssrtRegistry.getServerFactoryIdsByType(typeId_);
- }
- else {
- //serverIds = wsctRegistry.getServerFactoryIdsByClientType(typeId_);
- serverIds = wsctRegistry.getAllClientServerFactoryIds();
-
- }
- // rm serverId =
- // wssrtRegistry.getServerFactoryIdsByType(wse.getWebServiceType());
- if (serverIds == null) {
- serverIds = getAllServerTypes();
- }
- TreeItem[] parent = new TreeItem[serverIds.length];
- TreeItem[] item = new TreeItem[serverIds.length];
- if (serverIds != null) {
- for (int i = 0; i < serverIds.length; i++) {
- String server = ServerUtils.getInstance().getServerLabelForId(serverIds[i]);
- if (server != null) {
- RuntimeServerSelectionDialog.this.serverLabels_.put(server, serverIds[i]);
- IServerType serverType = ServerCore.findServerType(serverIds[i]);
- IRuntimeType runtimeType = serverType.getRuntimeType();
- if (!categories_.containsKey(serverType) && runtimeType != null) {
- categories_.put(serverType, runtimeType);
- if (categoryTreeItem.get(runtimeType) == null) {
- String categoryText = runtimeType.getName();
- Image categoryImage = ServerUICore.getLabelProvider().getImage(runtimeType);
- parent[i] = new TreeItem(serverTypesTree[0], SWT.NONE);
- parent[i].setText(categoryText);
- parent[i].setImage(categoryImage);
- categoryTreeItem.put(runtimeType, parent[i]);
- }
- else {
- parent[i] = (TreeItem) categoryTreeItem.get(runtimeType);
- }
- String factoryText = serverType.getName();
- Image factoryImage = ServerUICore.getLabelProvider().getImage(serverType);
- item[i] = new TreeItem(parent[i], SWT.NONE);
- item[i].setText(factoryText);
- item[i].setImage(factoryImage);
- item[i].setData(serverType);
- if (factoryText.equalsIgnoreCase(defaultServer_) && !existingServer) {
- serverList.setSelection(new TreeItem[] { item[i]});
- selectedServer_ = null;
- selectedServerLabel_ = factoryText;
- selectedServerFactoryID_ = (String) serverLabels_.get(selectedServerLabel_);
- }
- }
- }
- }
- }
-
- }
-
- /**
- * Get all servers in the workspace
- *
- * @return String[] of existing server names
- */
- private String[] getAllExistingServers() {
- Vector serverIds = new Vector();
- {
- IServer[] servers = ServerCore.getServers();
- if (servers != null && servers.length!=0) {
- for (int i = 0; i < servers.length; i++) {
- IServer server = (IServer) servers[i];
- serverIds.add(server.getName());
- existingServersTable_.put(server.getName(), server);
- }
- }
- }
- return (String[]) serverIds.toArray(new String[serverIds.size()]);
- }
-
- /**
- * Get all server types available for creation
- *
- * @return String[] of server names
- */
- private String[] getAllServerTypes() {
- Vector serverTypes_ = new Vector();
- IServerType[] defaultServersList = ServerCore.getServerTypes();
- for (int i = 0; i < defaultServersList.length; i++) {
- IServerType serverType = (IServerType) defaultServersList[i];
- serverTypes_.add(serverType.getId());
- }
- return (String[]) serverTypes_.toArray(new String[serverTypes_.size()]);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/TypeSelectionFilter.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/TypeSelectionFilter.java
deleted file mode 100644
index 2833a42..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/TypeSelectionFilter.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-
-
-public class TypeSelectionFilter
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private IStructuredSelection initSelection_;
-
- public String[] getWebServiceTypeByInitialSelection(IStructuredSelection initialSelection, HashMap webServiceTypes)
- {
-
- HashSet supportedTypes = new HashSet();
- if (initialSelection != null && initialSelection.size() == 1)
- {
-
- // Check for null initial selection
- Object initialObject = initialSelection.getFirstElement();
- if (initialObject == null)
- {
- return null;
- }
- // Match up resource type metadata with initial selection
- Iterator iter = webServiceTypes.values().iterator();
- while (iter.hasNext())
- {
- IWebServiceType wst = (IWebServiceType)iter.next();
- String typeId = (String)wst.getId();
- if (!supportedTypes.contains(typeId))
- {
- String[] resourceTypes = wst.getResourceTypeMetadata();
- for (int i=0; i<resourceTypes.length; i++)
- {
- if (resourceTypes[i]!=null)
- {
- if ((initialObject.getClass().getName()).endsWith(resourceTypes[i]))
- {
- String name = null;
- IResource resource = null;
-
- try
- {
- resource = ResourceUtils.getResourceFromSelection(initialObject);
- }
- catch( CoreException exc )
- {
- resource = null;
- }
-
- if (resource instanceof IContainer)
- {
- name = initialObject.getClass().getName();
- }
- else if( resource != null )
- {
- name = resource.getFullPath().toString();
- }
- else
- {
- name = initialObject.getClass().getName();
- }
- String[] extensions = wst.getExtensionMetadata();
- if (acceptsName(name, extensions))
- {
- supportedTypes.add(typeId);
- }
- }
-
- }
- }
- }
- }
-
- }
-
- if (supportedTypes.isEmpty())
- return null;
- else
- {
- return (String[])supportedTypes.toArray(new String[0]);
- }
- }
-
-
- //
- // Checks if the given name is acceptable based upon its extension
- //
- private boolean acceptsName ( String name, String[] extensions)
- {
- //Return true if "all" extensions are supported.
-
- if (extensions[0]!=null)
- {
- if (extensions[0].equals("all"))
- {
- return true;
- }
- }
-
- for (int i=0; i<extensions.length; i++)
- {
- if (extensions[i]!=null)
- {
- if (name.endsWith(extensions[i]))
- return true;
- }
- }
- return false;
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/TypeSelectionMetadata.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/TypeSelectionMetadata.java
deleted file mode 100644
index 198c12d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/TypeSelectionMetadata.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import java.util.StringTokenizer;
-
- //
- // This class holds the set of distinguishing factors in determining
- // the default Web service type. The default Web Service type will be determined
- // by pattern matching the initial selection with the supported extension
- // and the resource type metadata specified in the manifest file.
- //
- public class TypeSelectionMetadata
- {
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- public String[] extensionMeta;
- public String[] resourceTypeMeta;
-
- public TypeSelectionMetadata(String extensionMD, String resourceTypeMD)
- {
- setExtensionMetadata(extensionMD);
- setResourceTypeMetadata(resourceTypeMD);
- }
-
- public void setExtensionMetadata(String extensionMetadata)
- {
- StringTokenizer st = new StringTokenizer(extensionMetadata);
- extensionMeta = new String[st.countTokens()];
- int i=0;
- while (st.hasMoreElements())
- {
- String exten = (String)st.nextToken();
- if (exten!=null)
- {
- extensionMeta[i]=exten;
- }
- i++;
- }
-
- }
-
- public String[] getExtensionMetadata()
- {
- return extensionMeta;
- }
-
- public void setResourceTypeMetadata(String resourceTypeMetadata)
- {
- StringTokenizer st = new StringTokenizer(resourceTypeMetadata);
- resourceTypeMeta = new String[st.countTokens()];
- int i=0;
- while (st.hasMoreElements())
- {
- String resourceType = (String)st.nextToken();
- if (resourceType!=null)
- {
- resourceTypeMeta[i]=resourceType;
- }
- i++;
- }
- }
-
- public String[] getResourceTypeMetadata()
- {
- return resourceTypeMeta;
- }
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceClientTypeRegistry.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceClientTypeRegistry.java
deleted file mode 100644
index 2acf26b..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceClientTypeRegistry.java
+++ /dev/null
@@ -1,660 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.ws.internal.consumption.fragments.ClientPreAssemblyFragment;
-import org.eclipse.jst.ws.internal.consumption.fragments.ClientPreDeployFragment;
-import org.eclipse.jst.ws.internal.consumption.fragments.ClientPreDevelopFragment;
-import org.eclipse.jst.ws.internal.consumption.fragments.ClientPreInstallFragment;
-import org.eclipse.jst.ws.internal.data.LabelsAndIds;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactoryFactory;
-import org.eclipse.wst.command.env.core.registry.CommandRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-import org.eclipse.wst.command.internal.env.ui.widgets.CommandWidgetBindingList;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.ServerCore;
-
-public class WebServiceClientTypeRegistry implements CommandRegistry
-{
- private static WebServiceClientTypeRegistry instance_;
-
- private Vector configElems_;
- private HashSet typeNames_; // no duplicate client type names
- private HashMap types_;
- private HashMap clientTypeAndIds_;
- private HashMap clientIdToLabel_;
-
- private HashMap webServiceServers;
- private HashMap webServiceRuntimes;
- private HashMap webServiceClientTypes;
-
- private DataMappingRegistry dataMappingRegistry_;
- private WidgetRegistry widgetRegistry_;
- private CanFinishRegistry canFinishRegistry_;
- private HashMap factoryCache_;
-
- private WebServiceClientTypeRegistry()
- {
- }
-
- //
- // Loads WebServiceClientType objects into this registry.
- // This is done by querying the plugin registry for all extensions
- // hanging on the webServiceClientType extension point. Extensions
- // must implement the org.eclipse.jst.ws.ui.wizard.WebServiceClientType
- // interface.
- //
- private void loadTypes ()
- {
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] config = reg.getConfigurationElementsFor(
- "org.eclipse.jst.ws.consumption.ui",
- "webServiceClientType");
-
- for(int idx=0; idx<config.length; idx++)
- {
- IConfigurationElement elem = config[idx];
-
- if (elem.getName().equals("webServiceServer")) {
- WebServiceServer wss = new WebServiceServer(elem);
- webServiceServers.put(elem.getAttribute("id"), wss);
- }
- else if (elem.getName().equals("webServiceRuntime")) {
- WebServiceRuntime rt = new WebServiceRuntime(elem);
- webServiceRuntimes.put(elem.getAttribute("id"), rt);
- }
- else if (elem.getName().equals("webServiceClientType"))
- {
-
- String name = elem.getAttribute( "name" );
- typeNames_.add( name );
-
- String typeId = elem.getAttribute("clientType");
- if (typeId==null) {
- typeId = name;
- }
-
- String id = elem.getAttribute("id");
- clientTypeAndIds_.put(name, typeId);
- String serverId = elem.getAttribute("server");
- String runtimeId = elem.getAttribute("runtime");
- WebServiceServerRuntimeClientType wst = new WebServiceServerRuntimeClientType(serverId, runtimeId, typeId, name, elem);
- webServiceClientTypes.put(id, wst);
- types_.put(id, null );
- clientIdToLabel_.put( typeId, name );
- }
- configElems_.add( elem );
-
- }
- }
-
-
- /**
- * Loads WebServiceClientType objects into this registry.
- * See method getInstance().
- */
- private void load ()
- {
- typeNames_ = new HashSet();
- configElems_ = new Vector();
- types_ = new HashMap();
- clientTypeAndIds_ = new HashMap();
- webServiceClientTypes = new HashMap();
- webServiceRuntimes = new HashMap();
- webServiceServers = new HashMap();
- clientIdToLabel_ = new HashMap();
- loadTypes();
- }
-
- /**
- * Returns a singleton instance of this class.
- * @return A singleton WebServiceClientTypeRegistry object.
- */
- public static WebServiceClientTypeRegistry getInstance()
- {
- if (instance_ == null)
- {
- instance_ = new WebServiceClientTypeRegistry();
- instance_.load();
- }
- return instance_;
- }
-
- public WebServiceRuntime getRuntimeById( String id )
- {
- return (WebServiceRuntime)webServiceRuntimes.get( id );
- }
-
- public String[] getRuntimesByType(String typeId)
- {
- IConfigurationElement[] elems = getConfigurationElement(typeId);
- Vector runtimesVector = new Vector();
- String[] runtimeIds = new String[elems.length];
- for (int i=0; i<elems.length; i++)
- {
- IConfigurationElement elem = (IConfigurationElement)elems[i];
- runtimeIds[i] = elem.getAttribute("runtime");
- }
- return runtimeIds;
- }
-
- public boolean doesRuntimeSupportJ2EELevel(String j2eeVersionId, String runtimeId)
- {
- IWebServiceRuntime wsr = (IWebServiceRuntime)webServiceRuntimes.get(runtimeId);
- String[] j2eeVersions = wsr.getJ2EEVersions();
- if (j2eeVersions==null || j2eeVersions.length==0)
- return true;
-
- for(int i=0; i<j2eeVersions.length; i++)
- {
- if (j2eeVersions[i].equals(j2eeVersionId))
- {
- return true;
- }
- }
- return false;
- }
-
- public boolean doesRuntimeSupportServerTarget(String serverTargetId, String runtimeId)
- {
- //Vector serverFactoryIds = new Vector();
- Iterator it = webServiceClientTypes.values().iterator();
- while (it.hasNext()) {
- WebServiceServerRuntimeClientType wssrt = (WebServiceServerRuntimeClientType)it.next();
- if (wssrt.runtimeId_!=null) {
- if ((wssrt.runtimeId_).equalsIgnoreCase(runtimeId)) {
- WebServiceServer wss = (WebServiceServer)webServiceServers.get(wssrt.serverId_);
- String thisFactoryId = wss.getFactoryId();
- IServerType serverType = ServerCore.findServerType(thisFactoryId);
- if (serverType == null)
- continue;
-
- String thisServerTargetId = serverType.getRuntimeType().getId();
- if (thisServerTargetId.equals(serverTargetId))
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Returns the names of all registered <code>WebServiceClientType</code>
- * objects.
- * @return The names of all registered <code>WebServiceClientType</code>
- * objects.
- */
- public String[] getWebServiceClientTypeNames ()
- {
- return (String[])typeNames_.toArray( new String[0] );
- }
-
- public LabelsAndIds getClientTypeLabels()
- {
- LabelsAndIds labelIds = new LabelsAndIds();
- Iterator iterator = clientIdToLabel_.entrySet().iterator();
- int size = clientIdToLabel_.size();
- String[] labels = new String[size];
- String[] ids = new String[size];
- int index = 0;
-
- labelIds.setLabels_( labels );
- labelIds.setIds_( ids );
-
- while( iterator.hasNext() )
- {
- Map.Entry entry = (Map.Entry)iterator.next();
-
- ids[index] = (String)entry.getKey();
- labels[index] = (String)entry.getValue();
- index++;
- }
-
- return labelIds;
- }
-
- /**
- * Returns the IConfigurationElement given the server, runtime, and type attributes
- * The benefit of getting the IConfigurationElement is that the corresponding class
- * file and plugin are not loaded immediately.
- * @param server label
- * @param runtime label
- * @param type label
- * @return IConfiguration element
- */
- public IConfigurationElement getConfigurationElementFor(String serverId, String runtimeId, String typeId)
- {
- Iterator iter = webServiceClientTypes.values().iterator();
- while (iter.hasNext())
- {
- WebServiceServerRuntimeClientType wssrt = (WebServiceServerRuntimeClientType)iter.next();
- if (wssrt.hasConfigurationElementFor(serverId, runtimeId, typeId)) {
- return wssrt.element_;
- }
- }
- return null;
- }
-
- public IConfigurationElement getConfigElementFor(String factoryId, String runtimeId, String typeId)
- {
- Iterator iter = webServiceClientTypes.values().iterator();
- while (iter.hasNext())
- {
- WebServiceServerRuntimeClientType wssrt = (WebServiceServerRuntimeClientType)iter.next();
- if (wssrt.hasConfigElementFor(factoryId, runtimeId, typeId)) {
- return wssrt.element_;
- }
- }
- return null;
- }
-
- public String getClientExtensionIdFor(String serverId, String runtimeId, String typeId) {
- IConfigurationElement element = getConfigurationElementFor(serverId, runtimeId, typeId);
- return element.getAttribute("id");
- }
-
- public IConfigurationElement getConfigurationElementById(String id) {
-
- WebServiceServerRuntimeClientType wsrt = (WebServiceServerRuntimeClientType)webServiceClientTypes.get(id);
- return (IConfigurationElement)wsrt.element_;
-
- }
-
- public IConfigurationElement[] getConfigurationElement(String clientTypeId)
- {
- Vector v = new Vector();
- for (Iterator it = configElems_.iterator(); it.hasNext();)
- {
- IConfigurationElement element = (IConfigurationElement)it.next();
- String clientType = element.getAttribute("clientType");
- if (clientType != null && clientType.equals(clientTypeId))
- v.add(element);
- }
- return (IConfigurationElement[])v.toArray(new IConfigurationElement[0]);
- }
-
- public IConfigurationElement[] getConfigurationElement(String clientTypeId, String runtimeId)
- {
- Vector v = new Vector();
- for (Iterator it = configElems_.iterator(); it.hasNext();)
- {
- IConfigurationElement element = (IConfigurationElement)it.next();
- String clientType = element.getAttribute("clientType");
- String runtime = element.getAttribute("runtime");
- if (clientType != null && runtime != null && clientType.equals(clientTypeId) && runtime.equals(runtimeId))
- v.add(element);
- }
- return (IConfigurationElement[])v.toArray(new IConfigurationElement[0]);
- }
-
-
-
- public String getServerIdForFactoryId(String factoryId) {
-
- Iterator iter = webServiceServers.values().iterator();
- while (iter.hasNext()) {
- WebServiceServer wss = (WebServiceServer)iter.next();
- if (wss.getFactoryId().equals(factoryId)) {
- return wss.getId();
- }
- }
- return null;
-
- }
-
- public String getServerFactoryIdByServerLabel(String label) {
- Iterator iter = webServiceServers.values().iterator();
- while (iter.hasNext()) {
- WebServiceServer wss = (WebServiceServer)iter.next();
- if (wss.getLabel().equals(label)) {
- return wss.getFactoryId();
- }
- }
- return null;
- }
-
- public WebServiceRuntime getWebServiceRuntimeByName(String runtimeName) {
- Iterator iter = webServiceRuntimes.values().iterator();
- while (iter.hasNext()) {
- WebServiceRuntime wsr = (WebServiceRuntime)iter.next();
- if (wsr.getLabel().equals(runtimeName)) {
- return wsr;
- }
- }
- return null;
- }
-
- public WebServiceServer getWebServiceServerByFactoryId(String factoryId) {
- Iterator iter = webServiceServers.values().iterator();
- while (iter.hasNext()) {
- WebServiceServer wss = (WebServiceServer)iter.next();
- if (wss.getFactoryId().equals(factoryId)) {
- return wss;
- }
- }
- return null;
- }
-
- public String getServerInstanceLabelFromInstanceId( String instanceId )
- {
- IServer server = ServerCore.findServer( instanceId );
-
- return server.getName();
- }
-
- public String[] getAllClientServerFactoryIds() {
- String[] serverFactoryIds = new String[webServiceServers.size()];
- int i=0;
- Iterator iter = webServiceServers.values().iterator();
- while (iter.hasNext()) {
- WebServiceServer wss = (WebServiceServer)iter.next();
- if (wss.getFactoryId()!=null) {
- serverFactoryIds[i]=wss.getFactoryId();
- i++;
- }
- }
- return serverFactoryIds;
- }
-
- public String[] getAllClientRuntimes() {
- String[] runtimes = new String[webServiceRuntimes.size()];
- int i=0;
- Iterator iter = webServiceRuntimes.values().iterator();
- while (iter.hasNext()) {
- WebServiceRuntime wsr = (WebServiceRuntime)iter.next();
- if (wsr.getId() != null) {
- runtimes[i]=wsr.getId();
- i++;
- }
- }
- return runtimes;
- }
-
- public String getRuntimeLabelById(String runtimeId) {
- WebServiceRuntime wsRuntime = (WebServiceRuntime)webServiceRuntimes.get(runtimeId);
- if (wsRuntime!=null) {
- return wsRuntime.getLabel();
- }
- return null;
- }
-
- public String getClientTypeIdByName(String name) {
- return (String)clientTypeAndIds_.get(name);
- }
-
- public IWebServiceRuntime getWebServiceRuntimeById(String runtimeId)
- {
- return (IWebServiceRuntime)webServiceRuntimes.get(runtimeId);
- }
-
-
- /**
- * Gets the runtime IDs of all web service server runtime type
- * with an server factory ID equals to the input
- * @param server factory ID
- * @return array of runtime IDs
- */
- public String[] getRuntimeIdsByServerFactoryId(String serverFactoryID) {
- Vector runtimeIds = new Vector();
- Iterator it = webServiceClientTypes.values().iterator();
- while (it.hasNext()) {
- WebServiceServerRuntimeClientType wssrt = (WebServiceServerRuntimeClientType)it.next();
- if (wssrt.serverId_!=null) {
- String serverId = wssrt.serverId_;
- WebServiceServer wss = (WebServiceServer)webServiceServers.get(serverId);
- String wssfId = wss.getFactoryId();
- if (wssfId.equals(serverFactoryID))
- runtimeIds.add(wssrt.runtimeId_);
- /*
- String wssFactoryId = ((WebServiceServer)webServiceServers.get(wssrt.serverId_)).getFactoryId();
- if (wssFactoryId.equalsIgnoreCase(serverFactoryID)) {
- runtimeIds.add(wssrt.runtimeId_);
- }
- */
- }
- }
- return (String[])runtimeIds.toArray(new String[0]);
- }
-
- public String[] getServerFactoryIdsByClientType(String clientTypeName) {
-
- Vector factoryIds = new Vector();
- String clientTypeId = getClientTypeIdByName(clientTypeName);
- Iterator iter = webServiceClientTypes.values().iterator();
- while (iter.hasNext())
- {
- WebServiceServerRuntimeClientType wssrt = (WebServiceServerRuntimeClientType)iter.next();
- if ((wssrt.typeId_).equalsIgnoreCase(clientTypeId)) {
- WebServiceServer wss = (WebServiceServer)webServiceServers.get(wssrt.serverId_);
- factoryIds.add(wss.getFactoryId());
- }
-
- }
- return (String[])factoryIds.toArray(new String[0]);
-
- }
-
- /**
- * Gets the server factoryIds of all web service server runtime type
- * with an runtime Id equals to the input
- * @param runtime Id
- * @return array of factory Ids
- */
- public String[] getServerFactoryIdsByRuntimeId(String runtimeID) {
- Vector serverFactoryIds = new Vector();
- Iterator it = webServiceClientTypes.values().iterator();
- while (it.hasNext()) {
- WebServiceServerRuntimeClientType wssrt = (WebServiceServerRuntimeClientType)it.next();
- if (wssrt.runtimeId_!=null) {
- if ((wssrt.runtimeId_).equalsIgnoreCase(runtimeID)) {
- WebServiceServer wss = (WebServiceServer)webServiceServers.get(wssrt.serverId_);
- serverFactoryIds.add(wss.getFactoryId());
- }
- }
- }
- return (String[])serverFactoryIds.toArray(new String[0]);
- }
-
- public boolean webServiceClientRuntimeTypeExists(String serverId, String runtimeId, String typeId) {
- if (getConfigurationElementFor(serverId, runtimeId, typeId)==null)
- return false;
- return true;
-
- }
-
- public String[] getServerFactoryIdsByType(String clientTypeId)
- {
- String clientTypeName = (String)clientIdToLabel_.get(clientTypeId);
- return getServerFactoryIdsByClientType(clientTypeName);
- }
-
- public boolean isServerSupportedForChosenType(String clientTypeId, String serverFactoryID)
- {
- String[] supportedServerFactoryIds = getServerFactoryIdsByType(clientTypeId);
- if (supportedServerFactoryIds!=null && supportedServerFactoryIds.length>0)
- {
- for (int i=0; i<supportedServerFactoryIds.length; i++)
- {
- if (supportedServerFactoryIds[i].equals(serverFactoryID))
- return true;
- }
- }
- return false;
- }
-
- /**
- * WebServiceServerRuntimeClientType is the cached metadata including the IConfiguration
- */
- public final class WebServiceServerRuntimeClientType
- {
-
- private String typeId_ = null;
- private String serverId_ = null;
- private String runtimeId_ = null;
- private IConfigurationElement element_;
- private boolean requiresServerRuntime_ = false;
- private String label_;
-
- protected WebServiceServerRuntimeClientType(String serverId, String runtimeId,String typeId, String label, IConfigurationElement elem)
- {
- typeId_ = new String(typeId.trim());
- if (serverId!=null)
- serverId_ = new String(serverId.trim());
- if (runtimeId!=null)
- runtimeId_ = new String(runtimeId.trim());
- element_ = elem;
- if (serverId_!=null && runtimeId_!=null) {
- requiresServerRuntime_ = true;
- }
-
- label_ = label;
- }
-
- public boolean hasConfigurationElementFor(String serverID, String runtimeID, String typeID) {
- if (typeId_.equalsIgnoreCase(typeID) && !requiresServerRuntime_)
- return true;
-
- if (requiresServerRuntime_) {
- if (typeId_.equalsIgnoreCase(typeID) &&
- serverId_.equalsIgnoreCase(serverID) &&
- runtimeId_.equalsIgnoreCase(runtimeID))
- return true;
- }
- return false;
- }
-
- public boolean hasConfigElementFor(String factoryID, String runtimeID, String typeID) {
- if (typeId_.equalsIgnoreCase(typeID) && !requiresServerRuntime_)
- return true;
-
- if (requiresServerRuntime_)
- {
- String serverID = getServerIdForFactoryId( factoryID );
-
- if (typeId_.equalsIgnoreCase(typeID) &&
- serverId_.equalsIgnoreCase(serverID) &&
- runtimeId_.equalsIgnoreCase(runtimeID))
- return true;
- }
- return false;
- }
-
- public IConfigurationElement getClientTypeConfigurationElementFor(String serverID, String runtimeID, String typeID)
- {
- if (this.typeId_.equalsIgnoreCase(typeID) && serverID==null && runtimeID==null)
- return this.element_;
-
- if (this.typeId_.equalsIgnoreCase(typeID) &&
- this.serverId_.equalsIgnoreCase(serverID) &&
- this.runtimeId_.equalsIgnoreCase(runtimeID))
- return this.element_;
- return null;
- }
- }
-
- public CommandFragmentFactoryFactory getFactoryFactory( String[] ids )
- {
- String hashKey = ids[2] + "#" + ids[1] + "#" + ids[0];
- CommandWidgetBinding binding = (CommandWidgetBinding)factoryCache_.get( hashKey );
-
- if( binding == null )
- {
- IConfigurationElement element = getConfigElementFor( ids[2], ids[1], ids[0] );
-
- if( element == null ) return null;
-
- binding = createBinding( element );
-
- factoryCache_.put( hashKey, binding );
-
- binding.registerDataMappings( dataMappingRegistry_ );
-
- if( widgetRegistry_ != null )
- {
- binding.registerWidgetMappings( widgetRegistry_ );
- binding.registerCanFinish( canFinishRegistry_ );
- }
- }
-
- return binding;
- }
-
- private CommandWidgetBinding createBinding(IConfigurationElement element )
- {
- Vector bindings = new Vector(4);
- Vector fragments = new Vector(4);
-
- addBinding( element, "developBinding", bindings );
- addBinding( element, "assemblyBinding", bindings );
- addBinding( element, "deployBinding", bindings );
- addBinding( element, "installBinding", bindings );
-
- fragments.add( new ClientPreDevelopFragment() );
- fragments.add( new ClientPreAssemblyFragment() );
- fragments.add( new ClientPreDeployFragment() );
- fragments.add( new ClientPreInstallFragment() );
-
- return new CommandWidgetBindingList( bindings, fragments );
- }
-
- private void addBinding( IConfigurationElement element, String bindingName, Vector list )
- {
- Object binding = null;
-
- if( element.getAttribute( bindingName ) != null )
- {
- try
- {
- binding = element.createExecutableExtension( bindingName );
- }
- catch( CoreException exc )
- {
- }
- }
-
- list.add( binding );
- }
-
- public void setDataMappingRegistry( DataMappingRegistry registry )
- {
- dataMappingRegistry_ = registry;
-
- // We need to rebuild the factory cache each time we start the client
- // wizard.
- factoryCache_ = new HashMap();
- }
-
- public void setWidgetRegistry( WidgetRegistry registry )
- {
- widgetRegistry_ = registry;;
- }
-
- public void setCanFinishRegistry( CanFinishRegistry registry )
- {
- canFinishRegistry_ = registry;
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceInfo.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceInfo.java
deleted file mode 100644
index 64bc552..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceInfo.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-
-/**
-* This type is used to hold user or calculated
-* data to be use by finsih tasks
-*/
-public interface WebServiceInfo
-{
-
-}
-
-
-
-
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceRuntime.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceRuntime.java
deleted file mode 100644
index 3b9eef6..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceRuntime.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-
-
-/**
-* This is the interface for objects that represent a kind of
-* Web Service artifact.
-*/
-public class WebServiceRuntime implements IWebServiceRuntime
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private IConfigurationElement element_;
- public String runtimeId_;
- public String runtimeLabel_;
- public String runtimeDescription_;
- public String[] j2eeVersions;
-
-
- public WebServiceRuntime(IConfigurationElement elem)
- {
- super();
- this.element_ = elem;
- }
-
- /**
- * Returns the id of this Web Service runtime.
- * @return id of this Web Service runtime.
- */
- public String getId ()
- {
- if (runtimeId_ == null)
- runtimeId_ = element_.getAttribute("id");
- return runtimeId_;
- }
-
-
- /**
- * Returns a locale specific description of this Web Service runtime.
- * @return A locale specific description of this Web Service runtime.
- */
- public String getDescription ()
- {
- if (runtimeDescription_ == null)
- runtimeDescription_ = element_.getAttribute("description");
- return runtimeDescription_;
- }
-
- /**
- * Returns a short, locale specific Label of this Web Service runtime.
- * @return A short, locale specific Label of this Web Service runtime.
- */
- public String getLabel ()
- {
- if (runtimeLabel_==null)
- runtimeLabel_ = WebServiceConsumptionUIPlugin.getMessage((String)element_.getAttribute("label"));
- return runtimeLabel_;
- }
-
- /**
- * Returns a True if this runtime has been set as default
- * @return a boolean
- */
- public boolean getIsDefault()
- {
- return Boolean.valueOf(element_.getAttribute("isDefault")).booleanValue();
- }
-
- /**
- * Returns a String, J2EE version
- * @return
- */
- public String[] getJ2EEVersions()
- {
- if (j2eeVersions == null)
- {
- String attr = element_.getAttribute("j2eeversion");
- if (attr != null)
- {
- StringTokenizer st = new StringTokenizer(attr, " ");
- int size = st.countTokens();
- j2eeVersions = new String[size];
- for (int i = 0; i < j2eeVersions.length; i++)
- j2eeVersions[i] = st.nextToken();
- }
- }
- return j2eeVersions;
- }
-
- /**
- * Returns the configuration element associated with
- * this runtime.
- *
- * @return org.eclipse.core.runtime.IConfigurationElement
- */
- public IConfigurationElement getConfigurationElement()
- {
- return element_;
- }
-
-}
-
-
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceServer.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceServer.java
deleted file mode 100644
index b42e47a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceServer.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.ui.ServerUICore;
-
-/**
-* This is the interface for objects that represent a kind of
-* Web Service artifact. The primary purpose of a WebServiceType
-* object is to manufacture the wizard pages that support the type.
-*/
-public class WebServiceServer implements IWebServiceServer
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- public IConfigurationElement element_;
- public String serverId_;
- public String factoryId_;
- public String serverLabel_;
-
- public WebServiceServer(IConfigurationElement elem)
- {
- super();
- this.element_ = elem;
- }
- /**
- * Returns the id of this Web Service type.
- * @return id of this Web Service type.
- */
- public String getId ()
- {
- if (serverId_==null)
- serverId_ = element_.getAttribute("id");
- return serverId_;
- }
- /**
- * Returns a short, locale specific name of this Web Service type.
- * @return A short, locale specific name of this Web Service type.
- */
- public String getFactoryId ()
- {
- if (factoryId_==null)
- factoryId_ = element_.getAttribute("factoryId");
- return factoryId_;
- }
-
- /**
- * Returns a short, locale specific name of this Web Service type.
- * @return A short, locale specific name of this Web Service type.
- */
- public String getLabel ()
- {
- if (serverLabel_ == null)
- {
- IServerType serverType = ServerCore.findServerType(getFactoryId());
- serverLabel_ = ServerUICore.getLabelProvider().getText(serverType);
- }
- return serverLabel_;
- }
-
- /**
- * Returns a True if this server has been set as default
- * @return a boolean
- */
- public boolean getIsDefault()
- {
-
- return Boolean.valueOf(element_.getAttribute("isDefault")).booleanValue();
- }
-
- /**
- * Returns runtime target Id
- * @return String
- */
- public String getRuntimeTypeId()
- {
- return element_.getAttribute("runtimeTypeIds");
- }
-
- /**
- * Returns the configuration element associated with
- * this type.
- *
- * @return org.eclipse.core.runtime.IConfigurationElement
- */
- public IConfigurationElement getConfigurationElement()
- {
- return this.element_;
- }
-
- }
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceServerRuntimeType.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceServerRuntimeType.java
deleted file mode 100644
index df6e1d7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceServerRuntimeType.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-
-/**
-* This is the interface for objects that represent a kind of
-* Web Service-Server-Runtime artifact. The primary purpose of a WebServiceServerRuntimeType
-* object is to manufacture the wizard pages that support the type, server, and runtime configuration.
-*/
-public interface WebServiceServerRuntimeType
-{
- /**
- * Returns a short, locale specific name of this Web Service Server-Runtime type.
- * @return A short, locale specific name of this Web Service Server-Runtime type.
- */
- public String getName ();
-
- /**
- * Returns a locale specific description of this Web Service Server-Runtime type.
- * @return A locale specific description of this Web Service Server-Runtime type.
- */
- public String getDescription ();
-
- /**
- * Returns a label for the Server supported by this Web Service Server-Runtime type
- * @return A server label from server plugins
- */
- public String getServerLabel();
-
- /**
- * Sets a label for the Server supported by this Web Service Server-Runtime type
- * @param A server label from server plugins
- */
- public void setServerLabel(String serverLabel);
-
- /**
- * Returns a label for the deployment runtime of this Web Service Server-Runtime type
- * @return A label for the deployment runtime
- */
- public String getRuntimeLabel();
-
- /**
- * Sets a label for the deployment runtime of this Web Service Server-Runtime type
- * @param A label for the deployment runtime
- */
- public void setRuntimeLabel(String runtimeLabel);
-
- /**
- * Returns a label for the Web Service type associated with this WebServiceServerRuntimeType
- * @return A label for the Web Service type
- */
- public String getWebServiceTypeLabel();
-
- /**
- * Returns whether or not a Web Module is required for this WebServiceServerRuntimeType
- * @return true if requireWebModule
- */
- public boolean isWebModuleRequired();
-
- /**
- * Sets the boolean value at runtime according to requireWebModule attribute from the manifest file
- * @param requireWebModule
- */
- public void setWebModuleRequired(boolean requireWebModule);
-
- /**
- * Returns whether or not an EJB Module is required for this WebServiceServerRuntimeType
- * @return true is requireEJBModule is true
- */
- public boolean isEJBModuleRequired();
-
- /**
- * Sets the boolean value at runtime according to requireEJBModule attribute from the manifest file
- * @param requireEJBModule
- */
- public void setEJBModuleRequired(boolean requireEJBModule);
-}
-
-
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceServerRuntimeTypeRegistry.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceServerRuntimeTypeRegistry.java
deleted file mode 100644
index a8ed3b4..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceServerRuntimeTypeRegistry.java
+++ /dev/null
@@ -1,1222 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.internal.project.IEJBNatureConstants;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.fragments.ServicePreAssemblyFragment;
-import org.eclipse.jst.ws.internal.consumption.fragments.ServicePreDeployFragment;
-import org.eclipse.jst.ws.internal.consumption.fragments.ServicePreDevelopFragment;
-import org.eclipse.jst.ws.internal.consumption.fragments.ServicePreInstallFragment;
-import org.eclipse.jst.ws.internal.data.LabelsAndIds;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactoryFactory;
-import org.eclipse.wst.command.env.core.registry.CommandRegistry;
-import org.eclipse.wst.command.env.core.selection.SelectionList;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-import org.eclipse.wst.command.internal.env.ui.widgets.CommandWidgetBindingList;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.ServerCore;
-
-public class WebServiceServerRuntimeTypeRegistry implements CommandRegistry
-{
-
- private static WebServiceServerRuntimeTypeRegistry instance_;
-
- private IConfigurationElement[] indexedConfigElems_;
-
- private HashMap webServiceServers;
- private HashMap webServiceRuntimes;
- private HashMap webServiceTypes;
- private HashMap webServiceServerRuntimeTypes;
-
- private Hashtable runtimesByType_;
- private Hashtable runtimeLabelById_;
- private Hashtable runtimeIdByLabel_;
- private Hashtable serversByType_;
- private Hashtable serverLabelByFactoryId_;
- private Hashtable serverFactoryIdByLabel_;
-
- private Hashtable configElemsById_;
-
- private DataMappingRegistry dataMappingRegistry_;
- private WidgetRegistry widgetRegistry_;
- private CanFinishRegistry canFinishRegistry_;
- private HashMap factoryCache_;
-
- private SelectionListChoices serverToRuntimeToJ2EE_;
- private Log log_;
-
- public WebServiceServerRuntimeTypeRegistry() {
- log_ = new EclipseLog();
- }
- //
- // Loads WebServiceServerRuntimeType objects into this registry.
- // This is done by querying the plugin registry for all extensions
- // hanging on the WebServiceServerRuntimeType extension point. Extensions
- // must implement the org.eclipse.jst.ws.ui.wizard.WebServiceServerRuntimeType
- // interface.
- //
- private void loadTypes ()
- {
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] config = reg.getConfigurationElementsFor(
- "org.eclipse.jst.ws.consumption.ui",
- "webServiceServerRuntimeType");
-
- for(int idx=0; idx<config.length; idx++)
- {
- IConfigurationElement elem = config[idx];
- try
- {
- if (elem.getName().equals("webServiceServer"))
- {
- WebServiceServer wss = new WebServiceServer(elem);
- webServiceServers.put(elem.getAttribute("id"), wss);
- //System.out.println("WSSRT - Server ID = "+ elem.getAttribute("id"));
- String serverLabel = wss.getLabel();
- if (serverLabel != null && serverLabel.length()>0)
- {
- if (!serverLabelByFactoryId_.containsKey(wss.getFactoryId()));
- serverLabelByFactoryId_.put(wss.getFactoryId(), serverLabel);
- if (!serverFactoryIdByLabel_.containsKey(serverLabel));
- serverFactoryIdByLabel_.put(serverLabel, wss.getFactoryId());
- }
-
- }
- else if (elem.getName().equals("webServiceRuntime"))
- {
- WebServiceRuntime rt = new WebServiceRuntime(elem);
- webServiceRuntimes.put(elem.getAttribute("id"), rt);
- if(!runtimeLabelById_.containsKey(rt.getId()))
- runtimeLabelById_.put(rt.getId(), rt.getLabel());
- if(!runtimeIdByLabel_.containsKey(rt.getLabel()))
- runtimeIdByLabel_.put(rt.getLabel(), rt.getId());
-
- }
- else if (elem.getName().equals("webServiceType"))
- {
- WebServiceTypeImpl wst = new WebServiceTypeImpl(elem);
- webServiceTypes.put(elem.getAttribute("id"), wst);
- }
- else if (elem.getName().equals("webServiceServerRuntimeType"))
- {
- configElemsById_.put(elem.getAttribute("id"), elem);
-
- String typeId = elem.getAttribute("type");
- String serverId = elem.getAttribute("server");
- String runtimeId = elem.getAttribute("runtime");
-// System.out.println("Adding serverid = "+serverId);
- WebServiceServerRuntimeType_ wssrt = new WebServiceServerRuntimeType_(serverId, runtimeId, typeId, elem);
- webServiceServerRuntimeTypes.put(elem.getAttribute("id"), wssrt);
-
- setRuntimesByType(typeId,runtimeId);
- setServersByType(typeId, serverId);
-
- }
-
- }
- catch (Exception e)
- {
- log_.log(Log.ERROR, 5058, this, "loadTypes", e);
- }
-
- }
- }
-
-
- /**
- * Sets the Web service runtimes and type from each extension
- * in a Hashtable. The type is the key, and value is a Vector containing
- * each runtime supported in that Web service type.
- * @param runtime name
- * @param type name
- */
- private void setRuntimesByType(String typeId, String runtime)
- {
- if(runtimesByType_.get(typeId)!=null)
- {
- Vector v = (Vector)runtimesByType_.get(typeId);
- if (!v.contains(runtime.trim())) {
- v.add(runtime.trim());
- }
- }
- else
- {
- Vector vect = new Vector();
- vect.add(runtime.trim());
- runtimesByType_.put(typeId,vect);
- }
- }
-
- public WebServiceRuntime getRuntimeById( String id )
- {
- return (WebServiceRuntime)webServiceRuntimes.get( id );
- }
-
- /**
- * Gets the Web sevice runtimes vector given a type
- * @param Web service type
- * @return array of runtime labels
- */
- public String[] getRuntimesByType(String webServiceType)
- {
- String[] runtimes;
- if (runtimesByType_.containsKey(webServiceType))
- {
- Vector vect =(Vector)runtimesByType_.get(webServiceType);
- runtimes = new String[vect.size()];
- for (int i=0; i<vect.size(); i++)
- {
- String runtimeId = (String)vect.elementAt(i);
- WebServiceRuntime wsr = (WebServiceRuntime)webServiceRuntimes.get(runtimeId);
- if (wsr!=null) {
- runtimes[i] = (String)wsr.getId();
- }
- }
- return runtimes;
-
- }
- else
- {
- log_.log(Log.ERROR, 5059, this, "getRuntimesByType", "runtimes not found for Web service type "+webServiceType);
- return null;
- }
-
- }
-
- public boolean isRuntimeSupportedForType(String webServiceTypeId, String runtimeId)
- {
- String[] runtimes = getRuntimesByType(webServiceTypeId);
- for(int i=0;i<runtimes.length;i++)
- {
- if (runtimes[i].equals(runtimeId))
- return true;
- }
- return false;
- }
-
- public boolean doesRuntimeSupportJ2EELevel(String j2eeVersionId, String runtimeId)
- {
- IWebServiceRuntime wsr = (IWebServiceRuntime)webServiceRuntimes.get(runtimeId);
- String[] j2eeVersions = wsr.getJ2EEVersions();
- if (j2eeVersions==null || j2eeVersions.length==0)
- return true;
-
- for(int i=0; i<j2eeVersions.length; i++)
- {
- if (j2eeVersions[i].equals(j2eeVersionId))
- {
- return true;
- }
- }
- return false;
- }
-
- public boolean doesRuntimeSupportServerTarget(String serverTargetId, String runtimeId)
- {
- Iterator it = webServiceServerRuntimeTypes.values().iterator();
- while (it.hasNext())
- {
- WebServiceServerRuntimeType_ wssrt = (WebServiceServerRuntimeType_)it.next();
- if (wssrt!=null) {
- if (wssrt.runtimeId_.equals(runtimeId))
- {
- IWebServiceServer wsserver = getWebServiceServerById(wssrt.serverId_);
- String thisFactoryId = wsserver.getFactoryId();
- IServerType serverType = ServerCore.findServerType(thisFactoryId);
- if (serverType == null)
- continue;
-
- String thisServerTargetId = serverType.getRuntimeType().getId();
- if (thisServerTargetId.equals(serverTargetId))
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Gets the server factoryIDs of all web service server runtime type
- * with an runtime ID equals to the input
- * @param runtime ID
- * @return array of factory IDs
- */
- public String[] getServerFactoryIDByRuntimeID(String runtimeID) {
- Vector v = new Vector();
- Iterator it = webServiceServerRuntimeTypes.values().iterator();
- while (it.hasNext()) {
- WebServiceServerRuntimeType_ wssrt = (WebServiceServerRuntimeType_)it.next();
- if (wssrt!=null) {
- if (wssrt.runtimeId_.equals(runtimeID))
- v.add(getWebServiceServerById(wssrt.serverId_).getFactoryId());
-
- }
- }
- String[] serverFactoryIDs = new String[v.size()];
- for (int i = 0; i < v.size(); i++) {
- serverFactoryIDs[i] = (String)v.get(i);
- }
- return serverFactoryIDs;
- }
-
- /**
- * Gets the runtime IDs of all web service server runtime type
- * with an server factory ID equals to the input
- * @param server factory ID
- * @return array of runtime IDs
- */
- public String[] getRuntimeIDsByServerFactoryID(String serverFactoryID) {
- Vector v = new Vector();
- Iterator it = webServiceServerRuntimeTypes.values().iterator();
- while (it.hasNext()) {
- WebServiceServerRuntimeType_ wssrt = (WebServiceServerRuntimeType_)it.next();
- if (wssrt!=null) {
- IWebServiceServer wss = getWebServiceServerById(wssrt.serverId_);
- String wssfId = wss.getFactoryId();
- if (wssfId.equals(serverFactoryID))
- {
- if (!v.contains(wssrt.runtimeId_))
- {
- v.add(wssrt.runtimeId_);
- }
- }
- /*if (getWebServiceServerById(wssrt.serverId_).getFactoryId().equals(serverFactoryID))
- v.add(getWebServiceRuntimeById(wssrt.runtimeId_).getId());*/
- }
- }
- String[] runtimeIDs = new String[v.size()];
- for (int i = 0; i < v.size(); i++) {
- runtimeIDs[i] = (String)v.get(i);
- }
- return runtimeIDs;
- }
-
- /**
- * Sets the Web service servers and type from each extension
- * in a Hashtable. The type is the key, and value is a Vector containing
- * each runtime supported in that Web service type.
- * @param server name
- * @param type name
- */
- private void setServersByType(String typeId, String server)
- {
- if(serversByType_.get(typeId)!=null)
- {
- Vector v = (Vector)serversByType_.get(typeId);
- if (!v.contains(server.trim()))
- {
- v.add(server.trim());
- }
- }
- else
- {
- Vector vect = new Vector();
- vect.add(server.trim());
- serversByType_.put(typeId, vect);
- }
-
- }
-
- /**
- * Gets the Web service servers vector given a type
- * @param Web service type
- * @return array of server factory Ids
- */
- public String[] getServerFactoryIdsByType(String webServiceType)
- {
- String[] servers;
- if (serversByType_.containsKey(webServiceType))
- {
- Vector vect = (Vector)serversByType_.get(webServiceType);
- servers = new String[vect.size()];
- for (int i=0; i<vect.size(); i++)
- {
- String serverId = (String)vect.elementAt(i);
- WebServiceServer wss = (WebServiceServer)webServiceServers.get(serverId);
- if (wss!=null) {
- servers[i] = (String)wss.getFactoryId(); //Note: returning server factory Ids
- }
- }
- return servers;
- }
- else
- {
- log_.log(Log.ERROR, 5060, this, "getServerByType", "Web service server not found for Web service type "+webServiceType);
- return null;
- }
-
- }
-
- public IWebServiceRuntime getWebServiceRuntimeByLabel(String runtimeLabel)
- {
- Iterator iter = webServiceRuntimes.values().iterator();
- while (iter.hasNext())
- {
- WebServiceRuntime wsr = (WebServiceRuntime)iter.next();
- if (wsr!=null) {
- if (runtimeLabel.equals(wsr.getLabel()))
- return wsr;
- }
- }
- return null;
- }
-
- public IWebServiceRuntime getWebServiceRuntimeById(String runtimeId)
- {
- return (IWebServiceRuntime)webServiceRuntimes.get(runtimeId);
- }
-
- public IWebServiceServer getWebServiceServerByFactoryId(String serverFactoryId)
- {
- if (serverFactoryId==null)
- return null;
-
- Iterator iter = webServiceServers.values().iterator();
- while (iter.hasNext())
- {
- WebServiceServer wss = (WebServiceServer)iter.next();
- if (wss!=null && wss.getFactoryId()!=null) {
- if (serverFactoryId.equals(wss.getFactoryId())) {
- return wss;
- }
- }
- }
- return null;
-
- }
-
- public IWebServiceServer getWebServiceServerByLabel(String serverLabel)
- {
- if (serverLabel==null)
- return null;
-
- Iterator iter = webServiceServers.values().iterator();
- while (iter.hasNext())
- {
- WebServiceServer wss = (WebServiceServer)iter.next();
- if (wss!=null) {
- if (serverLabel.equals(wss.getLabel()))
- return wss;
- }
- }
- return null;
-
- }
-
- public IWebServiceServer getWebServiceServerById(String serverId)
- {
- return (IWebServiceServer)webServiceServers.get(serverId);
- }
-
- public IWebServiceType getWebServiceTypeByLabel(String typeLabel)
- {
- Iterator iter = webServiceTypes.values().iterator();
- while (iter.hasNext())
- {
- WebServiceTypeImpl wst = (WebServiceTypeImpl)iter.next();
- if (wst!=null) {
- if (typeLabel.equals(wst.getLabel()))
- return wst;
- }
- }
- return null;
- }
-
- public IWebServiceType getWebServiceTypeById(String typeId)
- {
- if (webServiceTypes.get(typeId)!= null)
- return (WebServiceTypeImpl)webServiceTypes.get(typeId);
- return null;
- }
-
- /*
- * Returns true if an EJB project is needed to host a Web service
- * of the type identified by typeId. If multiple natureIds are specified in the
- * "includeNatures" attribute, only the first one is checked. If no natureIds are specified,
- * false is returned.
- */
- public boolean requiresEJBProject(String typeId)
- {
- IWebServiceType wst = WebServiceServerRuntimeTypeRegistry.getInstance().getWebServiceTypeById(typeId);
- if (wst != null)
- {
- IConfigurationElement elem = wst.getConfigurationElement();
- String includedNatures = elem.getAttribute("includeNatures");
- if (includedNatures==null || includedNatures.length()==0)
- {
- return false;
- }
- else
- {
- StringTokenizer st = new StringTokenizer(includedNatures);
- if(st.hasMoreTokens())
- {
- String firstIncludedNature = st.nextToken();
- if (firstIncludedNature.equals(IEJBNatureConstants.NATURE_ID))
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Returns a list of valid projects for the Web service type with an id of typeId.
- * In the case where the Web service type extension does not specify which project
- * natures are included, a array of all Web and EJB projects in the workspace will
- * be returned.
- * @param typeId
- * @return IProject[] an array of valid projects
- */
- public IProject[] getProjectsByWebServiceType(String typeId)
- {
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- ArrayList validProjects = new ArrayList();
- IWebServiceType wst = WebServiceServerRuntimeTypeRegistry.getInstance().getWebServiceTypeById(typeId);
- if (wst != null)
- {
- IConfigurationElement elem = wst.getConfigurationElement();
- String includedNatures = elem.getAttribute("includeNatures");
- String excludedNatures = elem.getAttribute("excludeNatures");
- if (includedNatures!=null && includedNatures.length()>0)
- {
- for (int i = 0; i < projects.length; i++)
- {
- if (include(projects[i], includedNatures) && exclude(projects[i], excludedNatures))
- validProjects.add(projects[i]);
- }
- return (IProject[])validProjects.toArray(new IProject[0]);
- }
- }
-
- //If wst was null or the extension didn't specify which project natures are
- // to be included, revert to the old behaviour
- for (int j = 0; j < projects.length; j++)
- {
- if (ResourceUtils.isWebProject(projects[j]) || ResourceUtils.isEJBProject(projects[j]))
- validProjects.add(projects[j]);
- }
- return (IProject[])validProjects.toArray(new IProject[0]);
- }
-
- private boolean include(IProject project, String include)
- {
- StringTokenizer st = new StringTokenizer(include);
- while(st.hasMoreTokens())
- {
- try
- {
- if (project.hasNature(st.nextToken()))
- return true;
- }
- catch (CoreException ce)
- {
- }
- }
- return false;
- }
-
- private boolean exclude(IProject project, String exclude)
- {
- StringTokenizer st = new StringTokenizer(exclude);
- while(st.hasMoreTokens())
- {
- try
- {
- if (project.hasNature(st.nextToken()))
- return false;
- }
- catch (CoreException ce)
- {
- }
- }
- return true;
- }
-
- //
- // Loads WebServiceServerRuntimeType objects into this registry.
- // See method getInstance().
- //
- private void load ()
- {
- runtimesByType_ = new Hashtable();
- serversByType_ = new Hashtable();
- configElemsById_ = new Hashtable();
- runtimeIdByLabel_ = new Hashtable();
- runtimeLabelById_ = new Hashtable();
- serverFactoryIdByLabel_ = new Hashtable();
- serverLabelByFactoryId_ = new Hashtable();
-
- webServiceServers = new HashMap();
- webServiceRuntimes = new HashMap();
- webServiceTypes = new HashMap();
-
- webServiceServerRuntimeTypes = new HashMap();
-
- loadTypes();
- }
-
- /**
- * Returns a singleton instance of this class.
- * @return A singleton WebServiceServerRuntimeTypeRegistry object.
- */
- public static WebServiceServerRuntimeTypeRegistry getInstance ()
- {
- if (instance_ == null)
- {
- instance_ = new WebServiceServerRuntimeTypeRegistry();
- instance_.load();
- }
- return instance_;
- }
-
- /**
- * Returns the Web Service type names of all registered <code>WebServiceServerRuntimeType</code>
- * objects.
- * @return The Web Service type names of all registered <code>WebServiceServerRuntimeType</code>
- * objects.
- */
- public String[] getWebServiceTypeNames()
- {
-
- String[] types = new String[webServiceTypes.size()];
-
- int i=0;
- Iterator iter = webServiceTypes.values().iterator();
- while (iter.hasNext())
- {
- WebServiceTypeImpl wst = (WebServiceTypeImpl)iter.next();
- if (wst!=null) {
- types[i] = wst.getLabel();
- i++;
- }
- }
- return types;
- }
-
- public LabelsAndIds getServiceTypeLabels()
- {
- LabelsAndIds labelIds = new LabelsAndIds();
- Iterator iterator = webServiceTypes.values().iterator();
- int size = webServiceTypes.size();
- String[] labels = new String[size];
- String[] ids = new String[size];
- int index = 0;
-
- labelIds.setLabels_( labels );
- labelIds.setIds_( ids );
-
- while( iterator.hasNext() )
- {
- WebServiceTypeImpl type = (WebServiceTypeImpl)iterator.next();
-
- ids[index] = type.getId();
- labels[index] = type.getLabel();
- index++;
- }
-
- return labelIds;
- }
-
- /**
- * Returns the IConfigurationElement given the server, runtime, and type attributes
- * The benefit of getting the IConfigurationElement is that the corresponding class
- * file and plugin are not loaded immediately.
- * @param server label
- * @param runtime label
- * @param type label
- * @return IConfiguration element
- */
- public IConfigurationElement getConfigurationElementFor(String serverId, String runtimeId, String typeId)
- {
- if (serverId==null || runtimeId==null || typeId==null)
- return null;
- Iterator iter = webServiceServerRuntimeTypes.values().iterator();
- while (iter.hasNext())
- {
- WebServiceServerRuntimeType_ wssrt = (WebServiceServerRuntimeType_)iter.next();
- if (wssrt!=null ) {
- if (wssrt.getConfigurationElementFor(serverId, runtimeId, typeId)!=null)
- return wssrt.getConfigurationElementFor(serverId, runtimeId,typeId);
- }
- }
- return null;
- }
-
- public IConfigurationElement getConfigElementFor(String factoryId, String runtimeId, String typeId)
- {
- Iterator iter = webServiceServerRuntimeTypes.values().iterator();
- while (iter.hasNext())
- {
- WebServiceServerRuntimeType_ wssrt = (WebServiceServerRuntimeType_)iter.next();
- if (wssrt.hasConfigElementFor(factoryId, runtimeId, typeId)) {
- return wssrt.element_;
- }
- }
- return null;
- }
-
- public boolean requiresWebModuleFor(String server, String runtime, String type)
- {
- IConfigurationElement elem = getConfigurationElementFor(server, runtime, type);
- if (elem==null)
- {
- return false; // report error here instead
- }
- return Boolean.valueOf(elem.getAttribute("requireWebModule")).booleanValue();
- }
-
- public boolean requiresEJBModuleFor(String server, String runtime, String type)
- {
- IConfigurationElement elem = getConfigurationElementFor(server, runtime, type);
- if (elem==null)
- {
- return false;
- }
- return Boolean.valueOf(elem.getAttribute("requireEJBModule")).booleanValue();
- }
-
- /**
- * Returns the id of the <code>WebServiceServerRuntimeType</code> corresponding to the Server,
- * Runtime, and Web Service Type.
- */
- public boolean webServiceServerRuntimeTypeExists(String serverID, String runtimeID, String typeID)
- {
- return (getConfigurationElementFor(serverID, runtimeID, typeID) != null);
- }
-
- /**
- * Returns the id of the <code>WebServiceServerRuntimeType</code> corresponding to the Server,
- * Runtime, and Web Service Type.
- */
- public String getWebServiceServerRuntimeTypeName(String server, String runtime, String type)
- {
- IConfigurationElement elem = (IConfigurationElement)getConfigurationElementFor(server, runtime, type);
- return (elem==null ? null : elem.getAttribute("id"));
- }
-
- /**
- * Returns the <code>WebServiceServerRuntimeType</code> corresponding to the Server,
- * Runtime, and Web Service type. This will return the <code>WebServiceServerRuntimeType</code>
- * object and set the properties found in the manifest file. i.e. isWebModuleRequired, isEJBModuleRequired
- * @param server label
- * @param runtime label
- * @param Web service type
- * @return WebServiceServerRuntimeType object
- */
- public WebServiceServerRuntimeType getWebServiceServerRuntimeType(String server, String runtime, String type)
- {
-
- WebServiceServerRuntimeType wssrt = null;
- String serverId = getWebServiceServerByFactoryId(server).getId();
- // System.out.println("SERVER ID HERE = "+serverId);
- IConfigurationElement elem = getConfigurationElementFor(server, runtime, type);
-
-
- if( elem == null )
- {
- // We couldn't find the server and runtime specified so we will
- // find the default server and runtime.
-
- server = getDefaultServerValueFor(type);
- runtime = getDefaultRuntimeValueFor(type);
-
- elem = getConfigurationElementFor(server, runtime, type);
-
- }
-
-/*
- try {
- //Object webServiceType = elem.createExecutableExtension("class");
- if (webServiceType instanceof WebServiceServerRuntimeType)
- {
- wssrt = (WebServiceServerRuntimeType)webServiceType;
- wssrt.setServerLabel(server);
- wssrt.setRuntimeLabel(runtime);
- wssrt.setWebModuleRequired( Boolean.valueOf(elem.getAttribute("requireWebModule")).booleanValue() );
- wssrt.setEJBModuleRequired( Boolean.valueOf(elem.getAttribute("requireEJBModule")).booleanValue() );
- }
- else
- {
- String implementedInterface = "org.eclipse.jst.ws.ui.wizard.WebServiceServerRuntimeType ";
- String errMsg = "Extensions of the WebServiceServerRuntimeTypes extension point must implement the ";
- errMsg = errMsg + implementedInterface + "interface.";
- Log.write(this,"getWebServiceServerRuntimeType",Log.ERROR,errMsg);
- }
-
- }
- catch (CoreException ce)
- {
- Log.write(this,"loadTypes",Log.ERROR,ce);
- }
-*/
- return wssrt;
-
- }
-
-
- /**
- * Returns the <code>WebServiceServerRuntimeType</code> given the type name.
- * @param type name
- * @retrun WebServiceServerRuntimeType object
- */
- public WebServiceServerRuntimeType getWebServiceServerRuntimeTypeById(String id)
- {
- WebServiceServerRuntimeType wssrt = null;
- if (configElemsById_.containsKey(id))
- {
- try {
- IConfigurationElement elem = (IConfigurationElement)configElemsById_.get(id);
- Object webServiceType = elem.createExecutableExtension("class");
- if (webServiceType instanceof WebServiceServerRuntimeType)
- {
- wssrt = (WebServiceServerRuntimeType)webServiceType;
- wssrt.setServerLabel(elem.getAttribute("server"));
- wssrt.setRuntimeLabel(elem.getAttribute("runtime"));
- wssrt.setWebModuleRequired( Boolean.valueOf(elem.getAttribute("requireWebModule")).booleanValue() );
- wssrt.setEJBModuleRequired( Boolean.valueOf(elem.getAttribute("requireEJBModule")).booleanValue() );
- }
- else
- {
- String implementedInterface = "org.eclipse.jst.ws.ui.wizard.WebServiceServerRuntimeType ";
- String errMsg = "Extensions of the WebServiceServerRuntimeTypes extension point must implement the ";
- errMsg = errMsg + implementedInterface + "interface.";
- log_.log(Log.ERROR, 5061, this, "getWebServiceServerRuntimeTypeById", errMsg);
- }
- }
- catch (CoreException ce)
- {
- log_.log(Log.ERROR, 5062, this, "getWebServiceServerRuntimeTypeById", ce);
- }
- }
-
- return wssrt;
- }
-
- public String[] getWebServiceTypeBySelection(IStructuredSelection selection)
- {
-
- TypeSelectionFilter tsf = new TypeSelectionFilter();
- String[] wst = tsf.getWebServiceTypeByInitialSelection(selection, webServiceTypes);
- return wst == null ? null : wst;
-
- }
-
- public IWebServiceType getWebServiceTypeByTypeLabel(String webServiceTypeLabel)
- {
-
- Iterator iter = webServiceTypes.values().iterator();
- while (iter.hasNext())
- {
- WebServiceTypeImpl wst = (WebServiceTypeImpl)iter.next();
- if (wst!=null) {
- if (wst.getLabel().equals(webServiceTypeLabel)) {
- return wst;
- }
- }
- }
- return null;
- }
-
- public boolean isInitialSelectionValidForChosenType(IStructuredSelection selection, String typeName)
- {
- String[] supportedTypes = getWebServiceTypeBySelection(selection);
- if (supportedTypes!=null)
- {
- for (int i=0; i<supportedTypes.length; i++)
- {
- if (supportedTypes[i].equals(typeName))
- return true;
- }
- }
- return false;
-
- }
-
- public boolean isServerSupportedForChosenType(String typeId, String serverID)
- {
- if (serversByType_.containsKey(typeId))
- {
- Vector vect = (Vector)serversByType_.get(typeId);
- for (int i=0; i<vect.size(); i++)
- {
- WebServiceServer wss = (WebServiceServer)webServiceServers.get((String)vect.elementAt(i));
- if (serverID!=null) {
- if (serverID.equalsIgnoreCase(wss.getFactoryId()))
- return true;
- }
- }
- }
- return false;
- }
-
- public boolean isServerRuntimeTypeSupported(String server, String runtime, String type) {
-
- WebServiceServerRuntimeType wssrt = null;
- IConfigurationElement elem = getConfigurationElementFor(server, runtime, type);
- return elem == null ? false : true;
-
- }
-
- public String getDefaultServerValueFor(String typeId)
- {
- String[] servers;
- if (serversByType_.containsKey(typeId))
- {
- Vector vect = (Vector)serversByType_.get(typeId);
- servers = new String[vect.size()];
- for (int i=0; i<vect.size(); i++)
- {
- String serverId = (String)vect.elementAt(i);
- WebServiceServer wss = (WebServiceServer)webServiceServers.get(serverId);
- servers[i] = (String)wss.getId();
- }
- return servers[0];
- }
- else
- {
- log_.log(Log.ERROR, 5063, this, "getServerByType", "Unable to find default server for "+typeId);
- return null;
- }
-
- }
-
- public String getDefaultRuntimeValueFor(String typeId)
- {
- String[] runtimeName = getRuntimesByType(typeId);
- for (int i=0; i<runtimeName.length; i++)
- {
- WebServiceRuntime wsr = (WebServiceRuntime)webServiceRuntimes.get(runtimeName[i]);
- if (wsr.getIsDefault())
- return runtimeName[i];
- }
- return runtimeName[0];
- }
-
- public String getServerIdForFactoryId(String factoryId) {
-
- Iterator iter = webServiceServers.values().iterator();
- while (iter.hasNext()) {
- WebServiceServer wss = (WebServiceServer)iter.next();
- if (wss.getFactoryId().equals(factoryId)) {
- return wss.getId();
- }
- }
- return null;
-
- }
-
- public final class WebServiceServerRuntimeType_
- {
-
- public String typeId_;
- public String serverId_;
- public String runtimeId_;
- public IConfigurationElement element_;
-
- public WebServiceServerRuntimeType_(String serverId, String runtimeId,String typeId, IConfigurationElement elem)
- {
- this.typeId_ = typeId;
- this.serverId_ = serverId;
- this.runtimeId_ = runtimeId;
- this.element_ = elem;
- }
-
- public IConfigurationElement getConfigurationElementFor(String serverID, String runtimeID, String typeID)
- {
- if (this.typeId_.equals(typeID) && this.serverId_.equals(serverID) && this.runtimeId_.equals(runtimeID))
- return this.element_;
- return null;
- }
-
- public boolean hasConfigElementFor(String factoryID, String runtimeID, String typeID)
- {
- String serverID = getServerIdForFactoryId( factoryID );
-
- if (typeId_.equalsIgnoreCase(typeID) &&
- serverId_.equalsIgnoreCase(serverID) &&
- runtimeId_.equalsIgnoreCase(runtimeID))
- {
- return true;
- }
-
- return false;
- }
-
-
- }
-
- public CommandFragmentFactoryFactory getFactoryFactory( String[] ids )
- {
- String hashKey = ids[2] + "#" + ids[1] + "#" + ids[0];
- CommandWidgetBinding binding = (CommandWidgetBinding)factoryCache_.get( hashKey );
-
- if( binding == null )
- {
- IConfigurationElement element = getConfigElementFor( ids[2], ids[1], ids[0] );
-
- if( element == null ) return null;
-
- binding = createBinding( element );
-
- factoryCache_.put( hashKey, binding );
-
- binding.registerDataMappings( dataMappingRegistry_ );
-
- if( widgetRegistry_ != null )
- {
- binding.registerWidgetMappings( widgetRegistry_ );
- binding.registerCanFinish( canFinishRegistry_ );
- }
- }
-
- return binding;
- }
-
- private CommandWidgetBinding createBinding(IConfigurationElement element )
- {
- Vector bindings = new Vector(4);
- Vector fragments = new Vector(4);
-
- addBinding( element, "developBinding", bindings );
- addBinding( element, "assemblyBinding", bindings );
- addBinding( element, "deployBinding", bindings );
- addBinding( element, "installBinding", bindings );
-
- fragments.add( new ServicePreDevelopFragment() );
- fragments.add( new ServicePreAssemblyFragment() );
- fragments.add( new ServicePreDeployFragment() );
- fragments.add( new ServicePreInstallFragment() );
-
- return new CommandWidgetBindingList( bindings, fragments );
- }
-
- private void addBinding( IConfigurationElement element, String bindingName, Vector list )
- {
- Object binding = null;
-
- if( element.getAttribute( bindingName ) != null )
- {
- try
- {
- binding = element.createExecutableExtension( bindingName );
- }
- catch( CoreException exc )
- {
- }
- }
-
- list.add( binding );
- }
-
- public void setDataMappingRegistry( DataMappingRegistry registry )
- {
- dataMappingRegistry_ = registry;
-
- // We need to rebuild the factory cache each time we start the server
- // wizard.
- factoryCache_ = new HashMap();
- }
-
- public void setWidgetRegistry( WidgetRegistry registry )
- {
- widgetRegistry_ = registry;;
- }
-
- public void setCanFinishRegistry( CanFinishRegistry registry )
- {
- canFinishRegistry_ = registry;
- }
-
- public String[] getAllServerFactoryIds()
- {
- Object[] servers = webServiceServers.values().toArray();
- String[] factoryIds = new String[servers.length];
- for (int i=0; i<servers.length; i++)
- {
- WebServiceServer wss = (WebServiceServer)servers[i];
- factoryIds[i] = wss.getFactoryId();
- }
- return factoryIds;
- }
-
- public String getServerFactoryIdFromServerId(String serverId)
- {
- Object[] servers = webServiceServers.values().toArray();
- for (int i=0; i<servers.length; i++)
- {
- WebServiceServer wss = (WebServiceServer)servers[i];
- if (serverId == wss.getId())
- {
- return wss.getFactoryId();
- }
-
- }
- return null;
- }
-
- /*
- * Returns a cascading list of valid choices for server, runtime, and J2EE levels.
- * This is an intersection of what is available for service and client.
- */
- public SelectionListChoices getServerToRuntimeToJ2EE()
- {
- if (serverToRuntimeToJ2EE_!=null)
- {
- return serverToRuntimeToJ2EE_;
- }
-
- String[] servers = getStringArrayIntersection(getAllServerFactoryIds(), WebServiceClientTypeRegistry.getInstance().getAllClientServerFactoryIds());
- SelectionList serversList = new SelectionList(servers, 0);
- Vector choices = new Vector();
- for (int i=0; i<servers.length; i++)
- {
- choices.add(getRuntimeChoices(servers[i]));
- }
- serverToRuntimeToJ2EE_ = new SelectionListChoices(serversList, choices);
- return serverToRuntimeToJ2EE_;
-
- }
-
- private SelectionListChoices getRuntimeChoices(String serverFactoryId)
- {
- String[] serviceRuntimes = getRuntimeIDsByServerFactoryID(serverFactoryId);
- String[] clientRuntimes = WebServiceClientTypeRegistry.getInstance().getRuntimeIdsByServerFactoryId(serverFactoryId);
- String[] runtimes = getStringArrayIntersection(serviceRuntimes, clientRuntimes);
- SelectionList runtimesList = new SelectionList(runtimes, 0);
- Vector choices = new Vector();
- for (int i=0; i<runtimes.length; i++)
- {
- choices.add(getJ2EEChoices(runtimes[i]));
- }
- return new SelectionListChoices(runtimesList, choices);
- }
-
- private SelectionListChoices getJ2EEChoices(String runtimeId)
- {
- String[] serviceJ2EEVersions = getWebServiceRuntimeById(runtimeId).getJ2EEVersions();
- String[] clientJ2EEVersions = WebServiceClientTypeRegistry.getInstance().getWebServiceRuntimeById(runtimeId).getJ2EEVersions();
- String[] j2eeVersions = getStringArrayIntersection(serviceJ2EEVersions, clientJ2EEVersions);
- SelectionList j2eeVersionsList = new SelectionList(j2eeVersions, 0);
- return new SelectionListChoices(j2eeVersionsList, null);
- }
-
- public String getServerLabel(String factoryId)
- {
- if (factoryId==null || factoryId.length()==0)
- return null;
-
- if (serverLabelByFactoryId_.containsKey(factoryId))
- {
- return (String)serverLabelByFactoryId_.get(factoryId);
- }
- else
- {
- return null;
- }
- }
-
- public String getServerFactoryId(String label)
- {
- if (label==null || label.length()==0)
- return null;
-
- if (serverFactoryIdByLabel_.containsKey(label))
- {
- return (String)serverFactoryIdByLabel_.get(label);
- }
- else
- {
- return null;
- }
- }
-
- public String getRuntimeLabel(String id)
- {
- if (id==null || id.length()==0)
- return null;
-
- return (String) runtimeLabelById_.get(id);
- }
-
- public String getRuntimeId(String label)
- {
- if (label==null || label.length()==0)
- return null;
-
- return (String)runtimeIdByLabel_.get(label);
- }
-
- private String[] getStringArrayIntersection(String[] a1, String[] a2)
- {
- Vector vf = new Vector();
- if (a1==null || a2==null)
- {
- return convertToStringArray(vf.toArray());
- }
-
- for (int i=0; i<a1.length; i++)
- {
- for (int j=0; j<a2.length; j++)
- {
- if (a1[i].equals(a2[j]))
- {
- vf.add(a1[i]);
- break;
- }
- }
- }
-
- return convertToStringArray(vf.toArray());
- }
-
- private String[] convertToStringArray(Object[] a)
- {
- if (a==null) return new String[0];
-
- int length = a.length;
- String[] sa = new String[length];
- for (int i=0; i<length; i++)
- {
- Object obj = a[i];
- if (obj instanceof String)
- {
- sa[i] = (String)obj;
- }
- }
- return sa;
- }
-}
-
-
-
-
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceType.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceType.java
deleted file mode 100644
index 3a8f4fb..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceType.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-
-/**
-* This is the interface for objects that represent a kind of
-* Web Service artifact. The primary purpose of a WebServiceType
-* object is to manufacture the wizard pages that support the type.
-*/
-public interface WebServiceType
-{
- /**
- * Returns a short, locale specific name of this Web Service type.
- * @return A short, locale specific name of this Web Service type.
- */
- public String getName ();
-
- /**
- * Returns a locale specific description of this Web Service type.
- * @return A locale specific description of this Web Service type.
- */
- public String getDescription ();
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceTypeImpl.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceTypeImpl.java
deleted file mode 100644
index 229de46..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceTypeImpl.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-
-
-/**
-* This is the interface for objects that represent a kind of
-* Web Service artifact. The primary purpose of a WebServiceType
-* object is to manufacture the wizard pages that support the type.
-*/
-public class WebServiceTypeImpl implements IWebServiceType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- public IConfigurationElement element_;
- public String typeId_;
- public String typeLabel_;
- public String[] extensionMetadata_;
- public String[] resourceTypeMetadata_;
- public Boolean canFinish_;
-
- public WebServiceTypeImpl(IConfigurationElement elem)
- {
- super();
- this.element_ = elem;
- }
- /**
- * Returns the id of this Web Service type.
- * @return id of this Web Service type.
- */
- public String getId ()
- {
- if (typeId_==null)
- typeId_ = element_.getAttribute("id");
- return typeId_;
- }
- /**
- * Returns a short, locale specific name of this Web Service type.
- * @return A short, locale specific name of this Web Service type.
- */
- public String getLabel ()
- {
- if (typeLabel_ == null)
- typeLabel_ = element_.getAttribute("label");
- return typeLabel_;
- }
-
- /**
- * Returns a locale specific description of this Web Service type's extension metadata.
- * @return A locale specific description of this Web Service type's extension metadata.
- */
- public String[] getExtensionMetadata ()
- {
- if (extensionMetadata_ ==null)
- {
- StringTokenizer st = new StringTokenizer(element_.getAttribute("extensionMetadata"));
- extensionMetadata_ = new String[st.countTokens()];
- int i=0;
- while (st.hasMoreElements())
- {
- String exten = (String)st.nextToken();
- if (exten!=null)
- {
- extensionMetadata_[i]=exten;
- }
- i++;
- }
- }
- return this.extensionMetadata_;
- }
-
- /**
- * Returns a locale specific description of this Web Service type's resource metadata.
- * @return A locale specific description of this Web Service type's resource metadata.
- */
- public String[] getResourceTypeMetadata ()
- {
- if (resourceTypeMetadata_ == null)
- {
- StringTokenizer st = new StringTokenizer(element_.getAttribute("resourceTypeMetadata"));
- resourceTypeMetadata_ = new String[st.countTokens()];
- int i=0;
- while (st.hasMoreElements())
- {
- String resourceType = (String)st.nextToken();
- if (resourceType!=null)
- {
- resourceTypeMetadata_[i]=resourceType;
- }
- i++;
- }
- }
- return resourceTypeMetadata_;
- }
-
- /**
- * Returns true if the plugin.xml contains an attribute of "canFinish" with a value of true. Otherwise,
- * false is returned. Note: if the "canFinish" attribute is not specified true is returned by default.
- * @return Returns whether or not the user can finish on the pages before the web service type pages.
- */
- public boolean getCanFinish()
- {
- if( canFinish_ == null )
- {
- String canFinishString = element_.getAttribute("canFinish");
-
- canFinish_ = canFinishString == null ? new Boolean( true ) : Boolean.valueOf( canFinishString );
- }
-
- return canFinish_.booleanValue();
- }
-
- /**
- * Returns the configuration element associated with
- * this type.
- *
- * @return org.eclipse.core.runtime.IConfigurationElement
- */
- public IConfigurationElement getConfigurationElement()
- {
- return this.element_;
- }
-
- public String getObjectSelectionWidget()
- {
- return element_.getAttribute("objectSelectionWidget");
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceTypeRegistry.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceTypeRegistry.java
deleted file mode 100644
index d29b1ab..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/WebServiceTypeRegistry.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-
-public class WebServiceTypeRegistry
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- private static WebServiceTypeRegistry instance_;
-
- private Hashtable typesByName_;
- private String[] typeNames_;
-
- //
- // Loads WebServiceType objects into this registry.
- // This is done by querying the plugin registry for all extensions
- // hanging on the webServiceType extension point. Extensions
- // must implement the org.eclipse.jst.ws.ui.wizard.WebServiceType
- // interface.
- //
- private void loadTypes ()
- {
- Log log = new EclipseLog();
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] config = reg.getConfigurationElementsFor(
- "org.eclipse.jst.ws.consumption.ui",
- "webServiceType");
-
- for(int idx=0; idx<config.length; idx++)
- {
- IConfigurationElement elem = config[idx];
- try
- {
- Object webServiceType = elem.createExecutableExtension("class");
- if (webServiceType instanceof WebServiceType)
- {
- add((WebServiceType)webServiceType);
- }
- else
- {
- String implementedInterface = "org.eclipse.jst.ws.ui.wizard.WebServiceType ";
- String errMsg = "Extensions of the webServiceTypes extension point must implement the ";
- errMsg = errMsg + implementedInterface + "interface.";
- log.log(Log.ERROR, 5056, this, "loadTypes", errMsg);
- }
- } catch (CoreException e)
- {
- log.log(Log.ERROR, 5057, this, "loadTypes", e);
- }
- }
- }
-
- //
- // Loads WebServiceType objects into this registry.
- // See method getInstance().
- //
- private void load ()
- {
- typesByName_ = new Hashtable();
- loadTypes();
- indexTypesByName();
- }
-
- //
- // Add the given WebServiceType to this registry.
- // See method load().
- //
- private void add ( WebServiceType wst )
- {
- typesByName_.put(wst.getName(),wst);
- }
-
- //
- // Builds an index of WebServiceType objects by their names.
- // See method load().
- //
- private void indexTypesByName ()
- {
- if (typeNames_ == null)
- {
- typeNames_ = new String[typesByName_.size()];
- Enumeration e = typesByName_.keys();
- for (int i=0; e.hasMoreElements(); i++)
- {
- typeNames_[i] = (String)e.nextElement();
- }
- }
- }
-
- /**
- * Returns a singleton instance of this class.
- * @return A singleton WebServiceTypeRegistry object.
- */
- public static WebServiceTypeRegistry getInstance ()
- {
- if (instance_ == null)
- {
- instance_ = new WebServiceTypeRegistry();
- instance_.load();
- }
- return instance_;
- }
-
- /**
- * Returns all registered <code>WebServiceType</code> objects.
- * @return All registered <code>WebServiceType</code> objects.
- */
- public WebServiceType[] getWebServiceTypes ()
- {
- WebServiceType[] wsts = new WebServiceType[typesByName_.size()];
- Enumeration e = typesByName_.elements();
- for (int i=0; e.hasMoreElements(); i++)
- {
- wsts[i] = (WebServiceType)e.nextElement();
- }
- return wsts;
- }
-
- /**
- * Returns the names of all registered <code>WebServiceType</code>
- * objects.
- * @return The names of all registered <code>WebServiceType</code>
- * objects.
- */
- public String[] getWebServiceTypeNames ()
- {
- return typeNames_;
- }
-
- /**
- * Returns the <code>WebServiceType</code> object of the given
- * <code>name</code> or null if there is no such object.
- * @param name The name of the <code>WebServiceType</code> to find.
- * @return The <code>WebServiceType</code> or null if no such object
- * was found.
- */
- public WebServiceType getWebServiceTypeByName ( String name )
- {
- return (name == null ? null : (WebServiceType)typesByName_.get(name));
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryIBM.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryIBM.java
deleted file mode 100644
index a65e059..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryIBM.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi;
-
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-
-public class PublicUDDIRegistryIBM implements PublicUDDIRegistryType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- public PublicUDDIRegistryIBM() {
- }
-
- public String getName() {
- return WebServiceConsumptionUIPlugin.getMessage("%PUBLICUDDIREGISTRYTYPE_NAME_IBM");
- }
-
- public String getInquiryURL() {
- return "http://uddi.ibm.com/ubr/inquiryapi";
- }
-
- public String getPublishURL() {
- return "https://uddi.ibm.com/ubr/publishapi";
- }
-
- public String getRegistrationURL() {
- return "http://uddi.ibm.com/ubr/registry.html";
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryIBMTest.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryIBMTest.java
deleted file mode 100644
index 9e5c24b..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryIBMTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi;
-
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-
-public class PublicUDDIRegistryIBMTest implements PublicUDDIRegistryType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- public PublicUDDIRegistryIBMTest() {
- }
-
- public String getName() {
- return WebServiceConsumptionUIPlugin.getMessage("%PUBLICUDDIREGISTRYTYPE_NAME_IBM_TEST");
- }
-
- public String getInquiryURL() {
- return "http://uddi.ibm.com/testregistry/inquiryapi";
- }
-
- public String getPublishURL() {
- return "https://uddi.ibm.com/testregistry/publishapi";
- }
-
- public String getRegistrationURL() {
- return "http://uddi.ibm.com/testregistry/registry.html";
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryMicrosoft.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryMicrosoft.java
deleted file mode 100644
index ecba759..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryMicrosoft.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi;
-
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-
-public class PublicUDDIRegistryMicrosoft implements PublicUDDIRegistryType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- public PublicUDDIRegistryMicrosoft() {
- }
-
- public String getName() {
- return WebServiceConsumptionUIPlugin.getMessage("%PUBLICUDDIREGISTRYTYPE_NAME_MICROSOFT");
- }
-
- public String getInquiryURL() {
- return "http://uddi.microsoft.com/inquire";
- }
-
- public String getPublishURL() {
- return "https://uddi.microsoft.com/publish";
- }
-
- public String getRegistrationURL() {
- return "https://uddi.microsoft.com/register.aspx";
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryMicrosoftTest.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryMicrosoftTest.java
deleted file mode 100644
index 1170fa5..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryMicrosoftTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi;
-
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-
-public class PublicUDDIRegistryMicrosoftTest implements PublicUDDIRegistryType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- public PublicUDDIRegistryMicrosoftTest() {
- }
-
- public String getName() {
- return WebServiceConsumptionUIPlugin.getMessage("%PUBLICUDDIREGISTRYTYPE_NAME_MICROSOFT_TEST");
- }
-
- public String getInquiryURL() {
- return "http://test.uddi.microsoft.com/inquire";
- }
-
- public String getPublishURL() {
- return "https://test.uddi.microsoft.com/publish";
- }
-
- public String getRegistrationURL() {
- return "http://test.uddi.microsoft.com/register.aspx";
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryNTTComm.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryNTTComm.java
deleted file mode 100644
index 2ff95df..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryNTTComm.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi;
-
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-
-public class PublicUDDIRegistryNTTComm implements PublicUDDIRegistryType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- public PublicUDDIRegistryNTTComm() {
- }
-
- public String getName() {
- return WebServiceConsumptionUIPlugin.getMessage("%PUBLICUDDIREGISTRYTYPE_NAME_NTTCOMM");
- }
-
- public String getInquiryURL() {
- return "http://www.uddi.ne.jp/ubr/inquiryapi";
- }
-
- public String getPublishURL() {
- return "https://www.uddi.ne.jp/ubr/publishapi";
- }
-
- public String getRegistrationURL() {
- return "http://www.ntt.com/uddi/";
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistrySAP.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistrySAP.java
deleted file mode 100644
index 362818e..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistrySAP.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi;
-
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-
-public class PublicUDDIRegistrySAP implements PublicUDDIRegistryType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- public PublicUDDIRegistrySAP() {
- }
-
- public String getName() {
- return WebServiceConsumptionUIPlugin.getMessage("%PUBLICUDDIREGISTRYTYPE_NAME_SAP");
- }
-
- public String getInquiryURL() {
- return "http://uddi.sap.com/UDDI/api/inquiry/";
- }
-
- public String getPublishURL() {
- return "https://uddi.sap.com/UDDI/api/publish/";
- }
-
- public String getRegistrationURL() {
- return "http://uddi.sap.com/";
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistrySAPTest.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistrySAPTest.java
deleted file mode 100644
index 2111302..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistrySAPTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi;
-
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-
-public class PublicUDDIRegistrySAPTest implements PublicUDDIRegistryType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- public PublicUDDIRegistrySAPTest() {
- }
-
- public String getName() {
- return WebServiceConsumptionUIPlugin.getMessage("%PUBLICUDDIREGISTRYTYPE_NAME_SAP_TEST");
- }
-
- public String getInquiryURL() {
- return "http://udditest.sap.com/UDDI/api/inquiry/";
- }
-
- public String getPublishURL() {
- return "https://udditest.sap.com/UDDI/api/publish/";
- }
-
- public String getRegistrationURL() {
- return "http://udditest.sap.com/";
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryType.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryType.java
deleted file mode 100644
index e4d9e65..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryType.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi;
-
-public interface PublicUDDIRegistryType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- public String getName();
- public String getInquiryURL();
- public String getPublishURL();
- public String getRegistrationURL();
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryXMethods.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryXMethods.java
deleted file mode 100644
index 05bd648..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wizard/uddi/PublicUDDIRegistryXMethods.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wizard.uddi;
-
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-
-public class PublicUDDIRegistryXMethods implements PublicUDDIRegistryType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- public PublicUDDIRegistryXMethods() {
- }
-
- public String getName() {
- return WebServiceConsumptionUIPlugin.getMessage("%PUBLICUDDIREGISTRYTYPE_NAME_XMETHODS");
- }
-
- public String getInquiryURL() {
- //return "http://uddi.xmethods.net/inquire";
- return "http://uddi.xmethods.net/inquire2";
- }
-
- // Read-only registry. The publish and registration URLs don't exist.
- public String getPublishURL() {
- return "https://uddi.xmethods.net/publish2";
- }
-
- public String getRegistrationURL() {
- return "http://www.xmethods.net/ve2/Register.po?event=registerOrg";
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/AddWSDLToWSILWrapperCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/AddWSDLToWSILWrapperCommand.java
deleted file mode 100644
index d8ee61a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/AddWSDLToWSILWrapperCommand.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wsil;
-
-import org.eclipse.jst.ws.internal.consumption.wsil.AddWSDLToWSILCommand;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-public class AddWSDLToWSILWrapperCommand extends SimpleCommand
-{
- private AddWSDLToWSILCommand command;
- private Arguments args;
-
- public AddWSDLToWSILWrapperCommand()
- {
- super("org.eclipse.jst.ws.internal.consumption.ui.wsil.AddWSDLToWSILWrapperCommand", "org.eclipse.jst.ws.internal.consumption.ui.wsil.AddWSDLToWSILWrapperCommand");
- }
-
- public Status execute(Environment env)
- {
- if (command == null)
- command = new AddWSDLToWSILCommand();
- if (!args.isEmpty())
- {
- command.setArguments(args.getStringArguments());
- command.setWWWAuthenticationHandler(new DialogWWWAuthentication(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()));
- return command.execute(env);
- }
- return new SimpleStatus("");
- }
- /**
- * @param args The args to set.
- */
- public void setArgs(Arguments args)
- {
- this.args = args;
- }
-
- /**
- * @param command The command to set.
- */
- public void setCommand(AddWSDLToWSILCommand command)
- {
- this.command = command;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/Arguments.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/Arguments.java
deleted file mode 100644
index 7a177c5..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/Arguments.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wsil;
-
-import java.util.Vector;
-
-public class Arguments
-{
- private Vector args_;
-
- public Arguments()
- {
- args_ = new Vector();
- }
-
- public void add(String key, Object value)
- {
- args_.add(key);
- if (value != null)
- args_.add(value);
- }
-
- public void remove(String key)
- {
- int index = args_.indexOf(key);
- if (index >= 0)
- {
- args_.remove(index);
- args_.remove(index+1);
- }
- }
-
- public Object get(String key)
- {
- int index = args_.indexOf(key);
- if (index >= 0)
- return args_.get(index+1);
- else
- return null;
- }
-
- public void clear()
- {
- args_.clear();
- }
-
- public Object[] getArguments()
- {
- Object[] args = new Object[args_.size()];
- args_.copyInto(args);
- return args;
- }
-
- public String[] getStringArguments()
- {
- String[] args = new String[args_.size()];
- for (int i = 0; i < args.length; i++)
- args[i] = args_.get(i).toString();
- return args;
- }
-
- public boolean isEmpty()
- {
- return args_.isEmpty();
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/DialogWWWAuthentication.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/DialogWWWAuthentication.java
deleted file mode 100644
index 65607b4..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/DialogWWWAuthentication.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wsil;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.ws.parser.wsil.WWWAuthenticationException;
-import org.eclipse.wst.ws.parser.wsil.WWWAuthenticationHandler;
-
-
-public class DialogWWWAuthentication extends Dialog implements WWWAuthenticationHandler
-{
-
- /*CONTEXT_ID DBAS0001 for the HTTP basic authentication user name*/
- private final String INFOPOP_DBAS_USERNAME = WebServiceConsumptionUIPlugin.ID + ".DBAS0001";
-
- /*CONTEXT_ID DBAS0002 for the HTTP basic authentication password*/
- private final String INFOPOP_DBAS_PASSWORD = WebServiceConsumptionUIPlugin.ID + ".DBAS0002";
-
- private String usernameString_;
- private String passwordString_;
-
- private Text username_;
- private Text password_;
-
- private WWWAuthenticationException wwwae_;
-
- public DialogWWWAuthentication(Shell shell)
- {
- super(shell);
- usernameString_ = null;
- passwordString_ = null;
- wwwae_ = null;
- }
-
- /**
- * Called when the Cancel button is pressed.
- */
- protected void cancelPressed()
- {
- usernameString_ = null;
- passwordString_ = null;
- super.cancelPressed();
- }
-
- /**
- * Called when the OK button is pressed.
- */
- protected void okPressed()
- {
- String usernameString = username_.getText();
- usernameString_ = (usernameString.length() > 0) ? usernameString : null;
- String passwordString = password_.getText();
- passwordString_ = (passwordString.length() > 0) ? passwordString : null;
- setReturnCode(Dialog.OK);
- super.okPressed();
- }
-
- /**
- * See {@link org.eclipse.jface.window.Window#configureShell}.
- * @param shell The shell.
- */
- protected void configureShell(Shell shell)
- {
- super.configureShell(shell);
- shell.setText(getMessage("%DIALOG_TITLE_HTTP_BASIC_AUTH"));
- }
-
- /**
- * Creates the dialog area.
- * @param parent The parent composite.
- * @return The control area.
- */
- protected Control createDialogArea(Composite parent)
- {
- Composite composite = (Composite)super.createDialogArea(parent);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL);
- gd.widthHint = 400;
- gd.grabExcessVerticalSpace = true;
- gd.grabExcessHorizontalSpace = true;
- composite.setLayoutData(gd);
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- gl.verticalSpacing = 15;
- composite.setLayout(gl);
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText(getMessage("%LABEL_URL"));
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
- label = new Label(composite, SWT.WRAP);
- label.setText(wwwae_.getURL());
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- label = new Label(composite, SWT.WRAP);
- label.setText(getMessage("%LABEL_HTTP_BASIC_AUTH_USERNAME"));
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
- username_ = new Text(composite, SWT.BORDER);
- username_.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- username_.setToolTipText(getMessage("%TOOLTIP_HTTP_BASIC_AUTH_USERNAME"));
- WorkbenchHelp.setHelp(username_, new Object[]{INFOPOP_DBAS_USERNAME});
-
- label = new Label(composite, SWT.WRAP);
- label.setText(getMessage("%LABEL_HTTP_BASIC_AUTH_PASSWORD"));
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
- password_ = new Text(composite, SWT.BORDER);
- password_.setEchoChar('*');
- password_.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- password_.setToolTipText(getMessage("%TOOLTIP_HTTP_BASIC_AUTH_PASSWORD"));
- WorkbenchHelp.setHelp(username_, new Object[]{INFOPOP_DBAS_PASSWORD});
-
- return composite;
- }
-
- private String getMessage(String msgId)
- {
- return WebServiceConsumptionUIPlugin.getMessage(msgId);
- }
-
- public void handleWWWAuthentication(WWWAuthenticationException wwwae)
- {
- usernameString_ = null;
- passwordString_ = null;
- wwwae_ = wwwae;
- open();
- }
-
- public String getUsername()
- {
- return usernameString_;
- }
-
- public String getPassword()
- {
- return passwordString_;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/TableViewerEditor.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/TableViewerEditor.java
deleted file mode 100644
index 04400fe..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/TableViewerEditor.java
+++ /dev/null
@@ -1,525 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wsil;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.TableEditor;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-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.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-
-public class TableViewerEditor extends Composite
-{
- private int DEFAULT_TABLE_HEIGHT_HINT = 100;
- private int DEFAULT_COLUMN_WIDTH = 80;
-
- private String[] columns_;
- private TableViewer tableViewer_;
- private Table table_;
- private TableEditor editor_;
- private TableEditorListener tableEditorListener_;
- private Text text_;
- private Button add_;
- private Button remove_;
-
- private List values_;
- private Object defaultValue_;
-
- public TableViewerEditor(Composite parent, String[] columns, List initValues, Object defaultValue)
- {
- super(parent, SWT.NONE);
- columns_ = columns;
- values_ = new ArrayList();
- if (initValues != null && initValues.size() > 0)
- values_.addAll(initValues);
- defaultValue_ = (defaultValue != null) ? defaultValue : new String("");
- createPartControl(this);
- }
-
- private void createPartControl(Composite parent)
- {
- GridLayout gl = new GridLayout();
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- setLayout(gl);
- setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite composite = new Composite(parent, SWT.NONE);
- gl = new GridLayout();
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- composite.setLayout(gl);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- table_ = new Table(composite, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = DEFAULT_TABLE_HEIGHT_HINT;
- table_.setLayoutData(gd);
- table_.setHeaderVisible(true);
- table_.setLinesVisible(true);
- TableLayout tableLayout = new TableLayout();
- int maxWidth = DEFAULT_COLUMN_WIDTH;
- for (int i = 0; i < columns_.length; i++)
- {
- TableColumn tableColumn = new TableColumn(table_, SWT.NONE);
- tableColumn.setText(columns_[i]);
- tableColumn.pack();
- int tableColumnWidth = Math.max(DEFAULT_COLUMN_WIDTH, tableColumn.getWidth());
- maxWidth = Math.max(maxWidth, tableColumnWidth);
- ColumnWeightData columnData = new ColumnWeightData(tableColumnWidth, tableColumnWidth, true);
- tableLayout.addColumnData(columnData);
- }
- table_.setLayout(tableLayout);
- // initialize the table editor
- editor_ = new TableEditor(table_);
- // The editor must have the same size as the cell and must
- // not be any smaller than 50 pixels.
- editor_.horizontalAlignment = SWT.LEFT;
- editor_.grabHorizontal = true;
- editor_.minimumWidth = maxWidth;
- tableEditorListener_ = new TableEditorListener();
- table_.addMouseListener(tableEditorListener_);
- tableViewer_ = new TableViewer(table_);
- tableViewer_.getControl().addKeyListener(
- new KeyListener()
- {
- public void keyPressed(KeyEvent e)
- {
- // Del
- if (((int)e.character) == 127)
- handleDeleteKeyPressed();
- // Enter or space
- if (((int)e.character) == 13 || ((int)e.character) == 32)
- tableEditorListener_.editSelection();
- }
- public void keyReleased(KeyEvent e)
- {
- }
- }
- );
- tableViewer_.setContentProvider(new ListContentProvider());
- tableViewer_.setLabelProvider(new ListLabelProvider());
- tableViewer_.setInput(values_);
- tableViewer_.addSelectionChangedListener(
- new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- enableRemove(true);
- }
- }
- );
-
- Composite buttonComposite = new Composite(composite, SWT.NONE);
- gl = new GridLayout();
- gl.numColumns = 2;
- gl.makeColumnsEqualWidth = true;
- buttonComposite.setLayout(gl);
- buttonComposite.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- add_ = new Button(buttonComposite, SWT.PUSH);
- add_.setText(WebServiceConsumptionUIPlugin.getMessage("%LABEL_ADD"));
- add_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- add_.addSelectionListener(
- new SelectionListener()
- {
- public void widgetSelected(SelectionEvent event)
- {
- handleAddButtonSelected(event);
- }
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
- }
- );
-
- remove_ = new Button(buttonComposite, SWT.PUSH);
- remove_.setText(WebServiceConsumptionUIPlugin.getMessage("%LABEL_REMOVE"));
- remove_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- remove_.addSelectionListener(
- new SelectionListener()
- {
- public void widgetSelected(SelectionEvent event)
- {
- handleRemoveButtonSelected(event);
- }
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
- }
- );
- enableRemove(false);
- }
-
- private void enableRemove(boolean enabled)
- {
- remove_.setEnabled(enabled && !tableViewer_.getSelection().isEmpty());
- }
-
- private void handleAddButtonSelected(SelectionEvent event)
- {
- values_.add(defaultValue_);
- refresh();
- setSelectionAsObject(values_.get(table_.getItemCount()-1));
- tableEditorListener_.editSelection();
- }
-
- private void handleRemoveButtonSelected(SelectionEvent event)
- {
- handleDeleteKeyPressed();
- }
-
- private void handleDeleteKeyPressed()
- {
- internalDispose();
- ISelection selection = tableViewer_.getSelection();
- if (selection != null && !selection.isEmpty() && (selection instanceof IStructuredSelection))
- {
- int selectionIndex = table_.getSelectionIndex();
- int selectionCount = table_.getItemCount();
- values_.remove(selectionIndex);
- if (selectionIndex < selectionCount-1)
- setSelectionAsObject(values_.get(selectionIndex));
- else if (selectionCount -2 >= 0)
- setSelectionAsObject(values_.get(selectionCount-2));
- refresh();
- }
- }
-
- private void internalRefresh()
- {
- // synchronize text field, previously selected table cell and model (inputObject)
- if (text_ != null)
- {
- TableItem oldTableItem = editor_.getItem();
- int oldColumnIndex = editor_.getColumn();
- if (oldTableItem != null && oldColumnIndex >= 0 && oldColumnIndex < columns_.length)
- {
- String oldText = text_.getText();
- oldTableItem.setText(oldColumnIndex, oldText);
- int oldRowIndex = table_.indexOf(oldTableItem);
- values_.set(oldRowIndex, oldText);
- }
- }
- }
-
- private void setSelectionAsObject(Object object)
- {
- tableViewer_.setSelection(new StructuredSelection(object), true);
- }
-
- public void setToolTipText(String string)
- {
- table_.setToolTipText(string);
- }
-
- public void setInfopop(String string)
- {
- WorkbenchHelp.setHelp(table_, new Object[] {string});
- }
-
- public void setInput(List list)
- {
- values_.clear();
- values_.addAll(list);
- }
-
- public void refresh()
- {
- internalRefresh();
- tableViewer_.refresh();
- }
-
- public TableItem[] getItems()
- {
- internalRefresh();
- return table_.getItems();
- }
-
- public void setEnabled(boolean enabled)
- {
- super.setEnabled(enabled);
- add_.setEnabled(enabled);
- enableRemove(enabled);
- }
-
- public void dispose()
- {
- super.dispose();
- internalDispose();
- if (editor_ != null)
- editor_.dispose();
- if (table_ != null)
- table_.dispose();
- if (add_ != null)
- add_.dispose();
- if (remove_ != null)
- remove_.dispose();
- }
-
- private void internalDispose()
- {
- if (text_ != null)
- text_.dispose();
- text_ = null;
- }
-
- protected class TableEditorListener implements MouseListener
- {
- private int currSelectionIndex_;
- private int editRow_;
- private int editColumn_;
-
- public TableEditorListener()
- {
- super();
- currSelectionIndex_ = -1;
- editRow_ = -1;
- editColumn_ = -1;
- }
-
- public void mouseDoubleClick(MouseEvent e)
- {
- mouseDown(e);
- }
-
- public void mouseDown(MouseEvent e)
- {
- // refresh table
- internalRefresh();
- // Clean up previous text editor control
- internalDispose();
- // update table
- if (table_.isFocusControl())
- {
- int selectedRowIndex = getSelectedRow(table_, e.y);
- if (currSelectionIndex_ != -1 && selectedRowIndex != -1 && currSelectionIndex_ == selectedRowIndex)
- {
- TableItem tableItem = table_.getItem(selectedRowIndex);
- int selectedColumnIndex = getSelectedColumn(tableItem, e.x, e.y);
- if (selectedColumnIndex != -1 && (text_ == null || text_.isDisposed() || selectedColumnIndex != editor_.getColumn()))
- editSelection(selectedRowIndex, selectedColumnIndex);
- }
- currSelectionIndex_ = selectedRowIndex;
- }
- }
-
- public void mouseUp(MouseEvent e)
- {
- }
-
- private int getSelectedRow(Table table, int y)
- {
- TableItem[] tableItems = table.getItems();
- for (int i = 0; i < tableItems.length; i++)
- {
- Rectangle rectangle = tableItems[i].getBounds(0);
- if (rectangle != null && y >= rectangle.y && y < (rectangle.y + rectangle.height))
- return i;
- }
- return -1;
- }
-
- private int getSelectedColumn(TableItem tableItem, int x, int y)
- {
- for (int i = 0; i < columns_.length; i++)
- {
- if (tableItem.getBounds(i).contains(x, y))
- return i;
- }
- return -1;
- }
-
- private void editSelection(int row, int column)
- {
- editRow_ = row;
- editColumn_ = column;
- TableItem tableItem = table_.getItem(row);
- // Setup adapter for the new selection
- text_ = new Text(table_, SWT.NONE);
- String text = tableItem.getText(column);
- text_.setText((text != null) ? text : "");
- text_.addKeyListener(new KeyListener()
- {
- public void keyPressed(KeyEvent e)
- {
- // Esc
- if (((int)e.character) == 27)
- cancelSelection();
- }
- public void keyReleased(KeyEvent e)
- {
- }
- }
- );
- text_.addTraverseListener(new TraverseListener()
- {
- public void keyTraversed(TraverseEvent e)
- {
- if (e.detail == SWT.TRAVERSE_TAB_NEXT)
- traverseTabNext();
- else if (e.detail == SWT.TRAVERSE_TAB_PREVIOUS)
- traverseTabPrevious();
- }
- }
- );
- editor_.setEditor(text_, tableItem, column);
- text_.setFocus();
- text_.selectAll();
- }
-
- protected void traverseTabNext()
- {
- internalRefresh();
- internalDispose();
- if (!(editRow_ == table_.getItems().length-1 && editColumn_ == columns_.length-1))
- {
- if (editColumn_ < columns_.length-1)
- editColumn_++;
- else
- {
- editColumn_ = 0;
- editRow_++;
- table_.select(editRow_);
- }
- editSelection(editRow_, editColumn_);
- }
- }
-
- protected void traverseTabPrevious()
- {
- internalRefresh();
- internalDispose();
- if (!(editRow_ == 0 && editColumn_ == 0))
- {
- if (editColumn_ > 0)
- editColumn_--;
- else
- {
- editColumn_ = columns_.length-1;
- editRow_--;
- table_.select(editRow_);
- }
- editSelection(editRow_, editColumn_);
- }
- }
-
- public void cancelSelection()
- {
- internalDispose();
- internalRefresh();
- }
-
- public void editSelection()
- {
- int selectedRowIndex = table_.getSelectionIndex();
- if (selectedRowIndex != -1 && columns_.length > 0)
- {
- // refresh table
- internalRefresh();
- // Clean up any previous editor control
- internalDispose();
- editSelection(selectedRowIndex, 0);
- }
- currSelectionIndex_ = selectedRowIndex;
- }
- }
-
- protected class ListContentProvider implements IStructuredContentProvider
- {
- public void dispose()
- {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- tableViewer_.add(getElements(newInput));
- }
-
- public Object[] getElements(Object inputElement)
- {
- if (inputElement instanceof List)
- {
- List list = (List)inputElement;
- Object[] objects = new Object[list.size()];
- for (int i = 0; i < objects.length; i++)
- objects[i] = list.get(i);
- return objects;
- }
- else
- return new Object[0];
- }
- }
-
- protected class ListLabelProvider implements ITableLabelProvider
- {
- public Image getColumnImage(Object element, int columnIndex)
- {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex)
- {
- return element.toString();
- }
-
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return true;
- }
-
- public void dispose()
- {
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/Utils.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/Utils.java
deleted file mode 100644
index 41e17c3..0000000
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsil/Utils.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.ui.wsil;
-
-import java.net.MalformedURLException;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-
-
-public class Utils
-{
- public Utils()
- {
- }
-
- public String toFileSystemURI(String relativePlatformURI)
- {
- if (relativePlatformURI != null)
- return toFileSystemURI(ResourceUtils.findResource(relativePlatformURI));
- else
- return null;
- }
-
- public String toFileSystemURI(IResource res)
- {
- if (res != null)
- {
- IPath path = res.getLocation();
- if (path != null)
- {
- try
- {
- return path.toFile().toURL().toString();
- }
- catch (MalformedURLException murle)
- {
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/.classpath b/bundles/org.eclipse.jst.ws.consumption/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.ws.consumption/.cvsignore b/bundles/org.eclipse.jst.ws.consumption/.cvsignore
deleted file mode 100644
index 39ea2e1..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-build.xml
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption/.project b/bundles/org.eclipse.jst.ws.consumption/.project
deleted file mode 100644
index b98513e..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.ws.consumption</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.wst.command.env</project>
- <project>org.eclipse.wst.command.env.core</project>
- <project>org.eclipse.jst.ws</project>
- <project>org.eclipse.wst.wsdl</project>
- <project>org.eclipse.wst.ws.apache.soap</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.ws.consumption/build.properties b/bundles/org.eclipse.jst.ws.consumption/build.properties
deleted file mode 100644
index d540b63..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-source.wsc.jar = src/
-src.includes = build.properties,\
- doc/,\
- plugin.properties,\
- plugin.xml,\
- readme.html,\
- src/,\
- webserviceutils/
-jars.compile.order = wsc.jar,\
- webserviceutils.jar
-bin.includes = plugin.properties,\
- plugin.xml,\
- readme.html,\
- wsc.jar,\
- webserviceutils.jar
-source.webserviceutils.jar = webserviceutils/
diff --git a/bundles/org.eclipse.jst.ws.consumption/plugin.properties b/bundles/org.eclipse.jst.ws.consumption/plugin.properties
deleted file mode 100644
index 603482d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Web Services Consumption
-PLUGIN_PROVIDER=Eclipse.org
diff --git a/bundles/org.eclipse.jst.ws.consumption/plugin.xml b/bundles/org.eclipse.jst.ws.consumption/plugin.xml
deleted file mode 100644
index 487fd8c..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/plugin.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id="org.eclipse.jst.ws.consumption"
- version="1.0.0"
- name="%PLUGIN_NAME"
- provider-name="%PLUGIN_PROVIDER"
- class="org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin">
-
- <runtime>
- <library name="wsc.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.wst.ws.apache.soap"/>
- <import plugin="org.eclipse.jem"/>
- <import plugin="org.eclipse.jem.workbench"/>
- <import plugin="org.eclipse.emf.common"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.xsd"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.jst.ws"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <import plugin="org.eclipse.wst.command.env"/>
- <import plugin="com.ibm.wtp.emf.workbench"/>
- <import plugin="org.eclipse.jface"/>
- <import plugin="org.eclipse.wst.ws.parser"/>
- <import plugin="org.eclipse.wst.ws.apache.wsil"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.wst.server.ui"/>
- <import plugin="org.eclipse.jst.server.core"/>
- <import plugin="org.eclipse.wst.wsdl"/>
- <import plugin="org.eclipse.wst.internet.monitor.core"/>
- <import plugin="org.eclipse.wst.common.emf"/>
- <import plugin="org.eclipse.jst.j2ee.core"/>
- <import plugin="org.eclipse.jst.j2ee.ejb"/>
- <import plugin="org.eclipse.jst.j2ee"/>
- <import plugin="org.eclipse.jst.j2ee.web"/>
- <import plugin="org.eclipse.wst.common.emfworkbench.integration"/>
- <import plugin="org.eclipse.wst.common.frameworks"/>
- <import plugin="org.eclipse.jst.j2ee.ui"/>
- <import plugin="org.eclipse.wst.web"/>
- </requires>
-
- <extension-point
- id="wsfinder"
- name="org.eclipse.jst.ws.internal.consumption.wsfinder"/>
-
- <!-- The following extension point will be removed. -->
- <extension-point
- id="webServiceStartServerType"
- name="WebServiceStartServerType"/>
-
- <extension-point
- id="serverDefaulter"
- name="Server Defaulter"/>
-
- <extension
- point="org.eclipse.jst.ws.consumption.webServiceStartServerType">
- <webServiceStartServerType
- factoryId="org.eclipse.jst.server.tomcat.32"
- class="org.eclipse.jst.ws.internal.consumption.command.common.StartTomcatServer"
- id="SERVER_ID_TOMCAT32_LOCAL">
- </webServiceStartServerType>
- <webServiceStartServerType
- factoryId="org.eclipse.jst.server.tomcat.40"
- class="org.eclipse.jst.ws.internal.consumption.command.common.StartTomcatServer"
- id="SERVER_ID_TOMCAT40_LOCAL">
- </webServiceStartServerType>
- <webServiceStartServerType
- factoryId="org.eclipse.jst.server.tomcat.41"
- class="org.eclipse.jst.ws.internal.consumption.command.common.StartTomcatServer"
- id="SERVER_ID_TOMCAT41_LOCAL">
- </webServiceStartServerType>
- <webServiceStartServerType
- factoryId="org.eclipse.jst.server.tomcat.50"
- class="org.eclipse.jst.ws.internal.consumption.command.common.StartTomcatServer"
- id="SERVER_ID_TOMCAT50_LOCAL">
- </webServiceStartServerType>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/consumption/plugin.properties b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/consumption/plugin.properties
deleted file mode 100644
index 243f934..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/consumption/plugin.properties
+++ /dev/null
@@ -1,158 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Sample messages
-#
-MSG_ERROR_JTS_PROXY_HAS_NO_METHODS=IWAB0179E Unable to create a sample to the proxy because the proxy does not contain methods.
-MSG_ERROR_JTS_PROXY_HAS_NO_DEFAULT=IWAB0180E Unable to create a sample to the proxy because the proxy is not a bean (i.e.. the sample does not have public default constructor).
-MSG_ERROR_JTS_NO_PROXY_METHODS_PROCESSED=IWAB0181E Unable to create a sample to the proxy because none of the methods in the proxy were processed.
-MSG_WARN_JTS_UNSUPPORTED_TYPE=IWAB0182W The Sample JSP client does not support the following type:
-MSG_WARN_JTS_UNSUPPORTED_INDEXED_PROPERTIES=IWAB0187W The Sample JSP client does not support Indexed properties.
-MSG_WARN_JTS_UNSUPPORTED_PARAMETERS_ARRAYS=IWAB0237W The Sample JSP client does not support arrays:
-MSG_WARN_JTS_UNSUPPORTED_PARAMETERS_INPUTS=IWAB0124W The Sample JSP client does not support input parameters that are not beans:
-MSG_ERROR_JTS_CYCLIC_BEAN=IWAB0188E The Sample JSP client does not support beans containing attributes that reference the beans.
-MSG_WARN_JTS_PROXY_METHODS_OMITTED=IWAB0189W The Sample JSP client omitted some methods because they contained unsupported types.
-MSG_ERROR_SAMPLE_CREATION_CANCELED=IWAB0021E Sample creation was canceled
-MSG_WARN_UNABLE_TO_FIND_PROXY=IWAB0022W The Proxy Resource cound not not be found.
-
-
-#
-# Filters
-#
-FILTER_MSG_ERROR_NULL_OBJECT=IWAB0097E No object has been provided.
-FILTER_MSG_ERROR_NOT_FILE=IWAB0098E The object "{0}" is not a file.
-FILTER_MSG_ERROR_NOT_FOLDER=IWAB0137E The object "{0}" is not a folder.
-
-JAVA_FILTER_NAME=Java files
-JAVA_FILTER_DESC=Files with names ending in ".java" or ".class".
-JAVA_FILTER_MSG_ERROR_WRONG_EXTENSION=IWAB0102E The file "{0}" does not end in ".java" or ".class".
-
-WSDL_FILTER_NAME=WSDL files
-WSDL_FILTER_DESC=Files with names ending in ".wsdl".
-WSDL_FILTER_MSG_ERROR_WRONG_EXTENSION=IWAB0103E The file "{0}" does not end in ".wsdl".
-
-ISD_FILTER_NAME=ISD files
-ISD_FILTER_DESC=Files with names ending in ".isd".
-ISD_FILTER_MSG_ERROR_WRONG_EXTENSION=IWAB0095E The file "{0}" does not end in ".isd".
-
-FOLDER_FILTER_NAME=Folders
-FOLDER_FILTER_DESC=Folders.
-
-
-#
-# Common messages
-#
-
-
-MSG_ERROR_PROJECT_NOT_FOUND=IWAB0069E Web project was not found.
-MSG_ERROR_INSTANCE_NOT_FOUND=IWAB0070E Server was not found.
-
-PROGRESS_INFO_PUBLISH_WEB_PROJECT=IWAB0072I Publishing Web project.
-
-#
-# Deployment status
-#
-PROGRESS_INFO_COPY_WEBSERVICE_UTILS=IWAB0023I Copying the webservice utilities.
-PROGRESS_INFO_COPYING_FILE=IWAB0197I Copying SOAP run-time file.
-PROGRESS_INFO_START_WEB_PROJECT=IWAB0198I Starting Web project.
-PROGRESS_INFO_PUBLISHING_SERVER=IWAB0199I Publishing server.
-PROGRESS_INFO_STARTING_SERVER=IWAB0200I Starting server.
-PROGRESS_INFO_PUBLISH_WEB_PROJECT=IWAB0205I Publishing Web project.
-
-
-#
-# Deployment messages
-#
-MSG_ERROR_PROJECT_NOT_FOUND=IWAB0207E Web project was not found.
-MSG_ERROR_FILECOPY_WEBSERVICE_UTILS=IWAB0024E Error in copying Webservice Utility file.
-MSG_ERROR_INSTANCE_NOT_FOUND=IWAB0212E Server was not found.
-MSG_ERROR_SERVER=IWAB0213E Error in starting server.
-MSG_ERROR_PUBLISH=IWAB0217E Error in publishing Web project.
-
-MSG_WARN_NO_DB_DRIVER=IWAB0221W Unable to locate db2java.zip, please ensure db2java.zip is added to the server class path.
-
-MSG_ERROR_BAD_SERVER_CONFIG=IWAB0534E Unable to add EAR project to Server Configuration.
-MSG_ERROR_CREATE_SERVER=IWAB0025E Unable to create server.
-
-
-
-#
-# EJB messages
-#
-TASK_LABEL_CREATE_EJB_PROJECT=CreateEJBProjectTask
-TASK_DESC_CREATE_EJB_PROJECT=Create an EJB Project.
-MSG_ERROR_CANNOT_CREATE_EJB_PROJECT=IWAB0432E Unable to create EJB project.
-MSG_ERROR_CANNOT_CREATE_APP_CLIENT_PROJECT=IWAB0026E Unable to create application client project {0}.
-MSG_ERROR_CANNOT_CREATE_JAVA_PROJECT=IWAB0027E Unable to create Java project {0}.
-MSG_ERROR_CANNOT_CREATE_EAR_PROJECT=IWAB0062E Unable to create EAR project {0}.
-
-#
-# WebServiceMappingPage Messages
-#
-
-#
-# Validator task descriptions
-#
-TASK_LABEL_WEBSERVICE_DISABLE_VALIDATION=Disable validators.
-TASK_DESC_WEBSERVICE_DISABLE_VALIDATION=Temporarily disabling validators.
-TASK_LABEL_WEBSERVICE_RESTORE_VALIDATION=Restore validators.
-TASK_DESC_WEBSERVICE_RESTORE_VALIDATION=Restoring states of validators.
-TASK_LABEL_WEBSERVICE_DISABLE_BUILD=Disable auto build.
-TASK_DESC_WEBSERVICE_DISABLE_BUILD=Temporarily disabling auto build.
-TASK_LABEL_WEBSERVICE_RESTORE_BUILD=Restore auto build.
-TASK_DESC_WEBSERVICE_RESTORE_BUILD=Restoring state of auto build.
-TASK_LABEL_WEBSERVICE_BUILD_PROJECT=Build project.
-TASK_DESC_WEBSERVICE_BUILD_PROJECT=Building project.
-
-#
-# MISC
-#
-TASK_DESC_CREATE_WEB_PROJECT=Create Web Project
-TASK_LABEL_CREATE_WEB_PROJECT=Create Web Project
-MSG_ERROR_WEB_PROJECT_CREATE=IWAB0310E An error occurred during creation of the Web Project.
-MSG_ERROR_SERVER_VIEW_OPEN=IWAB0126E The server configuration editor is open for {0}. Close it and restart the wizard.
-
-#
-# Default Proxy project messages
-#
-
-
-#
-# DetectNonJavaCharsCommand
-#
-MSG_WARN_JAVA_METHOD_START_WITH_UPPER_CASE=IWAB0129W Java method {0} in class {1} starts with an upper case letter. Method names should begin with lower case letters.
-MSG_WARN_METHOD_NAME_INVALID=IWAB0131W Java method {0} name contains underscore or numeric digits followed by a lower case letter.\
-Method names should not contain lower case letters after a numeric or underscore.
-MSG_WARN_BOOLEAN_PROPERTY_ACCESSORS=IWAB0132W Boolean property accessor {0} in bean {1} begins with "get". Boolean getter methods should begin wth "is".
-MSG_WARN_PACKAGE_NAME_HAS_UPPER_CASE=IWAB0133W The package name {0} of class {1} includes upper case letters. Package names should consist of lower case letters only.
-
-#
-# JavaToModelCommand
-#
-LABEL_OK=OK
-DESCRIPTION_OK=Select OK to continue
-
-LABEL_CANCEL=Cancel
-DESCRIPTION_CANCEL=Select Cancel to cancel
-
-#
-# CreateMonitorCommand
-#
-MSG_ERROR_UNABLE_TO_START_MONITOR=IWAB0001E Unable to monitor port {0} of {1}.
-MSG_INFO_MONITORING_NOT_SUPPORTED=IWAB0002I {0} does not support port monitoring.
-
-#
-# CopyWSDLCommand
-#
-COMMAND_LABEL_COPY_WSDL=Copying WSDL
-COMMAND_DESC_COPY_WSDL=Copying WSDL into the workspace for Web service deployment
-MSG_ERROR_COPY_WSDL=IWAB0028E Failed to copy WSDL {0} to {1}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/Generator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/Generator.java
deleted file mode 100644
index 1ebafc3..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/Generator.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen;
-
-import java.util.Vector;
-
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-/**
-* Objects of this class represent a generator.
-* */
-public class Generator implements VisitorAction
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- * The StringBuffer that holds the codegen
- * */
- protected StringBuffer fbuffer;
-
- /**
- * The Visitor that calls the visit method
- * */
- protected Visitor fVisitor;
-
- /**
- * Vector that holds state data for this generator
- * */
- protected Vector fResidentVector;
-
- /*
- * This int holds the current number
- */
- protected int fUniqueNumber =0;
-
-
- protected String fClientFolderPath;
-
- public static final String FACTORY = "Factory";
-
- public static final String TAB = " ";
- public static final String DOUBLE_TAB = " ";
- public static final String SPACE = " ";
-
- /**
- * Constructor.
- *
- */
- public Generator ()
- {
- fbuffer = new StringBuffer();
- fResidentVector = new Vector();
-
- }
-
- /**
- * Constructor.
- * @param StringBuffer Takes the buffer it will write code to
- */
- public Generator (StringBuffer buffer)
- {
- fbuffer = buffer;
- fResidentVector = new Vector();
- }
-
- public void initialize(String resident)
- {
- //nothing to be done but must be implemented
- }
-
- public String getClientFolderPath()
- {
- return fClientFolderPath;
- }
-
- public void setClientFolderPath(String fClientFolderPath_)
- {
- fClientFolderPath = fClientFolderPath_;
- }
-
- protected String serviceName = "";
- protected String portName = "";
- protected String packageName = "";
- protected String proxyBaseName = "";
-
- public void setInfo(String service, String port, String packageName, String proxyBase)
- {
- serviceName = service;
- portName = port;
- this.packageName = packageName;
- proxyBaseName = proxyBase;
- }
-
- private static final char[] BAD_SYMBOLS = {'-', ' '}; // symbols that can appear in the folder name but it is not allowed in a java bean name
- private static final char UNDERSCORE = '_'; // replace the above ones by underscore
- public String getSessionBeanId()
- {
- String name = getClientFolderPath();
- int index = name.lastIndexOf("/");
- index++;
- String newName = name.substring(index);
- for ( int i = 0; i < BAD_SYMBOLS.length; i++ ) {
- newName = newName.replace ( BAD_SYMBOLS[i], UNDERSCORE );
- }
- return newName+ "id";
- }
-
- /*
- * The Number Factory is here for naming purposes. In
- * this way we insure no names we create in a piece of
- * code gen are the same. We keep track of the numbers
- * used and we hand back the next one. Like take a number
- * buddy
- * @param int number we are at as the state data has to be settable
- */
- public void setNumberFactory(int number)
- {
- fUniqueNumber = number;
- }
-
-
- /*
- * This is a unique number for state purposes
- * @return int
- */
- public int getNumberFactory()
- {
- return fUniqueNumber;
- }
- /*
- * This is a unique number for naming purposes
- * @return int
- */
- public int getUniqueNumber()
- {
- return fUniqueNumber++;
- }
-
-
- /**
- * returns the current StringBuffer
- * @return StringBuffer Takes the buffer it will write code too
- */
- public StringBuffer getStringBuffer ()
- {
- return fbuffer;
- }
-
-
- /**
- * returns the Visitor that called this generator
- * @return Visitor
- */
- public Visitor getVisitor ()
- {
- return fVisitor;
- }
-
-
-
-
- /**
- * vector used to hold state data
- * @parameter Visitor
- */
- public void putResidentVector (Object object)
- {
- fResidentVector.addElement(object);
- }
-
-
- /**
- * vector used to hold state data
- * @parameter Visitor
- */
- public void setResidentVector (Vector vector)
- {
- fResidentVector = vector;
- }
-
-
- /**
- * returns the resident vector
- * @return Visitor
- */
- public Vector getResidentVector ()
- {
- return fResidentVector;
- }
-
-
- /**
- * This function is used to initialize any state a generator may have
- *
- **/
-
- public void initialize()
- {
- //to be implemented in sublasses
- }
-
-
- /**
- * sets the visitor that calls the visit
- * @parameter Visitor
- */
-
- public void setVisitor(Visitor visitor)
- {
- fVisitor = visitor;
- }
-
-
- public Status visit (Object object)
- {
- //implemented by subclasses
- return new SimpleStatus("");
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/RelVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/RelVisitor.java
deleted file mode 100644
index 2be247f..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/RelVisitor.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-import org.eclipse.jst.ws.internal.datamodel.Rel;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a visitor.
-* This vistor will visit elements in a model given a
-* particular rel
-* */
-public class RelVisitor implements Visitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- private int fElementCounter;
- private int fTotalElements;
- private String frelName;
-
- /**
- * Constructor.
- *
- */
-
- public RelVisitor (String relName)
- {
- frelName = relName;
- }
-
- public int getTotalElementsToVisit()
- {
- return fTotalElements;
- }
-
- public boolean isLastElement()
- {
- if(getTotalElementsToVisit() - presentElement() == 0) return true;
- return false;
- }
-
- public int presentElement()
- {
- return fElementCounter;
- }
-
- public void initialize(VisitorAction va)
- {
- //implemented by subclasses
- }
- public Status run (Object sourceElement,VisitorAction vAction)
- {
- Status status = new SimpleStatus("");
- initialize(vAction);
-
- vAction.setVisitor(this);
- Rel rel = ((BasicElement)sourceElement).getRel(frelName);
- //set some state data
- fTotalElements = rel.getNumberOfTargetElements();
- fElementCounter = 0;
-
- Enumeration e = rel.getTargetElements();
- while (e.hasMoreElements()){
- BasicElement targetElement = (BasicElement)e.nextElement();
- fElementCounter++;
- initialize(vAction);
- status = vAction.visit(targetElement);
- }
- return status;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/Visitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/Visitor.java
deleted file mode 100644
index 42fe69a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/Visitor.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen;
-
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public interface Visitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public Status run (Object object, VisitorAction vAction);
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/VisitorAction.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/VisitorAction.java
deleted file mode 100644
index b3b0b42..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/VisitorAction.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen;
-
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a VisitorAction.
-* The visitor walks the model and the VisitorAction
-* does the action
-* */
-public interface VisitorAction
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- public Status visit (Object object);
- public void setVisitor(Visitor visitor);
- public void initialize(String residentString);
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/AttributeVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/AttributeVisitor.java
deleted file mode 100644
index 30ffda6..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/AttributeVisitor.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.bean;
-
-import java.util.Vector;
-
-import org.eclipse.jst.ws.internal.consumption.codegen.RelVisitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.VisitorAction;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeElement;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.InputFileAttributeGenerator;
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class AttributeVisitor extends RelVisitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- private String fResidentString;
- private Vector fResidentVector1;
- private Vector fResidentVector2;
-
- /**
- * Constructor.
- *
- */
-
- public AttributeVisitor ()
- {
- super(TypeElement.REL_ATTRIBUTES);
- fResidentString = "";
- }
-
- public AttributeVisitor (String rel)
- {
- super(rel);
- fResidentString = "";
- }
-
- public void setResidentString(String resident)
- {
- fResidentString = resident;
- }
-
- public void setResidentVector1(Vector resident)
- {
- fResidentVector1 = resident;
- }
-
- public void setResidentVector2(Vector resident)
- {
- fResidentVector2 = resident;
- }
-
-
- public void initialize(VisitorAction vAction)
- {
- //hack for 197726
-
- if(vAction instanceof InputFileAttributeGenerator){
- if(fResidentVector1 == null) fResidentVector1=new Vector();
- if(fResidentVector2 == null) fResidentVector2=new Vector();
- ((InputFileAttributeGenerator)vAction).setParentGetters(fResidentVector1,fResidentVector2);
- }
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/FieldVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/FieldVisitor.java
deleted file mode 100644
index d6db38b..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/FieldVisitor.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.bean;
-
-import java.util.Vector;
-
-import org.eclipse.jst.ws.internal.consumption.codegen.VisitorAction;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeElement;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.InputFileAttributeGenerator;
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class FieldVisitor extends AttributeVisitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- private String fResidentString;
- private Vector fResidentVector1;
- private Vector fResidentVector2;
-
- /**
- * Constructor.
- *
- */
-
- public FieldVisitor ()
- {
- super(TypeElement.REL_FIELDS);
- fResidentString = "";
- }
-
- public void setResidentString(String resident)
- {
- fResidentString = resident;
- }
-
- public void setResidentVector1(Vector resident)
- {
- fResidentVector1 = resident;
- }
-
- public void setResidentVector2(Vector resident)
- {
- fResidentVector2 = resident;
- }
-
-
- public void initialize(VisitorAction vAction)
- {
- //hack for 197726
-
- if(vAction instanceof InputFileAttributeGenerator){
- if(fResidentVector1 == null) fResidentVector1=new Vector();
- if(fResidentVector2 == null) fResidentVector2=new Vector();
- ((InputFileAttributeGenerator)vAction).setParentGetters(fResidentVector1,fResidentVector2);
- }
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/MethodVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/MethodVisitor.java
deleted file mode 100644
index 3466462..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/MethodVisitor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.bean;
-
-import org.eclipse.jst.ws.internal.consumption.codegen.RelVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanElement;
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class MethodVisitor extends RelVisitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- * Constructor.
- *
- */
-
- public MethodVisitor ()
- {
- super(BeanElement.REL_METHODS);
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/ParameterVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/ParameterVisitor.java
deleted file mode 100644
index 0749312..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/ParameterVisitor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.bean;
-
-import org.eclipse.jst.ws.internal.consumption.codegen.RelVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.MethodElement;
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class ParameterVisitor extends RelVisitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- * Constructor.
- *
- */
-
- public ParameterVisitor ()
- {
- super(MethodElement.REL_PARAMETERS);
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/ReturnParameterVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/ReturnParameterVisitor.java
deleted file mode 100644
index 1f62070..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/ReturnParameterVisitor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.bean;
-
-import org.eclipse.jst.ws.internal.consumption.codegen.RelVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.MethodElement;
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class ReturnParameterVisitor extends RelVisitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- * Constructor.
- *
- */
-
- public ReturnParameterVisitor ()
- {
- super(MethodElement.REL_RETURN_PARAMETERS);
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/TypeVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/TypeVisitor.java
deleted file mode 100644
index d254615..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/bean/TypeVisitor.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.bean;
-
-import org.eclipse.jst.ws.internal.consumption.codegen.RelVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeElement;
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class TypeVisitor extends RelVisitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- * Constructor.
- *
- */
-
- public TypeVisitor ()
- {
- super(TypeElement.REL_TYPE);
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/DetectNonJavaCharsBeanVisitorAction.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/DetectNonJavaCharsBeanVisitorAction.java
deleted file mode 100644
index 9901a73..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/DetectNonJavaCharsBeanVisitorAction.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitoractions;
-
-import java.util.Vector;
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofMethodVisitor;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-
-/**
-* Objects of this class represent a JavaMofBeanVisitorAction.
-* This VisitorAction will create a BeanElement using the
-* JavaClass and the BeanModelElementsFactory
-* It will also automatically walk the methods in the JavaClass
-* */
-public class DetectNonJavaCharsBeanVisitorAction extends VisitorActionImpl
-{
- private static char UNDERSCORE = '_';
- private boolean serviceBean = false;
-
- public DetectNonJavaCharsBeanVisitorAction ( Vector messages, Vector beans)
- {
- super (messages, beans);
- // if first bean fisited that means it is the Service bean
- if ( beans == null )
- serviceBean = true;
- }
-
- /**
- * The visit will create the bean
- * Walk the methods
- * @param JavaClass the class to be used to create the bean model
- **/
- public Status visit (Object javaclass)
- {
- JavaClass javaClass = (JavaClass)javaclass;
- String packageName = javaClass.getJavaPackage().getPackageName();
- String beanName = javaClass.getName();
-
- if (!isBeanVisited(javaClass)) {
- addVisitedBean(javaClass);
- // check the bean name
- checkBeanName(beanName);
- checkPackageName(packageName, beanName);
- DetectNonJavaCharsMethodVisitorAction methodVisitorAction = new DetectNonJavaCharsMethodVisitorAction(getMessages(), getBeansVisited());
- JavaMofMethodVisitor methodVisitor = new JavaMofMethodVisitor();
- methodVisitor.run(javaClass,methodVisitorAction);
- }
-
- return new SimpleStatus("");
- }
-
- private void checkBeanName(String beanName)
- {
-
- // check if the bean starts with a lower case
- if ( Character.isLowerCase(beanName.charAt(0)))
- addMessage("WARN_BEAN_NAME_STARTS_WITH_LOWER_CASE", new String[]{beanName});
-
-
- //check if the name has an underscore, then next letter should be upper case
- int underScoreIndex = beanName.indexOf(UNDERSCORE);
- String tempName = beanName;
- while(underScoreIndex !=-1) {
- tempName = tempName.substring(underScoreIndex+1);
- if ( Character.isLowerCase(tempName.charAt(0))) {
- addMessage("MSG_WARN_METHOD_NAME_INVALID", new String[] { beanName });
- break;
- }
- else
- underScoreIndex = tempName.indexOf(UNDERSCORE);
- }
- }
-
- private void checkPackageName(String packageName, String beanName)
- {
- if (!packageName.equals(packageName.toLowerCase()))
- addMessage("MSG_WARN_PACKAGE_NAME_HAS_UPPER_CASE", new String[] { packageName, beanName });
- }
- }
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/DetectNonJavaCharsMethodVisitorAction.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/DetectNonJavaCharsMethodVisitorAction.java
deleted file mode 100644
index b9e6680..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/DetectNonJavaCharsMethodVisitorAction.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitoractions;
-
-import java.util.Vector;
-
-import org.eclipse.jem.java.Method;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofParameterVisitor;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a JavaMofBeanVisitorAction.
-* This VisitorAction will create a BeanElement using the
-* JavaClass and the BeanModelElementsFactory
-* It will also automatically walk the methods in the JavaClass
-* */
-public class DetectNonJavaCharsMethodVisitorAction extends VisitorActionImpl
-{
- private static char UNDERSCORE = '_';
- private boolean serviceBean = false;
-
- public DetectNonJavaCharsMethodVisitorAction ( Vector messages, Vector beans)
- {
- super (messages, beans);
- if ( beans.size() == 1)
- serviceBean = true;
- }
-
- /**
- * Create a method element from the method
- * @param Method the class to be used to create the method
- **/
- public Status visit (Object imethod)
- {
-
- Method method = (Method)imethod;
- String className = method.getContainingJavaClass().getName();
- String name = method.getName();
-
- if ( serviceBean && !method.isConstructor() )
- checkUpperCase(name, className);
-
- // for service bean or any referenced bean property accessors
- if ( serviceBean || name.startsWith("get") || name.startsWith("set") || name.startsWith("is"))
- {
- checkUnderScore(name, className);
- checkNumericDigits(name, className);
- checkBooleanProperties(method, className);
-
- DetectNonJavaCharsParameterVisitorAction parameterVisitorAction = new DetectNonJavaCharsParameterVisitorAction(getMessages(), getBeansVisited());
- // rsk Passing in null for the environment. DetectNonJavaCharsParameterVisitorAction always returns an OK status.
- JavaMofParameterVisitor parameterVisitor = new JavaMofParameterVisitor(null);
- parameterVisitor.run(method, parameterVisitorAction);
- }
-
- return new SimpleStatus("");
- }
-
- private void checkUpperCase(String name, String className)
- {
- // in a service bean check if any method starts with upper case letter
- if ( Character.isUpperCase(name.charAt(0)))
- addMessage("MSG_WARN_JAVA_METHOD_START_WITH_UPPER_CASE", new String[]{name, className});
-
- }
-
- private void checkUnderScore(String name, String className)
- {
- //check if the name has an underscore, then next letter should be upper case
- int underScoreIndex = name.indexOf(UNDERSCORE);
- String tempName = name;
- while(underScoreIndex !=-1) {
- tempName = tempName.substring(underScoreIndex+1);
- if ( Character.isLowerCase(tempName.charAt(0))) {
- addMessage("MSG_WARN_METHOD_NAME_INVALID", new String[]{name, className});
- break;
- }
- else
- underScoreIndex = tempName.indexOf(UNDERSCORE);
- }
- }
-
- private void checkNumericDigits(String name, String className)
- {
- //check if the name has a numeric, then next letter should be upper case
- for ( int i = 0; i < name.length(); i++)
- {
- if ( Character.isDigit(name.charAt(i)))
- {
- if (Character.isLowerCase(name.charAt(i+1))) {
- addMessage("MSG_WARN_METHOD_NAME_INVALID", new String[]{name, className});
- break;
- }
- }
- }
- }
- private void checkBooleanProperties(Method method, String className)
- {
- if (!serviceBean && method.getName().startsWith("get") &&
- (method.getReturnType().getName().equals("boolean") ||
- method.getReturnType().getName().equals("java.lang.Boolean")))
- addMessage("MSG_WARN_BOOLEAN_PROPERTY_ACCESSORS", new String[]{method.getName(), className});
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/DetectNonJavaCharsParameterVisitorAction.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/DetectNonJavaCharsParameterVisitorAction.java
deleted file mode 100644
index d21bf1e..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/DetectNonJavaCharsParameterVisitorAction.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitoractions;
-
-import java.util.Vector;
-
-import org.eclipse.jem.java.ArrayType;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.JavaParameter;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofBeanVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-/**
-* Objects of this class represent a JavaMofBeanVisitorAction.
-* This VisitorAction will create a BeanElement using the
-* JavaClass and the BeanModelElementsFactory
-* It will also automatically walk the methods in the JavaClass
-* */
-public class DetectNonJavaCharsParameterVisitorAction extends VisitorActionImpl
-{
-
- public DetectNonJavaCharsParameterVisitorAction ( Vector messages, Vector beans)
- {
- super (messages, beans);
- }
-
- /**
- * Create a method element from the method
- * @param Method the class to be used to create the method
- **/
- public Status visit (Object ijavaParameter)
- {
-
- JavaParameter javaParameter = (JavaParameter) ijavaParameter;
- JavaClass javaClass = null;
- if ( javaParameter.getJavaType() instanceof JavaClass)
- {
- javaClass = (JavaClass) javaParameter.getJavaType();
- if (javaClass.isArray())
- {
- JavaHelpers componentType = ((ArrayType)javaClass).getComponentTypeAsHelper();
- if (componentType instanceof JavaClass)
- {
- javaClass = (JavaClass)componentType;
- }
- else
- {
- javaClass = null; //The array contains primitive types, there is no need for further checking.
- }
- }
- }
- if (toBeVisited(javaClass)) {
- DetectNonJavaCharsBeanVisitorAction beanVisitorAction = new DetectNonJavaCharsBeanVisitorAction(getMessages(), getBeansVisited());
- JavaMofBeanVisitor beanVisitor = new JavaMofBeanVisitor();
- beanVisitor.run(javaClass,beanVisitorAction);
- }
-
- return new SimpleStatus("");
- }
-
-
- private boolean toBeVisited (JavaClass javaClass)
- {
- //check for recognized types
- if( javaClass == null ||
- javaClass.isPrimitive() ||
- javaClass.getJavaName().startsWith("javax") ||
- TypeFactory.recognizedBean(javaClass.getJavaName()))
- return false;
- else
- return true;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofAttributeVisitorAction.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofAttributeVisitorAction.java
deleted file mode 100644
index 0783ef3..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofAttributeVisitorAction.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitoractions;
-
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.JavaParameter;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofTypeVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.AttributeElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanModelElementsFactory;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.common.SamplePropertyDescriptor;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusException;
-
-
-/**
-* Objects of this class represent a JavaMofBeanVisitorAction.
-* This VisitorAction will create a AttributeElement using the
-* JavaClass and the BeanModelElementsFactory
-* It will also automatically walk a complex type
-* */
-public class JavaMofAttributeVisitorAction extends JavaMofBeanVisitorAction
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- private MessageUtils msgUtils_;
-
- /*
- *Constructor
- **/
- public JavaMofAttributeVisitorAction(Element parentElement, String project, Environment env)
- {
- super(parentElement,project, env);
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- }
-
- /**
- * Create a type element from the JavaHelper
- * @param JavaParameter the mof element to be used to create the attribute
- **/
-
-
- //bean info code
-
-
- public Status visit (Object propertyDecorator)
- {
- Status status = new SimpleStatus("");
-
- //PropertyDecorator pd = (PropertyDecorator)propertyDecorator;
- SamplePropertyDescriptor pd = (SamplePropertyDescriptor)propertyDecorator;
-
-
- try{
- //if the type of this attribute is unsupported dont make an Attribute
- if(!(getReturnParam() && TypeFactory.isRecognizedReturnType((JavaHelpers)pd.getPropertyType()))
- && (TypeFactory.isUnSupportedType((JavaHelpers)pd.getPropertyType()))){
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_WARN_JTS_UNSUPPORTED_TYPE") + ((JavaHelpers)pd.getPropertyType()).getJavaName(), Status.WARNING );
- //getStatusMonitor().reportStatus( new Status(IStatus.WARNING,WebServiceConsumptionPlugin.ID,0,
- //WebServiceConsumptionPlugin.getMessage( "%MSG_WARN_JTS_UNSUPPORTED_TYPE") + ((JavaHelpers)pd.getPropertyType()).getJavaName(),null));
- return status;
- }
-
- Method setMethod = pd.getWriteMethod();
- Method getMethod = pd.getReadMethod();
- if(setMethod != null){
- if(setMethod.isStatic()){
- setMethod=null;
- }
- }
- if(getMethod != null){
- if(getMethod.isStatic()){
- getMethod=null;
- }
- }
- if(pd.isfStatic()){
- return status;
- }
-
- AttributeElement attributeElement = (AttributeElement)BeanModelElementsFactory.getBeanModelElement(propertyDecorator,fParentElement);
-
- if(attributeElement != null){
-
- //lets check and see if the getter takes input params
- //if so throw an error
- //now the inputs
- if(getMethod != null){
- JavaParameter javaParameter[] = getMethod.listParametersWithoutReturn();
- if(javaParameter.length > 0){
- if(getReturnParam()) return status;
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_WARN_JTS_UNSUPPORTED_INDEXED_PROPERTIES") + getMethod.getName(), Status.WARNING );
- //getStatusMonitor().reportStatus (new Status(IStatus.WARNING,WebServiceConsumptionPlugin.ID,0,
- // WebServiceConsumptionPlugin.getMessage( "%MSG_WARN_JTS_UNSUPPORTED_INDEXED_PROPERTIES" ) + getMethod.getName(),null));
- return status;
- }
- }
- if(setMethod != null) attributeElement.setSetterMethod(setMethod.getMethodElementSignature());
- if(getMethod != null) attributeElement.setGetterMethod(getMethod.getMethodElementSignature());
-
- JavaMofTypeVisitorAction typeVisitorAction = new JavaMofTypeVisitorAction(attributeElement,clientProject, env_);
- typeVisitorAction.setStatusMonitor(getStatusMonitor());
- typeVisitorAction.setBeansCreated(getBeansCreated());
- typeVisitorAction.setReturnParam(getReturnParam());
- JavaMofTypeVisitor typeVisitor = new JavaMofTypeVisitor(env_);
- typeVisitor.setClientProject(getProject());
- status = typeVisitor.run(pd,typeVisitorAction);
-
- }
-
- return status;
- }catch(Exception e)
- {
- env_.getLog().log(Log.WARNING, 5054, this, "visit", e);
- status = new SimpleStatus("JavaMofAttributeVisitorAction", //$NON-NLS-1$
- msgUtils_.getMessage("MSG_ERROR_JTS_JSP_GEN"), Status.WARNING, e);
- try {
- env_.getStatusHandler().report(status);
- } catch (StatusException e1) {
- status = new SimpleStatus("JavaMofAttributeVisitorAction", //$NON-NLS-1$
- msgUtils_.getMessage("MSG_ERROR_JTS_JSP_GEN"), Status.ERROR);
- }
- return status;
- }
- //env.Log.write(this,"visit",Log.OK,e);}
-
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofBeanVisitorAction.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofBeanVisitorAction.java
deleted file mode 100644
index c942694..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofBeanVisitorAction.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitoractions;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.JavaParameter;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jst.ws.internal.command.NullStatusMonitor;
-import org.eclipse.jst.ws.internal.command.StatusMonitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.Visitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.VisitorAction;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofAttributeVisitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofFieldVisitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofMethodVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanModelElementsFactory;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-import org.eclipse.wst.command.env.core.common.Choice;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.BooleanSelection;
-
-/**
-* Objects of this class represent a JavaMofBeanVisitorAction.
-* This VisitorAction will create a BeanElement using the
-* JavaClass and the BeanModelElementsFactory
-* It will also automatically walk the methods in the JavaClass
-* */
-public class JavaMofBeanVisitorAction implements VisitorAction
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private MessageUtils msgUtils_;
- protected Environment env_;
- // protected BeanElement fBeanElement;
-
- protected Visitor fVisitor;
-
- /*
- * The project that defines the context
- **/
- protected String clientProject;
-
- /*
- * The Status monitor
- **/
- protected StatusMonitor monitor_;
-
- /*
- * The model that will be created
- **/
- protected Model fModel;
-
- /*
- * This is the parent element used when creating a
- * new element
- */
- protected Element fParentElement;
-
- /*
- * Methods processed from proxy
- */
- protected Vector fBeansCreated;
-
- private BooleanSelection[] fMethodsSelected;
-
- /*
- * this boolean tells wether the bean is a return parameter or an input parameter
- * usually this should be set around the parametervisitoraction, and passed on from there
- */
- protected boolean fReturnParam=false;
-
- public JavaMofBeanVisitorAction(String clientProject,BooleanSelection[] methods, Environment env)
- {
- this.clientProject = clientProject;
- fMethodsSelected = methods;
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- env_ = env;
- }
-
-
-
- /*
- *Constructor
- * @param Model model is the Model that this bean will be placed in
- * @param IProject used in nature
- **/
- public JavaMofBeanVisitorAction(Model model, String clientProject, Environment env)
- {
- this.clientProject = clientProject;
- fModel = model;
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- env_ = env;
- }
-
- /*
- *Constructor
- * @param Element the parent element that this element will be added too
- * @param IProject used in nature
- **/
- public JavaMofBeanVisitorAction(Element parentElement, String clientProject, Environment env )
- {
- fParentElement = parentElement;
- this.clientProject = clientProject;
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- env_ = env;
- }
-
- /**
- * The visit will create the bean
- * Walk the methods
- * @param JavaClass the class to be used to create the bean model
- **/
- public Status visit (Object javaclass)
- {
- Choice OKChoice = new Choice('O', msgUtils_.getMessage("LABEL_OK"), msgUtils_.getMessage("DESCRIPTION_OK"));
- Choice CancelChoice = new Choice('C', msgUtils_.getMessage("LABEL_CANCEL"), msgUtils_.getMessage("DESCRIPTION_CANCEL"));
- Status status = new SimpleStatus("");
- JavaClass javaClass = (JavaClass)javaclass;
-
-
- BeanElement beanElement = (BeanElement)BeanModelElementsFactory.getBeanModelElement(javaClass,fParentElement,fModel);
- if(beanElement.isOwnerParameter()) {
- resetBeansCreated();
- }
- fModel = beanElement.getModel();
-
- //this for the subsequent beans that represent types
- //first do the attributes
- //if we are not on the root
- if (!(beanElement == fModel.getRootElement())){
- Enumeration e = getBeansCreated().elements();
- while(e.hasMoreElements()){
- String name = (String)e.nextElement();
- if(name.equals(javaClass.getName())){
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_JTS_CYCLIC_BEAN"), Status.WARNING);
- //getStatusMonitor().reportStatus(new Status(IStatus.WARNING,WebServiceConsumptionPlugin.ID,0,
- //WebServiceConsumptionPlugin.getMessage( "%MSG_ERROR_JTS_CYCLIC_BEAN" ),null));
- return status;
- }
- }
-
- JavaMofAttributeVisitorAction attributeVisitorAction = new JavaMofAttributeVisitorAction(beanElement,clientProject, env_);
- //attributeVisitorAction.setStatusMonitor(getStatusMonitor());
- Vector childVector = ((Vector)getBeansCreated().clone());
- childVector.addElement(javaClass.getName());
- attributeVisitorAction.setBeansCreated(childVector);
- attributeVisitorAction.setReturnParam(getReturnParam());
- JavaMofAttributeVisitor attributeVisitor = new JavaMofAttributeVisitor();
- attributeVisitor.setReturnParameter(getReturnParam());
- attributeVisitor.setProject(getProject());
- attributeVisitor.setEnvironment(env_);
- status = attributeVisitor.run(javaClass,attributeVisitorAction);
- //
- int severity = status.getSeverity();
- if (severity==Status.ERROR)
- return status;
-
- if (severity==Status.WARNING)
- {
- Choice result = env_.getStatusHandler().report(status, new Choice[]{OKChoice, CancelChoice});
- if (result.getLabel().equals(CancelChoice.getLabel()))
- {
- //return an error status since the user canceled
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SAMPLE_CREATION_CANCELED"), Status.ERROR);
- }
-
- }
- //
-
- JavaMofFieldVisitorAction fieldVisitorAction = new JavaMofFieldVisitorAction(beanElement,clientProject, env_);
- //fieldVisitorAction.setStatusMonitor(getStatusMonitor());
- Vector childVector2 = ((Vector)getBeansCreated().clone());
- childVector2.addElement(javaClass.getName());
- fieldVisitorAction.setBeansCreated(childVector2);
- fieldVisitorAction.setReturnParam(getReturnParam());
- JavaMofFieldVisitor fieldVisitor = new JavaMofFieldVisitor();
- fieldVisitor.setProject(getProject());
- status = fieldVisitor.run(javaClass,fieldVisitorAction);
- //
- severity = status.getSeverity();
- if (severity==Status.ERROR)
- return status;
-
- if (severity==Status.WARNING)
- {
- Choice result = env_.getStatusHandler().report(status, new Choice[]{OKChoice, CancelChoice});
- if (result.getLabel().equals(CancelChoice.getLabel()))
- {
- //return an error status since the user canceled
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SAMPLE_CREATION_CANCELED"), Status.ERROR);
- }
-
- }
- //
-
- }
-
- //this is to insure we are on the proxy
- //now do the methods
- if (beanElement == fModel.getRootElement()){
- //first lets make sure the proxy is in good form
- //-it has a default constructor
- //-it has at least one method
- //otherwise return the problem in the form of a status
-
- if (!proxyCheck(javaClass, status)) return status;
- JavaMofMethodVisitorAction methodVisitorAction = new JavaMofMethodVisitorAction(beanElement,clientProject, env_);
-
- //methodVisitorAction.setStatusMonitor(getStatusMonitor());
- JavaMofMethodVisitor methodVisitor = new JavaMofMethodVisitor();
- methodVisitor.setMethodSelection(fMethodsSelected);
- status = methodVisitor.run(javaClass,methodVisitorAction);
-
- //
- int severity = status.getSeverity();
- if (severity==Status.ERROR)
- return status;
-
- if (severity==Status.WARNING)
- {
- Choice result = env_.getStatusHandler().report(status, new Choice[]{OKChoice, CancelChoice});
- if (result.getLabel().equals(CancelChoice.getLabel()))
- {
- //return an error status since the user canceled
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SAMPLE_CREATION_CANCELED"), Status.ERROR);
- }
-
- }
- //
- //This is where we check for several things:
- //-if no methods were processed because of unsupported types then we send back that result
- //-if there were any methods omitted we should warn them
-
- //first no methods
- if (!methodVisitorAction.wereMethodsProcessed()){
- //this has to be done to insure the dialog is an error
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_ERROR_JTS_NO_PROXY_METHODS_PROCESSED"), Status.ERROR);
- return status;
- //getStatusMonitor().reportStatus( new Status(IStatus.ERROR,WebServiceConsumptionPlugin.ID,0,
- // WebServiceConsumptionPlugin.getMessage( "%MSG_ERROR_JTS_NO_PROXY_METHODS_PROCESSED" ),null));
- }
- //now methods omitted
- else if(methodVisitorAction.wereMethodsOmitted()){
- //The dialog is already a warning so we just need to set the overall message
- status = new SimpleStatus("",msgUtils_.getMessage("MSG_WARN_JTS_PROXY_METHODS_OMITTED"), Status.WARNING);
- return status;
- //getStatusMonitor().reportStatus( new Status(IStatus.WARNING,WebServiceConsumptionPlugin.ID,0,
- // WebServiceConsumptionPlugin.getMessage( "%MSG_WARN_JTS_PROXY_METHODS_OMITTED" ),null));
- }
- }
- return status;
- }
-
- public void initialize(String resident)
- {
- //nothing to be done but must be implemented
- }
-
-
- /*
- * Return the model that was created
- * @return Model the bean model that was created
- */
- public Model getModel()
- {
- return fModel;
- }
-
- /*
- * The proxy check insures there is a default constructor and
- * at Least one method
- * @param JavaClass javaClass is used to traverse the methods on the proxy
- */
- public boolean proxyCheck(JavaClass javaClass, Status status)
- {
- // first check for a method
- Iterator m=javaClass.getPublicMethods().iterator();
- if (!m.hasNext()){
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_JTS_PROXY_HAS_NO_METHODS"),Status.ERROR);
- //getStatusMonitor().reportStatus( new Status(IStatus.ERROR,WebServiceConsumptionPlugin.ID,0,
- // WebServiceConsumptionPlugin.getMessage( "%MSG_ERROR_JTS_PROXY_HAS_NO_METHODS" ),null));
- return false;
- }
- //now check for a default constructor
- while (m.hasNext()) {
- Method method=(Method)m.next();
- if (javaClass.getName().equals(method.getName())){
- //now the inputs
- JavaParameter javaParameter[] = method.listParametersWithoutReturn();
- if (javaParameter.length > 0){
- //then we have no default constructor
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_JTS_PROXY_HAS_NO_DEFAULT"),Status.ERROR);
- //getStatusMonitor().reportStatus( new Status(IStatus.ERROR,WebServiceConsumptionPlugin.ID,0,
- //WebServiceConsumptionPlugin.getMessage( "%MSG_ERROR_JTS_PROXY_HAS_NO_DEFAULT" ),null));
- return false;
- }
- }
- }
- return true;
-
- }
-
- /**
- * Sets the status monitor that this action will use to report status that occres while executing the Action.
- */
- public void setStatusMonitor ( StatusMonitor monitor )
- {
- monitor_ = monitor;
- }
-
- /**
- * Returns the status monitor that this task is using to report status.
- */
- public StatusMonitor getStatusMonitor ()
- {
- if (monitor_ == null)
- {
- monitor_ = new NullStatusMonitor();
- }
- return monitor_;
- }
-
-
- /**
- * check if the action has finished sucsessfully
- */
- /*
- public boolean isSuccessful ()
- {
- return getStatusMonitor().canContinue();
- }
- */
- public void resetBeansCreated()
- {
- fBeansCreated = new Vector();
- }
-
- public void setEnvironment(Environment env)
- {
- env_ = env;
- }
-
- /*
- * The command that called this will get the results of the operation in the form
- * of a status.
- */
- public Vector getBeansCreated ()
- {
- if(fBeansCreated == null) fBeansCreated = new Vector();
- return fBeansCreated;
- }
-
- /*
- * The command that called this will get the results of the operation in the form
- * of a status.
- */
- public void setBeansCreated (Vector beansCreated)
- {
- fBeansCreated = beansCreated;
- }
-
- /*
- * This boolean tells wether we are dealing with a return param
- */
- public boolean getReturnParam ()
- {
- return fReturnParam;
- }
-
- /*
- * This boolean tells wether we are dealing with a return param
- */
- public void setReturnParam (boolean returnparam)
- {
- fReturnParam = returnparam;
- }
-
- /*
- * This boolean tells wether we are dealing with a return param
- */
- public String getProject ()
- {
- return clientProject;
- }
-
- /*
- * This boolean tells wether we are dealing with a return param
- */
- public void setProject (String clientProject)
- {
- this.clientProject = clientProject;
- }
-
-
- /**
- * sets the visitor that calls the visit
- * @parameter Visitor
- */
-
- public void setVisitor(Visitor visitor)
- {
- fVisitor = visitor;
- }
-
- /*
- * Sets the parent element the child then knows where to
- * add itself to the model
- * @param Element parent element
- */
- public void setParentElement(Element element)
- {
- fParentElement = element;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofFieldVisitorAction.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofFieldVisitorAction.java
deleted file mode 100644
index 7f44d3b..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofFieldVisitorAction.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitoractions;
-
-import org.eclipse.jem.java.Field;
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofTypeVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanModelElementsFactory;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.FieldElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusException;
-
-
-/**
-* Objects of this class represent a JavaMofBeanVisitorAction.
-* This VisitorAction will create a AttributeElement using the
-* JavaClass and the BeanModelElementsFactory
-* It will also automatically walk a complex type
-* */
-public class JavaMofFieldVisitorAction extends JavaMofBeanVisitorAction
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- private MessageUtils msgUtils_;
-
-
- /*
- *Constructor
- **/
- public JavaMofFieldVisitorAction(Element parentElement, String project, Environment env)
- {
- super(parentElement,project, env);
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- }
-
- /**
- * Create a type element from the JavaHelper
- * @param JavaParameter the mof element to be used to create the attribute
- **/
-
-
- //bean info code
-
-
- public Status visit (Object field_)
- {
- Status status = new SimpleStatus("");
- Field field = (Field)field_;
-
- try{
- //if the type of this attribute is unsupported dont make an Attribute
- if(!(getReturnParam() && TypeFactory.isRecognizedReturnType((JavaHelpers)field.getJavaClass()))
- && (TypeFactory.isUnSupportedType((JavaHelpers)field.getJavaClass()))){
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_WARN_JTS_UNSUPPORTED_TYPE") + ((JavaHelpers)field.getJavaClass()).getJavaName(), Status.WARNING );
- //getStatusMonitor().reportStatus( new Status(IStatus.WARNING,WebServiceConsumptionPlugin.ID,0,
- //WebServiceConsumptionPlugin.getMessage( "%MSG_WARN_JTS_UNSUPPORTED_TYPE") + ((JavaHelpers)field.getJavaClass()).getJavaName(),null));
- return status;
- }
-
-
- FieldElement fieldElement = (FieldElement)BeanModelElementsFactory.getBeanModelElement(field,fParentElement);
-
- if(fieldElement != null){
- //lets check and see if the getter takes input params
- //if so throw an error
- //now the inputs
-
- JavaMofTypeVisitorAction typeVisitorAction = new JavaMofTypeVisitorAction(fieldElement,clientProject, env_);
- typeVisitorAction.setStatusMonitor(getStatusMonitor());
- typeVisitorAction.setBeansCreated(getBeansCreated());
- typeVisitorAction.setReturnParam(getReturnParam());
- JavaMofTypeVisitor typeVisitor = new JavaMofTypeVisitor(env_);
- typeVisitor.setClientProject(getProject());
- status = typeVisitor.run(field,typeVisitorAction);
-
- }
- return status;
-
- }catch(Exception e)
- {
- env_.getLog().log(Log.WARNING, 5055, this, "visit", e);
- status = new SimpleStatus("JavaMofFieldVisitorAction", //$NON-NLS-1$
- msgUtils_.getMessage("MSG_ERROR_JTS_JSP_GEN"), Status.WARNING, e);
- try {
- env_.getStatusHandler().report(status);
- } catch (StatusException e1) {
- status = new SimpleStatus("JavaMofFieldVisitorAction", //$NON-NLS-1$
- msgUtils_.getMessage("MSG_ERROR_JTS_JSP_GEN"), Status.ERROR);
- }
- return status;
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofMethodVisitorAction.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofMethodVisitorAction.java
deleted file mode 100644
index cc98f19..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofMethodVisitorAction.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitoractions;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.JavaParameter;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofParameterVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanModelElementsFactory;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.MethodElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a JavaMofBeanVisitorAction.
-* This VisitorAction will create a BeanElement using the
-* JavaClass and the BeanModelElementsFactory
-* It will also automatically walk the methods in the JavaClass
-* */
-public class JavaMofMethodVisitorAction extends JavaMofBeanVisitorAction
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private MessageUtils msgUtils_;
- public String fUnsupportedParameterName;
-
- /*
- * Methods omitted from the proxy
- */
- protected Vector fMethodsOmitted;
-
- /*
- * Methods processed from proxy
- */
- protected Vector fMethodsProcessed;
-
-
- /*
- *Constructor
- **/
- public JavaMofMethodVisitorAction(Element parentElement,String project, Environment env)
- {
- super(parentElement,project, env);
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- fMethodsOmitted = new Vector();
- fMethodsProcessed = new Vector();
-
- }
-
- /**
- * Create a method element from the method
- * @param Method the class to be used to create the method
- **/
- public Status visit (Object imethod)
- {
- Status status = new SimpleStatus("");
- Method method = (Method)imethod;
-
- if (methodCheck(method)){
- //this is to check immediate input and return parameters
- //if there is an unsupported type in these we can react immediately
- //we add it to the omitted methods an go to the next one
- if(!parameterCheck(method)){
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_WARN_JTS_UNSUPPORTED_PARAMETERS_ARRAYS") + fUnsupportedParameterName, Status.WARNING );
- //getStatusMonitor().reportStatus (new Status(IStatus.WARNING,WebServiceConsumptionPlugin.ID,0,
- // WebServiceConsumptionPlugin.getMessage( "%MSG_WARN_JTS_UNSUPPORTED_PARAMETERS_ARRAYS" ) + fUnsupportedParameterName,null));
- fMethodsOmitted.addElement(method.getMethodElementSignature());
- return status;
- }
- if(!nullConstructor(method)){
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_WARN_JTS_UNSUPPORTED_PARAMETERS_INPUTS") + fUnsupportedParameterName, Status.WARNING );
- //getStatusMonitor().reportStatus (new Status(IStatus.WARNING,WebServiceConsumptionPlugin.ID,0,
- // WebServiceConsumptionPlugin.getMessage( "%MSG_WARN_JTS_UNSUPPORTED_PARAMETERS_INPUTS" ) + fUnsupportedParameterName,null));
- fMethodsOmitted.addElement(method.getMethodElementSignature());
- return status;
-
- }
-
- //carry on all parameters supported
- MethodElement methodElement = (MethodElement)BeanModelElementsFactory.getBeanModelElement(method,fParentElement);
- JavaMofParameterVisitorAction parameterVisitorAction = new JavaMofParameterVisitorAction(methodElement,clientProject,env_);
- parameterVisitorAction.setStatusMonitor(getStatusMonitor());
- JavaMofParameterVisitor parameterVisitor = new JavaMofParameterVisitor(env_);
- status = parameterVisitor.run(method,parameterVisitorAction);
- //something may have gone wrong with an internal type
- if (status.getSeverity()!=Status.OK){
- //This method has to be omitted
- fMethodsOmitted.addElement(method.getMethodElementSignature());
- methodElement.setMethodOmmission(true);
- }
- else {
- fMethodsProcessed.addElement(method.getMethodElementSignature());
- }
- }
-
- return status;
- }
-
- /*
- * Tells wether any methods were processed
- * @return boolean true if any methods were processed
- */
- public boolean wereMethodsProcessed()
- {
- if(fMethodsProcessed.isEmpty()) return false;
- return true;
- }
-
- /*
- * Tells wether there were methods omitted because of unsupported types
- * @return boolean true if methods were omitted
- */
- public boolean wereMethodsOmitted()
- {
- if(fMethodsOmitted.isEmpty()) return false;
- return true;
- }
-
- /**
- * There may be methods that we dont support
- * and dont want in the model
- * @param boolean true if all parameters are fine
- **/
- public boolean methodCheck(Method method)
- {
- boolean ok = true;
- // if we have a constructor we return false
- if (method.isConstructor()) return false;
-
-
- return ok;
- }
-
- /**
- * There may be parameters of this method that have types
- * not yet supported return false if we find any
- * @param boolean true if all parameters are fine
- **/
- public boolean parameterCheck(Method method)
- {
-
- boolean ok = true;
-
- //now the inputs
- JavaParameter javaParameter[] = method.listParametersWithoutReturn();
- boolean paramSupported = true;
- for (int i = 0;i<javaParameter.length;i++) {
- JavaParameter param=javaParameter[i];
- JavaHelpers javaHelper1 = param.getJavaType();
- if(TypeFactory.isUnSupportedType(javaHelper1)) {
- fUnsupportedParameterName = param.getName();
- return false;
- }
- }
- return ok;
- }
-
-
- /**
- * There may be parameters of this method that have types
- * not yet supported return false if we find any
- * @param boolean true if all parameters are fine
- **/
- public boolean nullConstructor(Method method)
- {
-
- boolean ok = true;
- //now the inputs
- JavaParameter javaParameter[] = method.listParametersWithoutReturn();
- boolean paramSupported = true;
- for (int i = 0;i<javaParameter.length;i++) {
- JavaParameter param=javaParameter[i];
- JavaHelpers javaHelper1 = param.getJavaType();
- if(javaHelper1 instanceof JavaClass){
- JavaClass javaClass = (JavaClass)javaHelper1;
- if(TypeFactory.recognizedBean(javaClass.getJavaName()))return true;
- Iterator m=javaClass.getMethods().iterator();
- while (m.hasNext()) {
- Method method2=(Method)m.next();
- if (javaClass.getName().equals(method2.getName())){
- //now the inputs
- JavaParameter javaParam[] = method2.listParametersWithoutReturn();
- if (javaParam.length > 0){
- //then we have no default constructor
- fUnsupportedParameterName = param.getName();
- ok = false;
- }
- else return true;
- }
- }
- }
- }
- return ok;
- }
-
-
-
-
-
-
-
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofParameterVisitorAction.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofParameterVisitorAction.java
deleted file mode 100644
index 83fc0ae..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofParameterVisitorAction.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitoractions;
-
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofTypeVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanModelElementsFactory;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.ParameterElement;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.Choice;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-/**
-* Objects of this class represent a JavaMofBeanVisitorAction.
-* This VisitorAction will create a parameterElement using the
-* JavaClass and the BeanModelElementsFactory
-* It will also automatically walk to its type
-* */
-public class JavaMofParameterVisitorAction extends JavaMofBeanVisitorAction
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- private MessageUtils msgUtils_;
-
- /*
- *Constructor
- **/
- public JavaMofParameterVisitorAction(Element parentElement,String project, Environment env)
- {
- super(parentElement,project, env);
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- }
-
- /**
- * Create a parameter element from the method
- * @param JavaParameter the mof element to be used to create the Parameter
- **/
- public Status visit (Object ijavaParameter)
- {
- Status status = new SimpleStatus("");
- Choice OKChoice = new Choice('O', msgUtils_.getMessage("LABEL_OK"), msgUtils_.getMessage("DESCRIPTION_OK"));
- Choice CancelChoice = new Choice('C', msgUtils_.getMessage("LABEL_CANCEL"), msgUtils_.getMessage("DESCRIPTION_CANCEL"));
-
- ParameterElement parameterElement = (ParameterElement)BeanModelElementsFactory.getBeanModelElement(ijavaParameter,fParentElement);
- JavaMofTypeVisitorAction typeVisitorAction = new JavaMofTypeVisitorAction(parameterElement,clientProject, env_);
- //typeVisitorAction.setStatusMonitor(getStatusMonitor());
- typeVisitorAction.setReturnParam(parameterElement.isReturn());
- JavaMofTypeVisitor typeVisitor = new JavaMofTypeVisitor(env_);
- typeVisitor.setClientProject(getProject());
- status = typeVisitor.run(ijavaParameter,typeVisitorAction);
- //
- int severity = status.getSeverity();
- if (severity==Status.ERROR)
- return status;
-
- if (severity==Status.WARNING)
- {
- Choice result = env_.getStatusHandler().report(status, new Choice[]{OKChoice, CancelChoice});
- if (result.getLabel().equals(CancelChoice.getLabel()))
- {
- //return an error status since the user canceled
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SAMPLE_CREATION_CANCELED"), Status.ERROR);
- }
-
- }
- //
- return status;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofTypeVisitorAction.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofTypeVisitorAction.java
deleted file mode 100644
index fa69b2c..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/JavaMofTypeVisitorAction.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitoractions;
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofBeanVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanModelElementsFactory;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.Choice;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-
-/**
-* Objects of this class represent a JavaMofBeanVisitorAction.
-* This VisitorAction will create a TypeElement using the
-* JavaClass and the BeanModelElementsFactory
-* It will also automatically walk a complex type
-* */
-public class JavaMofTypeVisitorAction extends JavaMofBeanVisitorAction
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- private MessageUtils msgUtils_;
-
- /*
- *Constructor
- **/
- public JavaMofTypeVisitorAction(Element parentElement,String project, Environment env)
- {
- super(parentElement,project, env);
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- }
-
- /**
- * Create a type element from the JavaHelper
- * @param JavaHelper the mof element to be used to create the Type
- **/
- public Status visit (Object typeNavigator)
- {
- Status status = new SimpleStatus("");
- Choice OKChoice = new Choice('O', msgUtils_.getMessage("LABEL_OK"), msgUtils_.getMessage("DESCRIPTION_OK"));
- Choice CancelChoice = new Choice('C', msgUtils_.getMessage("LABEL_CANCEL"), msgUtils_.getMessage("DESCRIPTION_CANCEL"));
-
- //if bean
- JavaClass javaClass = null;
- if(typeNavigator instanceof JavaClass){
- javaClass = (JavaClass)typeNavigator;
- }
-
-
- /* If we are dealing with a return parameter then we need to treat this differently then if it is an input
- * parameter.
- * We need to first see if it is a special case for return types if not we treat it the same as everything
- * else.
- */
- if(getReturnParam() && TypeFactory.isRecognizedReturnType((JavaHelpers)typeNavigator)){
- TypeElement typeElement = (TypeElement)BeanModelElementsFactory.getBeanModelElement(typeNavigator,fParentElement);
- }
- else{
- if(TypeFactory.isUnSupportedType((JavaHelpers)typeNavigator)){
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_WARN_JTS_UNSUPPORTED_TYPE") + ((JavaHelpers)typeNavigator).getJavaName(), Status.WARNING );
- //getStatusMonitor().reportStatus( new Status(IStatus.WARNING,WebServiceConsumptionPlugin.ID,0,
- //WebServiceConsumptionPlugin.getMessage( "%MSG_WARN_JTS_UNSUPPORTED_TYPE" ) + ((JavaHelpers)typeNavigator).getJavaName(),null));
- return status;
- }
-
- //if javaclass is null then we have a simple type
- if((javaClass == null) || TypeFactory.recognizedBean(javaClass.getJavaName())){
- TypeElement typeElement = (TypeElement)BeanModelElementsFactory.getBeanModelElement(typeNavigator,fParentElement);
- }
- else{
- JavaMofBeanVisitorAction beanVisitorAction = new JavaMofBeanVisitorAction(fParentElement,clientProject, env_);
- beanVisitorAction.setStatusMonitor(getStatusMonitor());
- beanVisitorAction.setBeansCreated(getBeansCreated());
- beanVisitorAction.setReturnParam(getReturnParam());
- JavaMofBeanVisitor beanVisitor = new JavaMofBeanVisitor();
- status = beanVisitor.run(javaClass,beanVisitorAction);
- }
- }
-
- //
- int severity = status.getSeverity();
- if (severity==Status.ERROR)
- return status;
-
- if (severity==Status.WARNING)
- {
- Choice result = env_.getStatusHandler().report(status, new Choice[]{OKChoice, CancelChoice});
- if (result.getLabel().equals(CancelChoice.getLabel()))
- {
- //return an error status since the user canceled
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SAMPLE_CREATION_CANCELED"), Status.ERROR);
- }
-
- }
- //
- return status;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/VisitorActionImpl.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/VisitorActionImpl.java
deleted file mode 100644
index f8b43d5..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitoractions/VisitorActionImpl.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitoractions;
-
-import java.util.Vector;
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.ws.internal.consumption.codegen.Visitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.VisitorAction;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-
-
-
-
-
-/**
-* Objects of this class represent a VisitorAction.
-* It will automatically walk the methods in the JavaClass
-* */
-public abstract class VisitorActionImpl implements VisitorAction
-{
-
- private Visitor fVisitor = null;
- private Vector beansVisited = null;
- private Vector messages = null;
- private MessageUtils msgUtils_;
-
- public VisitorActionImpl( Vector messages, Vector beansVisited)
- {
- this.messages = messages;
- this.beansVisited = beansVisited;
- msgUtils_ = new MessageUtils( "org.eclipse.jst.ws.consumption.plugin", this );
- }
-
- public void initialize(String resident)
- {
- //nothing to be done but must be implemented
- }
-
- /**
- * Returns the vector of all messages found
- */
- public Vector getMessages ()
- {
- if (messages == null)
- messages = new Vector();
- return messages;
- }
-
- public Vector getBeansVisited()
- {
- if ( beansVisited == null)
- beansVisited = new Vector();
- return beansVisited;
- }
-
- public void addVisitedBean( JavaClass bean)
- {
- if ( beansVisited == null)
- beansVisited = new Vector();
- beansVisited.add(bean);
- }
-
- public boolean isBeanVisited (JavaClass bean)
- {
- return (beansVisited != null && beansVisited.contains(bean));
- }
-
- /**
- * sets the visitor that calls the visit
- * @parameter Visitor
- */
-
- public void setVisitor(Visitor visitor)
- {
- fVisitor = visitor;
- }
-
- protected void addMessage ( String key )
- {
- getMessages().add(msgUtils_.getMessage(key));
- }
-
- protected void addMessage ( String key, Object[] args )
- {
- getMessages().add(msgUtils_.getMessage(key,args));
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofAttributeVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofAttributeVisitor.java
deleted file mode 100644
index 49d5f72..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofAttributeVisitor.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.JavaParameter;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jem.java.impl.FieldImpl;
-import org.eclipse.jst.ws.internal.consumption.codegen.Visitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.VisitorAction;
-import org.eclipse.jst.ws.internal.consumption.command.common.JavaMofReflectionCommand;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.common.SamplePropertyDescriptor;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class JavaMofAttributeVisitor implements Visitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- private String clientProject;
- private boolean returnParameter;
- private Environment env;
-
-
- public void setEnvironment(Environment env)
- {
- this.env = env;
- }
-
- /*
- * Use this to reflect
- */
- public void setProject(String clientProject)
- {
- this.clientProject = clientProject;
- }
-
- /*
- * Use this to reflect
- */
- public String getProject()
- {
- return clientProject;
- }
-
- public void setReturnParameter(boolean returnParameter)
- {
- this.returnParameter = returnParameter;
- }
-
-
- /*
- * Get the attribute belonging to this complex type
- * @param JavaParameter javaParameter that owns the type
- * @param VisitorAction Action to be performed on each method
- **/
- public Status run ( Object javaclass, VisitorAction vAction)
- {
- Status status = new SimpleStatus("");
- JavaClass javaClass = (JavaClass)javaclass;
-
- Hashtable spdMap = new Hashtable();
- for (Iterator m=javaClass.getPublicMethods().iterator(); m.hasNext(); ) {
- Method method=(Method)m.next();
- if (((method.getMethodElementSignature().startsWith("get")
- || method.getMethodElementSignature().startsWith("is"))
- && method.listParametersWithoutReturn().length == 0 )
- || (method.getMethodElementSignature().startsWith("set")
- && method.listParametersWithoutReturn().length > 0)) {
- int sub = 3;
- if(method.getMethodElementSignature().startsWith("is"))
- sub = 2;
- String propertyName = method.getMethodElementSignature().substring(sub);
- String lower = propertyName.substring(0,1).toLowerCase();
- String remainder = propertyName.substring(1);
- propertyName = lower + remainder;
- int index = propertyName.lastIndexOf("(");
- String temp = propertyName;
- propertyName = temp.substring(0,index);
-
- //find the propertydescriptor
- SamplePropertyDescriptor spd = (SamplePropertyDescriptor)spdMap.get(propertyName);
- if(spd == null){
- spd = new SamplePropertyDescriptor(propertyName);
- spdMap.put(propertyName,spd);
- }
- if(method.getMethodElementSignature().startsWith("set"))
- spd.setWriteMethod(method);
- else
- spd.setReadMethod(method);
-
- FieldImpl field = (FieldImpl)javaClass.getFieldNamed(propertyName);
- JavaHelpers propertyType = null;
- if(field != null){
- propertyType = field.getJavaType();
- spd.setfStatic(field.isStatic());
- }
- else{
- if(method.getMethodElementSignature().startsWith("get") || method.getMethodElementSignature().startsWith("is"))
- propertyType = method.getReturnType();
- else{
- JavaParameter params[] = method.listParametersWithoutReturn();
- propertyType = params[0].getJavaType();
- }
- }
-
- spd.setPropertyType(propertyType);
-
- }
- }
- Enumeration spdEnum = spdMap.elements();
- while(spdEnum.hasMoreElements()){
- SamplePropertyDescriptor spd = (SamplePropertyDescriptor)spdEnum.nextElement();
- if(spdCheck(spd))
- status = vAction.visit(spd);
- }
-
- return status;
-
- }
-
- private boolean spdCheck(SamplePropertyDescriptor spd)
- {
- //check for indexed properties
- Method writeMethod = spd.getWriteMethod();
- if(writeMethod != null)
- if(writeMethod.listParametersWithoutReturn().length > 1) return false;
-
- if(spd.getPropertyType() == null) return false;
- if(spd.getPropertyType().isPrimitive()) return true;
- if(returnParameter && TypeFactory.isRecognizedReturnType(spd.getPropertyType())) return true;
- if(!returnParameter && TypeFactory.isUnSupportedType(spd.getPropertyType())) return true;
- if(!checkPolarity(spd)) return false;
-
- // so its a bean make sure it has a default constructor
- JavaMofReflectionCommand javaMofRef = new JavaMofReflectionCommand();
- javaMofRef.setClientProject(getProject());
- javaMofRef.setProxyBean(((JavaHelpers)spd.getPropertyType()).getQualifiedName());
- javaMofRef.execute(env);
- if(javaMofRef.getJavaClass() instanceof JavaClass){
- if(TypeFactory.recognizedBean(javaMofRef.getJavaClass().getJavaName())) return true;
- return defaultCheck((JavaClass)javaMofRef.getJavaClass());
-
- }
- return true;
-
- }
-
- private boolean checkPolarity(SamplePropertyDescriptor spd){
-
- Method readMethod = spd.getReadMethod();
- Method writeMethod = spd.getWriteMethod();
- if((readMethod == null && writeMethod != null) || (readMethod != null && writeMethod == null))
- return true;
- if(readMethod == null && writeMethod == null)
- return false;
-
- JavaParameter javaParameter[] = writeMethod.listParametersWithoutReturn();
- for(int i = 0;i< javaParameter.length;i++){
- JavaParameter jp = javaParameter[i];
- String name1 = jp.getJavaType().getJavaName();
- String name = readMethod.getReturnType().getJavaName();
- if(jp.getJavaType().getJavaName().equals(readMethod.getReturnType().getJavaName()))
- return true;
- }
- return false;
- }
-
- private boolean defaultCheck(JavaClass javaClass){
-
- Iterator m=javaClass.getMethods().iterator();
- //now check for a default constructor
- boolean defaultConst = true;
- while (m.hasNext()) {
- Method method=(Method)m.next();
- if (javaClass.getName().equals(method.getName())){
- //now the inputs
- JavaParameter javaParameter[] = method.listParametersWithoutReturn();
- if (javaParameter.length > 0){
- //then we have no default constructor
- defaultConst = false;
- }
- else if(javaParameter.length == 0){
- if (method.getJavaVisibility().getValue() == 0)
- return true;
- }
- }
- }
-
- return defaultConst;
- }
-
- private boolean polarityCheck(JavaClass javaClass){
-
- Iterator m=javaClass.getMethods().iterator();
- //now check for a default constructor
- boolean defaultConst = true;
- while (m.hasNext()) {
- Method method=(Method)m.next();
- if (javaClass.getName().equals(method.getName())){
- //now the inputs
- JavaParameter javaParameter[] = method.listParametersWithoutReturn();
- if (javaParameter.length > 0){
- //then we have no default constructor
- defaultConst = false;
- }
- else if(javaParameter.length == 0){
- if (method.getJavaVisibility().getValue() == 0)
- return true;
- }
- }
- }
-
- return defaultConst;
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofBeanVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofBeanVisitor.java
deleted file mode 100644
index d338a34..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofBeanVisitor.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors;
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.ws.internal.consumption.codegen.Visitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.VisitorAction;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class JavaMofBeanVisitor implements Visitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /*
- *Constructor
- **/
- public JavaMofBeanVisitor()
- {
- }
-
- public Status run ( Object javaClass, VisitorAction vAction)
- {
- return vAction.visit((JavaClass)javaClass);
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofFieldVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofFieldVisitor.java
deleted file mode 100644
index c1a3961..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofFieldVisitor.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jem.java.Field;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.JavaParameter;
-import org.eclipse.jem.java.JavaVisibilityKind;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jem.java.impl.FieldImpl;
-import org.eclipse.jst.ws.internal.consumption.codegen.Visitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.VisitorAction;
-import org.eclipse.jst.ws.internal.consumption.command.common.JavaMofReflectionCommand;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class JavaMofFieldVisitor implements Visitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- private String clientProject;
-
- /*
- * Constructor
- **/
- public JavaMofFieldVisitor()
- {
- }
-
- /*
- * Use this to reflect
- */
- public void setProject(String clientProject)
- {
- this.clientProject = clientProject;
- }
-
- /*
- * Use this to reflect
- */
- public String getProject()
- {
- return clientProject;
- }
-
- /*
- * Get the attribute belonging to this complex type
- * @param JavaParameter javaParameter that owns the type
- * @param VisitorAction Action to be performed on each method
- **/
- public Status run ( Object javaclass, VisitorAction vAction)
- {
- Status status = new SimpleStatus("");
- JavaClass javaClass = (JavaClass)javaclass;
-
- boolean holderClass = false;
- EList implemented = javaClass.getImplementsInterfaces();
- for (int i = 0; i < implemented.size(); i++) {
- JavaClass anInterface = (JavaClass) implemented.get(i);
- if (anInterface.getQualifiedName().equals("javax.xml.rpc.holders.Holder"))
- holderClass = true;
- }
-
- //beaninfo code
- if(holderClass){
- EList e = javaClass.getFields();
- ListIterator list = e.listIterator();
- while(list.hasNext()){
- Field field = (Field)list.next();
- if(field.getJavaVisibility().getValue() == JavaVisibilityKind.PUBLIC && !field.isFinal() && !field.isStatic()){
- if(fieldCheck((FieldImpl)field))
- status = vAction.visit(field);
- }
- }
- }
-
- return status;
- }
- private boolean fieldCheck(FieldImpl field)
- {
- // so its a bean make sure it has a default constructor
- JavaMofReflectionCommand javaMofRef = new JavaMofReflectionCommand();
- javaMofRef.setProxyBean(field.getJavaType().getQualifiedName());
- javaMofRef.setClientProject(getProject());
- javaMofRef.execute(null);
- if(javaMofRef.getJavaClass() instanceof JavaClass){
- if(TypeFactory.recognizedBean(javaMofRef.getJavaClass().getJavaName())) return true;
- return defaultCheck((JavaClass)javaMofRef.getJavaClass());
- }
- return true;
- }
-
- private boolean defaultCheck(JavaClass javaClass){
-
- Iterator m=javaClass.getMethods().iterator();
- //now check for a default constructor
- boolean defaultConst = true;
- while (m.hasNext()) {
- Method method=(Method)m.next();
- if (javaClass.getName().equals(method.getName())){
- //now the inputs
- JavaParameter javaParameter[] = method.listParametersWithoutReturn();
- if (javaParameter.length > 0){
- //then we have no default constructor
- defaultConst = false;
- }
- else if(javaParameter.length == 0){
- if (method.getJavaVisibility().getValue() == 0)
- return true;
- else if(method.getJavaVisibility().getValue() == 1)
- defaultConst = false;
- }
- }
- }
-
- return defaultConst;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofMethodVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofMethodVisitor.java
deleted file mode 100644
index e2b2d92..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofMethodVisitor.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors;
-
-import java.util.Iterator;
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jst.ws.internal.consumption.codegen.Visitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.VisitorAction;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.BooleanSelection;
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class JavaMofMethodVisitor implements Visitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- public String SET_ENDPOINT = "setEndPoint";
- public String GET_ENDPOINT = "getEndPoint";
- private BooleanSelection[] fMethodsSelected;
-
-
- /*
- * Constructor
- **/
- public JavaMofMethodVisitor()
- {
- }
-
- public String UNDER_SCORE = "_";
-
- /*
- * Run through all the methods in this bean
- * @param JavaClass javaclass that holds the methods
- * @param VisitorAction Action to be performed on each method
- **/
- public Status run ( Object javaclass, VisitorAction vAction)
- {
- Status status = new SimpleStatus("");
- JavaClass javaClass = (JavaClass)javaclass;
- for (Iterator m=javaClass.getPublicMethods().iterator(); m.hasNext(); ) {
- Method method=(Method)m.next();
- if(fMethodsSelected != null) {
- boolean methodSelected = false;
- for(int i =0;i < fMethodsSelected.length;i++){
- if(fMethodsSelected[i] == null) continue;
- if ( fMethodsSelected[i].getValue().equals(method.getMethodElementSignature()))
- methodSelected = (boolean) fMethodsSelected[i].isSelected();
- }
- String methodName = method.getName();
- if(methodSelected)
- status = vAction.visit(method);
-
- }
- else {
- status = vAction.visit(method);
- }
-
- }
- return status;
- }
-
- public void setMethodSelection(BooleanSelection[] methodSelected)
- {
- fMethodsSelected = methodSelected;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofParameterVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofParameterVisitor.java
deleted file mode 100644
index 8be991f..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofParameterVisitor.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors;
-
-import java.util.List;
-
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.JavaParameter;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jst.ws.internal.consumption.codegen.Visitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.VisitorAction;
-import org.eclipse.wst.command.env.core.common.Choice;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class JavaMofParameterVisitor implements Visitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- private MessageUtils msgUtils_;
- private Environment env_;
-
- /*
- * Constructor
- **/
- public JavaMofParameterVisitor(Environment env)
- {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- env_ = env;
- }
-
- /*
- * Run through all the parameters in this method
- * @param JavaClass javaclass that holds the parameters
- * @param VisitorAction Action to be performed on each method
- **/
- public Status run ( Object imethod, VisitorAction vAction)
- {
- Status status = new SimpleStatus("");
- Choice OKChoice = new Choice('O', msgUtils_.getMessage("LABEL_OK"), msgUtils_.getMessage("DESCRIPTION_OK"));
- Choice CancelChoice = new Choice('C', msgUtils_.getMessage("LABEL_CANCEL"), msgUtils_.getMessage("DESCRIPTION_CANCEL"));
- Method method = (Method)imethod;
-
- JavaHelpers javaReturnParameter = method.getReturnType();
- //pgm This visitor used to take a JavaParameter type and now it is being called
- // with a JavaHelpers type. Gil, please ensure that this is Ok.
- status = vAction.visit(javaReturnParameter);
- //
- int severity = status.getSeverity();
- if (severity==Status.ERROR)
- return status;
-
- if (severity==Status.WARNING)
- {
- Choice result = env_.getStatusHandler().report(status, new Choice[]{OKChoice, CancelChoice});
- if (result.getLabel().equals(CancelChoice.getLabel()))
- {
- //return an error status since the user canceled
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SAMPLE_CREATION_CANCELED"), Status.ERROR);
- }
-
- }
- //
-
- //now the inputs
- List parameters = method.getParameters();
-
- for (int index = 0; index < parameters.size(); index++)
- {
- JavaParameter param=(JavaParameter)parameters.get(index);
- status = vAction.visit(param);
- //
- severity = status.getSeverity();
- if (severity==Status.ERROR)
- return status;
-
- if (severity==Status.WARNING)
- {
- Choice result = env_.getStatusHandler().report(status, new Choice[]{OKChoice, CancelChoice});
- if (result.getLabel().equals(CancelChoice.getLabel()))
- {
- //return an error status since the user canceled
- return new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SAMPLE_CREATION_CANCELED"), Status.ERROR);
- }
-
- }
- //
- }
-
- return status;
-
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofTypeVisitor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofTypeVisitor.java
deleted file mode 100644
index 543dcc5..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/codegen/javamofvisitors/JavaMofTypeVisitor.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors;
-
-import org.eclipse.jem.java.Field;
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.JavaParameter;
-import org.eclipse.jem.java.impl.FieldImpl;
-import org.eclipse.jst.ws.internal.consumption.codegen.Visitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.VisitorAction;
-import org.eclipse.jst.ws.internal.consumption.command.common.JavaMofReflectionCommand;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.common.SamplePropertyDescriptor;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-/**
-* Objects of this class represent a visitor.
-* */
-public class JavaMofTypeVisitor implements Visitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private Environment env_;
-
- private String clientProject;
-
- /*
- * Constructor
- **/
- public JavaMofTypeVisitor(Environment env)
- {
- env_ = env;
- }
-
- /*
- * Use this to reflect
- */
- public void setClientProject(String clientProject)
- {
- this.clientProject = clientProject;
- }
-
- /*
- * Use this to reflect
- */
- public String getClientProject()
- {
- return clientProject;
- }
-
- /*
- * Get the type belonging to the parameter
- * @param JavaParameter javaParameter that owns the type
- * @param VisitorAction Action to be performed on each method
- **/
- public Status run ( Object typeNavigator, VisitorAction vAction)
- {
- Status status = new SimpleStatus("");
- if (typeNavigator instanceof JavaParameter){
-
- JavaParameter javaParameter = (JavaParameter)typeNavigator;
- JavaHelpers javaHelpers = javaParameter.getJavaType();
- status = vAction.visit(javaHelpers);
- }
- else if (typeNavigator instanceof JavaHelpers){
- status = vAction.visit(typeNavigator);
- }
- else if (typeNavigator instanceof SamplePropertyDescriptor){
- SamplePropertyDescriptor pd = (SamplePropertyDescriptor)typeNavigator;
- JavaMofReflectionCommand javaMofRef = new JavaMofReflectionCommand();
- javaMofRef.setClientProject(clientProject);
- javaMofRef.setProxyBean(((JavaHelpers)pd.getPropertyType()).getQualifiedName());
- status = javaMofRef.execute(env_);
- if (status.getSeverity()==Status.ERROR)
- return status;
-
- status = vAction.visit(javaMofRef.getJavaClass());
- }
- else if (typeNavigator instanceof Field){
- FieldImpl field = (FieldImpl)typeNavigator;
- JavaMofReflectionCommand javaMofRef = new JavaMofReflectionCommand();
- javaMofRef.setClientProject(clientProject);
- javaMofRef.setProxyBean(field.getJavaType().getQualifiedName());
-
- status = javaMofRef.execute(env_);
- if (status.getSeverity()==Status.ERROR)
- return status;
-
- status = vAction.visit(javaMofRef.getJavaClass());
- }
-
- return status;
- }
-
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/AbstractStartServer.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/AbstractStartServer.java
deleted file mode 100644
index d9715aa..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/AbstractStartServer.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerUtil;
-
-public abstract class AbstractStartServer {
-
-private IProject project = null;
-protected IProgressMonitor monitor;
-private Log log_;
-private MessageUtils msgUtils_;
-
-public AbstractStartServer()
-{
- log_ = new EclipseLog();
- msgUtils_ = new MessageUtils( "org.eclipse.jst.ws.consumption.plugin", this );
-}
-
-/**
- * Execute the command
- */
-public void StartServer (IProject project, IServer server, IProgressMonitor monitor, boolean restart) throws CoreException
-{
- this.project = project;
- this.monitor = monitor;
-
- try
- {
-
-// IJavaServer javaServer = (IJavaServer) server.getDelegate();
-// addJarsToClassPath(javaServer);
- validateRemoteServerPath(server);
-
- if (server.getServerState() != IServer.STATE_STOPPED) // The Server is running
- {
- if (server.getServerRestartState())
- {
-
- server.synchronousStop(false);
- log_.log(Log.INFO, 5050, this, "StartServer", "project="+project+", Stop command completed, restart needed");
- publishProject(server);
- startProject(server);
- }
- else
- {
-
- if (restart) // WEB-INF\lib need to be reloaded
- {
- publishProject(server);
- restartProject(project, server);
- }
- }
- }
- else {
-
- publishProject(server);
- startProject(server);
- }
-}
-
- catch (CoreException ce) {
- throw ce;
- }
- catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR,WebServiceConsumptionPlugin.ID,0,msgUtils_.getMessage("MSG_ERROR_SERVER"),e));
- }
-}
-
-protected void publishProject(IServer server) throws CoreException
-{
- if (server.shouldPublish())
- {
- monitor.subTask( msgUtils_.getMessage( "PROGRESS_INFO_PUBLISHING_SERVER" ) );
- IStatus status = server.publish(monitor);
- if (status.getSeverity() != IStatus.OK)
- throw new CoreException(status);
- log_.log(Log.INFO, 5051, this, "publishProject", "IServer="+server+", Publish command completed");
- }
- }
-
-protected void startProject(IServer server) throws CoreException
-{
- try
- {
- monitor.subTask( msgUtils_.getMessage( "PROGRESS_INFO_STARTING_SERVER" ) );
- server.synchronousStart(ILaunchManager.RUN_MODE, monitor);
- log_.log(Log.INFO, 5052, this, "startProject", "IServer="+server+", Start command completed");
-
- }
- catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR,WebServiceConsumptionPlugin.ID,0,msgUtils_.getMessage("MSG_ERROR_SERVER"),e));
- }
-}
-
-protected void restartProject(IProject project, IServer server) throws CoreException
-{
- try
- {
-
- monitor.subTask( msgUtils_.getMessage( "PROGRESS_INFO_STARTING_SERVER" ) );
- EARNatureRuntime[] ears = J2EEUtils.getEARProjects(project);
- for (int i = 0; i < ears.length; i++)
- {
- IProject earProject = ears[i].getProject();
- if (earProject != null && ServerUtil.containsModule(server,ResourceUtils.getModule(earProject), monitor))
- {
- (new org.eclipse.wst.server.ui.actions.RestartProjectAction(earProject)).run();
- log_.log(Log.INFO, 5053, this, "restartProject", "earProject="+earProject+", Restart project command completed");
-
- }
- }
- }
- catch (Exception e) {
- throw new CoreException( new Status(IStatus.ERROR,WebServiceConsumptionPlugin.ID,0,msgUtils_.getMessage("MSG_ERROR_SERVER"),e));
- }
-}
-
-public void runPreServerConfig(IServer server, IProject EARProject){
-
- return;
-
-}
-
-public void runPostServerConfig(IServer server, IProject EARProject){
-
- return;
-}
-
-
-protected abstract void addJarsToClassPath(IServer server) throws CoreException;
-protected abstract void validateRemoteServerPath(IServer server) throws CoreException;
-
-public void stopServer(IServer server) throws CoreException {
-
- if (server != null) {
-
- if (server.getServerState() != IServer.STATE_STOPPED) {
- server.synchronousStop(false);
- }
- }
-
-}
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/BuildProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/BuildProjectCommand.java
deleted file mode 100644
index 2d9760b..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/BuildProjectCommand.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.validate.ValidationManager;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class BuildProjectCommand extends SimpleCommand
-{
- private ValidationManager validationManager;
- private IProject project_;
- private boolean forceBuild_;
- // rm private Model model;
-
- /**
- * Default CTOR;
- */
- public BuildProjectCommand()
- {
- super( WebServiceConsumptionPlugin.getMessage("%TASK_LABEL_WEBSERVICE_BUILD_PROJECT"),
- WebServiceConsumptionPlugin.getMessage("%TASK_DESC_WEBSERVICE_BUILD_PROJECT") );
- }
-
- /**
- * Execute the command
- */
- public Status execute(Environment env)
- {
- try
- {
- if (forceBuild_)
- project_.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
- else if (validationManager == null)
- project_.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
- else if (validationManager.getWorkspaceAutoBuildPreference())
- project_.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
- }
- catch (Exception e)
- {
- }
- /*
- try
- {
- Platform.getJobManager().join(null, new NullProgressMonitor());
- }
- catch (InterruptedException ie)
- {
- // continue execution
- }
- catch (OperationCanceledException oce)
- {
- // continue execution
- }
- */
- return new SimpleStatus("");
- }
- /**
- * @param forceBuild The forceBuild to set.
- */
- public void setForceBuild(boolean forceBuild) {
- this.forceBuild_ = forceBuild;
- }
-
- /**
- * @param project The project to set.
- */
- public void setProject(IProject project) {
- this.project_ = project;
- }
-
- /**
- * @param validationManager The validationManager to set.
- */
- public void setValidationManager(ValidationManager validationManager) {
- this.validationManager = validationManager;
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CheckProjectOKCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CheckProjectOKCommand.java
deleted file mode 100644
index 8bd96b7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CheckProjectOKCommand.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-
-public class CheckProjectOKCommand extends SimpleCommand {
-
- private String serviceServerTypeId_;
-
- private MessageUtils msgUtils_;
-
- /**
- * Default CTOR
- */
- public CheckProjectOKCommand() {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
-
- }
-
- public Status execute(Environment env) {
- Status status = new SimpleStatus("");
-
- String typeid = serviceServerTypeId_;
- IServer[] servers = ServerCore.getServers();
-// Iterator iterator = servers.iterator();
- boolean viewOpen = false;
- String serverName = null;
-
- for (int i=0;i<servers.length;i++) {
- IServer server = (IServer) servers[i];
-
- // If the configuration editor is open for the server that we are
- // deploying
- // to we will prompt the user to close it.
- if (server != null && server.getServerType().getId().equals(typeid)) {
- viewOpen = true;
- serverName = server.getName();
- break;
- }
- }
-
- if (viewOpen) {
- String errorMessage = msgUtils_.getMessage("MSG_ERROR_SERVER_VIEW_OPEN", new String[] { serverName});
- return new SimpleStatus("", errorMessage, Status.ERROR, null);
-
- }
-
- return status;
- }
-
- /**
- * @param serviceServerId
- * The serviceServer factory Id to set.
- */
- public void setServiceServerTypeID(String serviceServerId) {
- this.serviceServerTypeId_ = serviceServerId;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ClientServerDeployableConfigCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ClientServerDeployableConfigCommand.java
deleted file mode 100644
index adc4686..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ClientServerDeployableConfigCommand.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-
-public class ClientServerDeployableConfigCommand extends SimpleCommand {
-
- private String LABEL = "ClientServerDeployableConfigCommand";
- private String DESCRIPTION = "Ensure Deployable is added to Server Configuration for client projects";
- private MessageUtils msgUtils_;
- private Boolean creationScenario_ = Boolean.TRUE;
- private TypeRuntimeServer clientIds_;
- private IProject sampleProject_;
- private String serviceServerTypeID_;
- private String sampleServerTypeID_;
- private IServer serviceExistingServer_;
- private IServer sampleExistingServer_;
- private String serviceProjectURL_;
- private String sampleProjectURL_;
-
- //addedProjectToServer_ is set to true if
- //- the project exists AND
- //- the server exists (i.e. this command did not create it) AND
- //- this command added the project to the server
- private boolean addedProjectToServer_ = false;
- /**
- * Default CTOR
- */
- public ClientServerDeployableConfigCommand() {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- setDescription(DESCRIPTION);
- setName(LABEL);
- }
-
- /**
- * Default CTOR
- */
- public ClientServerDeployableConfigCommand(boolean creationScenario) {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- setDescription(DESCRIPTION);
- setName(LABEL);
- creationScenario_ = new Boolean(creationScenario);
- }
-
- /**
- * execute
- */
- public Status execute(Environment env) {
-
- Status status = new SimpleStatus("");
- try {
-
- // determine client or service project
- IProject project = sampleProject_;
- if (project == null)
- return status;
-
- // get sample server factory Id and instanceId
- String serverFactoryId = clientIds_.getServerId();
- String existingServerInstId = clientIds_.getServerInstanceId();
- IServer server = null;
- if (existingServerInstId ==null) {
- server= sampleExistingServer_;
- }
- else {
- // get an IServer object; either existing or create one
- server = ServerCore.findServer(existingServerInstId);
- }
-
- if (server != null) {
- // find exact server for given project
- IServer[] servers = ServerUtil.getServersByModule(ResourceUtils.getModule(project), null);
- boolean foundServer = false;
- for (int i = 0; i < servers.length; i++) {
- if (servers[i].equals(server))
- foundServer = true;
- }
- if (!foundServer) {
- Status modStatus = ServerUtils.getInstance().modifyModules(env ,server, ResourceUtils.getModule(project), true, EnvironmentUtils.getIProgressMonitor(env));
- if (modStatus.getSeverity()==Status.ERROR)
- return modStatus;
-
- addedProjectToServer_ = true;
- }
- }
- else {
- if (ResourceUtils.isTrueJavaProject(project))
- {
- //Don't attempt to add a Java project to a server, therefore passing in null for the module.
- server = ServerUtils.getInstance().createServer(env, null, serverFactoryId, true, EnvironmentUtils.getIProgressMonitor(env));
- }
- else
- {
- server = ServerUtils.getInstance().createServer(env, ResourceUtils.getModule(project), serverFactoryId, true, EnvironmentUtils.getIProgressMonitor(env));
- }
- if (server == null) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_CREATE_SERVER"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- IModule[] parentModules = server.getRootModules(ResourceUtils.getModule(project),null);
- if (parentModules!=null && parentModules.length!=0) {
- if (!ServerUtil.containsModule(server, ResourceUtils.getModule(project), null)) {
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, server, ResourceUtils.getModule(project), true, EnvironmentUtils.getIProgressMonitor(env));
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
- }
-
- }
-
- //
- String projectURL = ResourceUtils.getWebProjectURL(project, serverFactoryId, server);
- if (creationScenario_.booleanValue()) {
- serviceExistingServer_ = server;
- serviceProjectURL_ = projectURL;
- }
- else {
- sampleExistingServer_ = server;
- sampleProjectURL_ = projectURL;
- }
-
- return status;
- }
- catch (Exception e) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_BAD_SERVER_CONFIG"), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return status;
- }
- }
-
-
- public void setSampleProject(IProject sampleProject) {
- sampleProject_ = sampleProject;
- }
-
- public void setServiceServerTypeID(String serviceServerTypeID) {
- serviceServerTypeID_ = serviceServerTypeID;
- }
-
- public void setSampleServerTypeID(String sampleServerTypeID) {
- sampleServerTypeID_ = sampleServerTypeID;
- }
-
- public void setServiceExistingServer(IServer serviceExistingServer) {
- serviceExistingServer_ = serviceExistingServer;
- }
-
- public IServer getServiceExistingServer() {
- return serviceExistingServer_;
- }
-
- public String getServiceExistingServerInstId() {
- String id = null;
- IServerWorkingCopy wc = null;
- if (serviceExistingServer_!=null){
- wc = serviceExistingServer_.createWorkingCopy();
- id = (wc!=null ? wc.getId() : null);
- }
- return id;
- }
-
- public void setSampleExistingServer(IServer sampleExistingServer) {
- sampleExistingServer_ = sampleExistingServer;
- }
-
- public IServer getSampleExistingServer() {
- return sampleExistingServer_;
- }
-
- public String getSampleExistingServerInstId() {
- String id = null;
- IServerWorkingCopy wc = null;
- if (sampleExistingServer_!=null){
- wc = sampleExistingServer_.createWorkingCopy();
- id = (wc!=null ? wc.getId() : null);
- }
- return id;
- }
-
- public String getServiceProjectURL() {
- return serviceProjectURL_;
- }
-
- public String getSampleProjectURL() {
- return sampleProjectURL_;
- }
-
- public void setClientTypeRuntimeServer(TypeRuntimeServer trs){
- this.clientIds_ = trs;
- }
-
- /**
- * @return Returns the addedProjectToServer_.
- */
- public boolean getAddedProjectToServer() {
- return addedProjectToServer_;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ComputeEndpointCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ComputeEndpointCommand.java
deleted file mode 100644
index 4a4d3bc..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ComputeEndpointCommand.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Iterator;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.soap.SOAPAddress;
-
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-public class ComputeEndpointCommand extends SimpleCommand
-{
- private WebServicesParser webServicesParser;
- private String wsdlURI;
- private Boolean monitorService;
- private Integer monitoredPort;
-
- public ComputeEndpointCommand()
- {
- super("org.eclipse.jst.ws.internal.consumption.command.common.ComputeEndpointCommand", "org.eclipse.jst.ws.internal.consumption.command.common.ComputeEndpointCommand");
- }
-
- /**
- * @param monitoredPort The monitoredPort to set.
- */
- public void setMonitoredPort(Integer monitoredPort)
- {
- this.monitoredPort = monitoredPort;
- }
- /**
- * @param monitorService The monitorService to set.
- */
- public void setMonitorService(Boolean monitorService)
- {
- this.monitorService = monitorService;
- }
- /**
- * @param webServicesParser The webServicesParser to set.
- */
- public void setWebServicesParser(WebServicesParser webServicesParser)
- {
- this.webServicesParser = webServicesParser;
- }
- /**
- * @param wsdlURI The wsdlURI to set.
- */
- public void setWsdlURI(String wsdlURI)
- {
- this.wsdlURI = wsdlURI;
- }
-
- public String getEndpoint()
- {
- if (monitorService != null && monitorService.booleanValue() && monitoredPort != null)
- {
- Definition def = webServicesParser.getWSDLDefinition(wsdlURI);
- if (def != null)
- {
- for (Iterator it = def.getServices().values().iterator(); it.hasNext();)
- {
- Service service = (Service)it.next();
- for (Iterator it2 = service.getPorts().values().iterator(); it2.hasNext();)
- {
- Port port = (Port)it2.next();
- for (Iterator it3 = port.getExtensibilityElements().iterator(); it3.hasNext();)
- {
- ExtensibilityElement ext = (ExtensibilityElement)it3.next();
- if (ext instanceof SOAPAddress)
- {
- String location = ((SOAPAddress)ext).getLocationURI();
- try
- {
- URL url = new URL(location);
- url = new URL(url.getProtocol(), url.getHost(), monitoredPort.intValue(), url.getFile());
- return url.toString();
- }
- catch (MalformedURLException murle)
- {
- int protocolIndex = location.indexOf("://");
- if (protocolIndex != -1)
- {
- String protocol = location.substring(0, protocolIndex+3);
- int hostPortIndex = location.indexOf('/', protocolIndex+3);
- String file;
- if (hostPortIndex == -1)
- {
- hostPortIndex = location.length();
- file = "";
- }
- else
- file = location.substring(hostPortIndex, location.length());
- String hostPort = location.substring(protocolIndex+3, hostPortIndex);
- int hostIndex = hostPort.indexOf(':');
- String host;
- if (hostIndex != -1)
- host = hostPort.substring(0, hostIndex+1);
- else
- host = hostPort + ':';
- String newPort = String.valueOf(monitoredPort.intValue());
- StringBuffer endpoint = new StringBuffer(protocol);
- endpoint.append(host);
- endpoint.append(newPort);
- endpoint.append(file);
- return endpoint.toString();
- }
- }
- }
- }
- }
- }
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CopyWSDLCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CopyWSDLCommand.java
deleted file mode 100644
index 6f13390..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CopyWSDLCommand.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.Types;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLWriter;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.uri.URIException;
-import org.eclipse.wst.ws.parser.discovery.NetUtils;
-import org.eclipse.wst.ws.parser.wsil.WWWAuthenticationException;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-import org.eclipse.wst.wsdl.internal.impl.XSDSchemaExtensibilityElementImpl;
-import org.eclipse.wst.wsdl.internal.impl.wsdl4j.WSDLFactoryImpl;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDParser;
-import org.w3c.dom.Element;
-
-public class CopyWSDLCommand extends SimpleCommand
-{
- private String wsdlURI;
- private WebServicesParser webServicesParser;
- private String destinationURI;
- private Definition def;
- private Vector ignoreList;
-
- public CopyWSDLCommand()
- {
- super(WebServiceConsumptionPlugin.getMessage("COMMAND_LABEL_COPY_WSDL"), WebServiceConsumptionPlugin.getMessage("COMMAND_DESC_COPY_WSDL"));
- }
-
- /**
- * Execute the command
- */
- public Status execute(Environment env)
- {
- try
- {
- ignoreList = new Vector();
- if (def == null)
- def = webServicesParser.getWSDLDefinition(wsdlURI);
- copyWSDL(env, wsdlURI, getBaseURI(destinationURI), getLocalname(destinationURI), def);
- return new SimpleStatus("");
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- Status status = new SimpleStatus(WebServiceConsumptionPlugin.ID, WebServiceConsumptionPlugin.getMessage("MSG_ERROR_COPY_WSDL", new String[]{wsdlURI, destinationURI}), Status.ERROR, t);
- env.getStatusHandler().reportError(status);
- return status;
- }
- }
-
- private void copyWSDL(Environment env, String uri, String destURI, String destLocalname) throws WSDLException, IOException, WWWAuthenticationException, TransformerException, TransformerConfigurationException, URIException
- {
- Definition definition;
-
- try {
- definition = webServicesParser.getWSDLDefinitionVerbose(uri);
- copyWSDL(env, uri, destURI, destLocalname, definition);
- } catch (WSDLException e) {
- copyXMLSchema(env, uri, destURI);
- }
- }
-
- private void copyWSDL(Environment env, String uri, String destURI, String destLocalname, Definition definition) throws WSDLException, IOException, WWWAuthenticationException, TransformerException, TransformerConfigurationException, URIException
- {
- if (ignoreList.contains(uri))
- return;
- ignoreList.add(uri);
- int index = wsdlURI.lastIndexOf('/');
- String baseURI = getBaseURI(wsdlURI);
- if (destLocalname == null || destLocalname.length() <= 0)
- destLocalname = getLocalname(wsdlURI);
- // copy WSDL
- StringBuffer destinationFileURI = new StringBuffer(addTrailingSeparator(destURI));
- destinationFileURI.append(destLocalname);
- WSDLFactory wsdlFactory = new WSDLFactoryImpl();
- WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
- OutputStream os = env.getURIFactory().newURI(destinationFileURI.toString()).getOutputStream();
- wsdlWriter.writeWSDL(definition, os);
- os.close();
- // copy <wsdl:import>s
- Map imports = definition.getImports();
- for (Iterator it = imports.values().iterator(); it.hasNext();)
- {
- List list = (List)it.next();
- for (Iterator listIt = list.iterator(); listIt.hasNext();)
- {
- Import wsdlImport = (Import)listIt.next();
- String wsdlImportURI = wsdlImport.getLocationURI();
- if (isRelative(wsdlImportURI))
- {
- String importBaseURI = (new StringBuffer(baseURI)).append(wsdlImportURI).toString();
- String wsdlImportBaseURI = getBaseURI(wsdlImportURI);
- StringBuffer importDestURI = new StringBuffer(destURI);
- if (wsdlImportBaseURI != null)
- importDestURI.append(wsdlImportBaseURI);
- copyWSDL(env, importBaseURI, importDestURI.toString(), getLocalname(wsdlImportURI));
- }
- }
- }
- Types types = definition.getTypes();
- if (types != null)
- {
- List schemas = types.getExtensibilityElements();
- for (Iterator it = schemas.iterator(); it.hasNext();)
- {
- ExtensibilityElement extElement = (ExtensibilityElement)it.next();
- if (extElement instanceof UnknownExtensibilityElement)
- {
- UnknownExtensibilityElement schemaElement = (UnknownExtensibilityElement)extElement;
- XSDSchema xsdSchema = null;
- try
- {
- xsdSchema = XSDSchemaImpl.createSchema(schemaElement.getElement());
- }
- catch (Throwable t)
- {
- // ignore any extensibility elements that cannot be parsed into a
- // XSDSchema instance
- }
- copyXMLSchema(env, xsdSchema, baseURI, destURI);
- }
- else if (extElement instanceof XSDSchemaExtensibilityElementImpl)
- {
- XSDSchemaExtensibilityElementImpl schemaElement = (XSDSchemaExtensibilityElementImpl)extElement;
- XSDSchema xsdSchema = null;
- try
- {
- xsdSchema = XSDSchemaImpl.createSchema(schemaElement.getElement());
- }
- catch (Throwable t)
- {
- // ignore any extensibility elements that cannot be parsed into a
- // XSDSchema instance
- }
- copyXMLSchema(env, xsdSchema, baseURI, destURI);
- }
- }
- }
- }
-
- private String getBaseURI(String uri)
- {
- int index = uri.lastIndexOf('/');
- if (index == -1)
- index = uri.lastIndexOf('\\');
- if (index != -1)
- return uri.substring(0, index + 1);
- else
- return null;
- }
-
- private String getLocalname(String uri)
- {
- int index = uri.lastIndexOf('/');
- if (index == -1)
- index = uri.lastIndexOf('\\');
- if (index != -1)
- return uri.substring(index + 1);
- else
- return uri;
- }
-
- private String addTrailingSeparator(String s)
- {
- if (!(s.endsWith("/") || s.endsWith("\\")))
- {
- StringBuffer sb = new StringBuffer(s);
- sb.append('/');
- return sb.toString();
- }
- else
- return s;
- }
-
- private boolean isRelative(String uri)
- {
- return (uri.indexOf(':') == -1);
- }
-
- private void copyXMLSchema(Environment env, String uri, String destURI) throws TransformerException, TransformerConfigurationException, IOException, URIException
- {
- if (ignoreList.contains(uri))
- return;
- ignoreList.add(uri);
- // load as a cached schema
- XSDSchema xsdSchema = XSDSchemaImpl.getSchemaForSchema(uri);
- // if schema is not cached, parse it
- if (xsdSchema == null)
- {
- XSDParser p = new XSDParser();
- InputStream is = NetUtils.getURLInputStream(uri);
- if (is != null)
- {
- p.parse(is);
- xsdSchema = p.getSchema();
- }
- }
- if (xsdSchema != null)
- {
- // copy schema
- Element e = xsdSchema.getElement();
- DOMSource domSource = new DOMSource(e);
- Transformer serializer = TransformerFactory.newInstance().newTransformer();
- serializer.setOutputProperty(OutputKeys.INDENT, "yes");
- serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
- serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
- OutputStream os = env.getURIFactory().newURI((new StringBuffer(destURI)).append(getLocalname(uri)).toString()).getOutputStream();
- serializer.transform(domSource, new StreamResult(os));
- os.close();
- // copy <xsd:import>s and <xsd:include>s
- copyXMLSchema(env, xsdSchema, getBaseURI(uri), destURI);
- }
- }
-
- private void copyXMLSchema(Environment env, XSDSchema xsdSchema, String baseURI, String destURI) throws TransformerException, TransformerConfigurationException, IOException, URIException
- {
- if (xsdSchema != null)
- {
- // copy <xsd:import>s and <xsd:include>s
- EList xsdSchemaContents = xsdSchema.getContents();
- for (Iterator it = xsdSchemaContents.iterator(); it.hasNext();)
- {
- Object content = it.next();
- if (content instanceof XSDSchemaDirective)
- {
- XSDSchemaDirective xsdSchemaDirective = (XSDSchemaDirective)content;
- String xsdSchemaDirectiveLocation = xsdSchemaDirective.getSchemaLocation();
- if (xsdSchemaDirectiveLocation != null && isRelative(xsdSchemaDirectiveLocation))
- {
- String directiveURI = (new StringBuffer(baseURI)).append(xsdSchemaDirectiveLocation).toString();
- String directiveBaseURI = getBaseURI(xsdSchemaDirectiveLocation);
- StringBuffer directiveDestURI = new StringBuffer(destURI);
- if (directiveBaseURI != null)
- directiveDestURI.append(directiveBaseURI);
- copyXMLSchema(env, directiveURI, directiveDestURI.toString());
- }
- }
- }
- }
- }
-
- public void setWsdlURI(String wsdlURI)
- {
- this.wsdlURI = wsdlURI;
- }
-
- public void setWebServicesParser(WebServicesParser webServicesParser)
- {
- this.webServicesParser = webServicesParser;
- }
-
- public void setDestinationURI(String destinationURI)
- {
- this.destinationURI = destinationURI;
- }
-
- public void setDefinition(Definition def)
- {
- this.def = def;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateAppClientProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateAppClientProjectCommand.java
deleted file mode 100644
index 028cbd8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateAppClientProjectCommand.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jst.j2ee.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.applicationclient.creation.AppClientModuleCreationDataModel;
-import org.eclipse.jst.j2ee.applicationclient.creation.AppClientModuleCreationOperation;
-import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
-import org.eclipse.jst.j2ee.internal.servertarget.IServerTargetConstants;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-public class CreateAppClientProjectCommand extends SimpleCommand
-{
- private String appClientProjectName_;
- private String earProjectName_;
- private String serverFactoryId_;
- private String j2eeVersion_;
-
-
- /**
- * Constructor
- */
- public CreateAppClientProjectCommand()
- {
- super("org.eclipse.jst.ws.internal.consumption.command.common.CreateAppClientProjectCommand", "org.eclipse.jst.ws.internal.consumption.command.common.CreateAppClientProjectCommand");
- //setRunInWorkspaceModifyOperation(false);
- }
-
- public Status execute(Environment env)
- {
- MessageUtils msgUtils_ = new MessageUtils( "org.eclipse.jst.ws.consumption.plugin", this );
-
- try
- {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject earProject = root.getProject(earProjectName_);
- if (earProject != null && !earProject.exists())
- {
- CreateEARProjectCommand c = new CreateEARProjectCommand();
- c.setEarProjectName(earProjectName_);
- c.setServerFactoryId(serverFactoryId_);
- c.setJ2EEVersion(j2eeVersion_);
- c.execute(env);
- earProject = root.getProject(earProjectName_);
- }
- IProject appClientProject = root.getProject(appClientProjectName_);
- if (appClientProject != null && !appClientProject.exists())
- {
- AppClientModuleCreationDataModel info = new AppClientModuleCreationDataModel();
- info.setProperty(AppClientModuleCreationDataModel.PROJECT_NAME, appClientProjectName_);
- info.setProperty(AppClientModuleCreationDataModel.EAR_PROJECT_NAME, earProjectName_);
- info.setProperty(AppClientModuleCreationDataModel.ADD_TO_EAR, Boolean.TRUE);
-
- //Set the J2EE version
- String finalJ2EEVersion = null;
- if (j2eeVersion_ != null && j2eeVersion_.length()>0)
- {
- info.setProperty(AppClientModuleCreationDataModel.J2EE_VERSION, new Integer(j2eeVersion_));
- finalJ2EEVersion = j2eeVersion_;
- }
- else
- {
- if (earProject != null && earProject.exists())
- {
- EARNatureRuntime ear = EARNatureRuntime.getRuntime(earProject);
- int earVersion = ear.getJ2EEVersion();
- info.setProperty(AppClientModuleCreationDataModel.J2EE_VERSION, new Integer(earVersion));
- finalJ2EEVersion = String.valueOf(earVersion);
- }
- else
- {
- info.setProperty(AppClientModuleCreationDataModel.J2EE_VERSION, new Integer(J2EEVersionConstants.J2EE_1_3_ID));
- finalJ2EEVersion = String.valueOf(J2EEVersionConstants.J2EE_1_3_ID);
- }
- }
-
- //Set the server target
- if (serverFactoryId_!=null && serverFactoryId_.length()>0)
- {
- String runtimeTargetId = ServerUtils.getServerTargetIdFromFactoryId(serverFactoryId_, IServerTargetConstants.APP_CLIENT_TYPE, finalJ2EEVersion);
- info.setProperty(AppClientModuleCreationDataModel.SERVER_TARGET_ID, runtimeTargetId );
- info.setProperty(AppClientModuleCreationDataModel.ADD_SERVER_TARGET, Boolean.TRUE);
- }
-
- //Create the AppClient project
- AppClientModuleCreationOperation operation = new AppClientModuleCreationOperation(info);
- operation.run(new NullProgressMonitor());
- }
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- Status status = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils_.getMessage("MSG_ERROR_CANNOT_CREATE_APP_CLIENT_PROJECT", new String[] {appClientProjectName_}), Status.ERROR, ite);
- env.getStatusHandler().reportError(status);
- return status;
- }
- catch (InterruptedException ie)
- {
- Status status = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils_.getMessage("MSG_ERROR_CANNOT_CREATE_APP_CLIENT_PROJECT", new String[] {appClientProjectName_}), Status.ERROR, ie);
- env.getStatusHandler().reportError(status);
- return status;
- }
- return new SimpleStatus("");
- }
-
- public void setAppClientProjectName(String appClientProjectName)
- {
- appClientProjectName_ = appClientProjectName;
- }
-
- public void setEarProjectName(String earProjectName)
- {
- earProjectName_ = earProjectName;
- }
-
- public void setServerFactoryId(String serverFactoryId)
- {
- serverFactoryId_ = serverFactoryId;
- }
-
- public void setJ2EEVersion(String j2eeVersion)
- {
- j2eeVersion_ = j2eeVersion;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateClientProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateClientProjectCommand.java
deleted file mode 100644
index 6ca45b8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateClientProjectCommand.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.consumption.common.WebServiceStartServerRegistry;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-
-public class CreateClientProjectCommand extends SimpleCommand
-{
- private String ID_WEB = "org.eclipse.jst.ws.consumption.ui.clientProjectType.Web";
- private String ID_EJB = "org.eclipse.jst.ws.consumption.ui.clientProjectType.EJB";
- private String ID_APP_CLIENT = "org.eclipse.jst.ws.consumption.ui.clientProjectType.AppClient";
- private String ID_JAVA = "org.eclipse.jst.ws.consumption.ui.clientProjectType.Containerless";
-
- private boolean proxyCodegenEnabled = true;
- private String clientProjectTypeId;
- private IProject proxyProject;
- private IProject proxyProjectEAR;
- private String existingServerId_;
- private String serverFactoryId_;
- private String j2eeVersion_;
- private boolean needEAR_;
- private boolean addedProjectToServer_ = false;
-
- private IServer fExistingServer = null;
- private MessageUtils msgUtils_;
-
- /**
- * Default CTOR
- */
- public CreateClientProjectCommand()
- {
- super("org.eclipse.jst.ws.internal.consumption.command.common.CreateClientProjectCommand", "org.eclipse.jst.ws.internal.consumption.command.common.CreateClientProjectCommand");
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- }
-
- public boolean isUndoable(){
- return true;
- }
-
- public Status undo(Environment env){
- Status stat = new SimpleStatus("");
- try {
-
- // check existingServer
- if (fExistingServer!=null) {
-
- AbstractStartServer startServerCommand = null;
- WebServiceStartServerRegistry reg = WebServiceStartServerRegistry.getInstance();
- startServerCommand = (AbstractStartServer)reg.getServerStartByTypeId(fExistingServer.getServerType().getId());
- if (proxyProjectEAR!=null) {
- startServerCommand.runPostServerConfig(fExistingServer, proxyProjectEAR);
- }
- }
- }
- catch (CoreException ce ) {
- IStatus embeddedStatus = ce.getStatus();
- stat = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- env.getStatusHandler().reportError(stat);
- return stat;
- }
-
- return stat;
- }
-
- public Status execute(Environment env)
- {
- Status status = new SimpleStatus("");
- //Get the existing server
-
- IServer[] servers = ServerCore.getServers();
- IServer existingServer = null;
- fExistingServer = null;
- for (int i=0; i<servers.length; i++)
- {
- IServer thisServer = (IServer)servers[i];
- IServerWorkingCopy wc = null;
- String thisServerId = null;
- if (thisServer!=null) {
- wc = thisServer.createWorkingCopy();
- thisServerId = (wc!=null ? wc.getId() : null);
- }
- if (thisServerId.equals(existingServerId_)){
- existingServer = thisServer;
- fExistingServer = existingServer;
- }
- }
-
- //Create the project
- if (proxyCodegenEnabled)
- {
- if (clientProjectTypeId == null || clientProjectTypeId.length() <= 0)
- clientProjectTypeId = (WebServicePlugin.getInstance().getProjectTopologyContext().getClientTypes())[0];
- if (ID_WEB.equals(clientProjectTypeId))
- {
- CreateWebProjectCommand c = new CreateWebProjectCommand();
- c.setProjectName(proxyProject.getName());
-
- if (proxyProjectEAR != null)
- c.setEarProjectName(proxyProjectEAR.getName());
- else
- c.setEarProjectName("");
-
- c.setServerFactoryId(serverFactoryId_);
- c.setJ2EEVersion(j2eeVersion_);
- c.setExistingServer(existingServer);
- c.setNeedEAR(needEAR_);
- c.setAddedProjectToServer(addedProjectToServer_);
-
- status = c.execute(env);
- if (status.getSeverity()==Status.ERROR){
- return status;
- }
-
- Status startServerStatus = startServer(env, proxyProject);
- if (startServerStatus.getSeverity()==Status.ERROR)
- return startServerStatus;
-
- }
- else if (ID_EJB.equals(clientProjectTypeId))
- {
- CreateEJBProjectCommand c = new CreateEJBProjectCommand();
- c.setEjbProjectName(proxyProject.getName());
- c.setEarProjectName(proxyProjectEAR.getName());
- c.setServerFactoryId(serverFactoryId_);
- c.setJ2EEVersion(j2eeVersion_);
- status = c.execute(env);
- }
- else if (ID_APP_CLIENT.equals(clientProjectTypeId))
- {
- CreateAppClientProjectCommand c = new CreateAppClientProjectCommand();
- c.setAppClientProjectName(proxyProject.getName());
- c.setEarProjectName(proxyProjectEAR.getName());
- c.setServerFactoryId(serverFactoryId_);
- c.setJ2EEVersion(j2eeVersion_);
- status = c.execute(env);
- }
- else if (ID_JAVA.equals(clientProjectTypeId))
- {
- CreateJavaProjectCommand c = new CreateJavaProjectCommand();
- c.setProjectName(proxyProject.getName());
- status = c.execute(env);
- }
-
- }
-
- try {
-
- AbstractStartServer startServerCommand = null;
- WebServiceStartServerRegistry reg = WebServiceStartServerRegistry.getInstance();
- startServerCommand = (AbstractStartServer)reg.getServerStartByTypeId(existingServer.getServerType().getId());
- if (proxyProjectEAR!=null && existingServer!=null) {
- startServerCommand.runPreServerConfig(existingServer, proxyProjectEAR);
- fExistingServer = existingServer;
- }
- }
- catch (CoreException ce ) {
- IStatus embeddedStatus = ce.getStatus();
- status = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- return status;
-
- }
-
- private Status startServer(Environment env, IProject webProject){
- try{
- // start server(Bug 4377)
- if (needEAR_ && fExistingServer != null){
- StartProjectCommand spc = new StartProjectCommand();
- spc.setSampleProject(webProject);
- spc.setSampleExistingServer(fExistingServer);
- spc.setCreationScenario(new Boolean("false"));
- return spc.execute(env);
-
- }
- }
- catch(Exception ce){
- env.getLog().log(Log.ERROR, 5046, this, "execute", ce);
- Status status = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils_.getMessage("MSG_ERROR_WEB_PROJECT_CREATE"), Status.ERROR, ce);
- env.getStatusHandler().reportError(status);
- return status;
- }
- return new SimpleStatus("");
- }
-
- public void setProxyCodegenEnabled(boolean proxyCodegenEnabled)
- {
- this.proxyCodegenEnabled = proxyCodegenEnabled;
- }
-
- /**
- * @param proxyProjectEAR The proxyProjectEAR to set.
- */
- public void setProxyProjectEAR(IProject proxyProjectEAR)
- {
- this.proxyProjectEAR = proxyProjectEAR;
- }
-
- /**
- * @param proxyProject The proxyProject to set.
- */
- public void setProxyProject(IProject proxyProject)
- {
- this.proxyProject = proxyProject;
- }
-
- /**
- * @param clientProjectTypeId The clientProjectTypeId to set.
- */
- public void setClientProjectTypeId(String clientProjectTypeId)
- {
- this.clientProjectTypeId = clientProjectTypeId;
- }
-
- public void setServerFactoryId(String serverFactoryId)
- {
- serverFactoryId_ = serverFactoryId;
- }
-
- public void setJ2EEVersion(String j2eeVersion)
- {
- j2eeVersion_ = j2eeVersion;
- }
-
- public void setNeedEAR(boolean needEAR)
- {
- needEAR_ = needEAR;
- }
-
- public void setExistingServerId(String existingServerId)
- {
- existingServerId_ = existingServerId;
- }
-
- public void setAddedProjectToServer(boolean addedProjectToServer)
- {
- addedProjectToServer_ = addedProjectToServer;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateEARProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateEARProjectCommand.java
deleted file mode 100644
index c205dd5..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateEARProjectCommand.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jst.j2ee.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.application.operations.EnterpriseApplicationCreationDataModel;
-import org.eclipse.jst.j2ee.application.operations.EnterpriseApplicationCreationOperation;
-import org.eclipse.jst.j2ee.internal.servertarget.IServerTargetConstants;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class CreateEARProjectCommand extends SimpleCommand
-{
- private String earProjectName_;
- private String serverFactoryId_;
- private String j2eeVersion_;
-
- /**
- * Constructor
- */
- public CreateEARProjectCommand()
- {
- super("org.eclipse.jst.ws.internal.consumption.command.common.CreateEARProjectCommand", "org.eclipse.jst.ws.internal.consumption.command.common.CreateEARProjectCommand");
- //setRunInWorkspaceModifyOperation(false);
- }
-
- public Status execute(Environment env)
- {
- MessageUtils msgUtils_ = new MessageUtils( "org.eclipse.jst.ws.consumption.plugin", this );
-
- try
- {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(earProjectName_);
- if (project != null && !project.exists())
- {
- EnterpriseApplicationCreationDataModel info = new EnterpriseApplicationCreationDataModel();
- info.setProperty(EnterpriseApplicationCreationDataModel.PROJECT_NAME, project.getName());
-
- //Set the J2EE version
- String finalJ2EEVersion = null;
- if (j2eeVersion_ != null && j2eeVersion_.length()>0)
- {
- info.setProperty(EnterpriseApplicationCreationDataModel.APPLICATION_VERSION, new Integer(j2eeVersion_));
- finalJ2EEVersion = j2eeVersion_;
- }
- else
- {
- info.setProperty(EnterpriseApplicationCreationDataModel.APPLICATION_VERSION, new Integer(J2EEVersionConstants.J2EE_1_3_ID));
- finalJ2EEVersion = String.valueOf(J2EEVersionConstants.J2EE_1_3_ID);
- }
-
- //Set the server target
- if (serverFactoryId_!=null && serverFactoryId_.length()>0)
- {
- String runtimeTargetId = ServerUtils.getServerTargetIdFromFactoryId(serverFactoryId_, IServerTargetConstants.EAR_TYPE, finalJ2EEVersion);
- info.setProperty(EnterpriseApplicationCreationDataModel.SERVER_TARGET_ID, runtimeTargetId );
- info.setProperty(EnterpriseApplicationCreationDataModel.ADD_SERVER_TARGET, Boolean.TRUE);
- }
-
- //Create the EAR
- EnterpriseApplicationCreationOperation operation = new EnterpriseApplicationCreationOperation(info);
- operation.run(new NullProgressMonitor());
- }
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- Status status = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils_.getMessage("MSG_ERROR_CANNOT_CREATE_EAR_PROJECT", new String[] {earProjectName_}), Status.ERROR, ite);
- env.getStatusHandler().reportError(status);
- return status;
- }
- catch (InterruptedException ie)
- {
- Status status = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils_.getMessage("MSG_ERROR_CANNOT_CREATE_EAR_PROJECT", new String[] {earProjectName_}), Status.ERROR, ie);
- env.getStatusHandler().reportError(status);
- return status;
- }
- return new SimpleStatus("");
- }
- /**
- * @param earProjectName_ The earProjectName_ to set.
- */
- public void setEarProjectName(String earProjectName)
- {
- this.earProjectName_ = earProjectName;
- }
-
- public void setServerFactoryId(String serverFactoryId)
- {
- serverFactoryId_ = serverFactoryId;
- }
-
- public void setJ2EEVersion(String j2eeVersion)
- {
- j2eeVersion_ = j2eeVersion;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateEJBProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateEJBProjectCommand.java
deleted file mode 100644
index 7c556ca..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateEJBProjectCommand.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jst.j2ee.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
-import org.eclipse.jst.j2ee.internal.ejb.project.operations.EJBModuleCreationDataModel;
-import org.eclipse.jst.j2ee.internal.ejb.project.operations.EJBModuleCreationOperation;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.servertarget.IServerTargetConstants;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerUtil;
-
-
-public class CreateEJBProjectCommand extends SimpleCommand
-{
- private static String LABEL = "%TASK_LABEL_CREATE_EJB_PROJECT";
- private static String DESCRIPTION = "%TASK_DESC_CREATE_EJB_PROJECT";
- private boolean isEJBProjectRequired_ = true;
- private String ejbProjectName_ = null;
- private String earProjectName_ = null;
-
- private IProject serviceProject;
- private IServer serviceExistingServer;
- private String serverFactoryId_;
- private String j2eeVersion_;
-
-
- public CreateEJBProjectCommand()
- {
- super(LABEL, DESCRIPTION);
- }
-
- /**
- * Constructor for CreateEJBProjectTask.
- * @param arg0
- * @param arg1
- */
- public CreateEJBProjectCommand(String label, String desc)
- {
- super(label, desc);
- //setRunInWorkspaceModifyOperation(false);
- }
-
- public Status execute(Environment env)
- {
- try
- {
- if (ejbProjectName_ != null && ejbProjectName_.length() > 0 && earProjectName_ != null && earProjectName_.length() > 0)
- {
- Status status = createEJBProject(ejbProjectName_, earProjectName_, env);
- if (status.getSeverity() == Status.ERROR)
- env.getStatusHandler().reportError(status);
- return status;
-
- }
-
- // Get web project and form ejbProjectName
- if (!isEJBProjectRequired_)
- return new SimpleStatus("");
-
- if (ejbProjectName_ == null)
- return new SimpleStatus("");
-
- // EJB Project already exists
- IContainer container = J2EEPlugin.getWorkspace().getRoot().getProject(ejbProjectName_);
- if (container.exists())
- {
- return new SimpleStatus("");
- }
-
- // Create EJBProjectInfo
- EJBModuleCreationDataModel projectInfo = new EJBModuleCreationDataModel();
- projectInfo.setProperty( EJBModuleCreationDataModel.PROJECT_NAME, ejbProjectName_ );
- projectInfo.setProperty(EJBModuleCreationDataModel.CREATE_DEFAULT_SESSION_BEAN,Boolean.TRUE);
-
- Status status;
- if (earProjectName_ != null)
- status = addEARToProject(earProjectName_, projectInfo);
- else
- {
- status = addEARToProject(serviceProject, projectInfo, env);
- }
- if (status.getSeverity() == Status.ERROR)
- env.getStatusHandler().reportError(status);
- return status;
- }
- catch (Exception e) {
- }
- return new SimpleStatus("");
- }
-
- private Status addEARToProject(String earProjectName, EJBModuleCreationDataModel projectInfo)
- {
- IProject earProject = null;
- // IProject earProject = ResourcesPlugin.getWorkspace().getRoot().getProject(earProjectName);
- // if (!earProject.exists())
- {
- EARNatureRuntime ear = null;
- if (j2eeVersion_!=null && j2eeVersion_.length()>0)
- {
- ear = J2EEUtils.getEAR(Integer.parseInt(j2eeVersion_));
- }
- else
- {
- ear = J2EEUtils.get13EAR();
- if (ear != null)
- earProject = ear.getProject();
- else
- {
- ear = J2EEUtils.get12EAR();
- if (ear != null)
- earProject = ear.getProject();
- }
- }
- }
-
- projectInfo.setProperty(EJBModuleCreationDataModel.EAR_PROJECT_NAME, earProject.getName());
- projectInfo.setProperty(EJBModuleCreationDataModel.ADD_TO_EAR, Boolean.TRUE);
-
- //Set the J2EE version
- String finalJ2EEVersion = null;
- if (j2eeVersion_ != null && j2eeVersion_.length()>0)
- {
- projectInfo.setProperty(EJBModuleCreationDataModel.J2EE_VERSION, new Integer(j2eeVersion_));
- finalJ2EEVersion = j2eeVersion_;
- }
- else
- {
- if (earProject != null && earProject.exists())
- {
- EARNatureRuntime ear = EARNatureRuntime.getRuntime(earProject);
- int earVersion = ear.getJ2EEVersion();
- projectInfo.setProperty(EJBModuleCreationDataModel.J2EE_VERSION, new Integer(earVersion));
- finalJ2EEVersion = String.valueOf(earVersion);
- }
- else
- {
- projectInfo.setProperty(EJBModuleCreationDataModel.J2EE_VERSION, new Integer(J2EEVersionConstants.J2EE_1_3_ID));
- finalJ2EEVersion = String.valueOf(J2EEVersionConstants.J2EE_1_3_ID);
- }
- }
-
- if (serverFactoryId_!=null && serverFactoryId_.length()>0)
- {
- String runtimeTargetId = ServerUtils.getServerTargetIdFromFactoryId(serverFactoryId_, IServerTargetConstants.EJB_TYPE, j2eeVersion_);
- projectInfo.setProperty(EJBModuleCreationDataModel.SERVER_TARGET_ID, runtimeTargetId );
- projectInfo.setProperty(EJBModuleCreationDataModel.ADD_SERVER_TARGET, Boolean.TRUE);
- }
-
- EJBModuleCreationOperation ejbProjectCreationOperation = new EJBModuleCreationOperation(projectInfo);
-
- try
- {
- ejbProjectCreationOperation.run(new NullProgressMonitor());
- }
- catch (java.lang.reflect.InvocationTargetException e)
- {
- return new SimpleStatus(WebServiceConsumptionPlugin.ID, WebServiceConsumptionPlugin.getMessage("%MSG_ERROR_CANNOT_CREATE_EJB_PROJECT"), Status.ERROR, e);
- }
- catch (InterruptedException ex)
- {
- return new SimpleStatus(WebServiceConsumptionPlugin.ID, WebServiceConsumptionPlugin.getMessage("%MSG_ERROR_CANNOT_CREATE_EJB_PROJECT"), Status.ERROR, ex);
- }
- return new SimpleStatus("");
- }
-
- private Status addEARToProject(IProject serviceProject, EJBModuleCreationDataModel projectInfo, Environment env)
- {
- EARNatureRuntime ear = null;
- IProject earProject = null;
- boolean addServiceEARToServer = false;
- boolean addDiscoveredEARToServer = false;
- IServer discoveredEARsServer = null;
- EARNatureRuntime[] ears = J2EEUtils.getEARProjects(serviceProject);
- try {
-
- if (ears!=null && ears.length >= 1) {
- ear = ears[0];
- earProject = ear.getProject();
- if (serviceExistingServer != null)
- {
- if (serviceExistingServer.getServerState() != IServer.STATE_STOPPED)
- serviceExistingServer.synchronousStop(false);
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, serviceExistingServer, ResourceUtils.getModule(earProject), false, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- addServiceEARToServer = true;
- }
-
- }
- else {
- //Check to see if any eligible EARs exist in the workspace.
- ear = J2EEUtils.get12EAR();
- if (ear!=null)
- {
- earProject = ear.getProject();
-
- // Add default server
- IServer defaultServer = ServerUtils.getDefaultExistingServer(earProject);
- if (defaultServer!=null)
- {
- if (defaultServer.getServerState() != IServer.STATE_STOPPED) {
- defaultServer.synchronousStop(false);
- }
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, defaultServer, ResourceUtils.getModule(earProject), false, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- addDiscoveredEARToServer = true;
- discoveredEARsServer = defaultServer;
- }
- }
- }
-
- }
- catch (Exception e)
- {
- return new SimpleStatus(WebServiceConsumptionPlugin.ID, WebServiceConsumptionPlugin.getMessage("%MSG_ERROR_CANNOT_CREATE_EJB_PROJECT"), Status.ERROR, e);
- }
-
- IProject ejbProject = null;
- //Add the project back to the Server config
- projectInfo.setProperty(EJBModuleCreationDataModel.EAR_PROJECT_NAME, earProject.getName());
- projectInfo.setProperty(EJBModuleCreationDataModel.ADD_TO_EAR, Boolean.TRUE);
- EJBModuleCreationOperation ejbProjectCreationOperation = new EJBModuleCreationOperation(projectInfo);
-
- try {
- ejbProjectCreationOperation.run(new NullProgressMonitor());
- }
- catch (java.lang.reflect.InvocationTargetException e)
- {
- return new SimpleStatus(WebServiceConsumptionPlugin.ID, WebServiceConsumptionPlugin.getMessage("%MSG_ERROR_CANNOT_CREATE_EJB_PROJECT"), Status.ERROR, e);
- }
- catch (InterruptedException ex)
- {
- return new SimpleStatus(WebServiceConsumptionPlugin.ID, WebServiceConsumptionPlugin.getMessage("%MSG_ERROR_CANNOT_CREATE_EJB_PROJECT"), Status.ERROR, ex);
- }
-
- //ejbProject = projectInfo.primGetProject();
-
- //Add the project back to the Server config
- if (addServiceEARToServer)
- {
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, serviceExistingServer, ResourceUtils.getModule(earProject), true, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
- if (addDiscoveredEARToServer)
- {
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, discoveredEARsServer, ResourceUtils.getModule(earProject), true, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
- return new SimpleStatus("");
- }
-
- private Status createEJBProject(String ejbProjectName, String earProjectName, Environment env)
- {
- try
- {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject earProject = root.getProject(earProjectName);
- if (earProject != null && !earProject.exists())
- {
- CreateEARProjectCommand c = new CreateEARProjectCommand();
- c.setEarProjectName(earProjectName);
- c.setServerFactoryId(serverFactoryId_);
- c.setJ2EEVersion(j2eeVersion_);
- c.execute(env);
- earProject = root.getProject(earProjectName);
- }
- IProject ejbProject = root.getProject(ejbProjectName);
- if (ejbProject != null && !ejbProject.exists())
- {
- EJBModuleCreationDataModel info = new EJBModuleCreationDataModel();
- info.setProperty(EJBModuleCreationDataModel.PROJECT_NAME, ejbProjectName);
- info.setProperty(EJBModuleCreationDataModel.EAR_PROJECT_NAME, earProjectName);
- info.setProperty(EJBModuleCreationDataModel.ADD_TO_EAR, Boolean.TRUE);
-
- info.setProperty(EJBModuleCreationDataModel.CREATE_DEFAULT_SESSION_BEAN,Boolean.TRUE);
-
- //Set the J2EE version
- String finalJ2EEVersion = null;
- if (j2eeVersion_ != null && j2eeVersion_.length()>0)
- {
- info.setProperty(EJBModuleCreationDataModel.J2EE_VERSION, new Integer(j2eeVersion_));
- finalJ2EEVersion = j2eeVersion_;
- }
- else
- {
- if (earProject != null && earProject.exists())
- {
- EARNatureRuntime ear = EARNatureRuntime.getRuntime(earProject);
- int earVersion = ear.getJ2EEVersion();
- info.setProperty(EJBModuleCreationDataModel.J2EE_VERSION, new Integer(earVersion));
- finalJ2EEVersion = String.valueOf(earVersion);
- }
- else
- {
- info.setProperty(EJBModuleCreationDataModel.J2EE_VERSION, new Integer(J2EEVersionConstants.J2EE_1_3_ID));
- finalJ2EEVersion = String.valueOf(J2EEVersionConstants.J2EE_1_3_ID);
- }
- }
-
- //Set the server target
- if (serverFactoryId_!=null && serverFactoryId_.length()>0)
- {
- String runtimeTargetId = ServerUtils.getServerTargetIdFromFactoryId(serverFactoryId_,IServerTargetConstants.EJB_TYPE, finalJ2EEVersion);
- info.setProperty(EJBModuleCreationDataModel.SERVER_TARGET_ID, runtimeTargetId );
- info.setProperty(EJBModuleCreationDataModel.ADD_SERVER_TARGET, Boolean.TRUE);
- }
-
- //Create the EJB Project
- EJBModuleCreationOperation operation = new EJBModuleCreationOperation(info);
- operation.run(new NullProgressMonitor());
- }
-
- // add EAR to Server
- if (serviceExistingServer!=null){
- boolean earAddedToServer = ServerUtil.containsModule(serviceExistingServer,ResourceUtils.getModule(earProject), new NullProgressMonitor());
-
- if (!earAddedToServer) {
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, serviceExistingServer, ResourceUtils.getModule(earProject) , true, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
- }
-
-
- }
- catch (java.lang.reflect.InvocationTargetException ite)
- {
- return new SimpleStatus(WebServiceConsumptionPlugin.ID, WebServiceConsumptionPlugin.getMessage("%MSG_ERROR_CANNOT_CREATE_EJB_PROJECT"), Status.ERROR, ite);
- }
- catch (InterruptedException ie)
- {
- return new SimpleStatus(WebServiceConsumptionPlugin.ID, WebServiceConsumptionPlugin.getMessage("%MSG_ERROR_CANNOT_CREATE_EJB_PROJECT"), Status.ERROR, ie);
- }
- return new SimpleStatus("");
- }
-
- /**
- * @param earProjectName The earProjectName to set.
- */
- public void setEarProjectName(String earProjectName)
- {
- this.earProjectName_ = earProjectName;
- }
-
- /**
- * @param ejbProjectName The ejbProjectName to set.
- */
- public void setEjbProjectName(String ejbProjectName)
- {
- this.ejbProjectName_ = ejbProjectName;
- }
-
- /**
- * @param isEJBProjectRequired The isEJBProjectRequired to set.
- */
- public void setEJBProjectRequired(boolean isEJBProjectRequired)
- {
- this.isEJBProjectRequired_ = isEJBProjectRequired;
- }
-
- /**
- * @param ejbProjectName The ejbProjectName to set.
- */
- public void setEJBProjectName(String ejbProjectName) {
- this.ejbProjectName_ = ejbProjectName;
- }
-
- /**
- * @param serviceExistingServer The serviceExistingServer to set.
- */
- public void setServiceExistingServer(IServer serviceExistingServer) {
- this.serviceExistingServer = serviceExistingServer;
- }
-
- /**
- * @param serviceProject The serviceProject to set.
- */
- public void setServiceProject(IProject serviceProject) {
- this.serviceProject = serviceProject;
- }
-
- public void setServerFactoryId(String serverFactoryId)
- {
- serverFactoryId_ = serverFactoryId;
- }
-
- public void setJ2EEVersion(String j2eeVersion)
- {
- j2eeVersion_ = j2eeVersion;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateJavaProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateJavaProjectCommand.java
deleted file mode 100644
index d31a005..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateJavaProjectCommand.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.ICommand;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-public class CreateJavaProjectCommand extends SimpleCommand
-{
- private String projectName_;
-
- /**
- * Default CTOR
- */
- public CreateJavaProjectCommand()
- {
- super("org.eclipse.jst.ws.internal.consumption.command.common.CreateJavaProjectCommand", "org.eclipse.jst.ws.internal.consumption.command.common.CreateJavaProjectCommand");
- //setRunInWorkspaceModifyOperation(false);
- }
-
- public Status execute(Environment env)
- {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName_);
- if (project != null && !project.exists())
- {
- try
- {
- NullProgressMonitor monitor = new NullProgressMonitor();
- project.create(ResourcesPlugin.getWorkspace().newProjectDescription(project.getName()), monitor);
- project.open(monitor);
- IProjectDescription desc = project.getDescription();
- desc.setNatureIds(new String[] {JavaCore.NATURE_ID});
- ICommand cmd = desc.newCommand();
- cmd.setBuilderName(JavaCore.BUILDER_ID);
- desc.setBuildSpec(new ICommand[] {cmd});
- project.setDescription(desc, monitor);
- IJavaProject javaProject = JavaCore.create(project);
- Path projectRoot = new Path(Path.ROOT.append(new Path(project.getName())).toString());
- javaProject.setRawClasspath(new IClasspathEntry[] {JavaCore.newSourceEntry(projectRoot), JavaCore.newContainerEntry(new Path(JavaRuntime.JRE_CONTAINER))}, monitor);
- javaProject.setOutputLocation(projectRoot, monitor);
- }
- catch (CoreException ce)
- {
- Status status = new SimpleStatus(WebServiceConsumptionPlugin.ID, WebServiceConsumptionPlugin.getMessage("%MSG_ERROR_CANNOT_CREATE_JAVA_PROJECT", new String[] {projectName_}), Status.ERROR, ce);
- env.getStatusHandler().reportError(status);
- return status;
- }
- }
- return new SimpleStatus("");
- }
-
- public void setProjectName(String projectName)
- {
- projectName_ = projectName;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateMonitorCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateMonitorCommand.java
deleted file mode 100644
index a0a91fe..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateMonitorCommand.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IMonitoredServerPort;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerMonitorManager;
-import org.eclipse.wst.server.core.IServerPort;
-import org.eclipse.wst.server.core.ServerCore;
-
-public class CreateMonitorCommand extends SimpleCommand {
-
- private static final String WEB_SERVICES = "Web services";
-
- private Boolean monitorService;
-
- private String serviceServerInstanceId;
-
- private Integer monitoredPort;
-
- public CreateMonitorCommand() {
- super("org.eclipse.jst.ws.internal.consumption.command.common.CreateMonitorCommand",
- "org.eclipse.jst.ws.internal.consumption.command.common.CreateMonitorCommand");
- }
-
- public Status execute(Environment env) {
- if (monitorService != null && monitorService.booleanValue()) {
- IServer server = ServerCore.findServer(serviceServerInstanceId);
- if (server != null) {
-
- // IMonitorableServer monitorableServer = (IMonitorableServer)
- // serverDelegate;
- IServerPort[] ports = server.getServerPorts();
- IServerPort port = null;
- for (int it = 0; it < ports.length; it++) {
- IServerPort p = ports[it];
- String protocol = p.getProtocol();
- if (protocol != null && protocol.trim().toLowerCase().equals("http")) {
- port = p;
- break;
- }
- }
- if (port != null) {
- IServerMonitorManager serverMonitorManager = ServerCore.getServerMonitorManager();
- IMonitoredServerPort[] monitoredPorts = serverMonitorManager.getMonitoredPorts(server);
- for (int it2 = 0; it2 < monitoredPorts.length; it2++) {
- IMonitoredServerPort imsPort = monitoredPorts[it2];
- if (port.getPort() == imsPort.getServerPort().getPort() && hasContentWebServices(imsPort)) // port
- // already
- // being
- // monitored
- {
- if (!imsPort.isStarted()) {
- try {
- serverMonitorManager.startMonitor(imsPort);
- }
- catch (CoreException ce) {
- MessageUtils msgUtils = new MessageUtils(WebServiceConsumptionPlugin.ID + ".plugin", this);
- Status error = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils.getMessage("MSG_ERROR_UNABLE_TO_START_MONITOR",
- new Object[] { String.valueOf(port.getPort()), server.getName()}), Status.ERROR, ce);
- env.getStatusHandler().reportError(error);
- return error;
- }
- }
- monitoredPort = new Integer(imsPort.getMonitorPort());
- return new SimpleStatus("");
- }
- }
- try {
- IMonitoredServerPort imsPort = serverMonitorManager.createMonitor(server, port, -1, new String[] { WEB_SERVICES});
- serverMonitorManager.startMonitor(imsPort);
- monitoredPort = new Integer(imsPort.getMonitorPort());
- return new SimpleStatus("");
- }
- catch (CoreException ce) {
- MessageUtils msgUtils = new MessageUtils(WebServiceConsumptionPlugin.ID + ".plugin", this);
- Status error = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils.getMessage("MSG_ERROR_UNABLE_TO_START_MONITOR", new Object[] {
- String.valueOf(port.getPort()), server.getName()}), Status.ERROR, ce);
- env.getStatusHandler().reportError(error);
- return error;
- }
- }
-
- else {
- MessageUtils msgUtils = new MessageUtils(WebServiceConsumptionPlugin.ID + ".plugin", this);
- Status info = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils.getMessage("MSG_INFO_MONITORING_NOT_SUPPORTED",
- new Object[] { server.getName()}), Status.INFO);
- env.getStatusHandler().reportInfo(info);
- return info;
- }
- }
- }
- return new SimpleStatus("");
- }
-
- private boolean hasContentWebServices(IMonitoredServerPort imsPort) {
- String[] contents = imsPort.getContentTypes();
- for (int i = 0; i < contents.length; i++)
- if (WEB_SERVICES.equals(contents[i])) return true;
- return false;
- }
-
- public void setServiceTypeRuntimeServer(TypeRuntimeServer typeRuntimeServer) {
- this.serviceServerInstanceId = typeRuntimeServer.getServerInstanceId();
- }
-
- public void setServiceServerInstanceId(String serviceServerInstanceId) {
- this.serviceServerInstanceId = serviceServerInstanceId;
- }
-
- public Integer getMonitoredPort() {
- return monitoredPort;
- }
-
- public void setMonitorService(Boolean value) {
- monitorService = value;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateServiceProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateServiceProjectCommand.java
deleted file mode 100644
index 8ccf556..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateServiceProjectCommand.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.consumption.common.WebServiceStartServerRegistry;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.model.IRunningActionServer;
-
-/**
- *
- *
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-public class CreateServiceProjectCommand extends SimpleCommand {
-
- private boolean requiresEJB = false; // future implementation perhaps
- private boolean requiresWeb = false;
- private String projectName;
- private String earProjectName;
- private String existingServerId;
- private String serverFactoryId_;
- private String j2eeVersion_;
- private boolean needEAR_;
- private boolean isServiceProjectEJB_= false;
- private boolean addedProjectToServer_ = false;
-
- private IServer fExistingServer = null;
- /**
- * Default CTOR
- */
- public CreateServiceProjectCommand() {
-
- super("org.eclipse.jst.ws.internal.consumption.command.common.CreateServiceProjectCommand",
- "org.eclipse.jst.ws.internal.consumption.command.common.CreateServiceProjectCommand");
- }
-
- public boolean isUndoable(){
- return true;
- }
-
- public Status undo(Environment env){
- Status stat = new SimpleStatus("");
- try {
-
- // check existingServer
- if (fExistingServer!=null) {
-
- // get EAR project
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject earProject = null;
- if (earProjectName!=null && earProjectName.length()>0) {
- earProject = root.getProject(earProjectName);
- }
-
- AbstractStartServer startServerCommand = null;
- WebServiceStartServerRegistry reg = WebServiceStartServerRegistry.getInstance();
- startServerCommand = (AbstractStartServer)reg.getServerStartByTypeId(fExistingServer.getServerType().getId());
- if (earProject!=null) {
- startServerCommand.runPostServerConfig(fExistingServer, earProject);
- }
- }
- }
- catch (CoreException ce ) {
- IStatus embeddedStatus = ce.getStatus();
- stat = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- env.getStatusHandler().reportError(stat);
- return stat;
- }
-
- return stat;
- }
-
- public Status execute(Environment env) {
-
- if (projectName == null) {
- return new SimpleStatus("");
- }
-
- Status status = new SimpleStatus("");
- IServer[] servers = ServerCore.getServers();
- IServer existingServer = null;
- fExistingServer = null;
- for (int i=0; i<servers.length; i++)
- {
- IServer thisServer = (IServer)servers[i];
- IServerWorkingCopy wc = null;
- String thisServerId = null;
-
- if (thisServer!=null) {
- wc = thisServer.createWorkingCopy();
- thisServerId = (wc!=null ? wc.getId() : null);
- }
- if (thisServerId.equals(existingServerId)) {
- existingServer = thisServer;
- }
- }
- if (isServiceProjectEJB_)
- {
- CreateEJBProjectCommand c = new CreateEJBProjectCommand();
- c.setEjbProjectName(projectName);
- c.setEarProjectName(earProjectName);
- c.setServiceExistingServer(existingServer);
- c.setServerFactoryId(serverFactoryId_);
- c.setJ2EEVersion(j2eeVersion_);
- status = c.execute(env);
- }
- else
- {
- CreateWebProjectCommand c = new CreateWebProjectCommand();
- c.setProjectName(projectName);
- c.setEarProjectName(earProjectName);
- c.setExistingServer(existingServer);
- c.setServerFactoryId(serverFactoryId_);
- c.setJ2EEVersion(j2eeVersion_);
- c.setNeedEAR(needEAR_);
- c.setAddedProjectToServer(addedProjectToServer_);
- status = c.execute(env);
- }
-
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject earProject = null;
- if (earProjectName!=null && earProjectName.length()>0)
- {
- earProject = root.getProject(earProjectName);
- }
-
- AbstractStartServer startServerCommand = null;
- WebServiceStartServerRegistry reg = WebServiceStartServerRegistry.getInstance();
- startServerCommand = (AbstractStartServer)reg.getServerStartByTypeId(existingServer.getServerType().getId());
- startServerCommand.runPreServerConfig(existingServer, earProject);
- fExistingServer = existingServer;
- }
- catch (CoreException ce ) {
- IStatus embeddedStatus = ce.getStatus();
- status = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- // Start server if req'd
- IServerWorkingCopy wc = fExistingServer.createWorkingCopy();
- if (wc!=null){
- try {
- Object x = fExistingServer.getAdapter(IRunningActionServer.class);
- if (x!=null && x instanceof IRunningActionServer) {
- int state = fExistingServer.getServerState();
- if (state == IServer.STATE_STOPPED || state == IServer.STATE_UNKNOWN) {
- String mode = ILaunchManager.RUN_MODE;
- fExistingServer.synchronousStart(mode, EnvironmentUtils.getIProgressMonitor(env));
- }
- }
- }
- catch (CoreException cex) {
- IStatus embeddedStatus = cex.getStatus();
- status = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- env.getStatusHandler().reportError(status);
- return status;
- }
- }
-
-
-
- return status;
-
- }
-
- /**
- * @param earProjectName The earProjectName to set.
- * @todo Generated comment
- */
- public void setEarProjectName(String earProjectName) {
-
- this.earProjectName = earProjectName;
- }
-
- public void setExistingServerId(String existingServerId)
- {
- this.existingServerId = existingServerId;
- }
- /**
- * @param projectName The projectName to set.
- * @todo Generated comment
- */
- public void setProjectName(String projectName) {
-
- this.projectName = projectName;
- }
- /**
- * @param requiresEJB The requiresEJB to set.
- * @todo Generated comment
- */
- public void setRequiresEJB(boolean requiresEJB) {
-
- this.requiresEJB = requiresEJB;
- }
- /**
- * @param requiresWeb The requiresWeb to set.
- * @todo Generated comment
- */
- public void setRequiresWeb(boolean requiresWeb) {
-
- this.requiresWeb = requiresWeb;
- }
-
- public void setServerFactoryId(String serverFactoryId)
- {
- serverFactoryId_ = serverFactoryId;
- }
-
- public void setJ2EEVersion(String j2eeVersion)
- {
- j2eeVersion_ = j2eeVersion;
- }
-
- public void setNeedEAR(boolean needEAR)
- {
- needEAR_ = needEAR;
- }
-
- public void setIsServiceProjectEJB(boolean isServiceProjectEJB)
- {
- this.isServiceProjectEJB_ = isServiceProjectEJB;
- }
-
-
- public void setAddedProjectToServer(boolean addedProjectToServer)
- {
- addedProjectToServer_ = addedProjectToServer;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateWebProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateWebProjectCommand.java
deleted file mode 100644
index 436f2f9..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/CreateWebProjectCommand.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jst.j2ee.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.internal.servertarget.IServerTargetConstants;
-import org.eclipse.jst.j2ee.internal.web.archive.operations.WebModuleCreationDataModel;
-import org.eclipse.jst.j2ee.internal.web.archive.operations.WebModuleCreationOperation;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.consumption.common.WebServiceStartServerRegistry;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerUtil;
-
-public class CreateWebProjectCommand extends SimpleCommand {
-
- private final static String DESCRIPTION = "TASK_DESC_CREATE_WEB_PROJECT";
- private final static String LABEL = "TASK_LABEL_CREATE_WEB_PROJECT";
- private final String DEFAULT_EAR_NAME = "WebServiceEAR";
- private String projectName_ = null;
- private String earProjectName_ = null;
- private boolean proxyCodegenEnabled = true;
- private String serverFactoryId_;
- private String j2eeVersion_;
- private IServer existingServer_;
- private boolean needEAR_;
- private boolean weAddedProjectToServer_ = false;
- private MessageUtils msgUtils_;
-
- /**
- * Default CTOR
- */
- public CreateWebProjectCommand() {
-
- super(LABEL, DESCRIPTION);
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
- //setRunInWorkspaceModifyOperation(false);
- }
-
- /**
- * Create service Web Project using the parameter Project name Note: to be
- * deprecated
- */
- public CreateWebProjectCommand(String serviceProjectName) {
-
- super(LABEL, DESCRIPTION);
- projectName_ = serviceProjectName;
- //setRunInWorkspaceModifyOperation(false);
- }
-
- public Status execute(Environment env) {
-
- if (projectName_ == null || projectName_.length() == 0) {
- env.getLog().log(Log.ERROR, 5044, this, "execute", "Web project name not set");
- Status status = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils_.getMessage("MSG_ERROR_WEB_PROJECT_CREATE"), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- if (existingServer_ == null)
- {
- env.getLog().log(Log.ERROR, 5044, this, "execute", "Server is null");
- Status status = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils_.getMessage("MSG_ERROR_WEB_PROJECT_CREATE"), Status.ERROR, null);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject webProject = root.getProject(projectName_);
- IProject earProject = null;
- if (earProjectName_!=null && earProjectName_.length()>0)
- {
- earProject = root.getProject(earProjectName_);
- }
-
- boolean projectExists = webProject != null && webProject.exists();
- boolean addedToServer = false;
- if (projectExists)
- {
- addedToServer = ServerUtil.containsModule(existingServer_,ResourceUtils.getModule(webProject), new NullProgressMonitor());
- }
-
- boolean earExists = earProject!=null && earProject.exists();
- boolean earAddedToServer = true;
- if (earExists)
- {
- earAddedToServer = ServerUtil.containsModule(existingServer_,ResourceUtils.getModule(earProject), new NullProgressMonitor());
- }
-
- boolean areAssociated = false;
- if (projectExists && earExists)
- {
- areAssociated = J2EEUtils.isEARAssociated(webProject, earProject);
- }
-
- boolean serverRequiresEARRemoval = true;
- try
- {
- // check the Registry to see if the server requires EAR removal
- if (serverFactoryId_!=null)
- {
- WebServiceStartServerRegistry wssReg = WebServiceStartServerRegistry.getInstance();
- serverRequiresEARRemoval = wssReg.isRemoveEARRequired(serverFactoryId_);
- }
- } catch (CoreException ce)
- {
- env.getLog().log(Log.ERROR, 5046, this, "execute", ce);
- Status status = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils_.getMessage("MSG_ERROR_WEB_PROJECT_CREATE"), Status.ERROR, ce);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
-
- if (!needEAR_ && projectExists && addedToServer && !weAddedProjectToServer_)
- {
- return new SimpleStatus("");
- }
-
- // existing project, ear and server configuration
- if (needEAR_ && projectExists && earExists && earAddedToServer && areAssociated && !weAddedProjectToServer_){
- return new SimpleStatus("");
- }
-
- //Always stop the server
- Status stoppingStatus = stopServer(env);
- if(stoppingStatus.getSeverity() == Status.ERROR)
- return stoppingStatus;
-
- if (!needEAR_ && projectExists && addedToServer)
- {
- return new SimpleStatus("");
- }
- else if (!needEAR_ && projectExists && !addedToServer)
- {
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, existingServer_, ResourceUtils.getModule(webProject) , true, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
- else if (!needEAR_ && !projectExists)
- {
- Status status = createWebProject(env);
- if(status.getSeverity() == Status.ERROR)
- return status;
- webProject = root.getProject(projectName_);
-
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, existingServer_, ResourceUtils.getModule(webProject) , true, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
- else if (projectExists && earExists && areAssociated && addedToServer)
- {
- return new SimpleStatus("");
- }
- else if (projectExists && earExists && areAssociated && !addedToServer)
- {
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, existingServer_, ResourceUtils.getModule(webProject) , true, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
- else if (projectExists && !earExists)
- {
- //Create the EAR project
- Status status = createEARProject(env);
- if (status.getSeverity() == Status.ERROR)
- return status;
- earProject = root.getProject(earProjectName_);
-
- //Associate the Web project and the EAR project
- J2EEUtils.associateWebProject(webProject, earProject);
-
- //Add to server
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, existingServer_, ResourceUtils.getModule(webProject) , true, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
- else if (!projectExists && !earExists)
- {
- //Create EAR
- Status status = createEARProject(env);
- if (status.getSeverity() == Status.ERROR)
- return status;
- earProject = root.getProject(earProjectName_);
-
- //Create project
- status = createWebProject(env);
- if(status.getSeverity() == Status.ERROR)
- return status;
- webProject = root.getProject(projectName_);
-
- //Add to server
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, existingServer_, ResourceUtils.getModule(webProject) , true, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
- else if (!projectExists && earExists)
- {
- //Remove the ear from the server if necessary
- if (earAddedToServer && serverRequiresEARRemoval)
- {
- // Stopping server and removing EAR from Server
- if (existingServer_.getServerState() != IServer.STATE_STOPPED)
- {
- existingServer_.synchronousStop(false);
- }
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, existingServer_, ResourceUtils.getModule(earProject), false, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
-
- //Create the Web project
- Status status = createWebProject(env);
- if(status.getSeverity() == Status.ERROR)
- return status;
- webProject = root.getProject(projectName_);
-
- boolean earAddedToServerFinal = ServerUtil.containsModule(existingServer_,ResourceUtils.getModule(earProject), new NullProgressMonitor());
- if (!earAddedToServerFinal)
- {
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, existingServer_, ResourceUtils.getModule(webProject) , true, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
-
- }
- else if (projectExists && earExists && !areAssociated)
- {
- //Remove the ear from the server if necessary
- if (earAddedToServer && serverRequiresEARRemoval)
- {
- // Stopping server and removing EAR from Server
- if (existingServer_.getServerState() != IServer.STATE_STOPPED)
- {
- existingServer_.synchronousStop(false);
- }
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, existingServer_, ResourceUtils.getModule(earProject), false, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
-
- //Associate the Web project and the EAR project
- J2EEUtils.associateWebProject(webProject, earProject);
-
- boolean earAddedToServerFinal = ServerUtil.containsModule(existingServer_,ResourceUtils.getModule(earProject), new NullProgressMonitor());
- if (!earAddedToServerFinal)
- {
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, existingServer_, ResourceUtils.getModule(webProject) , true, new NullProgressMonitor());
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
-
- }
-
- return new SimpleStatus("");
- }
-
- private Status createWebProject(Environment env)
- {
- try
- {
-
- WebModuleCreationDataModel projectInfo = new WebModuleCreationDataModel();
- projectInfo.setProperty(WebModuleCreationDataModel.PROJECT_NAME, projectName_);
- String finalJ2EEVersion = null;
- if (j2eeVersion_ != null && j2eeVersion_.length()>0)
- {
- projectInfo.setProperty(WebModuleCreationDataModel.J2EE_VERSION, new Integer(j2eeVersion_));
- finalJ2EEVersion = j2eeVersion_;
- }
- else
- {
- if (earProjectName_ !=null && earProjectName_.length()>0)
- {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject earProject = root.getProject(earProjectName_);
- if (earProject != null && earProject.exists())
- {
- EARNatureRuntime ear = EARNatureRuntime.getRuntime(earProject);
- int earVersion = ear.getJ2EEVersion();
- projectInfo.setProperty(WebModuleCreationDataModel.J2EE_VERSION, new Integer(earVersion));
- finalJ2EEVersion = String.valueOf(earVersion);
- }
- else
- {
- projectInfo.setProperty(WebModuleCreationDataModel.J2EE_VERSION, new Integer(J2EEVersionConstants.J2EE_1_3_ID));
- finalJ2EEVersion = String.valueOf(J2EEVersionConstants.J2EE_1_3_ID);
- }
- }
- else
- {
- projectInfo.setProperty(WebModuleCreationDataModel.J2EE_VERSION, new Integer(J2EEVersionConstants.J2EE_1_3_ID));
- finalJ2EEVersion = String.valueOf(J2EEVersionConstants.J2EE_1_3_ID);
- }
-
- }
- String runtimeTargetId = null;
- if (serverFactoryId_!=null && serverFactoryId_.length()>0)
- {
- runtimeTargetId = ServerUtils.getServerTargetIdFromFactoryId(serverFactoryId_,IServerTargetConstants.WEB_TYPE, finalJ2EEVersion);
- projectInfo.setProperty(WebModuleCreationDataModel.SERVER_TARGET_ID, runtimeTargetId );
- projectInfo.setProperty(WebModuleCreationDataModel.ADD_SERVER_TARGET, Boolean.TRUE);
- }
-
- if (earProjectName_ !=null && earProjectName_.length()>0)
- {
- projectInfo.setProperty(WebModuleCreationDataModel.EAR_PROJECT_NAME, earProjectName_);
- projectInfo.setProperty(WebModuleCreationDataModel.ADD_TO_EAR, Boolean.TRUE);
- }
- else
- {
- projectInfo.setProperty(WebModuleCreationDataModel.ADD_TO_EAR, Boolean.FALSE);
- }
-
-
-
- //Create and run the operation
- WebModuleCreationOperation op = new WebModuleCreationOperation(projectInfo);
- op.run(new NullProgressMonitor());
- return new SimpleStatus("");
- } catch (Exception e)
- {
- env.getLog().log(Log.ERROR, 5046, this, "createWebProject", e);
- Status status = new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils_.getMessage("MSG_ERROR_WEB_PROJECT_CREATE"), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return status;
- }
- }
-
- private Status createEARProject(Environment env)
- {
- CreateEARProjectCommand t = new CreateEARProjectCommand();
- t.setEarProjectName(earProjectName_);
- t.setServerFactoryId(serverFactoryId_);
- t.setJ2EEVersion(j2eeVersion_);
- Status status = t.execute(env);
- return status;
- }
-
- private Status stopServer(Environment env)
- {
-
- try
- {
- WebServiceStartServerRegistry reg = WebServiceStartServerRegistry.getInstance();
- AbstractStartServer startServerCommand = (AbstractStartServer)reg.getServerStartByTypeId(existingServer_.getServerType().getId());
- startServerCommand.stopServer(existingServer_);
- return new SimpleStatus("");
- }
- catch (CoreException ce )
- {
- IStatus embeddedStatus = ce.getStatus();
- Status status = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
-
- }
-
- // To be deprecated
- /*
- private Status createWebProject(String webProjectName, String earProjectName, Environment env) {
-
- try {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject earProject = root.getProject(earProjectName);
- if (earProject != null && !earProject.exists()) {
- CreateEARProjectCommand c = new CreateEARProjectCommand();
- c.setEarProjectName(earProjectName);
- c.setServerFactoryId(serverFactoryId_);
- c.setJ2EEVersion(j2eeVersion_);
- c.execute(env);
- earProject = root.getProject(earProjectName);
- }
- IProject webProject = root.getProject(webProjectName);
- if (webProject != null && !webProject.exists()) {
- WebModuleCreationDataModel info = new WebModuleCreationDataModel();
- info.setProperty(WebModuleCreationDataModel.PROJECT_NAME, webProjectName);
- info.setProperty(WebModuleCreationDataModel.EAR_PROJECT_NAME, earProjectName);
- //info.setProperty(WebModuleCreationDataModel.ADD_TO_EAR, Boolean.TRUE);
- info.setProperty(WebModuleCreationDataModel.ADD_TO_EAR, Boolean.FALSE);
- if (serverFactoryId_!=null && serverFactoryId_.length()>0)
- {
- String runtimeTargetId = ServerUtils.getRuntimeTargetIdFromFactoryId(serverFactoryId_);
- info.setProperty(WebModuleCreationDataModel.SERVER_TARGET_ID, runtimeTargetId );
- info.setProperty(WebModuleCreationDataModel.ADD_SERVER_TARGET, Boolean.TRUE);
- }
- if (j2eeVersion_ != null && j2eeVersion_.length()>0)
- {
- info.setProperty(WebModuleCreationDataModel.J2EE_VERSION, new Integer(j2eeVersion_));
- }
-
- WebProjectCreationOperation operation = new WebProjectCreationOperation(info);
- operation.run(new NullProgressMonitor());
- }
- }
- catch (java.lang.reflect.InvocationTargetException ite) {
- return new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils_.getMessage("MSG_ERROR_WEB_PROJECT_CREATE"), Status.ERROR,
- ite);
- }
- catch (InterruptedException ie) {
- return new SimpleStatus(WebServiceConsumptionPlugin.ID, msgUtils_.getMessage("MSG_ERROR_WEB_PROJECT_CREATE"), Status.ERROR,
- ie);
- }
- return new SimpleStatus("");
- }
- */
-
- private String getNewEARName() {
-
- String newEARName = DEFAULT_EAR_NAME;
- //Check to see if it exists
- IProject project = ResourceUtils.getWorkspace().getRoot().getProject(newEARName);
- return newEARName;
- }
-
-
- private IProject getDefaultEARProject(IProject project) {
-
- try {
- EARNatureRuntime[] ears = null;
- EARNatureRuntime ear = null;
- ears = J2EEProjectUtilities.getReferencingEARProjects(project);
- if (ears[0] != null && ears.length >= 1) {
- // found an EAR containing the web project
- return ears[0].getProject();
- }
-
- if (j2eeVersion_!=null && j2eeVersion_.length()>0)
- {
- ear = J2EEUtils.getEAR(Integer.parseInt(j2eeVersion_));
- }
- else
- {
- ear = J2EEUtils.get12EAR();
- if (ear == null)
- ear = J2EEUtils.get13EAR();
- if (ear == null)
- ear = J2EEUtils.getEAR(J2EEVersionConstants.J2EE_1_4_ID);
- }
-
- if (ear != null)
- return ear.getProject();
- else {
- String earName = getNewEARName();
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- return root.getProject(earName);
- }
- }
- catch (Exception e) {
- return null;
- }
-
- }
-
- private boolean isTomcat(String runtimeTargetId)
- {
- if (runtimeTargetId == null || runtimeTargetId.length()==0)
- {
- return false;
- }
- else
- {
- if (runtimeTargetId.equals("org.eclipse.jst.server.tomcat.41.runtime") ||
- runtimeTargetId.equals("org.eclipse.jst.server.tomcat.40.runtime") ||
- runtimeTargetId.equals("org.eclipse.jst.server.tomcat.32.runtime"))
- {
- return true;
- }
- else
- return false;
- }
- }
-
- /**
- * @param earProjectName
- * The earProjectName to set.
- */
- public void setEarProjectName(String earProjectName) {
-
- this.earProjectName_ = earProjectName;
- }
-
- /**
- * @param projectName
- * The projectName to set.
- */
- public void setProjectName(String projectName) {
-
- this.projectName_ = projectName;
- }
-
- /**
- * @param existingServer
- * The existingServer to set.
- */
- public void setExistingServer(IServer existingServer) {
-
- this.existingServer_ = existingServer;
- }
-
- public void setServerFactoryId(String serverFactoryId)
- {
- serverFactoryId_ = serverFactoryId;
- }
-
- public void setJ2EEVersion(String j2eeVersion)
- {
- j2eeVersion_ = j2eeVersion;
- }
-
- public void setNeedEAR(boolean needEAR)
- {
- needEAR_ = needEAR;
- }
-
- public void setAddedProjectToServer(boolean addedProjectToServer)
- {
- weAddedProjectToServer_ = addedProjectToServer;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/DisableBuildCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/DisableBuildCommand.java
deleted file mode 100644
index 827a303..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/DisableBuildCommand.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.jst.ws.internal.consumption.datamodel.validate.ValidationManager;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class DisableBuildCommand extends SimpleCommand
-{
- private MessageUtils msgUtils_;
- private Model model_;
- private ValidationManager manager_;
- private String LABEL = "TASK_LABEL_WEBSERVICE_DISABLE_BUILD";
- private String DESCRIPTION = "TASK_DESC_WEBSERVICE_DISABLE_BUILD";
- /**
- * CTOR;
- */
- public DisableBuildCommand()
- {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
-
- setName(msgUtils_.getMessage(LABEL));
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- }
-
- /**
- * Execute the command
- */
- public Status execute(Environment env) {
- Status status = new SimpleStatus("");
-
- env.getProgressMonitor().report(msgUtils_.getMessage("TASK_DESC_WEBSERVICE_DISABLE_BUILD"));
-
- if (manager_!=null) {
- manager_.disableAutoBuild();
- }
- return status;
- }
-
- /**
- * Set the model
- *
- * @param model
- */
- public void setModel(Model model) {
- this.model_ = model;
- }
-
-
- /**
- * @param manager_ The manager_ to set.
- */
- public void setValidationManager(ValidationManager manager) {
- this.manager_ = manager;
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/DisableValidationCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/DisableValidationCommand.java
deleted file mode 100644
index be03646..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/DisableValidationCommand.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.consumption.datamodel.validate.ValidationManager;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class DisableValidationCommand extends SimpleCommand {
-
- private MessageUtils msgUtils_;
- private ValidationManager manager_;
- private IProject serviceProject_;
- private String LABEL = "TASK_LABEL_WEBSERVICE_DISABLE_VALIDATION";
- private String DESCRIPTION = "TASK_DESC_WEBSERVICE_DISABLE_VALIDATION";
-
- /**
- * CTOR;
- */
- public DisableValidationCommand() {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
-
- setName(msgUtils_.getMessage(LABEL));
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- }
-
- /**
- * Execute the command
- */
- public Status execute(Environment env) {
- Status status = new SimpleStatus("");
-
- env.getProgressMonitor().report(msgUtils_.getMessage("TASK_DESC_WEBSERVICE_DISABLE_VALIDATION"));
-
- IProject project = serviceProject_;
- if (project != null) manager_.disableValidationForProject(project);
-
- return status;
- }
-
- /**
- * @param manager_
- * The manager_ to set.
- */
- public void setValidationManager(ValidationManager manager) {
- this.manager_ = manager;
- }
-
- public void setServiceProject(IProject serviceProject){
- this.serviceProject_ = serviceProject;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/GetMonitorCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/GetMonitorCommand.java
deleted file mode 100644
index 1f34d3e..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/GetMonitorCommand.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.http.HTTPAddress;
-import javax.wsdl.extensions.soap.SOAPAddress;
-
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusException;
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.wst.internet.monitor.core.IMonitorWorkingCopy;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-import org.eclipse.wst.server.core.util.SocketUtil;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-public class GetMonitorCommand extends SimpleCommand
-{
- private boolean monitorService;
- private boolean create;
- private WebServicesParser webServicesParser;
- private String wsdlURI;
- private List endpoints;
-
- public GetMonitorCommand()
- {
- super("org.eclipse.jst.ws.internal.consumption.command.common.GetMonitorCommand", "org.eclipse.jst.ws.internal.consumption.command.common.GetMonitorCommand");
- monitorService = true;
- create = true;
- }
-
- public Status execute(Environment env)
- {
- endpoints = new Vector();
- if (monitorService && webServicesParser != null && wsdlURI != null && wsdlURI.length() > 0)
- {
- Definition definition = webServicesParser.getWSDLDefinition(wsdlURI);
- if (definition != null)
- {
- Map services = definition.getServices();
- for (Iterator servicesIt = services.values().iterator(); servicesIt.hasNext();)
- {
- Service service = (Service)servicesIt.next();
- Map ports = service.getPorts();
- for (Iterator portsIt = ports.values().iterator(); portsIt.hasNext();)
- {
- Port wsdlPort = (Port)portsIt.next();
- List extElements = wsdlPort.getExtensibilityElements();
- for (Iterator extElementsIt = extElements.iterator(); extElementsIt.hasNext();)
- {
- ExtensibilityElement extElement = (ExtensibilityElement)extElementsIt.next();
- String endpoint = null;
- URL endpointURL = null;
- if (extElement instanceof SOAPAddress)
- endpoint = ((SOAPAddress)extElement).getLocationURI();
- else if (extElement instanceof HTTPAddress)
- endpoint = ((HTTPAddress)extElement).getLocationURI();
- if (endpoint != null)
- {
- try
- {
- endpointURL = new URL(endpoint);
- }
- catch (MalformedURLException murle)
- {
- }
- }
- if (endpointURL != null)
- {
- String protocol = endpointURL.getProtocol();
- String host = endpointURL.getHost();
- int port = endpointURL.getPort();
- if (port == -1)
- {
- if ("http".equalsIgnoreCase(protocol))
- port = 80;
- else if ("https".equalsIgnoreCase(protocol))
- port = 443;
- }
- if (protocol != null && protocol.startsWith("http") && host != null && host.length() > 0 && port != -1)
- {
- IMonitor m = null;
- IMonitor[] monitors = MonitorCore.getMonitors();
- for (int i=0; i<monitors.length; i++)
- {
- if (host.equalsIgnoreCase(monitors[i].getRemoteHost()) && port == monitors[i].getRemotePort())
- {
- m = monitors[i];
- break;
- }
- }
- if (m == null && create)
- {
- int monitoredPort = SocketUtil.findUnusedPort(5000, 15000);
- IMonitorWorkingCopy monitorWorkingCopy = MonitorCore.createMonitor();
- monitorWorkingCopy.setLocalPort(monitoredPort);
- monitorWorkingCopy.setRemoteHost(host);
- monitorWorkingCopy.setRemotePort(port);
- monitorWorkingCopy.setProtocol("HTTP");
- try
- {
- m = monitorWorkingCopy.save();
- }
- catch (Throwable t)
- {
- Status warning = new SimpleStatus(WebServiceConsumptionPlugin.ID, WebServiceConsumptionPlugin.getMessage("MSG_ERROR_UNABLE_TO_START_MONITOR", new Object[]{String.valueOf(port), endpoint}), Status.WARNING, t);
- try
- {
- if (env != null)
- env.getStatusHandler().report(warning);
- }
- catch (StatusException se)
- {
- }
- }
- }
- if (m != null)
- {
- try
- {
- if (!m.isRunning())
- m.start();
- StringBuffer sb = new StringBuffer(endpointURL.getProtocol());
- sb.append("://localhost:");
- sb.append(String.valueOf(m.getLocalPort()));
- sb.append(endpointURL.getFile());
- endpoints.add(sb.toString());
- }
- catch (Throwable t)
- {
- Status warning = new SimpleStatus(WebServiceConsumptionPlugin.ID, WebServiceConsumptionPlugin.getMessage("MSG_ERROR_UNABLE_TO_START_MONITOR", new Object[]{String.valueOf(port), endpoint}), Status.WARNING, t);
- try
- {
- if (env != null)
- env.getStatusHandler().report(warning);
- }
- catch (StatusException se)
- {
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return new SimpleStatus("");
- }
-
- public void setMonitorService(boolean monitorService)
- {
- this.monitorService = monitorService;
- }
-
- public void setDefinition(Definition definition)
- {
- }
-
- public void setWebServicesParser(WebServicesParser webServicesParser)
- {
- this.webServicesParser = webServicesParser;
- }
-
- public void setWsdlURI(String wsdlURI)
- {
- this.wsdlURI = wsdlURI;
- }
-
- public void setCreate(boolean create)
- {
- this.create = create;
- }
-
- public List getEndpoints()
- {
- return endpoints;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/JavaMofReflectionCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/JavaMofReflectionCommand.java
deleted file mode 100644
index e8b4634..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/JavaMofReflectionCommand.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-
-//core stuff
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jem.internal.plugin.JavaEMFNature;
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.impl.JavaClassImpl;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* This class is to be used to Build the data model
-* first we get the java class and then build the model
-*/
-public class JavaMofReflectionCommand extends SimpleCommand
-{
-
- public static String LABEL = "JavaMofReflectionCommand";
- public static String DESCRIPTION = "reflection for a given class";
- public static String OK_MESSAGE = "The model has been built ";
- private static String JAVA_EXTENSION = ".java";
- private static String CLASS_EXTENSION = ".class";
- private MessageUtils msgUtils_;
-
- private String clientProject;
- private ResourceSet resourceSet;
- private JavaHelpers javaClass;
- private String qname;
- private String proxyBean;
- private IProject clientIProject;
-
- /**
- * Constructs a new JavaMofReflectionCommand with the given label and description
- *
- */
- public JavaMofReflectionCommand()
- {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
-
- setDescription(DESCRIPTION);
- setName(LABEL);
- }
-
- // setters for this command
-
-
- /**
- * The end result of this whole process is to get the Java Class
- */
- public JavaHelpers getJavaClass()
- {
- return javaClass;
- }
-
-
- private void processQName()
- {
- qname = proxyBean;
- if (qname.toLowerCase().endsWith(JAVA_EXTENSION)) {
- qname = qname.substring(0,(qname.length() -5));
- }
- if (qname.toLowerCase().endsWith(CLASS_EXTENSION)) {
- qname = qname.substring(0,(qname.length() -6));
- }
- }
-
- /**
- * Get the java model from the resource then
- * build the model from the mof
- */
- public Status execute(Environment env)
- {
- //just make sure the project and qname are there
- //they are essential for this operation
- Status status = new SimpleStatus("");
- IProject clientIProject = (IProject)ResourceUtils.findResource(clientProject);
- processQName();
- if(clientProject == null || qname == null)
- return new SimpleStatus(WebServiceConsumptionPlugin.ID,WebServiceConsumptionPlugin.getMessage("%MSG_WARN_UNABLE_TO_FIND_PROXY"),Status.WARNING);
-
- JavaEMFNature nature = (JavaEMFNature)JavaEMFNature.getRuntime(clientIProject);
- if(nature == null){
- try{
- nature = (JavaEMFNature)JavaEMFNature.createRuntime(clientIProject);
- }catch(CoreException exc){}
- }
- resourceSet = nature.getResourceSet();
- javaClass = (JavaHelpers)JavaClassImpl.reflect(qname, resourceSet);
-
- return status;
- }
-
- public void setProxyBean(String proxyBean)
- {
- this.proxyBean = proxyBean;
- }
-
- public void setClientProject(String clientProject)
- {
- this.clientProject = clientProject;
- }
-
- }
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ManageServerStartUpCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ManageServerStartUpCommand.java
deleted file mode 100644
index fcc7dae..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ManageServerStartUpCommand.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-
-/**
- * @author sengpl
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class ManageServerStartUpCommand extends SimpleCommand {
-
- private java.lang.String DESCRIPTION = "Start Web Project";
- private java.lang.String LABEL = "ServerStartUpManager";
- private MessageUtils msgUtils_;
-
- private Boolean isStartServiceEnabled_;
- private Boolean isTestServiceEnabled_;
-
- private IProject serviceProject_;
- private String serviceServerTypeId_;
- private IServer serviceExistingServer_;
-
- private IProject sampleProject_;
- private String sampleServerTypeId_;
- private IServer sampleExistingServer_;
-
- private boolean isWebProjectStartupRequested_;
-
- /**
- * Default CTOR;
- */
- public ManageServerStartUpCommand() {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- }
-
- /**
- * Execute the command
- */
- public Status execute(Environment env)
- {
- Status status = new SimpleStatus( "" );
- env.getProgressMonitor().report(msgUtils_.getMessage("PROGRESS_INFO_START_WEB_PROJECT"));
-
- if (isStartServiceEnabled_.booleanValue() && serviceExistingServer_!=null){
- //System.out.println("Calling service server start: "+serviceProject_+" "+serviceServerTypeId_);
- StartProjectCommand spc = new StartProjectCommand();
- spc.setServiceProject(serviceProject_);
- spc.setServiceServerTypeID(serviceServerTypeId_);
- spc.setServiceExistingServer(serviceExistingServer_);
- spc.setIsWebProjectStartupRequested(isWebProjectStartupRequested_);
- spc.execute(env);
- }
-
- if(isTestServiceEnabled_.booleanValue()&& sampleExistingServer_!=null && serviceExistingServer_!=null && !sampleExistingServer_.equals(serviceExistingServer_)){
- //System.out.println("Calling client server start: "+sampleProject_+" "+sampleExistingServer__);
- StartProjectCommand spc = new StartProjectCommand();
- spc.setSampleProject(sampleProject_);
- spc.setSampleServerTypeID(sampleServerTypeId_);
- spc.setSampleExistingServer(sampleExistingServer_);
- spc.setCreationScenario(new Boolean("false"));
- spc.execute(env);
- }
-
- return status;
- }
-
- /**
- * @param isStartServiceEnabled The isStartServiceEnabled to set.
- */
- public void setStartService(Boolean isStartServiceEnabled) {
- this.isStartServiceEnabled_ = isStartServiceEnabled;
- }
- /**
- * @param isTestServiceEnabled The isTestServiceEnabled to set.
- */
- public void setTestService(Boolean isTestServiceEnabled) {
- this.isTestServiceEnabled_ = isTestServiceEnabled;
- }
- /**
- * @param serviceExistingServer The serviceExistingServer to set.
- */
- public void setServiceExistingServer(IServer serviceExistingServer) {
- this.serviceExistingServer_ = serviceExistingServer;
- }
-
- /**
- * @param serviceServerTypeId The serviceServerTypeId to set.
- */
- public void setServiceServerTypeId(String serviceServerTypeId) {
- this.serviceServerTypeId_ = serviceServerTypeId;
- }
- /**
- * @param serviceProject The serviceProject to set.
- */
- public void setServiceProject(IProject serviceProject) {
- this.serviceProject_ = serviceProject;
- }
-
- /**
- * @param sampleExistingServer The sampleExistingServer to set.
- */
- public void setSampleExistingServer(IServer sampleExistingServer) {
- this.sampleExistingServer_ = sampleExistingServer;
- }
- /**
- * @param sampleProject The sampleProject to set.
- */
- public void setSampleProject(IProject sampleProject) {
- this.sampleProject_ = sampleProject;
- }
- /**
- * @param sampleServerTypeId The sampleServerTypeId to set.
- */
- public void setSampleServerTypeId(String sampleServerTypeId) {
- this.sampleServerTypeId_ = sampleServerTypeId;
- }
-
- /**
- * @param isRestartProjectNeeded The isRestartProjectNeeded to set.
- */
- public void setIsWebProjectStartupRequested(boolean isRestartProjectNeeded) {
- this.isWebProjectStartupRequested_ = isRestartProjectNeeded;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/PublishProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/PublishProjectCommand.java
deleted file mode 100644
index 49aba8e..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/PublishProjectCommand.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-
-public class PublishProjectCommand extends SimpleCommand {
-
-private java.lang.String DESCRIPTION = "Publish Web Project";
-private java.lang.String LABEL = "PublishProjectCommand";
-private MessageUtils msgUtils_;
-
-private String project;
-private String serverTypeID;
-private IServer existingServer;
-
-
-/**
- * Default CTOR;
- */
-public PublishProjectCommand() {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- setDescription(DESCRIPTION);
- setName(LABEL);
- //TODO setRunInWorkspaceModifyOperation(false);
-}
-
-/**
- * Execute the command
- */
-public Status execute(Environment env)
-{
-
- Status status = new SimpleStatus("");
- try
- {
- env.getProgressMonitor().report( msgUtils_.getMessage( "PROGRESS_INFO_PUBLISH_WEB_PROJECT" ) );
-
- if (project == null){
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_PROJECT_NOT_FOUND"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- IProject iProject = (IProject)ResourceUtils.findResource(project);
- IServer instance = ServerUtils.getServerForModule(ResourceUtils.getModule(iProject), serverTypeID, existingServer, true, EnvironmentUtils.getIProgressMonitor(env));
- if (instance == null)
- {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_INSTANCE_NOT_FOUND"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- if (instance.shouldPublish())
- {
- IStatus returnedStatus = instance.publish(EnvironmentUtils.getIProgressMonitor(env));
- status = EnvironmentUtils.convertIStatusToStatus(returnedStatus);
-
- //getStatusMonitor().reportStatus (instance.publish(getProgressMonitor()));
- env.getLog().log(Log.OK, 5026, this, "execute", new String("project="+project+" successfully published"));
- //Log.write(PublishProjectCommand.class,"execute",Log.OK,"project="+project+" successfully published");
- return status;
- }
-
- return status;
- }
- catch (Exception e) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_PUBLISH"), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return status;
-
- }
-}
-
-
-public void setProject(String project)
-{
- this.project = project;
-}
-
-public void setServerTypeID(String serverTypeID)
-{
- this.serverTypeID = serverTypeID;
-}
-
-public void setExistingServer(IServer existingServer)
-{
- this.existingServer = existingServer;
-}
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/RestoreBuildStateCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/RestoreBuildStateCommand.java
deleted file mode 100644
index db0f563..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/RestoreBuildStateCommand.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-
-import org.eclipse.jst.ws.internal.consumption.datamodel.validate.ValidationManager;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class RestoreBuildStateCommand extends SimpleCommand
-{
-
- private MessageUtils msgUtils_;
- private ValidationManager manager_;
-
- private String LABEL = "TASK_LABEL_WEBSERVICE_RESTORE_BUILD";
- private String DESCRIPTION = "TASK_DESC_WEBSERVICE_RESTORE_BUILD";
- /**
- * Default CTOR;
- */
- public RestoreBuildStateCommand()
- {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
-
- setName(msgUtils_.getMessage(LABEL));
- setDescription(msgUtils_.getMessage(DESCRIPTION));
-
- }
-
- /**
- * Execute the command
- */
- public Status execute(Environment env)
- {
- env.getProgressMonitor().report(msgUtils_.getMessage("TASK_DESC_WEBSERVICE_RESTORE_BUILD"));
-
- manager_.restoreAutoBuild();
-
- return new SimpleStatus("");
- }
-
- /**
- * @param manager_ The manager_ to set.
- */
- public void setValidationManager(ValidationManager manager) {
- this.manager_ = manager;
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/RestoreValidationStateCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/RestoreValidationStateCommand.java
deleted file mode 100644
index e67de11..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/RestoreValidationStateCommand.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-
-import org.eclipse.jst.ws.internal.consumption.datamodel.validate.ValidationManager;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class RestoreValidationStateCommand extends SimpleCommand
-{
- private MessageUtils msgUtils_;
- private ValidationManager manager_;
-
- private String LABEL = "TASK_LABEL_WEBSERVICE_RESTORE_VALIDATION";
- private String DESCRIPTION = "TASK_DESC_WEBSERVICE_RESTORE_VALIDATION";
-
- private boolean runValidation_;
-
- /**
- * Default CTOR;
- */
- public RestoreValidationStateCommand( boolean runValidation )
- {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
-
- setName(msgUtils_.getMessage(LABEL));
- setDescription(msgUtils_.getMessage(DESCRIPTION));
- runValidation_ = runValidation;
- }
-
- /**
- * Execute the command
- */
- public Status execute(Environment env)
- {
- env.getProgressMonitor().report(msgUtils_.getMessage("TASK_DESC_WEBSERVICE_RESTORE_VALIDATION"));
-
- manager_.restoreValidationForProjects( runValidation_ );
-
- return new SimpleStatus("");
- }
-
- /**
- * @param manager The validation manager to set.
- */
- public void setValidationManager(ValidationManager manager) {
- this.manager_ = manager;
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ServerDeployableConfigurationCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ServerDeployableConfigurationCommand.java
deleted file mode 100644
index 160bb0d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/ServerDeployableConfigurationCommand.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerUtil;
-
-public class ServerDeployableConfigurationCommand extends SimpleCommand {
-
- private String LABEL = "ServerDeployableConfigurationCommand";
- private String DESCRIPTION = "Ensure Deployable is added to Server Configuration";
- private MessageUtils msgUtils_;
- private Boolean creationScenario_ = Boolean.TRUE;
- private TypeRuntimeServer clientIds_;
- private IProject serviceProject_;
- private IProject sampleProject_;
- private String serviceServerTypeID_;
- private String sampleServerTypeID_;
- private IServer serviceExistingServer_;
- private IServer sampleExistingServer_;
- private String serviceProjectURL_;
- private String sampleProjectURL_;
-
- //addedProjectToServer_ is set to true if
- //- the project exists AND
- //- the server exists (i.e. this command did not create it) AND
- //- this command added the project to the server
- private boolean addedProjectToServer_ = false;
-
- /**
- * Default CTOR
- */
- public ServerDeployableConfigurationCommand() {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- setDescription(DESCRIPTION);
- setName(LABEL);
- }
-
- /**
- * Default CTOR
- */
- public ServerDeployableConfigurationCommand(boolean creationScenario) {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- setDescription(DESCRIPTION);
- setName(LABEL);
- creationScenario_ = new Boolean(creationScenario);
- }
-
- /**
- * execute
- */
- public Status execute(Environment env) {
-
- Status status = new SimpleStatus("");
- try {
-
- if (!(creationScenario_.booleanValue()) )
- return status;
-
- // determine client or service project
- IProject project = ((creationScenario_.booleanValue()) ? serviceProject_ : sampleProject_);
- if (project == null)
- return status;
-
- sampleServerTypeID_ = clientIds_.getServerId();
-
- // determine service or sample server factory Id
- String serverFactoryId = ((creationScenario_.booleanValue()) ? serviceServerTypeID_ : sampleServerTypeID_);
-
- // get an IServer object; either existing or create one
- IServer server = ((creationScenario_.booleanValue()) ? serviceExistingServer_ : sampleExistingServer_);
- if (server != null) {
- // find exact server for given project
- IServer[] servers = ServerUtil.getServersByModule(ResourceUtils.getModule(project), null);
- boolean foundServer = false;
- for (int i = 0; i < servers.length; i++) {
- if (servers[i].equals(server))
- foundServer = true;
- }
- if (!foundServer) {
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, server, ResourceUtils.getModule(project), true, EnvironmentUtils.getIProgressMonitor(env));
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- addedProjectToServer_ = true;
- }
- }
- else {
- if (!(creationScenario_.booleanValue()) && serviceServerTypeID_ == sampleServerTypeID_) //Client
- {
- server = serviceExistingServer_;
- }
- else {
- server = ServerUtils.getInstance().createServer(env, ResourceUtils.getModule(project), serverFactoryId, true, EnvironmentUtils.getIProgressMonitor(env));
- }
- if (server == null) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_CREATE_SERVER"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- // check if module is already associated
- IModule[] parentModules = server.getRootModules(ResourceUtils.getModule(project), null);
- if (parentModules!=null && parentModules.length!=0) {
- if (!ServerUtil.containsModule(server, ResourceUtils.getModule(project), null)) {
- Status mmStatus = ServerUtils.getInstance().modifyModules(env, server, ResourceUtils.getModule(project), true, EnvironmentUtils.getIProgressMonitor(env));
- if (mmStatus.getSeverity()==Status.ERROR)
- return mmStatus;
- }
- }
-
- }
-
- //
- String projectURL = ResourceUtils.getWebProjectURL(project, serverFactoryId, server);
- if (creationScenario_.booleanValue()) {
- serviceExistingServer_ = server;
- serviceProjectURL_ = projectURL;
- if (serviceServerTypeID_.equals(sampleServerTypeID_) && clientIds_.getServerInstanceId()==null){
- sampleExistingServer_ = serviceExistingServer_;
- }
- }
- else {
- sampleExistingServer_ = server;
- sampleProjectURL_ = projectURL;
- }
- return status;
- }
- catch (Exception e) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_BAD_SERVER_CONFIG"), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return status;
- }
- }
-
- public void setServiceProject(IProject serviceProject) {
- serviceProject_ = serviceProject;
- }
-
- public void setSampleProject(IProject sampleProject) {
- sampleProject_ = sampleProject;
- }
-
- public void setServiceServerTypeID(String serviceServerTypeID) {
- serviceServerTypeID_ = serviceServerTypeID;
- }
-
- public void setSampleServerTypeID(String sampleServerTypeID) {
- sampleServerTypeID_ = sampleServerTypeID;
- }
-
- public void setServiceExistingServer(IServer serviceExistingServer) {
- serviceExistingServer_ = serviceExistingServer;
- }
-
- public IServer getServiceExistingServer() {
- return serviceExistingServer_;
- }
-
- public String getServiceExistingServerInstId() {
- String id = null;
- IServerWorkingCopy wc = null;
-
- if (serviceExistingServer_!=null){
- wc = serviceExistingServer_.createWorkingCopy();
- id = (wc!=null ? wc.getId() : null);
- }
-
- return id;
- }
-
- public String getSampleExistingServerInstId(){
- String id = null;
- IServerWorkingCopy wc = null;
- if (sampleExistingServer_!=null){
- wc = sampleExistingServer_.createWorkingCopy();
- id = (wc!=null ? wc.getId() : null);
- }
-
- return id;
-
- }
-
- public void setSampleExistingServer(IServer sampleExistingServer) {
- sampleExistingServer_ = sampleExistingServer;
- }
-
- public IServer getSampleExistingServer() {
- return sampleExistingServer_;
- }
-
- public String getServiceProjectURL() {
- return serviceProjectURL_;
- }
-
- public String getSampleProjectURL() {
- return sampleProjectURL_;
- }
-
- public void setClientTypeRuntimeServer(TypeRuntimeServer clientId){
- this.clientIds_ = clientId;
- }
-
- /**
- * @return Returns the addedProjectToServer_.
- */
- public boolean getAddedProjectToServer() {
- return addedProjectToServer_;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/StartProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/StartProjectCommand.java
deleted file mode 100644
index 1e06170..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/StartProjectCommand.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.consumption.common.WebServiceStartServerRegistry;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IServer;
-
-public class StartProjectCommand extends SimpleCommand {
-
-private java.lang.String DESCRIPTION = "Start Web Project";
-private java.lang.String LABEL = "StartProjectCommand";
-private MessageUtils msgUtils_;
-
-private Boolean creationScenario_ = Boolean.TRUE;
-
-private boolean isWebProjectStartupRequested_;
-private IProject serviceProject_;
-private IProject sampleProject_;
-private String serviceServerTypeID_;
-private String sampleServerTypeID_;
-private IServer serviceExistingServer_;
-private IServer sampleExistingServer_;
-
-// rm private Model model_;
-
-/**
- * Default CTOR;
- */
-public StartProjectCommand() {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- setDescription(DESCRIPTION);
- setName(LABEL);
- //TODO setRunInWorkspaceModifyOperation(false);
-}
-
-/**
- * Default CTOR;
- */
-public StartProjectCommand(boolean creationScenario ) {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- setDescription(DESCRIPTION);
- setName(LABEL);
-
- //TODO setRunInWorkspaceModifyOperation(false);
- creationScenario_ = new Boolean(creationScenario);
-}
-
-/**
- * Execute the command
- */
-public Status execute(Environment env)
-{
-
-
- Status status = new SimpleStatus( "" );
- env.getProgressMonitor().report(msgUtils_.getMessage("PROGRESS_INFO_START_WEB_PROJECT"));
-
-
- IProject project = ((creationScenario_.booleanValue()) ? serviceProject_ : sampleProject_);
- String serverTypeID = ((creationScenario_.booleanValue()) ? serviceServerTypeID_ : sampleServerTypeID_);
- IServer server = ((creationScenario_.booleanValue()) ? serviceExistingServer_ : sampleExistingServer_);
- if (serverTypeID == null && server!=null) {
- serverTypeID = server.getServerType().getId();
- }
- if (project == null)
- {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_PROJECT_NOT_FOUND"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
- IServer instance = ServerUtils.getServerForModule(ResourceUtils.getModule(project), serverTypeID, server, true, EnvironmentUtils.getIProgressMonitor(env));
- if (instance == null)
- {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_INSTANCE_NOT_FOUND"), Status.ERROR);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
- try
- {
- AbstractStartServer startServerCommand = null;
- WebServiceStartServerRegistry reg = WebServiceStartServerRegistry.getInstance();
- startServerCommand = (AbstractStartServer)reg.getServerStartByTypeId(instance.getServerType().getId());
- startServerCommand.StartServer(project, instance, EnvironmentUtils.getIProgressMonitor(env), isWebProjectStartupRequested_);
- return status;
- }
- catch (CoreException ce )
- {
- IStatus embeddedStatus = ce.getStatus();
- status = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- env.getStatusHandler().reportError(status);
- return status;
- }
- catch (Exception e)
- {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SERVER"), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return status;
- }
-
-}
-
-public void setCreationScenario(Boolean creationScenario)
-{
- creationScenario_ = creationScenario;
-}
-
-public void setServiceProject(IProject serviceProject)
-{
- serviceProject_ = serviceProject;
-}
-
-public void setSampleProject(IProject sampleProject)
-{
- sampleProject_ = sampleProject;
-}
-
-public void setServiceServerTypeID(String serviceServerTypeID)
-{
- serviceServerTypeID_ = serviceServerTypeID;
-}
-
-public void setSampleServerTypeID(String sampleServerTypeID)
-{
- sampleServerTypeID_ = sampleServerTypeID;
-}
-
-public void setServiceExistingServer(IServer serviceExistingServer)
-{
- serviceExistingServer_ = serviceExistingServer;
- if (serviceExistingServer_ != null)
- setServiceServerTypeID(serviceExistingServer_.getServerType().getId());
-}
-
-public void setSampleExistingServer(IServer sampleExistingServer)
-{
- sampleExistingServer_ = sampleExistingServer;
- if (sampleExistingServer_ != null)
- setSampleServerTypeID(sampleExistingServer_.getServerType().getId());
-}
-
-public void setIsWebProjectStartupRequested(boolean webProjectStartupRequested)
-{
- isWebProjectStartupRequested_ = webProjectStartupRequested;
-}
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/StartTomcatServer.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/StartTomcatServer.java
deleted file mode 100644
index 508bc4d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/StartTomcatServer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.server.core.IServer;
-
-public class StartTomcatServer extends AbstractStartServer {
-
- protected void addJarsToClassPath(IServer tInstance) throws CoreException {
-
- }
-
- protected void validateRemoteServerPath(IServer server)
- throws CoreException {
- }
-
- public void stopServer(IServer server) throws CoreException {
-
- if (server != null) {
-
- if (server.getServerState() != IServer.STATE_STOPPED) {
- server.synchronousStop(false);
- }
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/FolderResourceFilter.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/FolderResourceFilter.java
deleted file mode 100644
index 5c0328d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/FolderResourceFilter.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.common;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.ws.internal.common.AnyFilter;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-
-
-/**
-* This is a kind of {@link Filter} that accepts only objects
-* which indicate a Java resource. In particular, any
-* {@link org.eclipse.core.resources.IResource} whose
-* pathname, or any object whose string representation as
-* returned by <code>toString()</code>, ends in
-* "<code>.java</code>" or "<code>.class</code>" will be accepted.
-* All other objects will be rejected.
-*/
-public class FolderResourceFilter extends AnyFilter
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Constructs a new <code>JavaResourceFilter</code> that filters
- * "<code>.java</code>" and "<code>.class</code>" objects.
- * Equivalent to <code>JavaResourceFilter(ALL_FILES)</code>.
- */
- public FolderResourceFilter () { }
-
- /**
- * Returns the locale-specific name of this filter.
- * @return The locale-specific name of this filter.
- */
- public String getName ()
- {
- return WebServiceConsumptionPlugin.getMessage("%FOLDER_FILTER_NAME");
- }
-
- /**
- * Returns the locale-specific description of this filter.
- * @return The locale-specific description of this filter.
- */
- public String getDescription ()
- {
- return WebServiceConsumptionPlugin.getMessage("%FOLDER_FILTER_DESC");
- }
-
- public IStatus statusOf ( Object object )
- {
- if (object == null)
- {
- return new Status(
- IStatus.ERROR,
- WebServiceConsumptionPlugin.ID,
- 0,
- WebServiceConsumptionPlugin.getMessage("%FILTER_MSG_ERROR_NULL_OBJECT"),
- null
- );
- }
-
- String name = null;
-
- if (object instanceof IResource)
- {
- IResource resource = (IResource)object;
- name = resource.getFullPath().toString();
- if (resource.getType() != IResource.FOLDER)
- {
- return new Status(
- IStatus.ERROR,
- WebServiceConsumptionPlugin.ID,
- 0,
- WebServiceConsumptionPlugin.getMessage("%FILTER_MSG_ERROR_NOT_FOLDER",new Object[] {name}),
- null
- );
- }
- }
- return new Status(IStatus.OK,WebServiceConsumptionPlugin.ID,0,"",null);
- }
-
- private boolean acceptsName ( String name )
- {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/IServerDefaulter.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/IServerDefaulter.java
deleted file mode 100644
index fc1f1d9..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/IServerDefaulter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.common;
-
-import org.eclipse.core.resources.IProject;
-
-
-/**
- * Implement this interface to provide logic that can be plugged into
- * the server defaulting algorithm.
- * (See the org.eclipse.jst.ws.consumption.serverDefaulter extension point)
- */
-public interface IServerDefaulter
-{
-
- /**
- * @param project
- * @return ServerInfo.
- * If no existing server or server type is recommended, return null.
- * If a server type is recommended, return an instance of ServerInfo with a non-null
- * non-empty String for the serverFactoryId and null for the serverInstanceId.
- * If a server instance is recommended, return an instance of ServerInfo with a non-null
- * non-empty String for the serverFactoryId and the serverInstanceId.
- */
- public ServerInfo recommendDefaultServer(IProject project);
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/JavaResourceFilter.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/JavaResourceFilter.java
deleted file mode 100644
index fc44f91..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/JavaResourceFilter.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.common;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.ws.internal.common.AnyFilter;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-
-
-/**
-* This is a kind of {@link Filter} that accepts only objects
-* which indicate a Java resource. In particular, any
-* {@link org.eclipse.core.resources.IResource} whose
-* pathname, or any object whose string representation as
-* returned by <code>toString()</code>, ends in
-* "<code>.java</code>" or "<code>.class</code>" will be accepted.
-* All other objects will be rejected.
-*/
-public class JavaResourceFilter extends AnyFilter
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * A <code>JavaResourceFilter</code> constructed with this value will
- * accept "<code>.java</code>", but not "<code>.class</code>", objects.
- */
- public static final byte JAVA_FILES = (byte)1;
-
- /**
- * A <code>JavaResourceFilter</code> constructed with this value will
- * accept "<code>.class</code>", but not "<code>.java</code>", objects.
- */
- public static final byte CLASS_FILES = (byte)2;
-
- /**
- * A <code>JavaResourceFilter</code> constructed with this value will
- * accept both "<code>.java</code>" and "<code>.class</code>" objects.
- */
- public static final byte ALL_FILES = (byte)255;
-
- private byte extensions_;
-
- /**
- * Constructs a new <code>JavaResourceFilter</code> that filters
- * "<code>.java</code>" and "<code>.class</code>" objects.
- * Equivalent to <code>JavaResourceFilter(ALL_FILES)</code>.
- */
- public JavaResourceFilter ()
- {
- this(ALL_FILES);
- }
-
- /**
- * Constructs a new <code>JavaResourceFilter</code> that filters
- * "<code>.java</code>" objects, "<code>.class</code>" objects,
- * or both if the value of <code>extensions</code> is
- * {@link #JAVA_FILES}, {@link #CLASS_FILES} or {@link #ALL_FILES}
- * respectively.
- * @param extensions One of
- * {@link #JAVA_FILES}, {@link #CLASS_FILES} or {@link #ALL_FILES}.
- */
- public JavaResourceFilter ( byte extensions )
- {
- extensions_ = extensions;
- }
-
- /**
- * Returns the locale-specific name of this filter.
- * @return The locale-specific name of this filter.
- */
- public String getName ()
- {
- return WebServiceConsumptionPlugin.getMessage("%JAVA_FILTER_NAME");
- }
-
- /**
- * Returns the locale-specific description of this filter.
- * @return The locale-specific description of this filter.
- */
- public String getDescription ()
- {
- return WebServiceConsumptionPlugin.getMessage("%JAVA_FILTER_DESC");
- }
-
- /**
- * Returns an {@link org.eclipse.core.runtime.IStatus}
- * describing the <code>Filter</code>'s assessment of
- * the given <code>object</code>.
- * See {@link Filter#statusOf} for general comments.
- * @param object The object to filter.
- * @return An {@link org.eclipse.core.runtime.IStatus}
- * indicating whether or not if the given <code>object</code>
- * represents a Java resource.
- */
- public IStatus statusOf ( Object object )
- {
- if (object == null)
- {
- return new Status(
- IStatus.ERROR,
- WebServiceConsumptionPlugin.ID,
- 0,
- WebServiceConsumptionPlugin.getMessage("%FILTER_MSG_ERROR_NULL_OBJECT"),
- null
- );
- }
-
- String name = null;
-
- if (object instanceof IResource)
- {
- IResource resource = (IResource)object;
- name = resource.getFullPath().toString();
- if (resource.getType() != IResource.FILE)
- {
- return new Status(
- IStatus.ERROR,
- WebServiceConsumptionPlugin.ID,
- 0,
- WebServiceConsumptionPlugin.getMessage("%FILTER_MSG_ERROR_NOT_FILE",new Object[] {name}),
- null
- );
- }
- }
-
- if (name == null)
- {
- name = object.toString();
- }
-
- if (!acceptsName(name))
- {
- return new Status(
- IStatus.ERROR,
- WebServiceConsumptionPlugin.ID,
- 0,
- WebServiceConsumptionPlugin.getMessage("%JAVA_FILTER_MSG_ERROR_WRONG_EXTENSION",new Object[] {name}),
- null
- );
- }
-
- return new Status(IStatus.OK,WebServiceConsumptionPlugin.ID,0,"",null);
- }
-
- //
- // Checks if the given name is acceptable based upon its extension
- // and the value of the extensions_ bitmask.
- //
- private boolean acceptsName ( String name )
- {
- return (
- (name.endsWith(".java") && ((extensions_ & JAVA_FILES) != 0)) ||
- (name.endsWith(".class") && ((extensions_ & CLASS_FILES) != 0))
- );
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/MappingUtils.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/MappingUtils.java
deleted file mode 100644
index c53c10a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/MappingUtils.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-
-
-/**
-* This class contains useful methods for working with Server plugin functions
-*/
-public final class MappingUtils
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private static final String DEFAULT_SERVICE_EXT = "Service.wsdl";
- private static final String DEFAULT_BINDING_EXT = "Binding.wsdl";
- private static final String DEFAULT_V4_SERVICE_EXT = "-service.wsdl";
- private static final String DEFAULT_V4_BINDING_EXT = "-binding.wsdl";
- private static final String WSDL_EXTENSION = ".wsdl";
- private static final String WSDL_FOLDER = "wsdl";
- public static final String DEFAULT_SKELETON_PACKAGENAME = "service";
-
- /**
- * Returns the WSDL folder path
- * @param project the project
- */
- public static IPath getWSDLFolderPath (IProject project)
- {
- IPath wsdlFolder=null;
- IPath webModuleServerRoot = ResourceUtils.getWebModuleServerRoot( project ).getFullPath();
- if (webModuleServerRoot != null )
- wsdlFolder = webModuleServerRoot.append(WSDL_FOLDER);
- return wsdlFolder;
- }
-
-
- /**
- * Returns the base name based on WSDL file name
- * @param wsdlName WSDL file name
- */
- public static String getBaseName (String wsdlLocation )
- {
- String wsdlName=wsdlLocation;
-
- int index = wsdlLocation.lastIndexOf('/');
- if (index!= -1) {
- wsdlName = wsdlLocation.substring(index+1,wsdlName.length());
- }
-
- String baseName=wsdlName;
- if ( wsdlName.endsWith(DEFAULT_SERVICE_EXT) ) {
- baseName = wsdlName.substring(0,(wsdlName.length() - DEFAULT_SERVICE_EXT.length()));
- } else if ( wsdlName.toLowerCase().endsWith(DEFAULT_V4_SERVICE_EXT) ) {
- baseName = wsdlName.substring(0,(wsdlName.length() - DEFAULT_V4_SERVICE_EXT.length()));
- } else if (wsdlName.endsWith(DEFAULT_BINDING_EXT)) {
- baseName = wsdlName.substring(0,(wsdlName.length()-DEFAULT_BINDING_EXT.length()));
- } else if (wsdlName.toLowerCase().endsWith(DEFAULT_V4_BINDING_EXT)) {
- baseName = wsdlName.substring(0,(wsdlName.length()-DEFAULT_V4_BINDING_EXT.length()));
- } else if (wsdlName.toLowerCase().endsWith(WSDL_EXTENSION)) {
- baseName = wsdlName.substring(0,(wsdlName.length() - WSDL_EXTENSION.length()));
- } else {
- // no recognizable suffix, just remove extension, if any
- int index4 = baseName.lastIndexOf('.');
- if (index4!=-1)
- baseName = baseName.substring(0, index4);
- }
- return baseName;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/PropertiesResourceFilter.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/PropertiesResourceFilter.java
deleted file mode 100644
index 146b2f1..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/PropertiesResourceFilter.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.common;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.ws.internal.common.AnyFilter;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-
-
-/**
-* This is a kind of {@link Filter} that accepts only objects
-* which indicate a Java resource. In particular, any
-* {@link org.eclipse.core.resources.IResource} whose
-* pathname, or any object whose string representation as
-* returned by <code>toString()</code>, ends in
-* "<code>.java</code>" or "<code>.class</code>" will be accepted.
-* All other objects will be rejected.
-*/
-public class PropertiesResourceFilter extends AnyFilter
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- * Constructs a new <code>JavaResourceFilter</code> that filters
- * "<code>.java</code>" and "<code>.class</code>" objects.
- * Equivalent to <code>JavaResourceFilter(ALL_FILES)</code>.
- */
- public PropertiesResourceFilter ()
- {
-
- }
-
- /**
- * Returns the locale-specific name of this filter.
- * @return The locale-specific name of this filter.
- */
- public String getName ()
- {
- return WebServiceConsumptionPlugin.getMessage("%PROPERTIES_FILTER_NAME");
- }
-
- /**
- * Returns the locale-specific description of this filter.
- * @return The locale-specific description of this filter.
- */
- public String getDescription ()
- {
- return WebServiceConsumptionPlugin.getMessage("%PROPERTIES_FILTER_DESC");
- }
-
- /**
- * Returns an {@link org.eclipse.core.runtime.IStatus}
- * describing the <code>Filter</code>'s assessment of
- * the given <code>object</code>.
- * See {@link Filter#statusOf} for general comments.
- * @param object The object to filter.
- * @return An {@link org.eclipse.core.runtime.IStatus}
- * indicating whether or not if the given <code>object</code>
- * represents a Java resource.
- */
- public IStatus statusOf ( Object object )
- {
- if (object == null)
- {
- return new Status(
- IStatus.ERROR,
- WebServiceConsumptionPlugin.ID,
- 0,
- WebServiceConsumptionPlugin.getMessage("%FILTER_MSG_ERROR_NULL_OBJECT"),
- null
- );
- }
-
- String name = null;
-
- if (object instanceof IResource)
- {
- IResource resource = (IResource)object;
- name = resource.getFullPath().toString();
- if (resource.getType() != IResource.FILE)
- {
- return new Status(
- IStatus.ERROR,
- WebServiceConsumptionPlugin.ID,
- 0,
- WebServiceConsumptionPlugin.getMessage("%FILTER_MSG_ERROR_NOT_FILE",new Object[] {name}),
- null
- );
- }
- }
-
- if (name == null)
- {
- name = object.toString();
- }
-
- if (!name.endsWith(".properties"))
- {
- return new Status(
- IStatus.ERROR,
- WebServiceConsumptionPlugin.ID,
- 0,
- WebServiceConsumptionPlugin.getMessage("%PROPERTIES_FILTER_MSG_ERROR_WRONG_EXTENSION",new Object[] {name}),
- null
- );
- }
-
- return new Status(IStatus.OK,WebServiceConsumptionPlugin.ID,0,"",null);
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/ServerInfo.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/ServerInfo.java
deleted file mode 100644
index 0625cb2..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/ServerInfo.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Mar 25, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.ws.internal.consumption.common;
-
-/**
- *
- */
-public class ServerInfo
-{
- String serverFactoryId;
- String serverInstanceId;
- /**
- * @return Returns the serverFactoryId.
- */
- public String getServerFactoryId()
- {
- return serverFactoryId;
- }
- /**
- * @param serverFactoryId The serverFactoryId to set.
- */
- public void setServerFactoryId(String serverFactoryId)
- {
- this.serverFactoryId = serverFactoryId;
- }
- /**
- * @return Returns the serverInstanceId.
- */
- public String getServerInstanceId()
- {
- return serverInstanceId;
- }
- /**
- * @param serverInstanceId The serverInstanceId to set.
- */
- public void setServerInstanceId(String serverInstanceId)
- {
- this.serverInstanceId = serverInstanceId;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/WSDLResourceFilter.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/WSDLResourceFilter.java
deleted file mode 100644
index 7872f6d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/WSDLResourceFilter.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.common;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.ws.internal.common.AnyFilter;
-import org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin;
-
-
-/**
-* This is a kind of {@link Filter} that accepts only objects
-* which indicate a WSDL resource. In particular, any
-* {@link org.eclipse.core.resources.IResource} whose
-* pathname, or any object whose string representation as
-* returned by <code>toString()</code>, ends in
-* "<code>.wsdl</code>" will be accepted.
-* All other objects will be rejected.
-*/
-public class WSDLResourceFilter extends AnyFilter
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Constructs a new <code>WSDLResourceFilter</code>.
- */
- public WSDLResourceFilter ()
- {
- }
-
- /**
- * Returns the locale-specific name of this filter.
- * @return The locale-specific name of this filter.
- */
- public String getName ()
- {
- return WebServiceConsumptionPlugin.getMessage("%WSDL_FILTER_NAME");
- }
-
- /**
- * Returns the locale-specific description of this filter.
- * @return The locale-specific description of this filter.
- */
- public String getDescription ()
- {
- return WebServiceConsumptionPlugin.getMessage("%WSDL_FILTER_DESC");
- }
-
- /**
- * Returns an {@link org.eclipse.core.runtime.IStatus}
- * describing the <code>Filter</code>'s assessment of
- * the given <code>object</code>.
- * See {@link Filter#statusOf} for general comments.
- * @param object The object to filter.
- * @return An {@link org.eclipse.core.runtime.IStatus}
- * indicating whether or not if the given <code>object</code>
- * represents a WSDL resource.
- */
- public IStatus statusOf ( Object object )
- {
- if (object == null)
- {
- return new Status(
- IStatus.ERROR,
- WebServiceConsumptionPlugin.ID,
- 0,
- WebServiceConsumptionPlugin.getMessage("%FILTER_MSG_ERROR_NULL_OBJECT"),
- null
- );
- }
-
- String name = null;
-
- if (object instanceof IResource)
- {
- IResource resource = (IResource)object;
- name = resource.getFullPath().toString();
- if (resource.getType() != IResource.FILE)
- {
- return new Status(
- IStatus.ERROR,
- WebServiceConsumptionPlugin.ID,
- 0,
- WebServiceConsumptionPlugin.getMessage("%FILTER_MSG_ERROR_NOT_FILE",new Object[] {name}),
- null
- );
- }
- }
-
- if (name == null)
- {
- name = object.toString();
- }
-
- if (!name.endsWith(".wsdl"))
- {
- return new Status(
- IStatus.ERROR,
- WebServiceConsumptionPlugin.ID,
- 0,
- WebServiceConsumptionPlugin.getMessage("%WSDL_FILTER_MSG_ERROR_WRONG_EXTENSION",new Object[] {name}),
- null
- );
- }
-
- return new Status(IStatus.OK,WebServiceConsumptionPlugin.ID,0,"",null);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/WebServiceStartServerRegistry.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/WebServiceStartServerRegistry.java
deleted file mode 100644
index 13fc9ec..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/common/WebServiceStartServerRegistry.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.common;
-
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-
-
-
-/**
-* This is the registry of WebServiceStartServerType objects.
-*/
-public class WebServiceStartServerRegistry
-{
-
- private static WebServiceStartServerRegistry instance_;
- private Hashtable StartServerTypes;
-
- //
- // Loads WebServiceStartServerType objects into this registry.
- // See method getInstance().
- //
- private void load ()
- {
- StartServerTypes = new Hashtable();
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] config = reg.getConfigurationElementsFor(
- "org.eclipse.jst.ws.consumption",
- "webServiceStartServerType");
-
- for(int idx=0; idx<config.length; idx++)
- {
- IConfigurationElement elem = config[idx];
- try
- {
- String factoryId_ = elem.getAttribute("factoryId");
- StartServerTypes.put(factoryId_, elem);
-
- }
- catch (Exception e)
- {
- EclipseLog log = new EclipseLog();
- log.log(Log.ERROR, 5047, this, "load", e);
- }
-
- }
- }
-
- /**
- * Returns a singleton instance of this class.
- * @return A singleton WebServiceStartServerRegistry object.
- */
- public static WebServiceStartServerRegistry getInstance ()
- {
- if (instance_ == null)
- {
- instance_ = new WebServiceStartServerRegistry();
- instance_.load();
- }
- return instance_;
- }
-
- public Object getServerStartByTypeId (String typeID) throws CoreException
- {
- if (typeID==null)
- return null;
- return ((IConfigurationElement)StartServerTypes.get(typeID)).createExecutableExtension("class");
- }
-
- public boolean isRemoveEARRequired(String typeId) throws CoreException {
- if (typeId!=null) {
- IConfigurationElement elem = (IConfigurationElement)StartServerTypes.get(typeId);
- if (elem!=null){
- String value = elem.getAttribute("removeEAR");
- if (value!=null){
- return Boolean.valueOf(value).booleanValue();
- }
- }
- }
- return true;
- }
-}
-
-
-
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/ArrayElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/ArrayElement.java
deleted file mode 100644
index d009d50..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/ArrayElement.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicModel;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-
-/**
-* Objects of this class represent a Java bean.
-* Nearest moral equivalents: java.lang.Class, java.beans.BeanDescriptor.
-*/
-public class ArrayElement extends TypeElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- public static String ARRAY_NAME = "10101010array10101010";
- public static String REL_METHODS = "relmethods";
-
- /**
- * Constructor
- * @param projectElement The project this Bean belongs to.
- */
- public ArrayElement (String name)
- {
- this(name,new BasicModel("Project"),true);
- }
-
- /**
- * Constructor
- * @param parameterElement The parameter this Bean belongs to.
- */
- public ArrayElement (String name, Model model,boolean isRoot)
- {
- super(name,model,TypeElement.ARRAY);
- if(isRoot) model.setRootElement(this);
- fOwnerType = TypeElement.ROOT;
- }
-
-
- /**
- * Constructor for the case when this is not the root object
- * here it represents complex types
- * @param ParameterElement The Parameter that owns this bean type.
- * @param String Name of the bean element.
- */
- public ArrayElement ( ParameterElement parameterElement, String name)
- {
- super(name,parameterElement,TypeElement.REL_OWNER,TypeElement.REL_TYPE,TypeElement.ARRAY);
- fOwnerType = TypeElement.PARAMETER_OWNER;
- }
-
- /**
- * Constructor for the case when this is not the root object
- * here it represents complex types
- * @param ParameterElement The Parameter that owns this bean type.
- * @param String Name of the ParameterElement.
- */
- public ArrayElement ( AttributeElement attributeElement, String name)
- {
- super(name,attributeElement,TypeElement.REL_OWNER,TypeElement.REL_TYPE,TypeElement.ARRAY);
- fOwnerType = TypeElement.ATTRIBUTE_OWNER;
- }
-
- /**
- * Constructor for the case when this is not the root object
- * here it represents complex types
- * @param FieldElement The Parameter that owns this bean type.
- * @param String Name of the ParameterElement.
- */
- public ArrayElement ( FieldElement fieldElement, String name)
- {
- super(name,fieldElement,TypeElement.REL_OWNER,TypeElement.REL_TYPE,TypeElement.ARRAY);
- fOwnerType = TypeElement.FIELD_OWNER;
- }
-
-
- /*
- * determine wether this is an object array or
- * primitive array
- */
- public String getTypeName()
- {
- return ARRAY_NAME + getName();
- }
-
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/ArrayType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/ArrayType.java
deleted file mode 100644
index 3d8c7e4..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/ArrayType.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-
-
-/**
-* objects of this class represent a recognized return type
-*
-*/
-public class ArrayType extends RecognizedReturnType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- private String fTypeName;
-
- /**
- *Constructor
- *
- */
- public ArrayType(String typeName)
- {
- this(TypeFactory.ARRAY_NAME,typeName);
- }
-
- public ArrayType(String name,String typeName)
- {
- super(name);
- fTypeName = typeName;
- }
-
-
- /**
- * This is basically the function that dictates how we want to display this type
- * upon receiving it as a return from a proxy method
- * @param String the name of the type
- * @return String The display string
- */
- public String TypeConversion(String name)
- {
-
- String nonBean = Generator.DOUBLE_TAB + "java.util.List list" + getUniqueName() + "= java.util.Arrays.asList(" + name + ");" +StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "String temp"+ getUniqueName() +" = list" + getUniqueName() + ".toString();" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "%>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%=temp"+ getUniqueName() +"%>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%"+ StringUtils.NEWLINE;
-
- return nonBean;
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/AttributeElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/AttributeElement.java
deleted file mode 100644
index d2657b7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/AttributeElement.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-/**
-* Objects of this class represent a Java bean method parameter.
-* Nearest moral equivalents: java.beans.ParameterDescriptor.
-*/
-public class AttributeElement extends BasicElement implements AttributeElementType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static final String REL_TYPE = "type";
- public static final String REL_OWNING_BEAN = "owningbean";
-
- private String fSetterMethod;
- private String fGetterMethod;
-
- /**
- * Constructor this takes the owning bean.
- * @param name The name of the attribute.
- * @param beanElement the bean that owns this attribute.
- */
- public AttributeElement ( BeanElement beanElement, String name)
- {
- super(name,beanElement,REL_OWNING_BEAN,BeanElement.REL_ATTRIBUTES);
- }
-
- public void setSetterMethod(String setterMethod)
- {
- fSetterMethod = setterMethod;
- }
-
- public String getSetterMethod()
- {
- return fSetterMethod;
- }
-
- public String getGetterMethod()
- {
- return fGetterMethod;
- }
-
- public void setGetterMethod(String getterMethod)
- {
- fGetterMethod = getterMethod;
- }
-
- public String getSetterSignature(String attribute)
- {
- int bracket = fSetterMethod.indexOf("(");
- bracket++;
- String setter = fSetterMethod.substring(0,bracket);
- String fullSetter = setter + attribute + ");";
-
- return fullSetter;
- }
-
- /**
- * Returns the Bean that owns this Attribute.
- * @return BeanElement The bean that owns this attribute.
- */
- public BeanElement getOwningBeanElement ()
- {
- Enumeration e = getElements(REL_OWNING_BEAN);
- return e.hasMoreElements() ? (BeanElement)e.nextElement() : null;
- }
-
- /**
- * Returns the type that is owned by this attributte.
- * @return TypeElement The Type that of this attribute.
- */
- public TypeElement getTypeElement ()
- {
- Enumeration e = getElements(REL_TYPE);
- return e.hasMoreElements() ? (TypeElement)e.nextElement() : null;
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/AttributeElementType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/AttributeElementType.java
deleted file mode 100644
index 0b0b6fc..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/AttributeElementType.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* Objects of this class represent a Java bean method parameter.
-* Nearest moral equivalents: java.beans.ParameterDescriptor.
-*/
-public interface AttributeElementType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public void setSetterMethod(String setterMethod);
- public String getSetterMethod();
- public String getGetterMethod();
- public void setGetterMethod(String getterMethod);
- public BeanElement getOwningBeanElement ();
- public TypeElement getTypeElement ();
- /**
- * Return the signature with this value as the parmeter
- *
- */
- public String getSetterSignature(String attribute);
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BeanElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BeanElement.java
deleted file mode 100644
index ffb03af..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BeanElement.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicModel;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-
-
-/**
-* Objects of this class represent a Java bean.
-* Nearest moral equivalents: java.lang.Class, java.beans.BeanDescriptor.
-*/
-public class BeanElement extends TypeElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- public static String STATELESS_BEAN = "10101010statelessbean10101010";
- public static String REL_METHODS = "relmethods";
-
- /**
- * Constructor
- * @param projectElement The project this Bean belongs to.
- */
- public BeanElement (String name)
- {
- this(name,new BasicModel("Project"),true);
- }
-
- /**
- * Constructor
- * @param parameterElement The parameter this Bean belongs to.
- */
- public BeanElement (String name, Model model,boolean isRoot)
- {
- super(name,model,TypeElement.BEAN);
- if(isRoot) model.setRootElement(this);
- fOwnerType = TypeElement.ROOT;
- }
-
- /**
- * Constructor for the case when this is not the root object
- * here it represents complex types
- * @param ParameterElement The Parameter that owns this bean type.
- * @param String Name of the bean element.
- */
- public BeanElement ( ParameterElement parameterElement, String name)
- {
- super(name,parameterElement,TypeElement.REL_OWNER,TypeElement.REL_TYPE,TypeElement.BEAN);
- fOwnerType = TypeElement.PARAMETER_OWNER;
- }
-
- /**
- * Constructor for the case when this is not the root object
- * here it represents complex types
- * @param ParameterElement The Parameter that owns this bean type.
- * @param String Name of the ParameterElement.
- */
- public BeanElement ( AttributeElement attributeElement, String name)
- {
- super(name,attributeElement,TypeElement.REL_OWNER,TypeElement.REL_TYPE,TypeElement.BEAN);
- fOwnerType = TypeElement.ATTRIBUTE_OWNER;
-
- }
-
- /**
- * Constructor for the case when this is not the root object
- * here it represents complex types
- * @param ParameterElement The Parameter that owns this bean type.
- * @param String Name of the ParameterElement.
- */
- public BeanElement ( FieldElement fieldElement, String name)
- {
- super(name,fieldElement,TypeElement.REL_OWNER,TypeElement.REL_TYPE,TypeElement.BEAN);
- fOwnerType = TypeElement.FIELD_OWNER;
-
- }
-
- /**
- * Returns an enumeration of all Method objects of this Bean.
- * @return Enumeration All Method objects of this Bean.
- */
- public Enumeration getMethods ()
- {
- return getElements(REL_METHODS);
- }
-
- /**
- * Returns the number of Method objects of this Bean.
- * @return int The number of Method objects of this Bean.
- */
- public int getNumberOfMethodElements ()
- {
- return getNumberOfElements(REL_METHODS);
- }
-
- public String getTypeName()
- {
- if(isStateLess()) return STATELESS_BEAN + getName();
- return getName();
- }
-
- public boolean isStateLess()
- {
- Enumeration ea = getElements(TypeElement.REL_ATTRIBUTES);
- Enumeration ef = getElements(TypeElement.REL_FIELDS);
- if(ea.hasMoreElements() || ef.hasMoreElements()) return false;
- else return true;
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BeanModelElementsFactory.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BeanModelElementsFactory.java
deleted file mode 100644
index 56071a9..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BeanModelElementsFactory.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import org.eclipse.jem.java.Field;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.JavaParameter;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jst.ws.internal.consumption.sampleapp.common.SamplePropertyDescriptor;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-
-/**
- * TypeFactory
- * Creation date: (4/10/2001 12:41:48 PM)
- * @author: Gilbert Andrews
- */
-public class BeanModelElementsFactory
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- public static final String RETURN_PARAM_NAME="returnp";
-
- private BeanModelElementsFactory(){}
-
- public static Element getBeanModelElement(Object object)
- {
- return BeanModelElementsFactory.getBeanModelElement(object,null,null);
- }
-
- public static Element getBeanModelElement(Object object,Element parentElement)
- {
- return BeanModelElementsFactory.getBeanModelElement(object,parentElement,null);
- }
-
- /*
- * Take in an object and return an element depending on what
- * type we are dealing with from the javamof
- **/
- public static Element getBeanModelElement(Object object,Element parentElement, Model model)
- {
- Element returnElement = null;
-
- if (object instanceof JavaClass){
- JavaClass javaClass = (JavaClass)object;
- String javaName = javaClass.getJavaName();
- if (!javaClass.isArray()){
- if(parentElement == null && model ==null) returnElement = new BeanElement(javaName);
- else if(parentElement == null && model !=null) returnElement = new BeanElement(javaName,model,false);
- else{
- if(parentElement instanceof ParameterElement){
- ParameterElement tempElement = (ParameterElement)parentElement;
- returnElement = new BeanElement(tempElement,javaName);
- }
- else if(parentElement instanceof AttributeElement){
- AttributeElement tempElement = (AttributeElement)parentElement;
- returnElement = new BeanElement(tempElement,javaName);
- }
- else if(parentElement instanceof FieldElement){
- FieldElement tempElement = (FieldElement)parentElement;
- returnElement = new BeanElement(tempElement,javaName);
- }
- else if(parentElement instanceof MethodElement){
- returnElement = new ParameterElement((MethodElement)parentElement,RETURN_PARAM_NAME,MethodElement.REL_RETURN_PARAMETERS,true);
- }
- }
- }
- else{
- if(parentElement == null && model ==null) returnElement = new ArrayElement(javaName);
- else if(parentElement == null && model !=null) returnElement = new ArrayElement(javaName,model,false);
- else{
- if(parentElement instanceof ParameterElement){
- ParameterElement tempElement = (ParameterElement)parentElement;
- returnElement = new ArrayElement(tempElement,javaName);
- }
- else if(parentElement instanceof AttributeElement){
- AttributeElement tempElement = (AttributeElement)parentElement;
- returnElement = new ArrayElement(tempElement,javaName);
- }
- else if(parentElement instanceof FieldElement){
- FieldElement tempElement = (FieldElement)parentElement;
- returnElement = new ArrayElement(tempElement,javaName);
- }
- else if(parentElement instanceof MethodElement){
- returnElement = new ParameterElement((MethodElement)parentElement,RETURN_PARAM_NAME,MethodElement.REL_RETURN_PARAMETERS,true);
- }
-
- }
- }
-
- }
- else if(object instanceof SamplePropertyDescriptor){
- SamplePropertyDescriptor pd = (SamplePropertyDescriptor)object;
- returnElement = new AttributeElement((BeanElement)parentElement,pd.getName());
- }
- else if(object instanceof Field){
- Field field = (Field)object;
- returnElement = new FieldElement((BeanElement)parentElement,field.getName());
- }
- else if (object instanceof Method){
- Method method = (Method)object;
- returnElement = new MethodElement((BeanElement)parentElement,method.getName(), method.getMethodElementSignature());
- }
- //non beaninfo
- else if (object instanceof String){
- String name = (String)object;
- returnElement = new AttributeElement((BeanElement)parentElement,name);
- }
- else if (object instanceof JavaParameter){
- JavaParameter javaParameter = (JavaParameter)object;
-
-
- if (javaParameter.isReturn())
- returnElement = new ParameterElement((MethodElement)parentElement,RETURN_PARAM_NAME,MethodElement.REL_RETURN_PARAMETERS,true);
- else{
- //a java parameter gives us the qualified name we dont want this
- String name = javaParameter.getQualifiedName();
- String shortName;
- int index = name.lastIndexOf(".");
- if (index != -1){
- index++;
- shortName = name.substring(index);
- }
- else shortName = name;
-
- returnElement = new ParameterElement((MethodElement)parentElement,shortName,MethodElement.REL_PARAMETERS,false);
-
- }
-
- }
- else if (object instanceof JavaHelpers){
- JavaHelpers javaHelper = (JavaHelpers)object;
- String javaName;
- if (javaHelper.isArray()) javaName = TypeFactory.ARRAY_NAME;
- else javaName = javaHelper.getJavaName();
- if (parentElement instanceof ParameterElement){
- returnElement = new SimpleElement((ParameterElement)parentElement,javaName,javaHelper.isPrimitive());
- }
- else if(parentElement instanceof AttributeElement){
- returnElement = new SimpleElement((AttributeElement)parentElement,javaName,javaHelper.isPrimitive());
- }
- else if(parentElement instanceof FieldElement){
- returnElement = new SimpleElement((FieldElement)parentElement,javaName,javaHelper.isPrimitive());
- }
- else if(parentElement instanceof MethodElement){
- returnElement = new ParameterElement((MethodElement)parentElement,RETURN_PARAM_NAME,MethodElement.REL_RETURN_PARAMETERS,true);
- }
- }
- return returnElement;
- }
-
-
-
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BigDecimalType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BigDecimalType.java
deleted file mode 100644
index 24da0c1..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BigDecimalType.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-/**
-* objects of this class represent a type
-*
-*/
-public class BigDecimalType extends SimpleType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public BigDecimalType()
- {
- super(TypeFactory.BIG_DECIMAL_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type .
- */
- public String StringToType(String name)
- {
- return "new java.math.BigDecimal(" + name + ");";
- }
-
- /**
- * The stringConversion function nails out specific conversion methods used among simple types
- * This method is to be implemented by SimpleType subclasses
- * @param String the name of string after the request call
- * @return String the actual conversion string containing the name.
- */
- public String TypeToString(String name)
- {
- return name + ".toString()";
- }
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BigIntegerType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BigIntegerType.java
deleted file mode 100644
index acf6033..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/BigIntegerType.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-/**
-* objects of this class represent a type
-*
-*/
-public class BigIntegerType extends SimpleType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public BigIntegerType()
- {
- super(TypeFactory.BIG_INTEGER_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type .
- */
- public String StringToType(String name)
- {
- return "new java.math.BigInteger(" + name + ");";
- }
-
- /**
- * The stringConversion function nails out specific conversion methods used among simple types
- * This method is to be implemented by SimpleType subclasses
- * @param String the name of string after the request call
- * @return String the actual conversion string containing the name.
- */
- public String TypeToString(String name)
- {
- return name + ".toString()";
- }
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/DataType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/DataType.java
deleted file mode 100644
index 4861a69..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/DataType.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a type
-* This class is used to simplify the codegen process
-* Because codegen may be processed differently depending on the type
-* we can handle how each type wants the code to look for a specific task
-* by creating a datatype and calling generic methods that are
-* to be specialized in subclasses
-*/
-public interface DataType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static String REL_TYPE = "type";
-
- /**
- * This function hands back the code required to go from the
- * string the user entered to the actual type of the element
- * @param String typeName this is the actual name of the type ie int,boolean
- * @param String nodeName The nodeName is just the attributename + Temp.
- * @param String the attributeName
- * @return String convert the string to type .
- */
- public String stringConversion(String typeName, String nodeName, String attributeName);
-
- /**
- * Often times in order to convert a type to string, string to type or just plain provide an input form
- * A temporary variable is used. If we run into a sitution where two of the same types are used in the
- * same method these temporary variables share the same name space. It isnt enough to use a name
- * because of we may have a nested scenario. Therefore any temporary variable that is used in a dataType
- * must use a unique name apeended to the end. This name must be passed in and it is up to the user of
- * DataType to insure it is unique.
- * @return Unique Name
- */
- public void setUniqueName(String name);
-
- /**
- * This is the name each temp variable will use
- *
- *
- */
- public String getUniqueName();
-
- /**
- * This function dictates how you want to process the
- * incoming string from the input jsp. You may or may not use the markup
- * function depending on the type. The simple types use it. DomElement does not
- * @param String the name of the attribute
- * @return String the code to be generated
- */
- public String getRequestCode(String name, String id);
-
-
- /**
- * Input form returns the user input html
- * @param String name The name of the input element
- * @return String The form used to collect the data
- */
- public String inputForm(String name);
-
- /**
- * converts the type returned from the proxy
- * back to a string
- * @return String convert the type to string.
- */
- public String TypeConversion(String name);
-
- /**
- * return the type
- * @return String the type(including package).
- */
- public String getType();
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/DateType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/DateType.java
deleted file mode 100644
index 6a83989..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/DateType.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class DateType extends SimpleType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public DateType()
- {
- super(TypeFactory.BIG_DECIMAL_NAME);
- }
-
-
- /**
- * inputForm returns the user input html
- * The simple form is just a text input box
- * This has been specialized to show an example
- * @param String name The name of the input element
- * @return String The form used to collect the data
- */
- public String inputForm(String name)
- {
- String inputForm = "<TD ALIGN=\"left\"><INPUT TYPE=\"TEXT\" NAME=\""
- + name + "\" SIZE=20></TD>" + StringUtils.NEWLINE
- + "<%" + StringUtils.NEWLINE
- + "java.text.DateFormat dateFormat" + getUniqueName()+ " = java.text.DateFormat.getDateInstance();" + StringUtils.NEWLINE
- + "java.util.GregorianCalendar gcExamp" + getUniqueName()+ " = new java.util.GregorianCalendar();" + StringUtils.NEWLINE
- + "java.util.Date date" + getUniqueName()+ " = gcExamp" + getUniqueName()+ ".getTime();" + StringUtils.NEWLINE
- + "String tempResult" + getUniqueName()+ " = dateFormat" + getUniqueName()+ ".format(date" + getUniqueName()+ ");" + StringUtils.NEWLINE
- + "%>" + StringUtils.NEWLINE
- + "<TD ALIGN=\"left\">" + StringUtils.NEWLINE
- + "</TR>" + StringUtils.NEWLINE
- + "<TR>" + StringUtils.NEWLINE
- + "<TD> </TD>" + StringUtils.NEWLINE
- + "<TD ALIGN=\"left\"> eg. <%= tempResult" + getUniqueName()+ " %> </TD>" + StringUtils.NEWLINE
- + "</TR>" + StringUtils.NEWLINE;
-
-
-
- return inputForm;
- }
-
-
- /*
- * This function needs to be specialized
- * We must use the date function to help
- * us convert back and forth
- */
- public String stringConversion(String typeName, String nodeName, String attributeName)
- {
- String conversion = Generator.DOUBLE_TAB + "java.text.DateFormat dateFormat" + getUniqueName()+ " = java.text.DateFormat.getDateInstance();"
- + StringUtils.NEWLINE + Generator.DOUBLE_TAB + "java.util.Date " + nodeName + "= dateFormat" + getUniqueName()+ ".parse(" + attributeName + ");"
- + "" + StringUtils.NEWLINE;
- return conversion;
- }
-
- /**
- * this is needed for most case
- * but it is peripheral as the stringconversion needed
- * to be overridden
- */
- public String StringToType(String name)
- {
- return "";
- }
-
-
-
- /**
- * converts the type returned from the proxy
- * back to a string
- * @return String convert the type to string.
- */
- public String TypeConversion(String name)
- {
-
- String conversion = Generator.DOUBLE_TAB + "java.text.DateFormat dateFormat" + getUniqueName()+ " = java.text.DateFormat.getDateInstance();" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "String tempResult" + getUniqueName()+ " = org.eclipse.jst.ws.util.JspUtils.markup(dateFormat" + getUniqueName()+ ".format(" + name +"));" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "%>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%= tempResult" + getUniqueName()+ " %>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%" + StringUtils.NEWLINE;
-
- return conversion;
- }
-
-
-
- /**
- * The stringConversion function nails out specific conversion methods used among simple types
- * This method is to be implemented by SimpleType subclasses
- * @param String the name of string after the request call
- * @return String the actual conversion string containing the name.
- */
- public String TypeToString(String name)
- {
- return "";
- }
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/DomElementType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/DomElementType.java
deleted file mode 100644
index c0406ac..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/DomElementType.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class DomElementType implements DataType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- protected String fType;
- protected String fUniqueName;
-
- /**
- *Constructor
- *
- */
- public DomElementType()
- {
- fType = "org.w3c.dom.Element";
- fUniqueName = "";
- }
-
- /**
- * inputForm returns the user input html
- * The DomElement form is a text box
- * @param String name The name of the input element
- * @return String The form used to collect the data
- */
- public String inputForm(String name)
- {
- String inputForm = "<TD ALIGN=\"left\"><TEXTAREA Rows=7 Cols=45 NAME=\""
- + name + "\"></TEXTAREA></TD>" + StringUtils.NEWLINE
- + "</TR>" + StringUtils.NEWLINE;
- return inputForm;
- }
-
- /**
- * This function dictates how you want to process the
- * incoming string from the input jsp. You may or may not use the markup
- * function depending on the type. The simple types use it. DomElement does not
- * @param String the name of the attribute
- * @return String the code to be generated
- */
- public String getRequestCode(String name, String id)
- {
- String requestCode = Generator.DOUBLE_TAB + "String" + Generator.SPACE
- + id + "= request.getParameter(\""
- + name +"\");" + StringUtils.NEWLINE;
- return requestCode;
- }
-
- /**
- * This function hands back the code required to go from the
- * string the user entered to the actual type of the element
- * @param String typeName this is the actual name of the type ie int,boolean
- * @param String nodeName The nodeName is just the attributename + Temp.
- * @param String the attributeName
- * @return String convert the string to type .
- */
- public String stringConversion(String typeName, String nodeName, String attributeName)
- {
- String conversion = Generator.DOUBLE_TAB
- + "org.w3c.dom.Element " + nodeName + "= org.eclipse.jst.ws.util.DomElementHelper.createDomElementFromXMLString(" + attributeName + ");"
- + StringUtils.NEWLINE;
- return conversion;
- }
-
- /**
- * This is basically the function that dictates how we want to display this type
- * upon receiving it as a return from a proxy method
- * @param String the name of the type
- * @return String The display string
- */
- public String TypeConversion(String name)
- {
- String typeToString = Generator.DOUBLE_TAB + "String tempResult" + getUniqueName()+ " = org.eclipse.jst.ws.util.DomElementHelper.domWriter(" + name + ", new java.lang.StringBuffer()" + ");" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "%>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%= tempResult" + getUniqueName()+ " %>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%" + StringUtils.NEWLINE;
-
- return typeToString;
- }
-
- /**
- * return the name of this type
- * @return String the name(including package).
- */
- public String getType()
- {
- return fType;
- }
-
- public String getUniqueName()
- {
- return fUniqueName;
- }
-
- public void setUniqueName(String name)
- {
- fUniqueName = name;
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/FieldElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/FieldElement.java
deleted file mode 100644
index 5cde333..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/FieldElement.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-/**
-* Objects of this class represent a Java bean method parameter.
-* Nearest moral equivalents: java.beans.ParameterDescriptor.
-*/
-public class FieldElement extends BasicElement implements AttributeElementType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private String fSetterMethod;
- private String fGetterMethod;
-
-
- public static final String REL_TYPE = "type";
- public static final String REL_OWNING_BEAN = "owningbean";
-
- /**
- * Constructor this takes the owning bean.
- * @param name The name of the attribute.
- * @param beanElement the bean that owns this attribute.
- */
- public FieldElement ( BeanElement beanElement, String name)
- {
- super(name,beanElement,REL_OWNING_BEAN,BeanElement.REL_FIELDS);
- fSetterMethod = name;
- fGetterMethod = name;
- }
-
- public void setSetterMethod(String setterMethod)
- {
- fSetterMethod = setterMethod;
- }
-
- public String getSetterMethod()
- {
- return fSetterMethod;
- }
-
- public String getGetterMethod()
- {
- return fGetterMethod;
- }
-
- public void setGetterMethod(String getterMethod)
- {
- fGetterMethod = getterMethod;
- }
-
- public String getSetterSignature(String attribute)
- {
- return fSetterMethod + " = " + attribute + ";";
- }
-
- /**
- * Returns the Bean that owns this Attribute.
- * @return BeanElement The bean that owns this attribute.
- */
- public BeanElement getOwningBeanElement ()
- {
- Enumeration e = getElements(REL_OWNING_BEAN);
- return e.hasMoreElements() ? (BeanElement)e.nextElement() : null;
- }
-
- /**
- * Returns the type that is owned by this attributte.
- * @return TypeElement The Type that of this attribute.
- */
- public TypeElement getTypeElement ()
- {
- Enumeration e = getElements(REL_TYPE);
- return e.hasMoreElements() ? (TypeElement)e.nextElement() : null;
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/GregorianCalendarType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/GregorianCalendarType.java
deleted file mode 100644
index d7cfbf9..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/GregorianCalendarType.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-
-/**
-* objects of this class represent a type
-*
-*/
-public class GregorianCalendarType extends SimpleType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public GregorianCalendarType()
- {
- super(TypeFactory.GREGORIAN_CALENDAR_NAME);
- }
-
-
- /**
- * inputForm returns the user input html
- * The simple form is just a text input box
- * This has been specialized to show an example
- * @param String name The name of the input element
- * @return String The form used to collect the data
- */
- public String inputForm(String name)
- {
- String inputForm = "<TD ALIGN=\"left\"><INPUT TYPE=\"TEXT\" NAME=\""
- + name + "\" SIZE=20></TD>" + StringUtils.NEWLINE
- + "<%" + StringUtils.NEWLINE
- + "java.text.DateFormat dateFormat" + getUniqueName()+ " = java.text.DateFormat.getDateInstance();" + StringUtils.NEWLINE
- + "java.util.GregorianCalendar gcExamp" + getUniqueName()+ " = new java.util.GregorianCalendar();" + StringUtils.NEWLINE
- + "java.util.Date date" + getUniqueName()+ " = gcExamp" + getUniqueName()+ ".getTime();" + StringUtils.NEWLINE
- + "String tempResult" + getUniqueName()+ " = dateFormat" + getUniqueName()+ ".format(date" + getUniqueName()+ ");" + StringUtils.NEWLINE
- + "%>" + StringUtils.NEWLINE
-
-
- + "<TD ALIGN=\"left\">" + StringUtils.NEWLINE
- + "</TR>" + StringUtils.NEWLINE
- + "<TR>" + StringUtils.NEWLINE
- + "<TD> </TD>" + StringUtils.NEWLINE
- + "<TD ALIGN=\"left\"> eg. <%= tempResult" + getUniqueName()+ " %> </TD>" + StringUtils.NEWLINE
- + "</TR>" + StringUtils.NEWLINE;
-
-
-
- return inputForm;
- }
-
-
- /*
- * This function needs to be specialized
- * We must use the date function to help
- * us convert back and forth
- */
- public String stringConversion(String typeName, String nodeName, String attributeName)
- {
- String conversion = Generator.DOUBLE_TAB + "java.text.DateFormat dateFormat" + getUniqueName()+ " = java.text.DateFormat.getDateInstance();"
- + StringUtils.NEWLINE + Generator.DOUBLE_TAB + "java.util.Date dateTemp" + getUniqueName()+ " = dateFormat" + getUniqueName()+ ".parse(" + attributeName + ");"
- + StringUtils.NEWLINE + Generator.DOUBLE_TAB + "java.util.GregorianCalendar" + Generator.SPACE + nodeName + " = " + "new java.util.GregorianCalendar();"
- + StringUtils.NEWLINE + Generator.DOUBLE_TAB + nodeName + ".setTime(dateTemp" + getUniqueName()+ ");"
- + "" + StringUtils.NEWLINE;
- return conversion;
- }
-
- /**
- * this is needed for most case
- * but it is peripheral as the stringconversion needed
- * to be overridden
- */
- public String StringToType(String name)
- {
- return "";
- }
-
- /**
- * converts the type returned from the proxy
- * back to a string
- * @return String convert the type to string.
- */
- public String TypeConversion(String name)
- {
-
- String conversion = Generator.DOUBLE_TAB + "java.text.DateFormat dateFormat" + getUniqueName()+ " = java.text.DateFormat.getDateInstance();" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "java.util.Date date" + getUniqueName()+ " = " + name + ".getTime();" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "String tempResult" + getUniqueName()+ " = org.eclipse.jst.ws.util.JspUtils.markup(dateFormat" + getUniqueName()+ ".format(date" + getUniqueName() + "));" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "%>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%= tempResult" + getUniqueName()+ " %>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%" + StringUtils.NEWLINE;
-
- return conversion;
- }
-
-
-
- /**
- * The stringConversion function nails out specific conversion methods used among simple types
- * This method is to be implemented by SimpleType subclasses
- * @param String the name of string after the request call
- * @return String the actual conversion string containing the name.
- */
- public String TypeToString(String name)
- {
- return "";
- }
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/HashtableType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/HashtableType.java
deleted file mode 100644
index a1ff2cf..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/HashtableType.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a recognized return type
-*
-*/
-public class HashtableType extends RecognizedReturnType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public HashtableType()
- {
- super(TypeFactory.HASHTABLE_NAME);
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/MapType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/MapType.java
deleted file mode 100644
index 0035bfb..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/MapType.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a recognized return type
-*
-*/
-public class MapType extends RecognizedReturnType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public MapType()
- {
- super(TypeFactory.MAP_NAME);
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/MethodElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/MethodElement.java
deleted file mode 100644
index e1f897a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/MethodElement.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-/**
-* Objects of this class represent a Java bean method.
-* Nearest moral equivalents: java.lang.reflect.Method, java.beans.MethodDescriptor.
-*/
-public class MethodElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static final String REL_BEAN = "bean";
- public static final String REL_PARAMETERS = "parameters";
- public static final String REL_RETURN_PARAMETERS = "returnparameters";
- private String fDisplayName;
- private String fName;
- private boolean fMethodOmitted;
-
- /**
- * Constructor.
- * @param bean The Bean that owns this method.
- * @param name The name of the method.
- * @param type The type of the method.
- */
- public MethodElement ( BeanElement beanElement, String name, String displayName)
- {
- super(name,beanElement,REL_BEAN,BeanElement.REL_METHODS);
- fDisplayName = displayName;
- fName = name;
- fMethodOmitted = false;
-
- }
-
- /*
- * In the event that there is an unsupported type
- * we will set the ommission boolean variable
- * @return boolean true if this method is to be ommited
- */
- public boolean getMethodOmmission()
- {
- return fMethodOmitted;
- }
-
- /*
- * In the event that there is an unsupported type
- * we will get the ommission boolean variable
- * @param boolean true if this method is to be ommited
- */
- public void setMethodOmmission(boolean bool)
- {
- fMethodOmitted = bool;
- }
-
-
- public String getName()
- {
- return fName;
- }
-
- public String getDisplayName()
- {
- return fDisplayName;
- }
-
- /**
- * Returns the Bean that owns this method.
- * @return Bean The Bean that owns this method.
- */
- public BeanElement getBeanElement ()
- {
- Enumeration e = getElements(REL_BEAN);
- return e.hasMoreElements() ? (BeanElement)e.nextElement() : null;
- }
-
- /**
- * Returns an enumeration of the return parameter of this method.
- * @return Enumeration holds the return parameter of this method.
- */
- public Enumeration getReturnParameterEnum ()
- {
- return getElements(REL_RETURN_PARAMETERS);
- }
-
- /**
- * Returns an enumeration of the return parameter of this method.
- * @return Enumeration holds the return parameter of this method.
- */
- public ParameterElement getReturnParameterElement ()
- {
- Enumeration e = getReturnParameterEnum();
- return e.hasMoreElements() ? (ParameterElement)e.nextElement() : null;
- }
-
- /**
- * Returns an enumeration of all Parameter objects of this method.
- * @return Enumeration All Parameter objects of this method.
- */
- public Enumeration getParameterElements ()
- {
- return getElements(REL_PARAMETERS);
- }
-
- /**
- * Returns the number of Parameter objects of this method.
- * @return int The number of Parameter objects of this method.
- */
- public int getNumberOfParameterElements ()
- {
- return getNumberOfElements(REL_PARAMETERS);
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/ParameterElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/ParameterElement.java
deleted file mode 100644
index 8dccea3..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/ParameterElement.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-/**
-* Objects of this class represent a Java bean method parameter.
-* Nearest moral equivalents: java.beans.ParameterDescriptor.
-*/
-public class ParameterElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static final String REL_METHOD = "method";
- public static final String REL_TYPE = "type";
-
- public boolean fReturnParameter=false;
-
- /**
- * Constructor.
- * @param method The Method that owns this parameter.
- * @param name The name of the parameter.
- * @param type The type of the parameter.
- */
- public ParameterElement ( MethodElement methodElement, String name, String relType,boolean returnParameter )
- {
- this(name,methodElement,REL_METHOD,relType);
- fReturnParameter = returnParameter;
- }
-
- /**
- * Constructor.
- * @param method The Method that owns this parameter.
- * @param name The name of the parameter.
- * @param type The type of the parameter.
- */
- public ParameterElement (String name, MethodElement methodElement, String outRel,String inRel)
- {
- super(name,methodElement,outRel,inRel);
- }
-
- /**
- * Returns the Method that owns this parameter.
- * @return Method The Method that owns this parameter.
- */
- public MethodElement getMethodElement ()
- {
- Enumeration e = getElements(REL_METHOD);
- return e.hasMoreElements() ? (MethodElement)e.nextElement() : null;
- }
-
- /**
- * Returns the Method that owns this parameter.
- * @return Method The Method that owns this parameter.
- */
- public TypeElement getTypeElement ()
- {
- Enumeration e = getElements(REL_TYPE);
- return e.hasMoreElements() ? (TypeElement)e.nextElement() : null;
- }
-
- public boolean isReturn()
- {
- return fReturnParameter;
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveArrayType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveArrayType.java
deleted file mode 100644
index 3873061..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveArrayType.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-
-
-/**
-* objects of this class represent a recognized return type
-*
-*/
-public class PrimitiveArrayType extends ArrayType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public PrimitiveArrayType(String typeName)
- {
- super(TypeFactory.PRIMITIVE_ARRAY_NAME, typeName);
- }
-
- /**
- * This is basically the function that dictates how we want to display this type
- * upon receiving it as a return from a proxy method
- * @param String the name of the type
- * @return String The display string
- */
- public String TypeConversion(String name)
- {
- String trippleTab = Generator.DOUBLE_TAB + Generator.TAB;
-
- String nonBean = Generator.DOUBLE_TAB + "String temp" + getUniqueName() + " = \"[\";"
- + Generator.DOUBLE_TAB + "for(int i" + getUniqueName() + "=0;i" +getUniqueName() + "< " + name
- + ".length;i" + getUniqueName() + "++){" + StringUtils.NEWLINE
- + trippleTab + "temp"+ getUniqueName() +" = temp"+getUniqueName() + " + " + name + "[i" + getUniqueName()
- + "] + \",\";" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "}" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "int length" + getUniqueName() + " = temp" + getUniqueName() + ".length();"
- + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "temp" + getUniqueName() + " = temp"+getUniqueName()+".substring(0,(length"+getUniqueName()+" - 1)) + \"]\";"
- + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "%>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%=temp"+ getUniqueName() +"%>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%"+ StringUtils.NEWLINE;
-
- return nonBean;
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveBooleanType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveBooleanType.java
deleted file mode 100644
index f58ad9d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveBooleanType.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class PrimitiveBooleanType extends PrimitiveType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public PrimitiveBooleanType()
- {
- super(TypeFactory.PRIM_BOOLEAN_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type.
- */
- public String StringToType(String name)
- {
- String conversion = "Boolean.valueOf(" + name + ").booleanValue();";
- return conversion;
- }
-
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveByteType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveByteType.java
deleted file mode 100644
index 5045d26..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveByteType.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class PrimitiveByteType extends PrimitiveType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public PrimitiveByteType()
- {
- super(TypeFactory.PRIM_BYTE_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type.
- */
- public String StringToType(String name)
- {
- String conversion = "Byte.parseByte(" + name + ");";
- return conversion;
- }
-
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveCharType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveCharType.java
deleted file mode 100644
index d52f903..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveCharType.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class PrimitiveCharType extends PrimitiveType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public PrimitiveCharType()
- {
- super(TypeFactory.PRIM_CHAR_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type.
- */
- public String StringToType(String name)
- {
- String conversion = "" + name + ".charAt(0);";
- return conversion;
- }
-
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveDoubleType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveDoubleType.java
deleted file mode 100644
index 7b362e7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveDoubleType.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class PrimitiveDoubleType extends PrimitiveType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public PrimitiveDoubleType()
- {
- super(TypeFactory.PRIM_DOUBLE_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type.
- */
- public String StringToType(String name)
- {
- String conversion = "Double.parseDouble(" + name + ");";
- return conversion;
- }
-
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveFloatType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveFloatType.java
deleted file mode 100644
index 200f9d7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveFloatType.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class PrimitiveFloatType extends PrimitiveType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public PrimitiveFloatType()
- {
- super(TypeFactory.PRIM_FLOAT_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type.
- */
- public String StringToType(String name)
- {
- String conversion = "Float.parseFloat(" + name + ");";
- return conversion;
- }
-
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveIntType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveIntType.java
deleted file mode 100644
index 2f33dd9..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveIntType.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class PrimitiveIntType extends PrimitiveType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public PrimitiveIntType()
- {
- super(TypeFactory.PRIM_INTEGER_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type.
- */
- public String StringToType(String name)
- {
- String conversion = "Integer.parseInt(" + name + ");";
- return conversion;
- }
-
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveJavaTypes.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveJavaTypes.java
deleted file mode 100644
index f715236..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveJavaTypes.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-/**
-* objects of this class represent a type
-*
-*/
-public class PrimitiveJavaTypes extends SimpleType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public PrimitiveJavaTypes(String type)
- {
- super(type);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type .
- */
- public String StringToType(String name)
- {
- String conversion = fType + ".valueOf(" + name + ");";
- return conversion;
- }
-
- /**
- * The stringConversion function nails out specific conversion methods used among simple types
- * This method is to be implemented by SimpleType subclasses
- * @param String the name of string after the request call
- * @return String the actual conversion string containing the name.
- */
- public String TypeToString(String name)
- {
- return "String.valueOf(" + name + ")";
- }
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveLongType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveLongType.java
deleted file mode 100644
index ef0c826..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveLongType.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class PrimitiveLongType extends PrimitiveType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public PrimitiveLongType()
- {
- super(TypeFactory.PRIM_LONG_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type.
- */
- public String StringToType(String name)
- {
- String conversion = "Long.parseLong(" + name + ");";
- return conversion;
- }
-
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveShortType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveShortType.java
deleted file mode 100644
index 8f91ce6..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveShortType.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class PrimitiveShortType extends PrimitiveType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public PrimitiveShortType()
- {
- super(TypeFactory.PRIM_SHORT_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type.
- */
- public String StringToType(String name)
- {
- String conversion = "Short.parseShort(" + name + ");";
- return conversion;
- }
-
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveType.java
deleted file mode 100644
index 4b51767..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/PrimitiveType.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-/**
-* objects of this class represent a type
-*
-*/
-public abstract class PrimitiveType extends SimpleType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public PrimitiveType(String type)
- {
- super(type);
- }
-
- /**
- * The stringConversion function nails out specific conversion methods used among simple types
- * This method is to be implemented by SimpleType subclasses
- * @param String the name of string after the request call
- * @return String the actual conversion string containing the name.
- */
- public String TypeToString(String name)
- {
- return "String.valueOf(" + name + ")";
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/RecognizedReturnType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/RecognizedReturnType.java
deleted file mode 100644
index fc721a8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/RecognizedReturnType.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-
-
-/**
-* objects of this class represent a recognized return type
-*
-*/
-public class RecognizedReturnType implements DataType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- protected String fType;
- protected String fUniqueName;
-
- /**
- *Constructor
- *
- */
- public RecognizedReturnType(String type)
- {
- fType = type;
- fUniqueName = "";
- }
-
- /**
- * not relevant at this point
- */
- public String inputForm(String name)
- {
- return "";
- }
-
- /**
- * again not relevant
- */
- public String getRequestCode(String name, String id)
- {
- return "";
- }
-
- /**
- * This function hands back the code required to go from the
- * string the user entered to the actual type of the element
- * @param String typeName this is the actual name of the type ie int,boolean
- * @param String nodeName The nodeName is just the attributename + Temp.
- * @param String the attributeName
- * @return String convert the string to type .
- */
- public String stringConversion(String typeName, String nodeName, String attributeName)
- {
- return "";
- }
-
- /**
- * This is basically the function that dictates how we want to display this type
- * upon receiving it as a return from a proxy method
- * @param String the name of the type
- * @return String The display string
- */
- public String TypeConversion(String name)
- {
- String nonBean = Generator.DOUBLE_TAB + "if(" + name + "!= null){" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "String temp" + getUniqueName()+" = " + name + ".toString();" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "%>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%=temp" + getUniqueName() +"%>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "}";
- return nonBean;
- }
-
- /**
- * return the name of this type
- * @return String the name(including package).
- */
- public String getType()
- {
- return fType;
- }
-
- public String getUniqueName()
- {
- return fUniqueName;
- }
-
- public void setUniqueName(String name)
- {
- fUniqueName = name;
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/SOAPElementType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/SOAPElementType.java
deleted file mode 100644
index 289e009..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/SOAPElementType.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class SOAPElementType implements DataType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- protected String fType;
- protected String fUniqueName;
-
- /**
- *Constructor
- *
- */
- public SOAPElementType()
- {
- fType = "javax.xml.soap.SOAPElement";
- fUniqueName = "";
- }
-
- /**
- * inputForm returns the user input html
- * The DomElement form is a text box
- * @param String name The name of the input element
- * @return String The form used to collect the data
- */
- public String inputForm(String name)
- {
- String inputForm = "<TD ALIGN=\"left\"><TEXTAREA Rows=7 Cols=45 NAME=\""
- + name + "\"></TEXTAREA></TD>" + StringUtils.NEWLINE
- + "</TR>" + StringUtils.NEWLINE;
- return inputForm;
- }
-
- /**
- * This function dictates how you want to process the
- * incoming string from the input jsp. You may or may not use the markup
- * function depending on the type. The simple types use it. DomElement does not
- * @param String the name of the attribute
- * @return String the code to be generated
- */
- public String getRequestCode(String name, String id)
- {
- String requestCode = Generator.DOUBLE_TAB + "String" + Generator.SPACE
- + id + "= request.getParameter(\""
- + name +"\");" + StringUtils.NEWLINE;
- return requestCode;
- }
-
- /**
- * This function hands back the code required to go from the
- * string the user entered to the actual type of the element
- * @param String typeName this is the actual name of the type ie int,boolean
- * @param String nodeName The nodeName is just the attributename + Temp.
- * @param String the attributeName
- * @return String convert the string to type .
- */
- public String stringConversion(String typeName, String nodeName, String attributeName)
- {
- String conversion = Generator.DOUBLE_TAB
- + "javax.xml.soap.SOAPElement " + nodeName + "= org.eclipse.jst.ws.util.SoapElementHelper.createSOAPElementFromXMLString(" + attributeName + ");"
- + StringUtils.NEWLINE;
- return conversion;
- }
-
- /**
- * This is basically the function that dictates how we want to display this type
- * upon receiving it as a return from a proxy method
- * @param String the name of the type
- * @return String The display string
- */
- public String TypeConversion(String name)
- {
- String typeToString = Generator.DOUBLE_TAB + "String tempResult" + getUniqueName()+ " = org.eclipse.jst.ws.util.SoapElementHelper.soapElementWriter(" + name + ", new java.lang.StringBuffer()" + ");" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "%>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%= tempResult" + getUniqueName()+ " %>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%" + StringUtils.NEWLINE;
-
- return typeToString;
- }
-
- /**
- * return the name of this type
- * @return String the name(including package).
- */
- public String getType()
- {
- return fType;
- }
-
- public String getUniqueName()
- {
- return fUniqueName;
- }
-
- public void setUniqueName(String name)
- {
- fUniqueName = name;
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/SimpleElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/SimpleElement.java
deleted file mode 100644
index f478345..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/SimpleElement.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* 1 of three type elements represents primitives
-*/
-public class SimpleElement extends TypeElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- * Constructor
- * @param ParameterElement The Parameter that owns this simple type.
- * @param String Name of the simple element.
- */
- public SimpleElement ( ParameterElement parameterElement, String name, boolean prim)
- {
- super(name,parameterElement,TypeElement.REL_OWNER,TypeElement.REL_TYPE,TypeElement.SIMPLE);
- fOwnerType = TypeElement.PARAMETER_OWNER;
- setPrimitive(prim);
- }
-
- /**
- * Constructor
- * @param ParameterElement The Attribute that owns this simple type.
- * @param String Name of the AttributeElement.
- */
- public SimpleElement ( AttributeElement attributeElement, String name, boolean prim)
- {
- super(name,attributeElement,TypeElement.REL_OWNER,TypeElement.REL_TYPE,TypeElement.SIMPLE);
- fOwnerType = TypeElement.ATTRIBUTE_OWNER;
- setPrimitive(prim);
- }
-
- /**
- * Constructor
- * @param ParameterElement The Attribute that owns this simple type.
- * @param String Name of the AttributeElement.
- */
- public SimpleElement ( FieldElement fieldElement, String name, boolean prim)
- {
- super(name,fieldElement,TypeElement.REL_OWNER,TypeElement.REL_TYPE,TypeElement.SIMPLE);
- fOwnerType = TypeElement.FIELD_OWNER;
- setPrimitive(prim);
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/SimpleType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/SimpleType.java
deleted file mode 100644
index e819482..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/SimpleType.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public abstract class SimpleType implements DataType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- protected String fType;
- protected String fUniqueName;
-
- /**
- *Constructor
- *
- */
- public SimpleType(String type)
- {
- fType = type;
- }
-
- /**
- * inputForm returns the user input html
- * The simple form is just a text input box
- * @param String name The name of the input element
- * @return String The form used to collect the data
- */
- public String inputForm(String name)
- {
- String inputForm = "<TD ALIGN=\"left\"><INPUT TYPE=\"TEXT\" NAME=\""
- + name + "\" SIZE=20></TD>" + StringUtils.NEWLINE
- + "</TR>" + StringUtils.NEWLINE;
- return inputForm;
- }
-
- /**
- * This function dictates how you want to process the
- * incoming string from the input jsp. You may or may not use the markup
- * function depending on the type. The simple types use it. DomElement does not
- * @param String the name of the attribute
- * @return String the code to be generated
- */
- public String getRequestCode(String name, String id)
- {
- String requestCode = Generator.DOUBLE_TAB + "String" + Generator.SPACE
- + id + "= request.getParameter(\""
- + name +"\");" + StringUtils.NEWLINE;
- return requestCode;
- }
-
- /**
- * This function hands back the code required to go from the
- * string the user entered to the actual type of the element
- * it uses another function that all subclasses of SimpleType are required to implement
- * The StringToType function
- * @param String typeName this is the actual name of the type ie int,boolean
- * @param String nodeName The nodeName is just the attributename + Temp.
- * @param String the attributeName
- * @return String convert the string to type .
- */
- public String stringConversion(String typeName, String nodeName, String attributeName)
- {
- String conversion = Generator.DOUBLE_TAB + typeName + Generator.SPACE + nodeName
- + Generator.SPACE + " = " + StringToType(attributeName)
- + "" + StringUtils.NEWLINE;
- return conversion;
- }
-
- /**
- * The stringConversion function nails out specific conversion methods used among simple types
- * This method is to be implemented by SimpleType subclasses
- * @param String the name of string after the request call
- * @return String the actual conversion string containing the name.
- */
- public abstract String StringToType(String name);
-
- /**
- * converts the type returned from the proxy
- * back to a string
- * @return String convert the type to string.
- */
- public String TypeConversion(String name)
- {
-
- String conversion = Generator.DOUBLE_TAB + "String tempResult" + getUniqueName()+ " = org.eclipse.jst.ws.util.JspUtils.markup(" + TypeToString(name) + ");" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "%>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%= tempResult" + getUniqueName()+ " %>" + StringUtils.NEWLINE
- + Generator.DOUBLE_TAB + "<%" + StringUtils.NEWLINE;
-
- return conversion;
- }
-
- /**
- * The stringConversion function nails out specific conversion methods used among simple types
- * This method is to be implemented by SimpleType subclasses
- * @param String the name of string after the request call
- * @return String the actual conversion string containing the name.
- */
- public abstract String TypeToString(String name);
-
- /**
- * return the name of this type
- * @return String the name(including package).
- */
- public String getType()
- {
- return fType;
- }
-
- public String getUniqueName()
- {
- return fUniqueName;
- }
-
- public void setUniqueName(String name)
- {
- fUniqueName = name;
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/StateLessBeanType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/StateLessBeanType.java
deleted file mode 100644
index 16a98a8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/StateLessBeanType.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a recognized return type
-*
-*/
-public class StateLessBeanType extends RecognizedReturnType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
-
- private String fTypeName;
-
-
-
- /**
- *Constructor
- *
- */
-
- public StateLessBeanType(String name)
- {
- super(TypeFactory.STATELESS_BEAN);
- fTypeName = name;
-
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/StringType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/StringType.java
deleted file mode 100644
index 1b99c74..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/StringType.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-/**
-* objects of this class represent a type
-*
-*/
-public class StringType extends SimpleType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public StringType()
- {
- super(TypeFactory.STRING_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type .
- */
- public String StringToType(String name)
- {
- String conversion = name + ";";
- return conversion;
- }
-
- /**
- * The stringConversion function nails out specific conversion methods used among simple types
- * This method is to be implemented by SimpleType subclasses
- * @param String the name of string after the request call
- * @return String the actual conversion string containing the name.
- */
- public String TypeToString(String name)
- {
- return "String.valueOf(" + name + ")";
- }
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/TypeElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/TypeElement.java
deleted file mode 100644
index 48743e8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/TypeElement.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-
-/**
-* TypeElement is the base class for Java bean features that have types.
-*/
-public abstract class TypeElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static int BEAN = 0;
- public static int SIMPLE = 1;
- public static int ARRAY = 2;
-
- private int fType;
- protected int fOwnerType;
- private boolean fPrimitive = false;
-
- /**
- * Constructor. Automatically adds this object to the given model.
- * @param name The name of the element
- * @param model The model to own this object.
- * @param type The type represented by this object, one of
- * <code>BEAN</code>, <code>SIMPLE</code> or <code>ARRAY</code>.
- */
- protected TypeElement ( String name, Model model, int type )
- {
- super(name,model);
- fType = type;
- }
-
- /**
- */
- protected TypeElement ( String name, Element element, String outboundRelName, String inboundRelName, int type )
- {
- super(name,element,outboundRelName,inboundRelName);
- fType = type;
- }
-
- /*
- *This will tell you wether the type is a bean
- *@param Boolean returns true if this is bean
- **/
- public boolean isBean()
- {
- if (fType == BEAN) return true;
- return false;
- }
-
- /*
- *This will tell you wether the type is a bean
- *@param Boolean returns true if this is bean
- **/
- public boolean isPrimitive()
- {
- return fPrimitive;
- }
-
- /*
- *This will tell you wether the type is a bean
- *@param Boolean returns true if this is bean
- **/
- protected void setPrimitive(boolean prim)
- {
- fPrimitive = prim;
- }
-
-
- /*
- * This is mainly needed for arrays as with all types the
- * names come out as java.util.type, but with an array it
- * isnt explicit in telling us its an array
- */
- public String getTypeName()
- {
- return getName();
- }
-
- /*
- *This will tell you wether the type is a simple
- *@param Boolean returns true if this is simple
- **/
- public boolean isSimple()
- {
- if (fType == SIMPLE) return true;
- return false;
- }
-
- /*
- *This will tell you wether the type is a array
- *@param Boolean returns true if this is array
- **/
- public boolean isArray()
- {
- if (fType == ARRAY) return true;
- return false;
- }
-
- public static String REL_ATTRIBUTES = "attributes";
- public static String REL_FIELDS = "fields";
- public static final String REL_TYPE = "type";
- public static final String REL_OWNER = "owner";
-
- public static int PARAMETER_OWNER = 0;
- public static int ATTRIBUTE_OWNER = 1;
- public static int FIELD_OWNER = 2;
- public static int ROOT = 3;
-
- /*
- * This could be The root test bean
- * @return boolean true if this is root bean
- */
- public boolean isRoot()
- {
- if(fOwnerType == ROOT) return true;
- return false;
- }
-
- /*
- * This Type could be owned by a Parameter or an attribute
- * @return boolean true if this is owned by a parameter
- */
- public boolean isOwnerParameter()
- {
- if(fOwnerType == PARAMETER_OWNER) return true;
- return false;
- }
-
- /*
- * This Type could be owned by a Parameter or an attribute
- * @return boolean true if this is owned by an attribute
- */
- public boolean isOwnerAttribute()
- {
- if(fOwnerType == ATTRIBUTE_OWNER) return true;
- return false;
- }
-
- /*
- * This Type could be owned by a Parameter or an attribute
- * @return boolean true if this is owned by an attribute
- */
- public boolean isOwnerField()
- {
- if(fOwnerType == FIELD_OWNER) return true;
- return false;
- }
-
- /**
- * This Type may be owned by a parameter or an attribute
- * Use this method in conjunction with isOwnerParamter, isOwner
- * @return BasicElement the element that owns this attribute.
- */
- public BasicElement getOwningElement ()
- {
- if (isOwnerParameter()){
- Enumeration e = getElements(REL_OWNER);
- return e.hasMoreElements() ? (BasicElement)e.nextElement() : null;
- }
- else if(isOwnerAttribute()){
- Enumeration e = getElements(REL_OWNER);
- return e.hasMoreElements() ? (BasicElement)e.nextElement() : null;
- }
- else if(isOwnerField()){
- Enumeration e = getElements(REL_OWNER);
- return e.hasMoreElements() ? (BasicElement)e.nextElement() : null;
- }
-
- return null;
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/TypeFactory.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/TypeFactory.java
deleted file mode 100644
index 4f9822a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/TypeFactory.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-import java.util.Hashtable;
-
-import org.eclipse.jem.java.JavaHelpers;
-/**
- * TypeFactory
- * Creation date: (4/10/2001 12:41:48 PM)
- * @author: Gilbert Andrews
- */
-public class TypeFactory
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static final String URL_NAME = "java.net.URL";
- public static final String STRING_NAME = "java.lang.String";
- public static final String BIG_DECIMAL_NAME = "java.math.BigDecimal";
- public static final String BIG_INTEGER_NAME = "java.math.BigInteger";
- public static final String DATE_NAME = "java.util.Date";
- public static final String GREGORIAN_CALENDAR_NAME = "java.util.GregorianCalendar";
- public static final String CALENDAR_NAME = "java.util.Calendar";
- public static final String BOOLEAN_NAME = "java.lang.Boolean";
- public static final String BYTE_NAME = "java.lang.Byte";
- public static final String DOUBLE_NAME = "java.lang.Double";
- public static final String FLOAT_NAME = "java.lang.Float";
- public static final String INTEGER_NAME = "java.lang.Integer";
- public static final String LONG_NAME = "java.lang.Long";
- public static final String SHORT_NAME = "java.lang.Short";
- public static final String CHARACTER_NAME = "java.lang.Character";
- public static final String PRIM_BOOLEAN_NAME = "boolean";
- public static final String PRIM_BYTE_NAME = "byte";
- public static final String PRIM_DOUBLE_NAME = "double";
- public static final String PRIM_FLOAT_NAME = "float";
- public static final String PRIM_INTEGER_NAME = "int";
- public static final String PRIM_LONG_NAME = "long";
- public static final String PRIM_SHORT_NAME = "short";
- public static final String PRIM_CHAR_NAME = "char";
- public static final String VOID_NAME = "void";
-
- //some special complex
- public static final String DOM_ELEMENT_NAME = "org.w3c.dom.Element";
- public static final String SOAP_ELEMENT_NAME = "javax.xml.soap.SOAPElement";
- public static final String STATELESS_BEAN = BeanElement.STATELESS_BEAN;
-
-
-
- public static Hashtable javaTypes = new Hashtable();
-
- public TypeFactory(){}
-
- static{
- javaTypes.put(BOOLEAN_NAME,new PrimitiveJavaTypes(BOOLEAN_NAME));
- javaTypes.put(BYTE_NAME, new PrimitiveJavaTypes(BYTE_NAME));
- javaTypes.put(DOUBLE_NAME, new PrimitiveJavaTypes(DOUBLE_NAME));
- javaTypes.put(FLOAT_NAME, new PrimitiveJavaTypes(FLOAT_NAME));
- javaTypes.put(INTEGER_NAME,new PrimitiveJavaTypes(INTEGER_NAME));
- javaTypes.put(LONG_NAME, new PrimitiveJavaTypes(LONG_NAME));
- javaTypes.put(SHORT_NAME, new PrimitiveJavaTypes(SHORT_NAME));
- javaTypes.put(CHARACTER_NAME, new PrimitiveJavaTypes(CHARACTER_NAME));
- }
-
-
- /*
- * This function allows us to handle recognized beans
- * in displaying and generating code for them instead of
- * treating them as complex types
- */
- public static boolean recognizedBean(String type)
- {
-
- //
- //current recognized beans (mostly java.lang)
- if (type.equals(BOOLEAN_NAME) ||
- type.equals(BYTE_NAME) ||
- type.equals(DOUBLE_NAME) ||
- type.equals(FLOAT_NAME) ||
- type.equals(INTEGER_NAME) ||
- type.equals(LONG_NAME) ||
- type.equals(SHORT_NAME) ||
- type.equals(CHARACTER_NAME) ||
- type.equals(DOM_ELEMENT_NAME) ||
- type.equals(SOAP_ELEMENT_NAME) ||
- type.equals(BIG_DECIMAL_NAME) ||
- type.equals(BIG_INTEGER_NAME) ||
- type.equals(DATE_NAME) ||
- type.equals(GREGORIAN_CALENDAR_NAME) ||
- type.equals(CALENDAR_NAME) ||
- type.equals(URL_NAME) ||
- type.equals(STRING_NAME)) return true;
- return false;
-
- }
-
- /*
- * This function allows us to handle unsupported types
- * if we dont want to support a type and we want to omitt this
- * method from the samples
- * @param javaHelpers this is the type to be evaluated
- * @return boolean true if the type is not supported
- */
- public static boolean isUnSupportedType(JavaHelpers javaHelpers)
- {
- //we also dont support arrays
- if (javaHelpers.isArray()||
- javaHelpers.getJavaName().equals(MAP_NAME)||
- javaHelpers.getJavaName().equals(VECTOR_NAME)||
- javaHelpers.getJavaName().equals("java.lang.class") ) return true;
-
- return false;
- }
-
- public static String HASHTABLE_NAME = "java.util.Hashtable";
- public static String MAP_NAME = "java.util.Map";
- public static String VECTOR_NAME = "java.util.Vector";
- public static String ARRAY_NAME = ArrayElement.ARRAY_NAME;
- public static String PRIMITIVE_ARRAY_NAME = "primitivearray";
-
- public static boolean isRecognizedReturnType(JavaHelpers javaHelpers)
- {
- //arrays
- //Hashtable
- //Vectors
- if (javaHelpers.isArray()) return true;
- else if (javaHelpers.getJavaName().equals(HASHTABLE_NAME))return true;
- else if (javaHelpers.getJavaName().equals(VECTOR_NAME))return true;
- else if (javaHelpers.getJavaName().equals(MAP_NAME))return true;
- else return false;
- }
-
- public static boolean isRecognizedReturnType(String type)
- {
- //arrays
- //Hashtable
- //Vectors
- if (type.startsWith(ARRAY_NAME)) return true;
- else if (type.equals(HASHTABLE_NAME))return true;
- else if (type.equals(VECTOR_NAME))return true;
- else if (type.equals(MAP_NAME))return true;
- else return false;
- }
-
- public static boolean isStateLessBean(String type)
- {
- if(type.startsWith(STATELESS_BEAN)) return true;
- return false;
- }
-
-
- /**
- * Creates a type based on the JavaHelper then sets this type in the element
- * @params JavaHelpers this holds the type
- * @param TypeElement The element which will hold the type created
- * @param String Uniquename to be used when naming temp variables
- */
-
- public static DataType createType(String type, String UniqueName)
- {
- //this guy might be both stateless and one of the below elements
- //we would like to be as specific as we can, stateless is the worst case
- boolean stateless = false;
- if(type.startsWith(STATELESS_BEAN)) {
- stateless = true;
- type = type.substring(29);
- }
-
- DataType datatype = null;
- if (type.equals(PRIM_BOOLEAN_NAME)) datatype = new PrimitiveBooleanType();
- else if (type.equals(PRIM_BYTE_NAME)) datatype = new PrimitiveByteType();
- else if (type.equals(PRIM_DOUBLE_NAME)) datatype = new PrimitiveDoubleType();
- else if (type.equals(PRIM_FLOAT_NAME)) datatype = new PrimitiveFloatType();
- else if (type.equals(PRIM_LONG_NAME)) datatype = new PrimitiveLongType();
- else if (type.equals(PRIM_INTEGER_NAME)) datatype = new PrimitiveIntType();
- else if (type.equals(PRIM_CHAR_NAME)) datatype = new PrimitiveCharType();
- else if (type.equals(PRIM_SHORT_NAME)) datatype = new PrimitiveShortType();
-
-
- //see if this critter is a javatype
- else if (type.equals(BOOLEAN_NAME) ||
- type.equals(BYTE_NAME) ||
- type.equals(DOUBLE_NAME) ||
- type.equals(FLOAT_NAME) ||
- type.equals(INTEGER_NAME) ||
- type.equals(LONG_NAME) ||
- type.equals(CHARACTER_NAME) ||
- type.equals(SHORT_NAME)) datatype = (DataType)javaTypes.get(type);
-
- //see if its a case we handle
- else if (type.equals(STRING_NAME)) datatype = new StringType();
- else if (type.equals(VOID_NAME)) datatype = new VoidType();
- else if (type.equals(DOM_ELEMENT_NAME)) datatype = new DomElementType();
- else if (type.equals(SOAP_ELEMENT_NAME)) datatype = new SOAPElementType();
- else if (type.equals(BIG_DECIMAL_NAME)) datatype = new BigDecimalType();
- else if (type.equals(BIG_INTEGER_NAME)) datatype = new BigIntegerType();
- else if (type.equals(DATE_NAME)) datatype = new DateType();
- else if (type.equals(URL_NAME)) datatype = new URLType();
- else if (type.equals(GREGORIAN_CALENDAR_NAME)) datatype = new GregorianCalendarType();
- else if (type.equals(CALENDAR_NAME)) datatype = new GregorianCalendarType();
-
- //it could be a return type we support
- else if (type.equals(HASHTABLE_NAME)) datatype = new HashtableType();
- else if (type.equals(VECTOR_NAME)) datatype = new VectorType();
- else if (type.equals(MAP_NAME)) datatype = new MapType();
-
- // need to see if it is an object array
- //or a primitive
- else if (type.startsWith(ARRAY_NAME)){
- String name = type.substring(21);
- if(name.startsWith(PRIM_BOOLEAN_NAME) ||
- name.startsWith(PRIM_BYTE_NAME) ||
- name.startsWith(PRIM_DOUBLE_NAME) ||
- name.startsWith(PRIM_FLOAT_NAME) ||
- name.startsWith(PRIM_LONG_NAME) ||
- name.startsWith(PRIM_INTEGER_NAME) ||
- name.startsWith(PRIM_CHAR_NAME) ||
- name.startsWith(PRIM_SHORT_NAME))
- datatype = new PrimitiveArrayType(name);
- else
- datatype = new ArrayType(name);
-
- }
- else if (stateless){
- datatype = new StateLessBeanType(type);
-
- }
-
-
- datatype.setUniqueName(UniqueName);
- return datatype;
-
- }
-
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/URLType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/URLType.java
deleted file mode 100644
index 9c0fb28..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/URLType.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-/**
-* objects of this class represent a type
-*
-*/
-public class URLType extends SimpleType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public URLType()
- {
- super(TypeFactory.URL_NAME);
- }
-
- /**
- * StringToType gets the string taken by the
- * user into proxy form
- * @return String convert the string to type .
- */
- public String StringToType(String name)
- {
- String conversion = "new java.net.URL(" + name + ");";
- return conversion;
- }
-
- /**
- * The stringConversion function nails out specific conversion methods used among simple types
- * This method is to be implemented by SimpleType subclasses
- * @param String the name of string after the request call
- * @return String the actual conversion string containing the name.
- */
- public String TypeToString(String name)
- {
- return name + ".toString()";
- }
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/VectorType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/VectorType.java
deleted file mode 100644
index 5a0718d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/VectorType.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a recognized return type
-*
-*/
-public class VectorType extends RecognizedReturnType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public VectorType()
- {
- super(TypeFactory.VECTOR_NAME);
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/VoidType.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/VoidType.java
deleted file mode 100644
index 5fde91e..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/beanmodel/VoidType.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel;
-
-
-/**
-* objects of this class represent a type
-*
-*/
-public class VoidType extends SimpleType
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- *Constructor
- *
- */
- public VoidType()
- {
- super("void");
- }
-
- /**
- * for a void there is no need to return
- * @return String convert the string to type .
- */
- public String StringToType(String name)
- {
- return "";
- }
-
- /**
- * The stringConversion function nails out specific conversion methods used among simple types
- * This method is to be implemented by SimpleType subclasses
- * @param String the name of string after the request call
- * @return String the actual conversion string containing the name.
- */
- public String TypeToString(String name)
- {
- return "String.valueOf(" + name + ")";
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/validate/ValidationManager.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/validate/ValidationManager.java
deleted file mode 100644
index dba9769..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/validate/ValidationManager.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.validate;
-
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-
-/**
- * This class manages the validation state of projects that some tasks may want
- * to disable. The manager can then be used to restore the validation state.
-**/
-public class ValidationManager
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * This set contains a set of IProjects that need to be validated.
- **/
- private HashSet projects = null;
-
- /**
- * This object contains a reference to the j2ee validator.
- **/
- //pgm private ValidatorManager j2eeManager = null;
-
- /**
- * This boolean contains the auto build setting under preferrence
- **/
- private boolean isAutoBuild_;
- private boolean autoBuildDisabled_;
-
- public ValidationManager()
- {
- projects = new HashSet();
- //pgm j2eeManager = ValidatorManager.getManager();
- setAutoBuildPreference();
- autoBuildDisabled_ = false;
- }
-
- /**
- * Disables the validation for a project if required.
- **/
- public void disableValidationForProject( IProject project )
- {
- // We need to remember that this project needs have validation turned back on.
- projects.add( project );
-
- //pgm j2eeManager.suspendAllValidation( true );
- }
-
- /**
- * Restores the validation state for all needed projects.
- **/
- public void restoreValidationForProjects( boolean runValidation )
- {
- //pgm j2eeManager.suspendAllValidation( false );
-
- Iterator iterator = projects.iterator();
-
- while( iterator.hasNext() )
- {
- IProject project = (IProject)(iterator.next());
-
- // Now kick off validation for this project if this was requested.
- if( runValidation )
- {
- //pgm EnabledValidatorsOperation validOp = new EnabledValidatorsOperation( project, null );
- //pgm validOp.run( monitor );
- }
- }
- }
-
- public void modifyAutoBuild(boolean isAutoBuild) {
- try {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceDescription workspaceDesc = workspace.getDescription();
- workspaceDesc.setAutoBuilding(isAutoBuild);
- workspace.setDescription(workspaceDesc);
- }
- catch (Exception e) {}
- }
-
- public void disableAutoBuild() {
- if (!autoBuildDisabled_) {
- setAutoBuildPreference();
- modifyAutoBuild(false);
- autoBuildDisabled_ = true;
- }
- }
-
- public void restoreAutoBuild() {
- if (autoBuildDisabled_) {
- modifyAutoBuild(getAutoBuildPreference());
- autoBuildDisabled_ = false;
- }
- }
-
- public boolean setAutoBuildPreference() {
- isAutoBuild_ = getWorkspaceAutoBuildPreference();
- return isAutoBuild_;
- }
-
- public boolean getAutoBuildPreference() {
- return isAutoBuild_;
- }
-
- public boolean getWorkspaceAutoBuildPreference() {
- IWorkspaceDescription workspaceDesc = ResourcesPlugin.getWorkspace().getDescription();
- return workspaceDesc.isAutoBuilding();
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/BindingElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/BindingElement.java
deleted file mode 100644
index 7990a67..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/BindingElement.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.wsdlmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-public class BindingElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static String REL_PORT = "port";
- public static String REL_OPERATIONS = "operations";
- public static String REL_PORT_TYPE = "porttype";
-
- public BindingElement (PortElement portElement,String name)
- {
- super(name,portElement,REL_PORT,PortElement.REL_BINDING);
- }
-
- public Enumeration getPort()
- {
- return getElements(REL_PORT);
- }
-
- public Enumeration getPortType()
- {
- return getElements(REL_PORT_TYPE);
- }
-
- public Enumeration getOperations()
- {
- return getElements(REL_OPERATIONS);
- }
-
- public int getNumberOfOperations()
- {
- return getNumberOfElements(REL_OPERATIONS);
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/DefinitionElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/DefinitionElement.java
deleted file mode 100644
index a7fa852..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/DefinitionElement.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.wsdlmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-public class DefinitionElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static String REL_SERVICES = "services";
- public static String REL_WSDL = "wsdl";
-
- public DefinitionElement (WSDLElement wsdlElement,String name)
- {
- super(name,wsdlElement,REL_WSDL,WSDLElement.REL_DEFINITIONS);
- }
-
- public Enumeration getWSDL()
- {
- return getElements(REL_WSDL);
- }
-
- public Enumeration getServices()
- {
- return getElements(REL_SERVICES);
- }
-
- public int getNumberOfServices()
- {
- return getNumberOfElements(REL_SERVICES);
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/MessageElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/MessageElement.java
deleted file mode 100644
index 36b4361..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/MessageElement.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.wsdlmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-public class MessageElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static String REL_OPERATION = "operation";
- public static String REL_PARTS = "parts";
-
- public MessageElement (OperationElement operationElement,String name)
- {
- super(name,operationElement,REL_OPERATION,OperationElement.REL_MESSAGES);
- }
-
- public Enumeration getOperation()
- {
- return getElements(REL_OPERATION);
- }
-
- public Enumeration getParts()
- {
- return getElements(REL_PARTS);
- }
-
- public int getNumberOfParts()
- {
- return getNumberOfElements(REL_PARTS);
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/OperationElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/OperationElement.java
deleted file mode 100644
index 9bd235e..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/OperationElement.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.wsdlmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-public class OperationElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static String REL_BINDING = "binding";
- public static String REL_MESSAGES = "messages";
-
- public OperationElement (BindingElement bindingElement,String name)
- {
- super(name,bindingElement,REL_BINDING,BindingElement.REL_OPERATIONS);
- }
-
- public Enumeration getBinding()
- {
- return getElements(REL_BINDING);
- }
-
- public Enumeration getMessages()
- {
- return getElements(REL_MESSAGES);
- }
-
- public int getNumberOfMessages()
- {
- return getNumberOfElements(REL_MESSAGES);
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/PartElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/PartElement.java
deleted file mode 100644
index 451eea9..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/PartElement.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.wsdlmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-public class PartElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static String REL_MESSAGE = "message";
-
- public PartElement (MessageElement messageElement,String name)
- {
- super(name,messageElement,REL_MESSAGE,MessageElement.REL_PARTS);
- }
-
- public Enumeration getMessage()
- {
- return getElements(REL_MESSAGE);
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/PortElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/PortElement.java
deleted file mode 100644
index 43bde81..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/PortElement.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.wsdlmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-public class PortElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static String REL_BINDING = "binding";
- public static String REL_SERVICE = "service";
-
- public PortElement (ServiceElement serviceElement,String name)
- {
- super(name,serviceElement,REL_SERVICE,ServiceElement.REL_PORTS);
- }
-
- public Enumeration getService()
- {
- return getElements(REL_SERVICE);
- }
-
- public Enumeration getBinding()
- {
- return getElements(REL_BINDING);
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/PortTypeElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/PortTypeElement.java
deleted file mode 100644
index e4122e7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/PortTypeElement.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.wsdlmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-public class PortTypeElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static String REL_BINDING = "binding";
-
- public PortTypeElement (BindingElement bindingElement,String name)
- {
- super(name,bindingElement,REL_BINDING,BindingElement.REL_PORT_TYPE);
- }
-
- public Enumeration getBinding()
- {
- return getElements(REL_BINDING);
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/ServiceElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/ServiceElement.java
deleted file mode 100644
index 30ef1c8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/ServiceElement.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.wsdlmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-
-
-public class ServiceElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static String REL_PORTS = "ports";
- public static String REL_DEFINITION = "definition";
-
- public ServiceElement (DefinitionElement definitionElement,String name)
- {
- super(name,definitionElement,REL_DEFINITION,DefinitionElement.REL_SERVICES);
- }
-
- public Enumeration getDefinition()
- {
- return getElements(REL_DEFINITION);
- }
-
- public Enumeration getPorts()
- {
- return getElements(REL_PORTS);
- }
-
- public int getNumberOfPorts()
- {
- return getNumberOfElements(REL_PORTS);
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/StubbedWSDLModel.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/StubbedWSDLModel.java
deleted file mode 100644
index f55d36a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/StubbedWSDLModel.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.wsdlmodel;
-
-import org.eclipse.jst.ws.internal.datamodel.Model;
-
-public class StubbedWSDLModel
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- protected Model fModel;
- public StubbedWSDLModel()
- {
- WSDLElement wsdlElement = new WSDLElement("WSDLFiles");
- fModel = wsdlElement.getModel();
- }
-
- public Model getWSDLModel()
- {
- return fModel;
- }
-
- public void buildModel()
- {
- DefinitionElement def1 = new DefinitionElement((WSDLElement)fModel.getRootElement(),"StockQuote");
- ServiceElement ser1 = new ServiceElement(def1,"getQuote");
- ServiceElement ser2 = new ServiceElement(def1,"setQuote");
- PortElement port1 = new PortElement(ser1,"port1");
- PortElement port2 = new PortElement(ser1,"port2");
- PortElement port3 = new PortElement(ser2,"port1");
- PortElement port4 = new PortElement(ser2,"port2");
- BindingElement bind1 = new BindingElement(port1,"bind1");
- BindingElement bind2 = new BindingElement(port2,"bind1");
- BindingElement bind3 = new BindingElement(port3,"bind1");
- BindingElement bind4 = new BindingElement(port4,"bind1");
- OperationElement op1 = new OperationElement(bind1,"op1");
- OperationElement op2 = new OperationElement(bind2,"op1");
- OperationElement op3 = new OperationElement(bind3,"op1");
- OperationElement op4 = new OperationElement(bind4,"op1");
- MessageElement me1 = new MessageElement(op1,"me1");
- MessageElement me2 = new MessageElement(op1,"me2");
- PartElement pe1 = new PartElement(me1,"pe1");
- PartElement pe2 = new PartElement(me2,"pe2");
-
- DefinitionElement def2 = new DefinitionElement((WSDLElement)fModel.getRootElement(),"TempConversion");
- ServiceElement ser3 = new ServiceElement(def2,"getTemp");
- ServiceElement ser4 = new ServiceElement(def2,"setTemp");
- PortElement port5 = new PortElement(ser3,"port1");
- PortElement port6 = new PortElement(ser4,"port1");
- BindingElement bind5 = new BindingElement(port5,"bind1");
- BindingElement bind6 = new BindingElement(port6,"bind1");
- OperationElement op5 = new OperationElement(bind5,"op1");
- OperationElement op6 = new OperationElement(bind6,"op1");
-
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/WSDLElement.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/WSDLElement.java
deleted file mode 100644
index 52a4c1f..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/datamodel/wsdlmodel/WSDLElement.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.datamodel.wsdlmodel;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-import org.eclipse.jst.ws.internal.datamodel.BasicModel;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-
-
-public class WSDLElement extends BasicElement
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static String REL_DEFINITIONS = "definitions";
-
- /*
- *
- **/
- public WSDLElement (String name)
- {
- this(name,new BasicModel("WSDLModel"));
- }
-
- public WSDLElement (String name, Model model)
- {
- super(name,model);
- model.setRootElement(this);
- }
-
- public Enumeration getDefinitions()
- {
- return getElements(REL_DEFINITIONS);
- }
-
- public int getNumberOfDefinitions()
- {
- return getNumberOfElements(REL_DEFINITIONS);
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreAssemblyFragment.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreAssemblyFragment.java
deleted file mode 100644
index 6b479a7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreAssemblyFragment.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.fragments;
-
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-
-public class ClientPreAssemblyFragment extends SequenceFragment
-{
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreDeployFragment.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreDeployFragment.java
deleted file mode 100644
index d59ebf7..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreDeployFragment.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.fragments;
-
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-
-public class ClientPreDeployFragment extends SequenceFragment
-{
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreDevelopFragment.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreDevelopFragment.java
deleted file mode 100644
index e375dd3..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreDevelopFragment.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.fragments;
-
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-
-public class ClientPreDevelopFragment extends SequenceFragment
-{
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreInstallFragment.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreInstallFragment.java
deleted file mode 100644
index a3e94a0..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ClientPreInstallFragment.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.fragments;
-
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-
-public class ClientPreInstallFragment extends SequenceFragment
-{
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreAssemblyFragment.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreAssemblyFragment.java
deleted file mode 100644
index 2dd56f3..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreAssemblyFragment.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.fragments;
-
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-
-public class ServicePreAssemblyFragment extends SequenceFragment
-{
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreDeployFragment.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreDeployFragment.java
deleted file mode 100644
index 1ff4a49..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreDeployFragment.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.fragments;
-
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-
-public class ServicePreDeployFragment extends SequenceFragment
-{
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreDevelopFragment.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreDevelopFragment.java
deleted file mode 100644
index 1e2316c..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreDevelopFragment.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.fragments;
-
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-
-public class ServicePreDevelopFragment extends SequenceFragment
-{
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreInstallFragment.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreInstallFragment.java
deleted file mode 100644
index a71790c..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/fragments/ServicePreInstallFragment.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.fragments;
-
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-
-public class ServicePreInstallFragment extends SequenceFragment
-{
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/plugin/WebServiceConsumptionPlugin.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/plugin/WebServiceConsumptionPlugin.java
deleted file mode 100644
index c10745c..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/plugin/WebServiceConsumptionPlugin.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.plugin;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-
-
-/**
-* This is the plugin class for the Web Services plugin.
-* <p>
-* This plugin contains the bulk of the Web Services runtime.
-* Only the graphical user interface portion of the runtime is
-* found elsewhere - in the org.eclipse.jst.ws.ui plugin.
-*/
-public class WebServiceConsumptionPlugin extends Plugin
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * The identifier of the descriptor of this plugin in plugin.xml.
- */
- public static final String ID = "org.eclipse.jst.ws.consumption";
-
- /**
- * The reference to the singleton instance of this plugin.
- */
- private static WebServiceConsumptionPlugin instance_;
-
- private Log log_;
-
- /**
- * Constructs a runtime plugin object for this plugin.
- * The "plugin" element in plugin.xml should include the attribute
- * class = "org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin".
- * @param descriptor The descriptor of this plugin.
- */
- public WebServiceConsumptionPlugin ( IPluginDescriptor descriptor )
- {
- super(descriptor);
- if (instance_ == null)
- {
- instance_ = this;
- }
- log_ = new EclipseLog();
- }
-
- /**
- * Returns the singleton instance of this plugin. Equivalent to calling
- * (WebServiceConsumptionPlugin)Platform.getPlugin("org.eclipse.jst.ws");
- * @return The WebServiceConsumptionPlugin singleton.
- */
- public static WebServiceConsumptionPlugin getInstance ()
- {
- return instance_;
- }
-
- /**
- * Called once by the platform when this plugin is first loaded.
- * @throws CoreException If this plugin fails to start.
- */
- public void startup () throws CoreException
- {
- log_.log(Log.INFO, 5042, this, "startup", "Starting plugin org.eclipse.jst.ws.consumption");
- super.startup();
- }
-
- /**
- * Called once by the platform when this plugin is unloaded.
- * @throws CoreException If this plugin fails to shutdown.
- */
- public void shutdown () throws CoreException
- {
- log_.log(Log.INFO, 5043, this, "shutdown", "Shutting plugin org.eclipse.jst.ws.consumption");
- super.shutdown();
- }
-
- /**
- * Returns the message string identified by the given key from
- * plugin.properties.
- * @return The String message.
- */
- public static String getMessage ( String key )
- {
- MessageUtils msgUtils = new MessageUtils( "org.eclipse.jst.ws.consumption.plugin", instance_ );
-
- if( key.startsWith("%"))
- {
- key = key.substring( 1, key.length() );
- }
-
- return msgUtils.getMessage(key);
- }
-
- /**
- * Returns the message string identified by the given key from
- * plugin.properties. Substitution sequences in the message string
- * are replaced by the given array of substitution objects (which
- * are most frequently strings). See the JDK's
- * {@link java.text.MessageFormat java.text.MessageFormat}
- * class for further details on substitution.
- * @return The String message.
- */
- public static String getMessage ( String key, Object[] args )
- {
- return MessageFormat.format(getMessage(key),args);
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileAttributeGenerator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileAttributeGenerator.java
deleted file mode 100644
index 436e45d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileAttributeGenerator.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.TypeVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.AttributeElementType;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a InputFileTypeGenerator.
-* */
-public class InputFileAttributeGenerator extends InputFileTypeGenerator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- private boolean fStateLess;
-
- /**
- * Constructor.
- *
- */
- public InputFileAttributeGenerator (StringBuffer buffer, int currentLevel, int levelsDeep)
- {
- super(buffer,currentLevel,levelsDeep);
- }
-
-
- /*
- * Takes in an object to be acted upon by this visitor action
- * @param Object The object to be acted upon
- */
- public Status visit (Object object)
- {
-
- AttributeElementType attributeElementType = (AttributeElementType)object;
- //if it is a bean is it stateless
- attributeElementType.getTypeElement();
-
- if(attributeElementType.getTypeElement().isBean()){
- BeanElement bean = (BeanElement)attributeElementType.getTypeElement();
- fStateLess = bean.isStateLess();
- }
-
- TypeVisitor typeVisitor = new TypeVisitor();
- InputFileTypeGenerator inputFileTypeGenerator = new InputFileTypeGenerator(fbuffer,fCurrentLevel,fLevelsDeep);
- if(attributeElementType.getTypeElement().isBean() && !TypeFactory.recognizedBean(attributeElementType.getTypeElement().getName())
- && !(getReturnParam() && (TypeFactory.isRecognizedReturnType(attributeElementType.getTypeElement().getTypeName()) || fStateLess)))
-
- addParentGetter(attributeElementType.getGetterMethod(),attributeElementType.getTypeElement().getName());
- inputFileTypeGenerator.addParentGetter(returnParentGetter(),returnParentGetterType());
- inputFileTypeGenerator.setInstanceName(fInstanceName);
- inputFileTypeGenerator.setReturnParam(getReturnParam());
- typeVisitor.run(attributeElementType,inputFileTypeGenerator);
- fbuffer = inputFileTypeGenerator.getStringBuffer();
-
- return new SimpleStatus("");
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileGenerator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileGenerator.java
deleted file mode 100644
index 190bc7d..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileGenerator.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.MethodVisitor;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a MethodFilegenerator.
-* */
-public class InputFileGenerator extends Generator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public String fResultName;
-
- /**
- * Constructor.
- * used directly
- */
- public InputFileGenerator (String result)
- {
- super();
- fResultName = result;
- }
-
- /**
- * Constructor.
- * called from subclasses
- */
- public InputFileGenerator (StringBuffer buffer, String result)
- {
- super(buffer);
- fResultName = result;
- }
-
- /**
- * Constructor.
- * called from subclasses
- */
- public InputFileGenerator (StringBuffer buffer)
- {
- super(buffer);
- }
-
- public void setFileNames(String results)
- {
- fResultName = results;
- }
-
- //takes in a bean node
- public Status visit (Object object)
- {
- Element beanElement = (Element)object;
- fbuffer.append("<%@page contentType=\"text/html;charset=UTF-8\"%>" + StringUtils.NEWLINE);
- fbuffer.append("<HTML>" + StringUtils.NEWLINE);
- fbuffer.append("<HEAD>" + StringUtils.NEWLINE);
- fbuffer.append("<TITLE>Inputs</TITLE>" + StringUtils.NEWLINE);
- fbuffer.append("</HEAD>" + StringUtils.NEWLINE);
- fbuffer.append("<BODY>" + StringUtils.NEWLINE);
- fbuffer.append("<H1>Inputs</H1>" + StringUtils.NEWLINE + "" + StringUtils.NEWLINE);
- fbuffer.append("<%" + StringUtils.NEWLINE + "String method = request.getParameter(\"method\");" + StringUtils.NEWLINE);
- fbuffer.append("int methodID = 0;" + StringUtils.NEWLINE);
- fbuffer.append("if (method == null) methodID = -1;" + StringUtils.NEWLINE + "" + StringUtils.NEWLINE);
- fbuffer.append("boolean valid = true;" + StringUtils.NEWLINE + StringUtils.NEWLINE);
-
- fbuffer.append("if(methodID != -1) methodID = Integer.parseInt(method);" + StringUtils.NEWLINE);
- fbuffer.append("switch (methodID){ " + StringUtils.NEWLINE);
-
- // go to the next generator
- MethodVisitor methodVisitor = new MethodVisitor();
- InputFileHelp1Generator inputFileHelp1Generator = new InputFileHelp1Generator(fbuffer,fResultName);
- methodVisitor.run(beanElement,inputFileHelp1Generator);
- fbuffer = inputFileHelp1Generator.getStringBuffer();
-
- fbuffer.append("case 1111111111:" + StringUtils.NEWLINE);
- fbuffer.append("valid = false;" + StringUtils.NEWLINE);
- fbuffer.append("%>" + StringUtils.NEWLINE);
- fbuffer.append("<FORM METHOD=\"POST\" ACTION=\"" + fResultName + "\" TARGET=\"result\">" + StringUtils.NEWLINE);
- fbuffer.append("<INPUT TYPE=\"HIDDEN\" NAME=\"method\" VALUE=\"<%=method%>\">" + StringUtils.NEWLINE);
- fbuffer.append("<TABLE>" + StringUtils.NEWLINE);
- fbuffer.append("<TR>" + StringUtils.NEWLINE);
- fbuffer.append("<TD COLSPAN=\"1\" ALIGN=\"LEFT\">URLString:</TD>" + StringUtils.NEWLINE);
- fbuffer.append("<TD ALIGN=\"left\"><INPUT TYPE=\"TEXT\" NAME=\"url1111111111\" SIZE=20></TD>" + StringUtils.NEWLINE);
- fbuffer.append("</TR>" + StringUtils.NEWLINE);
- fbuffer.append("</TABLE>" + StringUtils.NEWLINE);
- fbuffer.append("<BR>" + StringUtils.NEWLINE);
- fbuffer.append("<INPUT TYPE=\"SUBMIT\" VALUE=\"Invoke\">" + StringUtils.NEWLINE);
- fbuffer.append("<INPUT TYPE=\"RESET\" VALUE=\"Clear\">" + StringUtils.NEWLINE);
- fbuffer.append("</FORM>" + StringUtils.NEWLINE);
- fbuffer.append("<%" + StringUtils.NEWLINE);
- fbuffer.append("break;" + StringUtils.NEWLINE);
- fbuffer.append("case 1111111112:" + StringUtils.NEWLINE);
- fbuffer.append("valid = false;" + StringUtils.NEWLINE);
- fbuffer.append("%>" + StringUtils.NEWLINE);
- fbuffer.append("<FORM METHOD=\"POST\" ACTION=\"" + fResultName + "\" TARGET=\"result\">" + StringUtils.NEWLINE);
- fbuffer.append("<INPUT TYPE=\"HIDDEN\" NAME=\"method\" VALUE=\"<%=method%>\">" + StringUtils.NEWLINE);
- fbuffer.append("<BR>" + StringUtils.NEWLINE);
- fbuffer.append("<INPUT TYPE=\"SUBMIT\" VALUE=\"Invoke\">" + StringUtils.NEWLINE);
- fbuffer.append("<INPUT TYPE=\"RESET\" VALUE=\"Clear\">" + StringUtils.NEWLINE);
- fbuffer.append("</FORM>" + StringUtils.NEWLINE);
- fbuffer.append("<%" + StringUtils.NEWLINE);
- fbuffer.append("break;" + StringUtils.NEWLINE);
-
-
-
- fbuffer.append("}" + StringUtils.NEWLINE);
- fbuffer.append("if (valid) {" + StringUtils.NEWLINE);
- fbuffer.append("%>" + StringUtils.NEWLINE + "Select a method to test." + StringUtils.NEWLINE);
- fbuffer.append("<%" + StringUtils.NEWLINE);
- fbuffer.append(Generator.TAB + "return;" + StringUtils.NEWLINE);
- fbuffer.append("}" + StringUtils.NEWLINE);
- fbuffer.append("%>" + StringUtils.NEWLINE + StringUtils.NEWLINE);
- fbuffer.append("</BODY>" + StringUtils.NEWLINE);
- fbuffer.append("</HTML>" + StringUtils.NEWLINE);
-
- return new SimpleStatus("");
-
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileHelp1Generator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileHelp1Generator.java
deleted file mode 100644
index 428f70a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileHelp1Generator.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.ParameterVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.MethodElement;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a InputFileHelp1Generator.
-* */
-public class InputFileHelp1Generator extends InputFileGenerator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static final int INITIAL_STATE = 1;
- public static final int FINAL_STATE = 2;
-
- public int fstate;
-
- /**
- * Constructor.
- *
- */
- public InputFileHelp1Generator (StringBuffer buffer)
- {
- super(buffer);
- fstate = INITIAL_STATE;
- }
-
- /**
- * Constructor.
- *
- */
- public InputFileHelp1Generator (StringBuffer buffer,String resultName)
- {
- super(buffer,resultName);
- fstate = INITIAL_STATE;
- }
-
- /*
- * Takes in an element
- * @param Object Takes in an object to be acted upon
- */
- public Status visit (Object object)
- {
- Element methodElement = (Element)object;
- MethodElement method = (MethodElement)methodElement;
- if (method.getMethodOmmission()) return new SimpleStatus("");
-
- ParameterVisitor parameterVisitor = new ParameterVisitor();
- fbuffer.append("case " + method.getNumberID()+ ":" + StringUtils.NEWLINE);
- fbuffer.append("valid = false;" + StringUtils.NEWLINE);
- fbuffer.append("%>" + StringUtils.NEWLINE);
- fbuffer.append("<FORM METHOD=\"POST\" ACTION=\"" + fResultName + "\" TARGET=\"result\">" + StringUtils.NEWLINE);
- fbuffer.append("<INPUT TYPE=\"HIDDEN\" NAME=\"method\" VALUE=\"<%=method%>\">" + StringUtils.NEWLINE);
-
- // go to the next generator
- InputFileHelp2Generator inputFileHelp2Generator = new InputFileHelp2Generator(fbuffer);
- parameterVisitor.run(methodElement,inputFileHelp2Generator);
- fbuffer = inputFileHelp2Generator.getStringBuffer();
-
- fbuffer.append("<BR>" + StringUtils.NEWLINE);
- fbuffer.append("<INPUT TYPE=\"SUBMIT\" VALUE=\"Invoke\">" + StringUtils.NEWLINE);
- fbuffer.append("<INPUT TYPE=\"RESET\" VALUE=\"Clear\">" + StringUtils.NEWLINE);
- fbuffer.append("</FORM>" + StringUtils.NEWLINE);
- fbuffer.append("<%" + StringUtils.NEWLINE);
- fbuffer.append("break;" + StringUtils.NEWLINE);
-
-
- return new SimpleStatus("");
-
-
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileHelp2Generator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileHelp2Generator.java
deleted file mode 100644
index 1eb6012..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileHelp2Generator.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.RelVisitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.TypeVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.ParameterElement;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a InputFileHelp2Generator.
-* */
-public class InputFileHelp2Generator extends InputFileHelp1Generator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /*
- * This is actually used by the result generator to show the
- * resultant Bean
- * The name is the name the resultant bean is using as its instance name
- */
- protected String fInstanceName;
- private boolean fReturnParam=false;
-
- /**
- * Constructor.
- *
- */
- public InputFileHelp2Generator (StringBuffer buffer)
- {
- super(buffer);
- fInstanceName="";
- }
-
- /**
- * This is state data to be used by the generators
- * @param String name The instance name of the parameters type bean
- */
- public void setInstanceName(String name)
- {
- fInstanceName = name;
- }
-
- /**
- * This is state data to be used by the generators
- * @return String name The instance name of the parameters type bean
- */
- public String getInstanceName()
- {
- return fInstanceName;
- }
-
-
- /*
- * Takes in an object to be acted upon by this visitor action
- * @param Object The object to be acted upon
- */
- public Status visit (Object object)
- {
- Element parameterElement = (Element)object;
- RelVisitor visitor = (RelVisitor)getVisitor();
- ParameterElement parameter = (ParameterElement)parameterElement;
-
- fbuffer.append("<TABLE>" + StringUtils.NEWLINE);
-
- TypeVisitor typeVisitor = new TypeVisitor();
- InputFileTypeGenerator inputFileTypeGenerator = new InputFileTypeGenerator(fbuffer,0);
- inputFileTypeGenerator.setReturnParam(getReturnParam());
- inputFileTypeGenerator.setInstanceName(fInstanceName);
- typeVisitor.run(parameterElement,inputFileTypeGenerator);
- fbuffer = inputFileTypeGenerator.getStringBuffer();
-
- fbuffer.append("</TABLE>" + StringUtils.NEWLINE);
-
- return new SimpleStatus("");
-
- }
-
- public boolean getReturnParam()
- {
- return fReturnParam;
- }
-
- public void setReturnParam(boolean returnParam)
- {
- fReturnParam = returnParam;
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileTypeGenerator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileTypeGenerator.java
deleted file mode 100644
index ee13447..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/InputFileTypeGenerator.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import java.util.Vector;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.AttributeVisitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.FieldVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.AttributeElementType;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.DataType;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.SimpleElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a InputFileTypeGenerator.
-* */
-public class InputFileTypeGenerator extends InputFileHelp2Generator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- protected String fParentGetters;
- protected int fLevelsDeep;
- protected int fColspan;
- protected int fCurrentLevel;
- private boolean fIsSimple;
- private boolean fStateLessBean;
- private Vector fGetters;
- private Vector fTypes;
-
- /**
- * Constructor.
- *
- */
- public InputFileTypeGenerator (StringBuffer buffer, int currentLevel)
- {
- super(buffer);
- fCurrentLevel = currentLevel;
- fLevelsDeep = -1;
- fParentGetters = "";
- }
-
- /**
- * Constructor.
- *
- */
- public InputFileTypeGenerator (StringBuffer buffer, int currentLevel,int levelsDeep)
- {
- super(buffer);
- fCurrentLevel = currentLevel;
- fLevelsDeep = levelsDeep;
- fParentGetters = "";
- }
-
- public void setParentGetters(Vector getter,Vector type)
- {
- if(fGetters != null){
- fGetters.clear();
- fTypes.clear();
- }
- addParentGetter(getter,type);
- }
-
-
- /**
- * This function holds some state data that is important in getting the
- * Strings for display of resultant beans
- * @param String getter this is the getter of an attribute
- * The idea is that by the time we get to the simple type
- * we have getAddress().getStreet()....
- */
- public void addParentGetter(String getter, String type)
- {
- if(fGetters == null) fGetters = new Vector();
- if(fTypes == null) fTypes = new Vector();
- fGetters.addElement(getter);
- fTypes.addElement(type);
- }
-
- /*
- * this will be used when passing between two visitors
- *
- */
- public void addParentGetter(Vector getters, Vector types)
- {
- if(fGetters == null) fGetters = new Vector();
- if(fTypes == null) fTypes = new Vector();
- int size = getters.size();
- for(int i = 0; i<size; i++){
- fGetters.addElement(getters.get(i));
- fTypes.addElement(types.get(i));
- }
- }
-
- protected String returnParentGetter(int count)
- {
- if (fGetters == null || count > fGetters.size()) return null;
- return (String)fGetters.get(count);
- }
-
- protected String returnParentGetterType(int count)
- {
- if (fTypes == null || count > fTypes.size()) return null;
- return (String)fTypes.get(count);
- }
-
- protected Vector returnParentGetter()
- {
- if (fGetters == null ) return new Vector();
- return fGetters;
- }
-
- protected Vector returnParentGetterType()
- {
- if (fTypes == null ) return new Vector();
- return fTypes;
- }
-
- protected int getterCount()
- {
- if(fGetters == null) return 0;
- return fGetters.size();
- }
-
-
- /**
- * This function returns some state data that is important in getting the
- * Strings for display of resultant beans
- * @return String the string of getters to this point
- * The idea is that by the time we get to the simple type
- * we have getAddress().getStreet()....
- */
- public String getParentGetters()
- {
- return fParentGetters;
- }
-
- /*
- * Takes in an object to be acted upon by this visitor action
- * @param Object The object to be acted upon
- */
- public Status visit (Object object)
- {
- TypeElement element = (TypeElement)object;
-
- if (element instanceof SimpleElement) fIsSimple = true;
- else fIsSimple = false;
-
- //this could be a statelessbean need to know
- if (element instanceof BeanElement ){
- BeanElement bean = (BeanElement)element;
- if (bean.isStateLess()) fStateLessBean = true;
- }
-
-
-
- //Complex type support
- //first I need to find out how many levels deep
- if(fLevelsDeep == -1){
- AttributeVisitor attributeVisitor = new AttributeVisitor();
- LevelsDeepVisitorAction ldva = new LevelsDeepVisitorAction();
- attributeVisitor.run(element,ldva);
- fLevelsDeep = ldva.getLevelsDeep();
- //check out the fields
- FieldVisitor fieldVisitor = new FieldVisitor();
- LevelsDeepVisitorAction ldva2 = new LevelsDeepVisitorAction();
- fieldVisitor.run(element,ldva2);
-
- if(fLevelsDeep < ldva2.getLevelsDeep())fLevelsDeep = ldva2.getLevelsDeep();
- fLevelsDeep++;
- }
- fColspan = fLevelsDeep - fCurrentLevel;
-
- //if we have a return param with no getter make sure we are on the
- //attribute and not the parameter then return
- if(getReturnParam() && element.getOwningElement() instanceof AttributeElementType &&(((AttributeElementType)element.getOwningElement()).getGetterMethod() == null) ) return new SimpleStatus("");
-
- //Code gen for all elements
- fbuffer.append("<TR>" + StringUtils.NEWLINE);
- for (int i = 0; i < fCurrentLevel;i++){
- fbuffer.append("<TD WIDTH=\"5%\"></TD>" + StringUtils.NEWLINE);
- }
- fbuffer.append("<TD COLSPAN=\"" + fColspan + "\" ALIGN=\"LEFT\">" + element.getOwningElement().getName() + ":</TD>" + StringUtils.NEWLINE);
- if(fIsSimple || TypeFactory.recognizedBean(element.getName())
- || (getReturnParam() && fStateLessBean)
- || (getReturnParam() && TypeFactory.isRecognizedReturnType(element.getTypeName()))){
- if(getInstanceName().equals("")){
- DataType dataType = TypeFactory.createType(element.getName(),element.getOwningElement().getMUID());
- fbuffer.append(dataType.inputForm(element.getOwningElement().getMUID()));
- }
- else{
- if(getReturnParam() && (TypeFactory.isRecognizedReturnType(element.getTypeName()) || fStateLessBean)){
- DataType dataType = TypeFactory.createType(element.getTypeName(),element.getOwningElement().getMUID());
- String uniqueName = "type" + dataType.getUniqueName();
- fbuffer.append("<TD>" + StringUtils.NEWLINE);
- fbuffer.append("<%" + StringUtils.NEWLINE);
- fbuffer.append("if(" + getInstanceName() + " != null){" + StringUtils.NEWLINE);
- String afterString = getInstanceName();
- String tmpString = "tebece";
- String prevString = getInstanceName();
- String newTmpString = "";
- for(int i=0;i<getterCount();i++){
- newTmpString = tmpString + i;
- fbuffer.append(returnParentGetterType(i) + " " + newTmpString + "=" + prevString + "." + returnParentGetter(i) + ";" + StringUtils.NEWLINE);
- prevString = newTmpString;
- fbuffer.append("if(" + newTmpString + " != null){" + StringUtils.NEWLINE);
- afterString = newTmpString;
- }
- fbuffer.append(element.getName() + " " + uniqueName + " = " + afterString + "." + ((AttributeElementType)element.getOwningElement()).getGetterMethod()+ ";" + StringUtils.NEWLINE);
- fbuffer.append(dataType.TypeConversion(uniqueName));
- for(int i=0;i<getterCount();i++){
- fbuffer.append("}");
- }
- fbuffer.append("}%>" + StringUtils.NEWLINE);
- fbuffer.append("</TD>" + StringUtils.NEWLINE);
- }
-
- else{
- fbuffer.append("<TD>" + StringUtils.NEWLINE);
- fbuffer.append("<%" + StringUtils.NEWLINE);
- fbuffer.append("if(" + getInstanceName() + " != null){" + StringUtils.NEWLINE);
- String afterString = getInstanceName();
- String tmpString = "tebece";
- String prevString = getInstanceName();
- String newTmpString = "";
- for(int i=0;i<getterCount();i++){
- newTmpString = tmpString + i;
- fbuffer.append(returnParentGetterType(i) + " " + newTmpString + "=" + prevString + "." + returnParentGetter(i) + ";" + StringUtils.NEWLINE);
- prevString = newTmpString;
- fbuffer.append("if(" + newTmpString + " != null){" + StringUtils.NEWLINE);
- afterString = newTmpString;
- }
- fbuffer.append("%>" + StringUtils.NEWLINE);
- fbuffer.append("<%=");
- fbuffer.append(afterString + "." + ((AttributeElementType)element.getOwningElement()).getGetterMethod()+ StringUtils.NEWLINE);
- fbuffer.append("%>");
- fbuffer.append("<%");
- for(int i=0;i<getterCount();i++){
- fbuffer.append("}");
- }
- fbuffer.append("}%>" + StringUtils.NEWLINE);
- fbuffer.append("</TD>" + StringUtils.NEWLINE);
- }
- }
-
- }
-
- //Now carry on down the rest of the bean
- else {
- AttributeVisitor attributeVisitor = new AttributeVisitor();
- attributeVisitor.setResidentVector1(returnParentGetter());
- attributeVisitor.setResidentVector2(returnParentGetterType());
- InputFileAttributeGenerator inputFileAttributeGenerator = new InputFileAttributeGenerator(fbuffer,(fCurrentLevel + 1),fLevelsDeep);
- inputFileAttributeGenerator.setReturnParam(getReturnParam());
- inputFileAttributeGenerator.setInstanceName(fInstanceName);
- attributeVisitor.run(element,inputFileAttributeGenerator);
- fbuffer = inputFileAttributeGenerator.getStringBuffer();
-
- //now do fields very similar
- FieldVisitor fieldVisitor = new FieldVisitor();
- fieldVisitor.setResidentVector1(returnParentGetter());
- fieldVisitor.setResidentVector2(returnParentGetterType());
- InputFileAttributeGenerator inputFileAttributeGenerator2 = new InputFileAttributeGenerator(fbuffer,(fCurrentLevel + 1),fLevelsDeep);
- inputFileAttributeGenerator2.setReturnParam(getReturnParam());
- inputFileAttributeGenerator2.setInstanceName(fInstanceName);
- fieldVisitor.run(element,inputFileAttributeGenerator2);
- fbuffer = inputFileAttributeGenerator2.getStringBuffer();
-
-
-
- }
-
-
- return new SimpleStatus("");
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/LevelsDeepVisitorAction.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/LevelsDeepVisitorAction.java
deleted file mode 100644
index 4167ea5..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/LevelsDeepVisitorAction.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import org.eclipse.jst.ws.internal.consumption.codegen.Visitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.VisitorAction;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.AttributeVisitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.FieldVisitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.TypeVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.AttributeElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a LevelsDeepVisitorAction.
-* */
-public class LevelsDeepVisitorAction implements VisitorAction
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- private Visitor fVisitor;
- private int fLevelsDeep;
- private int fDeepestLevel;
-
- /**
- * Constructor.
- * This is the starting point
- *
- */
- public LevelsDeepVisitorAction ()
- {
- fLevelsDeep = 0;
- }
-
- /**
- * Constructor.
- * This is the starting point
- *
- */
- public LevelsDeepVisitorAction (int current,boolean increment)
- {
- fLevelsDeep = current;
- if(increment) fLevelsDeep++;
- fDeepestLevel = fLevelsDeep;
- }
-
- public void initialize(String resident)
- {
- //nothing to be done but must be implemented
- }
-
-
-
- /**
- * The visitor that called this VisitorAction
- * @param visitor the visitor that called this visitor action
- */
- public void setVisitor(Visitor visitor)
- {
- fVisitor = visitor;
- }
-
-
- /**
- * Returns the level of nesting within this bean
- * @return int returns the int number representing the number of nests of this bean
- */
- public int getLevelsDeep()
- {
- return fDeepestLevel;
- }
-
-
- /**
- * Takes in an object to be acted upon by this visitor action
- * @param Object The object to be acted upon
- */
- public Status visit (Object object)
- {
- Element element = (Element)object;
- if (element instanceof AttributeElement || element instanceof TypeElement){
- TypeVisitor typeVisitor = new TypeVisitor();
- LevelsDeepVisitorAction lvda = new LevelsDeepVisitorAction(fLevelsDeep,true);
- typeVisitor.run(element,lvda);
-
- if (lvda.getLevelsDeep() > fDeepestLevel) fDeepestLevel = lvda.getLevelsDeep();
-
- }
- else if (element instanceof BeanElement && !(TypeFactory.recognizedBean(element.getName()))){
- AttributeVisitor attributeVisitor = new AttributeVisitor();
- LevelsDeepVisitorAction lvda = new LevelsDeepVisitorAction(fLevelsDeep,false);
- attributeVisitor.run(element,lvda);
- if (lvda.getLevelsDeep() > fDeepestLevel) fDeepestLevel = lvda.getLevelsDeep();
-
- FieldVisitor fieldVisitor = new FieldVisitor();
- LevelsDeepVisitorAction lvda2 = new LevelsDeepVisitorAction(fLevelsDeep,false);
- fieldVisitor.run(element,lvda2);
- if (lvda2.getLevelsDeep() > fDeepestLevel) fDeepestLevel = lvda2.getLevelsDeep();
-
- }
-
- return new SimpleStatus("");
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/MethodFileGenerator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/MethodFileGenerator.java
deleted file mode 100644
index b5b2bb6..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/MethodFileGenerator.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.MethodVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanElement;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a MethodFilegenerator.
-* */
-public class MethodFileGenerator extends Generator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public String fInputName;
- /**
- * Constructor.
- *
- */
- public MethodFileGenerator (String inputs)
- {
- super();
- fInputName = inputs;
- }
-
- /**
- * Constructor.
- * @param StringBuffer buffer to append codegen
- */
- public MethodFileGenerator (StringBuffer buffer,String inputs)
- {
- super(buffer);
- fInputName = inputs;
- }
-
-
- public void setFileNames(String inputs)
- {
- fInputName = inputs;
- }
-
- //public static String LOCATOR = "Locator";
- public static String BEAN = "Proxy";
- public static String GET = "get";
-
-
- //takes in a bean node
- public Status visit (Object object)
- {
- Element beanElement = (Element)object;
- BeanElement bean = (BeanElement)beanElement;
- fbuffer.append("<%@page contentType=\"text/html;charset=UTF-8\"%>");
- fbuffer.append("<HTML>" + StringUtils.NEWLINE + "<HEAD>" + StringUtils.NEWLINE + "<TITLE>Methods</TITLE>" + StringUtils.NEWLINE + "</HEAD>" + StringUtils.NEWLINE + "<BODY>" + StringUtils.NEWLINE + "<H1>Methods</H1>" + StringUtils.NEWLINE + "<UL>" + StringUtils.NEWLINE);
- MethodVisitor methodVisitor = new MethodVisitor();
- MethodFileHelpGenerator methodFileHelpGenerator = new MethodFileHelpGenerator(fbuffer,fInputName);
- methodVisitor.run(beanElement,methodFileHelpGenerator);
- fbuffer = methodFileHelpGenerator.getStringBuffer();
- fbuffer.append("</UL>" + StringUtils.NEWLINE + "</BODY>" + StringUtils.NEWLINE + "</HTML>");
-
- return new SimpleStatus("");
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/MethodFileHelpGenerator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/MethodFileHelpGenerator.java
deleted file mode 100644
index a2540aa..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/MethodFileHelpGenerator.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.MethodElement;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a MethodFilegenerator.
-* */
-public class MethodFileHelpGenerator extends MethodFileGenerator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- /**
- * Constructor.
- *
- */
- public MethodFileHelpGenerator (StringBuffer buffer,String inputName)
- {
- super(buffer,inputName);
- }
-
-
- //takes in a Method node
- public Status visit (Object object)
- {
- Element methodElement = (Element)object;
- MethodElement method = (MethodElement)methodElement;
- if (method.getMethodOmmission()) return new SimpleStatus("");
-
- fbuffer.append("<LI><A HREF=\"" + fInputName + "?method=" + method.getNumberID());
- fbuffer.append("\" TARGET=\"inputs\"> " + method.getDisplayName());
- fbuffer.append("</A></LI>" + StringUtils.NEWLINE);
-
- return new SimpleStatus("");
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileAttributeGenerator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileAttributeGenerator.java
deleted file mode 100644
index aab0ee2..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileAttributeGenerator.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import java.util.Vector;
-
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.TypeVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.AttributeElementType;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.DataType;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.jst.ws.internal.datamodel.BasicElement;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-/**
-* Objects of this class represent a ResultFileAttributeGenerator.
-* */
-public class ResultFileAttributeGenerator extends ResultFileHelp2Generator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- private Vector fSetterVector;
-
- /**
- * Constructor.
- * @param buffer StringBuffer object that this code generator writes to
- */
- public ResultFileAttributeGenerator (StringBuffer buffer)
- {
- super(buffer);
-
- }
-
- /**
- * Setter vector
- */
- public Vector getSetterVector()
- {
- return fSetterVector;
- }
-
-
- /**
- * Visit Method generates code for this Visitor
- * @param Parameter parameter code will be generated
- */
- public Status visit (Object object)
- {
- AttributeElementType attributeElementType = (AttributeElementType)object;
- BasicElement element = (BasicElement)object;
- if(attributeElementType.getTypeElement().isSimple() || TypeFactory.recognizedBean(attributeElementType.getTypeElement().getName())){
- //start the codegen
- //ask the datatype for its request line, it may need mark up or not.
- //ie For the simple types we need the mark up
- //for the dom element we cant use it.
- DataType dataType = TypeFactory.createType(attributeElementType.getTypeElement().getName(),element.getMUID());
- setTypeOwnerId(idName(element.getName()));
- fbuffer.append(dataType.getRequestCode(element.getMUID(),getTypeOwnerId()));
-
- }
-
- TypeVisitor typeVisitor = new TypeVisitor();
- ResultFileTypeGenerator resultFileTypeGenerator = new ResultFileTypeGenerator(fbuffer);
- resultFileTypeGenerator.setNumberFactory(getNumberFactory());
- resultFileTypeGenerator.setTypeOwnerId(getTypeOwnerId());
-
- typeVisitor.run(attributeElementType,resultFileTypeGenerator);
- setNumberFactory(resultFileTypeGenerator.getNumberFactory());
- Vector setterInputs = resultFileTypeGenerator.getResidentVector();
- if(attributeElementType.getSetterMethod() == null) return new SimpleStatus("");
- putResidentVector(attributeElementType.getSetterSignature((String)setterInputs.firstElement()));
-
- return new SimpleStatus("");
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileGenerator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileGenerator.java
deleted file mode 100644
index 19faf6f..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileGenerator.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.MethodVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.BeanElement;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a MethodFilegenerator.
-* */
-public class ResultFileGenerator extends Generator
-{
- public static String TRIPLE_TAB = Generator.DOUBLE_TAB + Generator.TAB;
- public static String QUAD_TAB = Generator.DOUBLE_TAB + Generator.DOUBLE_TAB;
-
- private String setEndpointMethod;
-
- /**
- * Constructor.
- *
- */
- public ResultFileGenerator ()
- {
- super();
- }
-
- /**
- * Constructor.
- *
- */
- public ResultFileGenerator (StringBuffer buffer)
- {
- super(buffer);
- }
-
- //takes in a bean node
- public Status visit (Object object)
- {
- Element beanElement = (Element)object;
- BeanElement bean = (BeanElement)beanElement;
- fbuffer.append("<%@page contentType=\"text/html;charset=UTF-8\"%>");
- fbuffer.append("<HTML>" + StringUtils.NEWLINE);
- fbuffer.append("<HEAD>" + StringUtils.NEWLINE);
- fbuffer.append("<TITLE>Result</TITLE>" + StringUtils.NEWLINE);
- fbuffer.append("</HEAD>" + StringUtils.NEWLINE);
- fbuffer.append("<BODY>" + StringUtils.NEWLINE);
- fbuffer.append("<H1>Result</H1>" + StringUtils.NEWLINE + StringUtils.NEWLINE);
-
- fbuffer.append("<jsp:useBean id=\""+ getSessionBeanId() + "\" scope=\"session\" class=\"");
- fbuffer.append(bean.getName() + "\" />" + StringUtils.NEWLINE);
- if (setEndpointMethod != null && setEndpointMethod.length() > 0)
- {
- fbuffer.append("<%");
- fbuffer.append(StringUtils.NEWLINE);
- fbuffer.append("if (request.getParameter(\"endpoint\") != null && request.getParameter(\"endpoint\").length() > 0)");
- fbuffer.append(StringUtils.NEWLINE);
- fbuffer.append(getSessionBeanId());
- fbuffer.append(".");
- int index = setEndpointMethod.indexOf('?');
- if (index != -1)
- {
- fbuffer.append(setEndpointMethod.substring(0, index));
- fbuffer.append("(new ");
- fbuffer.append(setEndpointMethod.substring(index+1, setEndpointMethod.length()));
- fbuffer.append("(request.getParameter(\"endpoint\")));");
- }
- else
- {
- fbuffer.append(setEndpointMethod);
- fbuffer.append("(request.getParameter(\"endpoint\"));");
- }
- fbuffer.append(StringUtils.NEWLINE);
- fbuffer.append("%>");
- fbuffer.append(StringUtils.NEWLINE);
- }
- fbuffer.append(StringUtils.NEWLINE);
-
- //carry on with regular gorp
- fbuffer.append("<%" + StringUtils.NEWLINE);
- fbuffer.append("String method = request.getParameter(\"method\");" + StringUtils.NEWLINE);
- fbuffer.append("int methodID = 0;" + StringUtils.NEWLINE);
- fbuffer.append("if (method == null) methodID = -1;" + StringUtils.NEWLINE + "" + StringUtils.NEWLINE);
- fbuffer.append("if(methodID != -1) methodID = Integer.parseInt(method);" + StringUtils.NEWLINE);
- fbuffer.append("boolean gotMethod = false;" + StringUtils.NEWLINE + StringUtils.NEWLINE);
-
- fbuffer.append("try {" + StringUtils.NEWLINE);
- fbuffer.append("switch (methodID){ " + StringUtils.NEWLINE);
-
- // go to the next generator
- MethodVisitor methodVisitor = new MethodVisitor();
- ResultFileHelp1Generator resultFileHelp1Generator = new ResultFileHelp1Generator(fbuffer);
- resultFileHelp1Generator.setNumberFactory(getNumberFactory());
- resultFileHelp1Generator.setClientFolderPath(getClientFolderPath());
- methodVisitor.run(beanElement,resultFileHelp1Generator);
- setNumberFactory(resultFileHelp1Generator.getNumberFactory());
-
- fbuffer = resultFileHelp1Generator.getStringBuffer();
-
- fbuffer.append("}" + StringUtils.NEWLINE);
- fbuffer.append("} catch (Exception e) { " + StringUtils.NEWLINE);
- fbuffer.append("%>" + StringUtils.NEWLINE);
- fbuffer.append("exception: <%= e %>" + StringUtils.NEWLINE);
- fbuffer.append("<%" + StringUtils.NEWLINE);
- fbuffer.append("return;" + StringUtils.NEWLINE);
- fbuffer.append("}" + StringUtils.NEWLINE);
- fbuffer.append("if(!gotMethod){" + StringUtils.NEWLINE);
- fbuffer.append("%>" + StringUtils.NEWLINE);
- fbuffer.append("result: N/A" + StringUtils.NEWLINE);
- fbuffer.append("<%" + StringUtils.NEWLINE);
- fbuffer.append("}" + StringUtils.NEWLINE);
- fbuffer.append("%>" + StringUtils.NEWLINE);
- fbuffer.append("</BODY>" + StringUtils.NEWLINE);
- fbuffer.append("</HTML>");
-
- return new SimpleStatus("");
- }
-
- /**
- * @param setEndpointMethod The setEndpointMethod to set.
- */
- public void setSetEndpointMethod(String setEndpointMethod)
- {
- this.setEndpointMethod = setEndpointMethod;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileHelp1Generator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileHelp1Generator.java
deleted file mode 100644
index 30f5874..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileHelp1Generator.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.ParameterVisitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.ReturnParameterVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.DataType;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.MethodElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a ResultFilegenerator.
-* */
-public class ResultFileHelp1Generator extends ResultFileGenerator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public static final int INITIAL_STATE = 1;
- public static final int FINAL_STATE = 2;
- public static final String MTEMP = "mtemp";
- public static String BEAN = "Proxy";
-
- /**
- * keeps the state of the visitor
- * */
-
- private int fstate;
-
-
- /**
- * Constructor.
- * @param buffer StringBuffer object that this code generator writes to
- */
- public ResultFileHelp1Generator (StringBuffer buffer)
- {
- super(buffer);
- fstate = INITIAL_STATE;
-
- }
-
- /**
- * Visit Method generates code for this Visitor
- * @param method method code will be generated for
- */
- public Status visit (Object object)
- {
- Element methodElement = (Element)object;
-
-
- MethodElement method = (MethodElement)methodElement;
- if (method.getMethodOmmission()) return new SimpleStatus("");
-
- fbuffer.append("case " + method.getNumberID()+ ":" + StringUtils.NEWLINE);
- visitHelper(method);
-
- fbuffer.append("break;" + StringUtils.NEWLINE);
-
- return new SimpleStatus("");
- }
- /**
- * Helps out the visitor
- * @param method method code will be generated for
- */
- public void visitHelper (Element methodElement)
- {
-
- fbuffer.append(Generator.DOUBLE_TAB + "gotMethod = true;" + StringUtils.NEWLINE);
-
- MethodElement method = (MethodElement)methodElement;
- // go to the next generator
- ResultFileHelp2Generator resultFileHelp2Generator = new ResultFileHelp2Generator(fbuffer);
- resultFileHelp2Generator.setNumberFactory(getNumberFactory());
- ParameterVisitor parameterVisitor = new ParameterVisitor();
- parameterVisitor.run(methodElement,resultFileHelp2Generator);
- fbuffer = resultFileHelp2Generator.getStringBuffer();
- setNumberFactory(resultFileHelp2Generator.getNumberFactory());
- // we must now grab the state data from the resident vector
- setResidentVector(resultFileHelp2Generator.getResidentVector());
-
-
- //there is no return type if void occurs
-
-
- if (method.getReturnParameterElement().getTypeElement().getName().equals("void"))
- fbuffer.append(Generator.DOUBLE_TAB + getSessionBeanId() + "." +method.getName() + "(");
-
- else{
- fbuffer.append(Generator.DOUBLE_TAB + method.getReturnParameterElement().getTypeElement().getName() + Generator.SPACE + method.getMUID() + MTEMP + Generator.SPACE);
- fbuffer.append("=" + Generator.SPACE + getSessionBeanId() + "." + method.getName() + "(");
- }
-
- Enumeration e = fResidentVector.elements();
- while (e.hasMoreElements()){
- fbuffer.append((String)e.nextElement());
- if (e.hasMoreElements())
- fbuffer.append(",");
- }
- fbuffer.append(");" + StringUtils.NEWLINE);
- if (!method.getReturnParameterElement().getTypeElement().getName().equals("void") && !method.getReturnParameterElement().getTypeElement().isPrimitive()){
- //in case our result is null
- fbuffer.append("if(" + method.getMUID() + "mtemp == null){" + StringUtils.NEWLINE);
- fbuffer.append("%>" + StringUtils.NEWLINE);
- fbuffer.append("<%=" + method.getMUID() + "mtemp %>" + StringUtils.NEWLINE);
- fbuffer.append("<%" + StringUtils.NEWLINE);
- fbuffer.append("}else{" + StringUtils.NEWLINE);
- }
-
- //now lets display the return bean
- // if it is simple we dont need to use the generator
-
- if (!method.getReturnParameterElement().getTypeElement().getName().equals("void")){
- if (method.getReturnParameterElement().getTypeElement().isSimple()
- || TypeFactory.recognizedBean(method.getReturnParameterElement().getTypeElement().getName())
- || TypeFactory.isStateLessBean(method.getReturnParameterElement().getTypeElement().getTypeName())
- || TypeFactory.isRecognizedReturnType(method.getReturnParameterElement().getTypeElement().getTypeName())){
- DataType dataType = TypeFactory.createType(method.getReturnParameterElement().getTypeElement().getTypeName(),method.getReturnParameterElement().getMUID());
- fbuffer.append(dataType.TypeConversion(method.getMUID() + MTEMP));
- }
- else{
- fbuffer.append("%>" + StringUtils.NEWLINE);
- InputFileHelp2Generator inputFileHelp2Generator = new InputFileHelp2Generator(fbuffer);
- inputFileHelp2Generator.setInstanceName(method.getMUID() + MTEMP);
- inputFileHelp2Generator.setReturnParam(true);
- ReturnParameterVisitor returnParameterVisitor = new ReturnParameterVisitor();
- returnParameterVisitor.run(method,inputFileHelp2Generator);
- fbuffer = inputFileHelp2Generator.getStringBuffer();
- fbuffer.append("<%" + StringUtils.NEWLINE);
-
- }
- }
-
- if (!method.getReturnParameterElement().getTypeElement().getName().equals("void") && !method.getReturnParameterElement().getTypeElement().isPrimitive()) fbuffer.append("}" + StringUtils.NEWLINE);
-
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileHelp2Generator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileHelp2Generator.java
deleted file mode 100644
index a5e9ca6..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileHelp2Generator.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.TypeVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.DataType;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.ParameterElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-/**
-* Objects of this class represent a ResultFileHelp2generator.
-* */
-public class ResultFileHelp2Generator extends Generator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- private String fTypeOwnerId;
-
-
- /**
- * Constructor.
- * @param buffer StringBuffer object that this code generator writes to
- */
- public ResultFileHelp2Generator (StringBuffer buffer)
- {
- super(buffer);
-
- }
-
- /**
- * Visit Method generates code for this Visitor
- * @param Parameter parameter code will be generated
- */
- public Status visit (Object object)
- {
-
-
- ParameterElement parameterElement = (ParameterElement)object;
- Element element= parameterElement.getTypeElement();
- if(parameterElement.getTypeElement().isSimple() || TypeFactory.recognizedBean(parameterElement.getTypeElement().getName())){
- //start the codegen
- //ask the datatype for its request line, it may need mark up or not.
- //ie For the simple types we need the mark up
- //for the dom element we cant use it.
- DataType dataType = TypeFactory.createType(parameterElement.getTypeElement().getName(),parameterElement.getMUID());
- setTypeOwnerId(idName(parameterElement.getName()));
- fbuffer.append(dataType.getRequestCode(parameterElement.getMUID(),getTypeOwnerId()));
- }
-
- //visit the type generator
- ResultFileTypeGenerator resultFileTypeGenerator = new ResultFileTypeGenerator(fbuffer);
- resultFileTypeGenerator.setNumberFactory(getNumberFactory());
- resultFileTypeGenerator.setTypeOwnerId(getTypeOwnerId());
- TypeVisitor TypeVisitor = new TypeVisitor();
- TypeVisitor.run(parameterElement,resultFileTypeGenerator);
- fbuffer = resultFileTypeGenerator.getStringBuffer();
- setNumberFactory(resultFileTypeGenerator.getNumberFactory());
- String name = (String)resultFileTypeGenerator.getResidentVector().firstElement();
- putResidentVector(name);
-
- return new SimpleStatus("");
- }
-
-
- public String getTypeOwnerId()
- {
- if (fTypeOwnerId == null) fTypeOwnerId = "";
- return fTypeOwnerId;
- }
-
- public void setTypeOwnerId(String name)
- {
- fTypeOwnerId = name;
- }
-
- public String idName(String name)
- {
-
- String uniqueNum = String.valueOf(getUniqueNumber());
- String newName = name.replace('.','1') + "_" +uniqueNum + "id";
- return newName;
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileTypeGenerator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileTypeGenerator.java
deleted file mode 100644
index 2470ce9..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/ResultFileTypeGenerator.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import java.util.Enumeration;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.AttributeVisitor;
-import org.eclipse.jst.ws.internal.consumption.codegen.bean.FieldVisitor;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.DataType;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeElement;
-import org.eclipse.jst.ws.internal.consumption.datamodel.beanmodel.TypeFactory;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-/**
-* Objects of this class represent a ResultFileHelp2generator.
-* */
-public class ResultFileTypeGenerator extends ResultFileHelp2Generator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
-
- public String fTypeIdName;
-
- /**
- * Constructor.
- * @param buffer StringBuffer object that this code generator writes to
- */
- public ResultFileTypeGenerator (StringBuffer buffer)
- {
- super(buffer);
- }
-
- /**
- * Visit Method generates code for this Visitor
- * @param Parameter parameter code will be generated
- */
- public Status visit (Object object)
- {
- Element typeElement = (Element)object;
- TypeElement type = (TypeElement)typeElement;
- // right now we only have simple to worry about
- if(type.isSimple() || TypeFactory.recognizedBean(type.getName())){
- // create the type that represents the simple type name
- DataType dataType = TypeFactory.createType(type.getName(),type.getOwningElement().getMUID());
-
- String nodeName = getTypeOwnerId()+ "Temp";
- fbuffer.append(dataType.stringConversion(type.getName(),nodeName,getTypeOwnerId()));
-
- putResidentVector(nodeName);
- }
-
- else {
- //must be complex
- String typeName = typeElement.getName();
- fTypeIdName = idName(typeName);
-
- AttributeVisitor attributeVisitor = new AttributeVisitor();
- ResultFileAttributeGenerator resultFileAttributeGenerator = new ResultFileAttributeGenerator(fbuffer);
- resultFileAttributeGenerator.setNumberFactory(getNumberFactory());
- attributeVisitor.run(typeElement,resultFileAttributeGenerator);
- setNumberFactory(resultFileAttributeGenerator.getNumberFactory());
- fbuffer = resultFileAttributeGenerator.getStringBuffer();
-
- FieldVisitor fieldVisitor = new FieldVisitor();
- ResultFileAttributeGenerator resultFileAttributeGenerator2 = new ResultFileAttributeGenerator(fbuffer);
- resultFileAttributeGenerator2.setNumberFactory(getNumberFactory());
- fieldVisitor.run(typeElement,resultFileAttributeGenerator2);
- setNumberFactory(resultFileAttributeGenerator2.getNumberFactory());
- fbuffer = resultFileAttributeGenerator2.getStringBuffer();
-
-
- fbuffer.append(Generator.DOUBLE_TAB + "%>" + StringUtils.NEWLINE);
- fbuffer.append(Generator.DOUBLE_TAB + "<jsp:useBean id=\"" + fTypeIdName + "\" scope=\"session\" class=\"" + typeName + "\" />" + StringUtils.NEWLINE);
- fbuffer.append(Generator.DOUBLE_TAB + "<%" + StringUtils.NEWLINE);
-
- Enumeration e = resultFileAttributeGenerator.getResidentVector().elements();
- while(e.hasMoreElements()){
- fbuffer.append(Generator.DOUBLE_TAB + fTypeIdName + "." + e.nextElement() + StringUtils.NEWLINE);
- }
-
- Enumeration e2 = resultFileAttributeGenerator2.getResidentVector().elements();
- while(e2.hasMoreElements()){
- fbuffer.append(Generator.DOUBLE_TAB + fTypeIdName + "." + e2.nextElement() + StringUtils.NEWLINE);
- }
- putResidentVector(fTypeIdName);
- //end of changes
-
- }
-
- return new SimpleStatus("");
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/TestClientFileGenerator.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/TestClientFileGenerator.java
deleted file mode 100644
index b7d5036..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/codegen/TestClientFileGenerator.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.sampleapp.codegen;
-
-import org.eclipse.jst.ws.internal.common.StringUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
-* Objects of this class represent a TestClientFilegenerator.
-* */
-public class TestClientFileGenerator extends Generator
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- public String fMethodName;
- public String fInputName;
- public String fResultName;
-
- /**
- * Constructor.
- *
- */
- public TestClientFileGenerator (String inputs, String methods, String results)
- {
- super();
- fInputName = inputs;
- fMethodName = methods;
- fResultName = results;
- }
-
- public void setFileNames(String inputs, String methods, String results)
- {
- fInputName = inputs;
- fMethodName = methods;
- fResultName = results;
- }
-
- //takes in a bean node
- public Status visit (Object object)
- {
- Element beanElement = (Element)object;
-
- fbuffer.append("<%@page contentType=\"text/html;charset=UTF-8\"%>");
- fbuffer.append("<HTML>" + StringUtils.NEWLINE);
- fbuffer.append("<HEAD>" + StringUtils.NEWLINE);
- fbuffer.append("<TITLE>Web Services Test Client</TITLE>" + StringUtils.NEWLINE);
- fbuffer.append("</HEAD>" + StringUtils.NEWLINE + "");
- fbuffer.append("<FRAMESET COLS=\"220,*\">" + StringUtils.NEWLINE);
- fbuffer.append("<FRAME SRC=\""+ fMethodName + "\" NAME=\"methods\" MARGINWIDTH=\"1\" MARGINHEIGHT=\"1\" SCROLLING=\"yes\" FRAMEBORDER=\"1\">" + StringUtils.NEWLINE);
- fbuffer.append("<FRAMESET ROWS=\"80%,20%\">" + StringUtils.NEWLINE);
- fbuffer.append("<FRAME SRC=\""+ fInputName + "\" NAME=\"inputs\" MARGINWIDTH=\"1\" MARGINHEIGHT=\"1\" SCROLLING=\"yes\" FRAMEBORDER=\"1\">" + StringUtils.NEWLINE);
- fbuffer.append("<%").append(StringUtils.NEWLINE);
- fbuffer.append("StringBuffer resultJSP = new StringBuffer(\"").append(fResultName).append("\");").append(StringUtils.NEWLINE);
- fbuffer.append("resultJSP.append(\"?\");").append(StringUtils.NEWLINE);
- fbuffer.append("java.util.Enumeration resultEnum = request.getParameterNames();");
- fbuffer.append("while (resultEnum.hasMoreElements()) {").append(StringUtils.NEWLINE);
- fbuffer.append("Object resultObj = resultEnum.nextElement();").append(StringUtils.NEWLINE);
- fbuffer.append("resultJSP.append(resultObj.toString()).append(\"=\").append(request.getParameter(resultObj.toString())).append(\"&\");").append(StringUtils.NEWLINE);
- fbuffer.append("}").append(StringUtils.NEWLINE);
- fbuffer.append("%>").append(StringUtils.NEWLINE);
- fbuffer.append("<FRAME SRC=\"<%=resultJSP.toString()%>\" NAME=\"result\" MARGINWIDTH=\"1\" MARGINHEIGHT=\"1\" SCROLLING=\"yes\" FRAMEBORDER=\"1\">" + StringUtils.NEWLINE);
- fbuffer.append("</FRAMESET>" + StringUtils.NEWLINE);
-
-
- fbuffer.append("<NOFRAMES>" + StringUtils.NEWLINE);
- fbuffer.append("<BODY>" + StringUtils.NEWLINE);
- fbuffer.append("The Web Services Test Client requires a browser that supports frames." + StringUtils.NEWLINE);
- fbuffer.append("</BODY>" + StringUtils.NEWLINE);
- fbuffer.append("</NOFRAMES>" + StringUtils.NEWLINE);
- fbuffer.append("</FRAMESET>" + StringUtils.NEWLINE);
- fbuffer.append("</HTML>");
-
- return new SimpleStatus("");
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/command/GeneratePageCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/command/GeneratePageCommand.java
deleted file mode 100644
index e407fd1..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/command/GeneratePageCommand.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.sampleapp.command;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jst.ws.internal.consumption.codegen.Generator;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-import org.eclipse.wst.command.env.common.FileResourceUtils;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-
-
-/**
- * MofToBeanModelCommand
- * Creation date: (4/10/2001 12:41:48 PM)
- * @author: Gilbert Andrews
- */
-public class GeneratePageCommand extends SimpleCommand {
-
-private String LABEL = "GeneratePageCommand";
-private String DESCRIPTION = "Generate code based on the model";
-private MessageUtils msgUtils_;
-
-private Model model_;
-private Generator fGenerator;
-private IFile fIFile;
-private ResourceContext resourceContext_;
-private StringBuffer fStringBuffer;
-
-private Element rootElement_;
-/**
- * Build constructor comment.
- */
-public GeneratePageCommand()
-{
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- setDescription(DESCRIPTION);
- setName(LABEL);
-}
-
-/**
-* Constructor
-* This command will generate code from a Model
-* @param model The model to be traversed
-* @param generator The code generator to be used
-* @param resource the resource to place the finished product
-*/
-public GeneratePageCommand(ResourceContext context, Model model, Generator generator, IFile file)
-{
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- setDescription(DESCRIPTION);
- setName(LABEL);
-
- model_ = model;
- fGenerator = generator;
- fIFile = file;
- resourceContext_ = context;
-}
-
-public Model getDataModel()
-{
- return model_;
-}
-
-/**
- *
- */
-public Status execute(Environment env)
-{
- Status status = new SimpleStatus( "" );
- try {
- fGenerator.visit(model_.getRootElement());
- fStringBuffer = fGenerator.getStringBuffer();
- String tempString = fStringBuffer.toString();
- OutputStream fileResource = FileResourceUtils.newFileOutputStream(resourceContext_, fIFile.getFullPath(), env.getProgressMonitor(), env.getStatusHandler());
- //PrintStream ps = new PrintStream(fileResource);
- //ps.print(tempString);
- OutputStreamWriter osw = new OutputStreamWriter(fileResource,"UTF-8");
- osw.write(tempString,0,fStringBuffer.length());
- osw.close();
- fileResource.close();
- return status;
- } catch (IOException ioexc) {
- status = new SimpleStatus("", ioexc.getMessage(), Status.ERROR);
- return status;
- }
-}
-
-public void setRootElement(Element rootElement)
-{
- rootElement_ = rootElement;
-}
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/command/JavaToModelCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/command/JavaToModelCommand.java
deleted file mode 100644
index 06d24df..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/command/JavaToModelCommand.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.sampleapp.command;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitoractions.JavaMofBeanVisitorAction;
-import org.eclipse.jst.ws.internal.consumption.codegen.javamofvisitors.JavaMofBeanVisitor;
-import org.eclipse.jst.ws.internal.consumption.command.common.JavaMofReflectionCommand;
-import org.eclipse.jst.ws.internal.datamodel.Element;
-import org.eclipse.jst.ws.internal.datamodel.Model;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Choice;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.BooleanSelection;
-
-/**
-* This is the base class for commands that need to report progress
-* and status during and after their execution. This class extends
-* {@link org.eclipse.emf.common.command.AbstractCommand AbstractCommand}
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-* with methods to {@link #setProgressMonitor set}
-* and {@link #getProgressMonitor get} a progress monitor,
-* and to get a status object {@link #getReadyStatus before}
-* or {@link #getResultStatus after} execution.
-* <p>
-* Note that the responsibility of providing an
-* {@link org.eclipse.core.runtime.IProgressMonitor IProgressMonitor}
-* rests with frameworks that construct or run ProgressCommand objects,
-* whereas the responsibility of providing an
-* {@link org.eclipse.core.runtime.IStatus IStatus}
-* object lies with the subclasses of ProgressCommand.
-* Subclasses must follow the rules described for
-* {@link org.eclipse.emf.common.command.AbstractCommand AbstractCommand}.
-*/
-public class JavaToModelCommand extends SimpleCommand
-{
- private MessageUtils msgUtils;
- private IResource resource;
- private String clientProject;
- private BooleanSelection[] methods;
- private String proxyBean;
- private JavaClass javaClass;
- private Model model;
- private Element parentElement;
- private IProject project;
-
- public static String LABEL = "JavaToModelCommand";
- public static String DESCRIPTION = "this creates a model from a resource";
-
-
-
- public JavaToModelCommand ()
- {
- String pluginId = "org.eclipse.jst.ws.consumption";
- msgUtils = new MessageUtils(pluginId + ".plugin", this);
- setDescription(DESCRIPTION);
- setName(LABEL);
- }
-
-
- private Status createJavaReflection(Environment env)
- {
- Status status = new SimpleStatus("");
- JavaMofReflectionCommand javaMofReflectionCommand = new JavaMofReflectionCommand();
- javaMofReflectionCommand.setClientProject(clientProject);
- javaMofReflectionCommand.setProxyBean(proxyBean);
- //javaMofReflectionCommand.setStatusMonitor(getStatusMonitor());
- status = javaMofReflectionCommand.execute(env);
- javaClass = (JavaClass)javaMofReflectionCommand.getJavaClass();
- return status;
- }
-
- /**
- * The Model that was created from this javamof
- * @return Model The data model that was created
- **/
- public Model getDataModel()
- {
- return model;
- }
-
- /**
- * Build the datamodel from the mof
- */
- public Status buildModelFromMof (Environment env) throws CoreException
- {
-
- Choice OKChoice = new Choice('O', msgUtils.getMessage("LABEL_OK"), msgUtils.getMessage("DESCRIPTION_OK"));
- Choice CancelChoice = new Choice('C', msgUtils.getMessage("LABEL_CANCEL"), msgUtils.getMessage("DESCRIPTION_CANCEL"));
-
- // we could have one of three cases:
- //1. The model is null meaning we want and the parent element is null, meaning we want to
- // create a brand new model and make this bean its root
- //2. The model is null but the parentElement is not, meaning we want to add the Bean to the
- // given parent element
- //3. The model is not null however the parentElement is, meaning we want to add this Bean to
- // This model but dont attach it to anything
- Status status = new SimpleStatus("");
-
- if(model == null && parentElement == null){
- JavaMofBeanVisitorAction beanVisitorAction = new JavaMofBeanVisitorAction(clientProject,methods, env);
- //beanVisitorAction.setStatusMonitor(getStatusMonitor());
- JavaMofBeanVisitor beanVisitor = new JavaMofBeanVisitor();
- status = beanVisitor.run(javaClass,beanVisitorAction);
- //
- int severity = status.getSeverity();
- if (severity==Status.ERROR)
- return status;
-
- if (severity==Status.WARNING)
- {
- Choice result = env.getStatusHandler().report(status, new Choice[]{OKChoice, CancelChoice});
- if (result.getLabel().equals(CancelChoice.getLabel()))
- {
- //return an error status since the user canceled
- return new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_SAMPLE_CREATION_CANCELED"), Status.ERROR);
- }
-
- }
- //
- model = beanVisitorAction.getModel();
-
- }
- else if (model == null && parentElement != null){
- JavaMofBeanVisitorAction beanVisitorAction = new JavaMofBeanVisitorAction(parentElement,clientProject, env);
- //beanVisitorAction.setStatusMonitor(getStatusMonitor());
- JavaMofBeanVisitor beanVisitor = new JavaMofBeanVisitor();
- status = beanVisitor.run(javaClass,beanVisitorAction);
- //
- int severity = status.getSeverity();
- if (severity==Status.ERROR)
- return status;
-
- if (severity==Status.WARNING)
- {
- Choice result = env.getStatusHandler().report(status, new Choice[]{OKChoice, CancelChoice});
- if (result.getLabel().equals(CancelChoice.getLabel()))
- {
- //return an error status since the user canceled
- return new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_SAMPLE_CREATION_CANCELED"), Status.ERROR);
- }
-
- }
- //
- model = beanVisitorAction.getModel();
- }
- else {
- JavaMofBeanVisitorAction beanVisitorAction = new JavaMofBeanVisitorAction(model,clientProject, env);
- //beanVisitorAction.setStatusMonitor(getStatusMonitor());
- JavaMofBeanVisitor beanVisitor = new JavaMofBeanVisitor();
- status = beanVisitor.run(javaClass,beanVisitorAction);
- //
- int severity = status.getSeverity();
- if (severity==Status.ERROR)
- return status;
-
- if (severity==Status.WARNING)
- {
- Choice result = env.getStatusHandler().report(status, new Choice[]{OKChoice, CancelChoice});
- if (result.getLabel().equals(CancelChoice.getLabel()))
- {
- //return an error status since the user canceled
- return new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_SAMPLE_CREATION_CANCELED"), Status.ERROR);
- }
-
- }
- //
- model = beanVisitorAction.getModel();
- }
-
- return status;
- }
-
- /**
- * Get the java model from the resource then
- * build the model from the mof
- */
- public Status execute(Environment env)
- {
- Status status = new SimpleStatus("");
- if(clientProject == null) return status;
- IProject project = (IProject)ResourceUtils.findResource(clientProject);
-
- status = createJavaReflection(env);
- if (status.getSeverity()==Status.ERROR) return status;
- try{
- status = buildModelFromMof(env);
- return status;
- }catch(CoreException exc){
- IStatus embeddedStatus = exc.getStatus();
- status = EnvironmentUtils.convertIStatusToStatus(embeddedStatus);
- return status;
- }
-
- }
-
- public void setMethods(BooleanSelection[] methods)
- {
- this.methods = methods;
- }
-
- public void setClientProject(String clientProject)
- {
- this.clientProject = clientProject;
- }
-
- public void setParentElement(Element parentElement)
- {
- this.parentElement = parentElement;
- }
-
- public void setProxyBean(String proxyBean)
- {
- this.proxyBean = proxyBean;
- }
-
- }
-
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/common/SamplePropertyDescriptor.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/common/SamplePropertyDescriptor.java
deleted file mode 100644
index 74f4b01..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/sampleapp/common/SamplePropertyDescriptor.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.sampleapp.common;
-
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.Method;
-
-
-/**
-* Objects of this class represent a PropertyDescriptor.
-* */
-public class SamplePropertyDescriptor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
-
- private Method fReadMethod;
- private Method fWriteMethod;
- private String fPropertyName;
- private JavaHelpers fPropertyType;
- private boolean fStatic;
-
- /*
- * Constructor
- **/
- public SamplePropertyDescriptor(String name)
- {
- fPropertyName = name;
- }
-
- /*
- * set the ReadMethod
- */
- public void setReadMethod(Method readMethod)
- {
- fReadMethod = readMethod;
- }
-
- /*
- * get the ReadMethod
- */
- public Method getReadMethod()
- {
- return fReadMethod;
- }
-
- /*
- * set the writeMethod
- */
- public void setWriteMethod(Method writeMethod)
- {
- fWriteMethod = writeMethod;
- }
-
- /*
- * get the writeMethod
- */
- public Method getWriteMethod()
- {
- return fWriteMethod;
- }
-
- /*
- * set the propertyName
- */
- public void setName(String name)
- {
- fPropertyName= name;
- }
-
- /*
- * get the propertyName
- */
- public String getName()
- {
- return fPropertyName;
- }
-
- /*
- * set the PropertyType
- */
- public void setPropertyType(JavaHelpers propertyType)
- {
- fPropertyType = propertyType;
- }
-
- /*
- * get the PropertyType
- */
- public JavaHelpers getPropertyType()
- {
- return fPropertyType;
- }
-
- public boolean isfStatic()
- {
- return fStatic;
- }
-
- public void setfStatic(boolean fStatic)
- {
- this.fStatic = fStatic;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/util/WSDLUtils.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/util/WSDLUtils.java
deleted file mode 100644
index af76828..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/util/WSDLUtils.java
+++ /dev/null
@@ -1,531 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.util;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.Collator;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import javax.wsdl.Binding;
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.internal.impl.wsdl4j.WSDLFactoryImpl;
-
-public class WSDLUtils {
-
- private static final String DOT = ".";
- private static final String SLASH = "/";
- private static final String PROTOCOL_SUFFIX = "://";
-
- /**
- * Tokens in a namespace that are treated as package name part separators.
- * Used by normalizePackageName.
- */
- private static final char[] pkgSeparators = { ':', '\\', '/' };
-
- /**
- * These are java keywords as specified at the following URL (sorted alphabetically).
- * http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#229308
- * Note that false, true, and null are not strictly keywords; they are literal values,
- * but for the purposes of this array, they can be treated as literals.
- */
- static final String keywords[] =
- {
- "abstract", "boolean", "break", "byte", "case",
- "catch", "char", "class", "const", "continue",
- "default", "do", "double", "else", "extends",
- "false", "final", "finally", "float", "for",
- "goto", "if", "implements", "import", "instanceof",
- "int", "interface", "long", "native", "new",
- "null", "package", "private", "protected", "public",
- "return", "short", "static", "strictfp", "super",
- "switch", "synchronized", "this", "throw", "throws",
- "transient", "true", "try", "void", "volatile",
- "while"
- };
-
- /** Collator for comparing the strings */
- static final Collator englishCollator = Collator.getInstance(Locale.ENGLISH);
-
- /** Use this character as suffix */
- static final char keywordPrefix = '_';
-
- private WSDLUtils() {
- }
-
- /**
- * Returns the name of the first service element in the WSDL definition.
- * @return String service element name
- */
- public static String getServiceElementName(Definition definition) {
- Service service = (Service) definition.getServices().values().iterator().next();
- return service.getQName().getLocalPart();
- }
-
- /**
- * Returns the name of the port type element points to by the first service and port element in the WSDL definition.
- * @return String port type element name
- */
- public static String getPortTypeName(Definition definition) {
- Service service = (Service) definition.getServices().values().iterator().next();
- Iterator iterator = service.getPorts().values().iterator();
- while(iterator.hasNext()){
- Port port = (Port) iterator.next();
- for (int i=0; i<port.getExtensibilityElements().size();i++) {
- if (port.getExtensibilityElements().get(i) instanceof SOAPAddress) {
- Binding binding = port.getBinding();
- return binding.getPortType().getQName().getLocalPart();
- }
- }
- }
- return "";
-
- }
-
- /**
- * Returns the name of the port element in the WSDL definition.
- * @return String port name
- */
- public static String getPortName(Definition definition) {
- Service service = (Service) definition.getServices().values().iterator().next();
- Iterator iterator = service.getPorts().values().iterator();
- while(iterator.hasNext()){
- Port port = (Port) iterator.next();
- for (int i=0; i<port.getExtensibilityElements().size();i++) {
- if (port.getExtensibilityElements().get(i) instanceof SOAPAddress)
- return port.getName();
- }
- }
- return "";
- }
-
-
-
- public static String makeNamespace (String clsName) {
- return makeNamespace(clsName, "http");
- }
-
- /**
- * Make namespace from a fully qualified class name
- * and the given protocol
- *
- * @param clsName fully qualified class name
- * @param protocol protocol String
- * @return namespace namespace String
- */
- public static String makeNamespace (String clsName, String protocol) {
- if (clsName.lastIndexOf('.') == -1)
- return protocol + "://" + "DefaultNamespace";
- String packageName = clsName.substring(0, clsName.lastIndexOf('.'));
- return makeNamespaceFromPackageName(packageName, protocol);
- }
-
-
- private static String makeNamespaceFromPackageName(String packageName, String protocol) {
- if (packageName == null || packageName.equals(""))
- return protocol + "://" + "DefaultNamespace";
- StringTokenizer st = new StringTokenizer( packageName, "." );
- String[] words = new String[ st.countTokens() ];
- for(int i = 0; i < words.length; ++i)
- words[i] = st.nextToken();
-
- StringBuffer sb = new StringBuffer(80);
- for(int i = words.length-1; i >= 0; --i) {
- String word = words[i];
- // seperate with dot
- if( i != words.length-1 )
- sb.append('.');
- sb.append( word );
- }
- return protocol + "://" + sb.toString();
- }
-
- /**
- * Return a Definition for the wsdl url given
- *
- */
- public static Definition getWSDLDefinition(String wsdlURL)
- {
- if(wsdlURL == null) return null;
-
- WSDLFactory wsdlFactory;
- Definition definition = null;
- String wsdlLocation = null;
- try {
- wsdlFactory = new WSDLFactoryImpl();
- WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
- definition = wsdlReader.readWSDL(wsdlURL);
- }
- catch (Exception e) { // can be WSDLException or IOException
- return null;
- }
- return definition;
- }
-
- public static String getPackageName(Definition definition)
- {
- if (definition != null)
- {
- String namespace = definition.getTargetNamespace();
- return namespaceURI2PackageName(namespace);
- }
- return "";
- }
-
- public static String getPackageNameForBindingImpl(Port port, Map ns2pkgMap)
- {
- if (port != null && ns2pkgMap != null)
- {
- Binding binding = port.getBinding();
- QName bndQName = binding.getQName();
- String namespace = bndQName.getNamespaceURI();
- Object pkg = ns2pkgMap.get(namespace);
- if (pkg != null)
- return (String)pkg;
- }
- return getPackageNameForBindingImpl(port);
- }
-
- public static String getPackageNameForBindingImpl(Definition definition, Map ns2pkgMap)
- {
- if (definition != null && ns2pkgMap != null)
- {
- Service service = (Service) definition.getServices().values().iterator().next();
- Port port = (Port) service.getPorts().values().iterator().next();
- return getPackageNameForBindingImpl(port, ns2pkgMap);
- }
- return getPackageNameForBindingImpl(definition);
- }
-
- public static String getPackageNameForBindingImpl(Definition definition)
- {
- Port port = null;
- if (definition != null)
- {
- Service service = (Service)definition.getServices().values().iterator().next();
- port = (Port)service.getPorts().values().iterator().next();
- }
- return getPackageNameForBindingImpl(port);
- }
-
-// This is yet another naming algorithm based on webservices.jar
-// They always use the binding namespace as the package name
-// of the BindingImpl class.
-public static String getPackageNameForBindingImpl(Port port)
-{
- if (port != null)
- {
- Binding binding = port.getBinding();
-// PortType portType = binding.getPortType();
- QName bndQName = binding.getQName();
- String namespace = bndQName.getNamespaceURI();
- return namespaceURI2PackageName(namespace);
- }
- return "";
-}
-
-/**
-* Get the namespace for the Port Type
-*
-*/
-public static String getPortTypeNamespace(Definition definition)
-{
- String namespace = "";
- if (definition != null)
- {
- Service service = (Service) definition.getServices().values().iterator().next();
- Iterator iterator = service.getPorts().values().iterator();
- while(iterator.hasNext()){
- Port port = (Port) iterator.next();
- for (int i=0; i<port.getExtensibilityElements().size();i++) {
- if (port.getExtensibilityElements().get(i) instanceof SOAPAddress){
- PortType portType = port.getBinding().getPortType();
- QName bndQName = portType.getQName();
- namespace = bndQName.getNamespaceURI();
- }
- }
- }
- }
- return namespace;
-}
-
-// This is yet another naming algorithm based on webservices.jar
-// They always use the porttype namespace as the package name
-// of the Java class (in ejb).
-public static String getPackageNameForPortType(Definition definition)
-{
- if (definition != null)
- {
- String namespace = getPortTypeNamespace(definition);
- return namespaceURI2PackageName(namespace);
- }
- return "";
-}
-
- /**
- * checks if the input string is a valid java keyword.
- * @return boolean true/false
- */
- public static boolean isJavaKeyword(String keyword) {
- return (Arrays.binarySearch(keywords, keyword, englishCollator) >= 0);
- }
-
- /**
- * Turn a java keyword string into a non-Java keyword string. (Right now
- * this simply means appending an underscore.)
- */
- public static String makeNonJavaKeyword(String keyword){
- return keywordPrefix + keyword;
- }
-
- public static String getFullyQualifiedPortTypeName(Definition definition)
- {
- StringBuffer beanName = new StringBuffer();
- beanName.append(getPackageNameForPortType(definition));
- beanName.append(DOT);
- beanName.append(getPortTypeName(definition));
- return beanName.toString();
-
- }
-
- /**
- * getName
- * @param uri String
- * @return get the file name after the last \ and /
- */
- public static String getName(String uri) {
-
- // Get everything after last slash or backslash
- int bslash = uri.lastIndexOf("\\");
- int slash = uri.lastIndexOf("/");
- int i = bslash > slash ? bslash : slash;
- String fileName = uri.substring(i+1).replace('?', '.');
-
- return fileName;
- }
-
-
-/**
- * getWSDLName
- * @param uri String
- * @return get the file name after the last \ and /, trimmed, defaulted to
- * "default.wsdl" if there is no name, and ending with ".wsdl".
- */
- public static String getWSDLName(String uri) {
-
- // Get everything after last slash or backslash from input URI
- // with no whitespace.
- String WSDLName = getName(uri).trim();
-
- // if empty, return the default "default.wsdl"
- if ( WSDLName.equals( "" ) ) {
- WSDLName = "default.wsdl";
- }
-
- // make sure name ends with ".wsdl", lower case.
- else {
- if ( ! WSDLName.endsWith( ".wsdl" ) ) {
- if ( WSDLName.toLowerCase().endsWith( ".wsdl" ) ) {
- int lastDot = WSDLName.lastIndexOf(".");
- WSDLName = WSDLName.substring( 0, lastDot ) + ".wsdl";
- }
- else {
- WSDLName = WSDLName + ".wsdl";
- }
- }
- }
-
- return WSDLName;
- }
-
- /**
- * getPortTypeNameFromBeanName
- * @param beanname String
- * @return get the port type name based on the bean name
- */
- public static String getPortTypeNameFromBeanName(String beanName) {
- return beanName.substring(beanName.lastIndexOf('.') + 1);
- }
-
- public static String getPackageName(Service service, Map ns2pkgMap)
- {
- if (service != null)
- {
- String namespace = service.getQName().getNamespaceURI();
- if (ns2pkgMap != null)
- {
- Object pkg = ns2pkgMap.get(namespace);
- if (pkg != null)
- return (String)pkg;
- }
- return namespaceURI2PackageName(namespace);
- }
- else
- return "";
- }
-
- public static String getPackageName(Port port, Map ns2pkgMap)
- {
- if (port != null)
- return getPackageName(port.getBinding(), ns2pkgMap);
- else
- return "";
- }
-
- public static String getPackageName(Binding binding, Map ns2pkgMap)
- {
- if (binding != null)
- {
- String namespace = binding.getQName().getNamespaceURI();
- if (ns2pkgMap != null)
- {
- Object pkg = ns2pkgMap.get(namespace);
- if (pkg != null)
- return (String)pkg;
- }
- return namespaceURI2PackageName(namespace);
- }
- else
- return "";
- }
-
- public static String getPackageName(PortType portType, Map ns2pkgMap)
- {
- if (portType != null)
- {
- String namespace = portType.getQName().getNamespaceURI();
- if (ns2pkgMap != null)
- {
- Object pkg = ns2pkgMap.get(namespace);
- if (pkg != null)
- return (String)pkg;
- }
- return namespaceURI2PackageName(namespace);
- }
- else
- return "";
- }
-
-
- /**
- * namespaceURI2PackageName
- * @param namespaceURI
- * @return package name based on namespace
- */
- public static String namespaceURI2PackageName(String namespaceURI)
- {
- StringBuffer sb = new StringBuffer(80);
- if (namespaceURI != null && namespaceURI.length() > 0)
- {
- String hostname = null;
- try
- {
- hostname = new URL(namespaceURI).getHost();
- }
- catch (MalformedURLException e)
- {
- int index = namespaceURI.indexOf(":");
- if (index > -1)
- {
- hostname = namespaceURI.substring(index+1);
- index = hostname.indexOf("/");
- if (index > -1)
- hostname = hostname.substring(0, index);
- }
- else
- hostname = namespaceURI;
- }
-
- // if we didn't file a hostname, bail
- if (hostname == null) {
- return null;
- }
-
- //convert illegal java identifier
- hostname = hostname.replace('-', '_');
- // tokenize the hostname and reverse it
- StringTokenizer st = new StringTokenizer(hostname, ".");
- String[] words = new String[st.countTokens()];
- for (int i = 0; i < words.length; ++i)
- words[i] = st.nextToken();
- for(int i = words.length-1; i >= 0; --i)
- {
- String word = words[i];
- if (isJavaKeyword(word))
- word = makeNonJavaKeyword(word);
- // seperate with dot
- if (i != words.length-1)
- sb.append('.');
- // convert digits to underscores
- if (Character.isDigit(word.charAt(0)))
- sb.append('_');
- sb.append(word);
- }
- }
- return normalizePackageName(sb.toString(), DOT.charAt(0));
- }
-
- /**
- * normalizePackageName
- * @param pkg
- * @param separator
- * @return normalize a String (package name) and repalcing
- * ':', '\\', '/' by separator (DOT).
- */
- private static String normalizePackageName(String pkg, char separator)
- {
- if (pkg == null) {
- return pkg;
- }
- for(int i=0; i<pkgSeparators.length; i++)
- pkg = pkg.replace(pkgSeparators[i], separator);
- return pkg;
- }
-
- public static String resolveDotInPortName(String name) {
- if(name.indexOf(".")<0)
- {
- return name;
- }
- StringBuffer sb = new StringBuffer();
- boolean afterDot = false;
- for(int i=0; i<name.length(); i++)
- {
- if(name.charAt(i)=='.')
- {
- afterDot = true;
- }
- else if(afterDot)
- {
- sb.append(name.substring(i,i+1).toUpperCase());
- afterDot=false;
- }
- else
- {
- sb.append(name.charAt(i));
- }
- }
- return sb.toString();
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/IWSFinder.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/IWSFinder.java
deleted file mode 100644
index 7ea7ff5..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/IWSFinder.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.wsfinder;
-
-import java.util.List;
-
-public interface IWSFinder
-{
- public String getID();
- public void setID(String id);
-
- public String getName();
- public void setName(String name);
-
- public String getDescription();
- public void setDescription(String desc);
-
- public List find();
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/LiveWSDLFilter.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/LiveWSDLFilter.java
deleted file mode 100644
index 71ae493..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/LiveWSDLFilter.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.wsfinder;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.http.HTTPAddress;
-import javax.wsdl.extensions.soap.SOAPAddress;
-
-import org.eclipse.wst.ws.parser.discovery.WebServicesParserExt;
-import org.eclipse.wst.ws.parser.wsil.WWWAuthenticationException;
-
-public class LiveWSDLFilter extends Thread
-{
- private String wsdlURL_;
- private boolean finish_;
- private boolean live_;
-
- public LiveWSDLFilter(String wsdlURL)
- {
- wsdlURL_ = wsdlURL;
- finish_ = false;
- live_ = false;
- }
-
- public String getWSDLURL()
- {
- return wsdlURL_;
- }
-
- public boolean isFinish()
- {
- return finish_;
- }
-
- public boolean isWSDLLive()
- {
- return live_;
- }
-
- public void run()
- {
- try
- {
- live_ = validateWSDL();
- }
- catch (Throwable t)
- {
- live_ = false;
- }
- finally
- {
- finish_ = true;
- }
- }
-
- private boolean validateWSDL() throws WSDLException, MalformedURLException, IOException, WWWAuthenticationException
- {
- WebServicesParserExt parser = new WebServicesParserExt();
- Definition definition = parser.getWSDLDefinitionVerbose(wsdlURL_);
- Map services = definition.getServices();
- Iterator serviceIterator = services.values().iterator();
- while (serviceIterator.hasNext())
- {
- Service service = (Service)serviceIterator.next();
- Map ports = service.getPorts();
- Iterator portIterator = ports.values().iterator();
- while (portIterator.hasNext())
- {
- Port port = (Port)portIterator.next();
- List extensibilityElements = port.getExtensibilityElements();
- Iterator extensibilityElementsIterator = extensibilityElements.iterator();
- while (extensibilityElementsIterator.hasNext())
- {
- ExtensibilityElement extensibilityElement = (ExtensibilityElement)extensibilityElementsIterator.next();
- if ((extensibilityElement instanceof SOAPAddress) || (extensibilityElement instanceof HTTPAddress))
- return true;
- }
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/WSFinderCommon.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/WSFinderCommon.java
deleted file mode 100644
index 4cc1cc8..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/WSFinderCommon.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.wsfinder;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectNature;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.j2ee.internal.ejb.project.EJBNatureRuntime;
-import org.eclipse.jst.j2ee.internal.project.IEJBNatureConstants;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-
-public abstract class WSFinderCommon implements IWSFinder
-{
- private String id_;
- private String name_;
- private String desc_;
-
- public WSFinderCommon()
- {
- id_ = null;
- name_ = null;
- desc_ = null;
- }
-
- public String getID()
- {
- return id_;
- }
-
- public void setID(String id)
- {
- id_ = id;
- }
-
- public String getName()
- {
- return name_;
- }
-
- public void setName(String name)
- {
- name_ = name;
- }
-
- public String getDescription()
- {
- return desc_;
- }
-
- public void setDescription(String desc)
- {
- desc_ = desc;
- }
-
- protected IProject[] getWorkspaceProjects()
- {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- return root.getProjects();
- }
-
- protected J2EEWebNatureRuntime getWebNature(IProject project)
- {
- try
- {
- IProjectNature nature = project.getNature(IWebNatureConstants.J2EE_NATURE_ID);
- if (nature != null && nature instanceof J2EEWebNatureRuntime)
- return (J2EEWebNatureRuntime)nature;
- }
- catch (CoreException ce)
- {
- }
- return null;
- }
-
- protected EJBNatureRuntime getEJBNature(IProject project)
- {
- try
- {
- IProjectNature nature = project.getNature(IEJBNatureConstants.NATURE_ID);
- if (nature != null && nature instanceof EJBNatureRuntime)
- return (EJBNatureRuntime)nature;
- }
- catch (CoreException ce)
- {
- }
- return null;
- }
-
- protected IFolder getFolderRootPublishable(J2EEWebNatureRuntime webNature)
- {
- return (IFolder)webNature.getRootPublishableFolder();
- }
-
- protected IFolder getFolderWEBINF(J2EEWebNatureRuntime webNature)
- {
- return webNature.getProject().getFolder(webNature.getWEBINFPath().toString());
- }
-
- protected IFolder getFolderMETAINF(EJBNatureRuntime ejbNature)
- {
- return ejbNature.getMetaFolder();
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/WSFinderRegistry.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/WSFinderRegistry.java
deleted file mode 100644
index cbc747b..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsfinder/WSFinderRegistry.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.wsfinder;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-
-public class WSFinderRegistry
-{
- private static WSFinderRegistry instance_;
- private Vector wsfinders_;
-
- private WSFinderRegistry()
- {
- wsfinders_ = new Vector();
- }
-
- /**
- * Returns a singleton instance of this class.
- * @return A singleton WSFinderRegistry object.
- */
- public static WSFinderRegistry getInstance()
- {
- if (instance_ == null)
- {
- instance_ = new WSFinderRegistry();
- instance_.init();
- }
- return instance_;
- }
-
- private void init()
- {
- IPluginRegistry pluginReg = Platform.getPluginRegistry();
- IConfigurationElement[] configElements = pluginReg.getConfigurationElementsFor("org.eclipse.jst.ws.consumption", "wsfinder");
- for (int i = 0; i < configElements.length; i++)
- {
- try
- {
- Object object = configElements[i].createExecutableExtension("class");
- if (object instanceof IWSFinder)
- {
- IWSFinder wsfinder = (IWSFinder)object;
- wsfinder.setID(configElements[i].getAttribute("id"));
- wsfinder.setName(configElements[i].getAttribute("name"));
- wsfinder.setDescription(configElements[i].getAttribute("description"));
- wsfinders_.add(wsfinder);
- }
- }
- catch (CoreException ce)
- {
- }
- }
- }
-
- public List getWSFinders()
- {
- return wsfinders_;
- }
-
- public List getWebServices()
- {
- List ws = new Vector();
- List wsFinders = getWSFinders();
- for (Iterator it = wsFinders.iterator(); it.hasNext();)
- {
- IWSFinder wsFinder = (IWSFinder)it.next();
- ws.addAll(wsFinder.find());
- }
- return ws;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsil/AddWSDLToWSILCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsil/AddWSDLToWSILCommand.java
deleted file mode 100644
index abfe043..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/wsil/AddWSDLToWSILCommand.java
+++ /dev/null
@@ -1,540 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.consumption.wsil;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-import javax.wsdl.Definition;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.wsil.Abstract;
-import org.apache.wsil.Description;
-import org.apache.wsil.Inspection;
-import org.apache.wsil.QName;
-import org.apache.wsil.Service;
-import org.apache.wsil.WSILDocument;
-import org.apache.wsil.WSILException;
-import org.apache.wsil.extension.ExtensionBuilder;
-import org.apache.wsil.extension.wsdl.ImplementedBinding;
-import org.apache.wsil.extension.wsdl.Reference;
-import org.apache.wsil.extension.wsdl.ReferencedService;
-import org.apache.wsil.extension.wsdl.WSDLConstants;
-import org.apache.wsil.xml.XMLWriter;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.uri.URIException;
-import org.eclipse.wst.command.env.core.uri.URIFactory;
-import org.eclipse.wst.ws.parser.wsil.IllegalArgumentsException;
-import org.eclipse.wst.ws.parser.wsil.WWWAuthenticationException;
-import org.eclipse.wst.ws.parser.wsil.WWWAuthenticationHandler;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class AddWSDLToWSILCommand extends SimpleCommand
-{
- public static final String ARG_WSIL = "-wsil";
- public static final String ARG_WSDL = "-wsdl";
- public static final String ARG_RESOLVE_WSDL = "-resolvewsdl";
- public static final String ARG_HTTP_BASIC_AUTH_USERNAME = "-httpusername";
- public static final String ARG_HTTP_BASIC_AUTH_PASSWORD = "-httppassword";
- private final String id = "org.eclipse.wst.ws.parser.wsil.AddWSDLToWSILCommand";
- private ResourceBundle resBundle_;
- private WWWAuthenticationHandler wwwAuthHandler_;
- private String[] args_;
- private String wsil_;
- private ArrayList wsdls_;
- private boolean resolveWSDL_;
- private String httpUsername_;
- private String httpPassword_;
-
- public AddWSDLToWSILCommand()
- {
- super("org.eclipse.wst.ws.parser.wsil.AddWSDLToWSILCommand", "org.eclipse.wst.ws.parser.wsil.AddWSDLToWSILCommand");
- resBundle_ = ResourceBundle.getBundle("org.eclipse.wst.ws.parser.wsil.wsil");
- wwwAuthHandler_ = null;
- args_ = new String[0];
- clearParsedArgs();
- }
-
- private void clearParsedArgs()
- {
- wsil_ = null;
- if (wsdls_ == null)
- wsdls_ = new ArrayList();
- else
- wsdls_.clear();
- resolveWSDL_ = false;
- httpUsername_ = null;
- httpPassword_ = null;
- }
-
- /**
- * Executes the Command.
- *
- * @param environment
- * The environment. Must not be null.
- * @return A <code>Status</code> object indicating the degree to which the
- * <code>execute</code> method was successful. A valud of <code>null</code>,
- * or a Status with a severity of less than <code>Status.ERROR</code>
- * signifies success.
- */
- public Status execute(Environment environment)
- {
- URIFactory uriFactory = environment.getURIFactory();
- // Parse arguments
- try
- {
- parseArguments();
- }
- catch (IllegalArgumentsException iae)
- {
- return new SimpleStatus(id, resBundle_.getString("MSG_ERROR_ILLEGAL_ARGUMENTS"), Status.ERROR, iae);
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- return new SimpleStatus(id, resBundle_.getString("MSG_ERROR_INVALID_ARGUMENTS"), Status.ERROR, e);
- }
- // Create new WSIL document
- WSILDocument wsilDocument = null;
- URL wsilURL = null;
- try
- {
- wsilDocument = WSILDocument.newInstance();
- wsilURL = new URL(wsil_);
- }
- catch (MalformedURLException murle)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_INVALID_WSIL_URI"), Status.ERROR, murle);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- catch (WSILException wsile)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_UNEXPECTED_EXCEPTION"), Status.ERROR, wsile);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- // Read WSIL
- try
- {
- InputStream is = uriFactory.newURI(wsilURL).getInputStream();
- if (is != null)
- {
- wsilDocument.read(new InputStreamReader(is));
- is.close();
- }
- }
- catch (URIException urie)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_UNEXPECTED_EXCEPTION"), Status.ERROR, urie);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- catch (IOException ioe)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_UNEXPECTED_EXCEPTION"), Status.ERROR, ioe);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- catch (WSILException wsile)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_UNEXPECTED_EXCEPTION"), Status.ERROR, wsile);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- // internalExecute
- String httpUsername = null;
- String httpPassword = null;
- if (wsdls_.size() == 1 && httpUsername_ != null && httpPassword_ != null)
- {
- httpUsername = httpUsername_;
- httpPassword = httpPassword_;
- }
- for (Iterator it = wsdls_.iterator(); it.hasNext();)
- {
- String wsdl = (String) it.next();
- Status status = null;
- try
- {
- status = internalExecute(environment, wsilDocument, platform2File(uriFactory, wsil_), wsdl, httpUsername, httpPassword);
- }
- catch (WWWAuthenticationException wwwae)
- {
- if (wwwAuthHandler_ != null && httpUsername == null && httpPassword == null)
- {
- wwwAuthHandler_.handleWWWAuthentication(wwwae);
- String handlerUsername = wwwAuthHandler_.getUsername();
- String handlerPassword = wwwAuthHandler_.getPassword();
- if (handlerUsername != null && handlerPassword != null)
- {
- try
- {
- status = internalExecute(environment, wsilDocument, platform2File(uriFactory, wsil_), wsdl, handlerUsername, handlerPassword);
- }
- catch (WWWAuthenticationException wwwae2)
- {
- Status wwwaeStatus = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_UNRESOLVABLE_WSDL"), Status.ERROR, wwwae2.getIOException());
- environment.getStatusHandler().reportError(wwwaeStatus);
- return wwwaeStatus;
- }
- }
- }
- if (status == null)
- {
- Status s = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_UNRESOLVABLE_WSDL"), Status.ERROR, wwwae.getIOException());
- environment.getStatusHandler().reportError(s);
- return s;
- }
- }
- if (status.getSeverity() != Status.OK)
- return status;
- }
- // Write WSIL
- try
- {
- XMLWriter xmlWriter = new XMLWriter();
- OutputStream os = uriFactory.newURI(wsilURL).getOutputStream();
- if (os != null)
- xmlWriter.writeDocument(wsilDocument, os);
- else
- throw new IOException();
- os.close();
- }
- catch (URIException urie)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_WRITE_WSIL"), Status.ERROR, urie);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- catch (IOException ioe)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_WRITE_WSIL"), Status.ERROR, ioe);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- catch (WSILException wsile)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_WRITE_WSIL"), Status.ERROR, wsile);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- return new SimpleStatus(id, "", Status.OK, null);
- }
-
- private Status internalExecute(Environment environment, WSILDocument wsilDocument, String wsil, String wsdl, String httpUsername, String httpPassword) throws WWWAuthenticationException
- {
- Definition definition = null;
- ArrayList wsdlService = new ArrayList();
- ArrayList wsdlBinding = new ArrayList();
- if (resolveWSDL_)
- {
- // Parse WSDL
- try
- {
- definition = parseWSDL(wsdl, wsdlService, wsdlBinding, httpUsername, httpPassword);
- }
- catch (MalformedURLException murle)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_INVALID_WSDL_URI"), Status.ERROR, murle);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- catch (IOException ioe)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_UNRESOLVABLE_WSDL"), Status.ERROR, ioe);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- catch (ParserConfigurationException pce)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_UNEXPECTED_EXCEPTION"), Status.ERROR, pce);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- catch (SAXException saxe)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_MALFORMED_WSDL"), Status.ERROR, saxe);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- }
- // Add WSDL to WSIL
- try
- {
- Inspection inspection = wsilDocument.getInspection();
- Service service = wsilDocument.createService();
- if (definition != null)
- {
- Element documentation = definition.getDocumentationElement();
- Abstract serviceAbstract = wsilDocument.createAbstract();
- serviceAbstract.setText(Element2String(documentation));
- service.addAbstract(serviceAbstract);
- }
- Description desc = wsilDocument.createDescription();
- desc.setReferencedNamespace(WSDLConstants.NS_URI_WSDL);
- desc.setLocation(getRelativeURI(wsil, wsdl));
- ExtensionBuilder extBuilder = wsilDocument.getExtensionRegistry().getBuilder(WSDLConstants.NS_URI_WSIL_WSDL);
- if (definition == null || endpointPresent(definition))
- {
- for (Iterator it = wsdlService.iterator(); it.hasNext();)
- {
- Reference reference = (Reference) extBuilder.createElement(new QName(WSDLConstants.NS_URI_WSIL_WSDL, WSDLConstants.ELEM_REFERENCE));
- reference.setEndpointPresent(new Boolean(true));
- ReferencedService refService = (ReferencedService) extBuilder.createElement(new QName(WSDLConstants.NS_URI_WSIL_WSDL, WSDLConstants.ELEM_REF_SERVICE));
- refService.setReferencedServiceName((QName) it.next());
- reference.setReferencedService(refService);
- desc.setExtensionElement(reference);
- }
- }
- else
- {
- Reference reference = (Reference) extBuilder.createElement(new QName(WSDLConstants.NS_URI_WSIL_WSDL, WSDLConstants.ELEM_REFERENCE));
- reference.setEndpointPresent(new Boolean(false));
- for (Iterator it = wsdlBinding.iterator(); it.hasNext();)
- {
- ImplementedBinding binding = (ImplementedBinding) extBuilder.createElement(new QName(WSDLConstants.NS_URI_WSIL_WSDL, WSDLConstants.ELEM_IMPL_BINDING));
- binding.setBindingName((QName) it.next());
- reference.addImplementedBinding(binding);
- }
- }
- service.addDescription(desc);
- inspection.addService(service);
- }
- catch (WSILException wsile)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_UNEXPECTED_EXCEPTION"), Status.ERROR, wsile);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- catch (Throwable t)
- {
- Status status = new SimpleStatus(id, resBundle_.getString("MSG_ERROR_UNEXPECTED_EXCEPTION"), Status.ERROR, t);
- environment.getStatusHandler().reportError(status);
- return status;
- }
- return new SimpleStatus(id, "", Status.OK, null);
- }
-
- /**
- * Returns <code>true</code> if, and only if, the Command's <code>undo</code>
- * method is supported.
- *
- * @return True if the Command supports being undone.
- */
- public boolean isUndoable()
- {
- return false;
- }
-
- /**
- * Undoes the Command.
- *
- * @param environment
- * The environment. Must not be null.
- * @return A <code>Status</code> object indicating the degree to which the
- * <code>undo</code> method was successful. A valud of <code>null</code>,
- * or a Status with a severity of less than <code>Status.ERROR</code>
- * signifies success.
- */
- public Status undo(Environment environment)
- {
- return new SimpleStatus(id, "", Status.OK, null);
- }
-
- /**
- * Re-executes the Command.
- *
- * @param environment
- * The environment. Must not be null.
- * @return A <code>Status</code> object indicating the degree to which the
- * <code>redo</code> method was successful. A value of <code>null</code>,
- * or a Status with a severity of less then <code>Status.ERROR</code>
- * signifies success.
- */
- public Status redo(Environment environment)
- {
- return execute(environment);
- }
-
- private Definition parseWSDL(String wsdl, ArrayList wsdlService, ArrayList wsdlBinding, String httpUsername, String httpPassword) throws MalformedURLException, IOException, ParserConfigurationException, SAXException, WWWAuthenticationException
- {
- WebServicesParser wsParser = new WebServicesParser(wsdl);
- if (httpUsername != null && httpPassword != null)
- {
- wsParser.setHTTPBasicAuthUsername(httpUsername);
- wsParser.setHTTPBasicAuthPassword(httpPassword);
- }
- wsParser.parse(WebServicesParser.PARSE_NONE);
- Definition definition = wsParser.getWSDLDefinition(wsdl);
- if (definition != null)
- {
- Map services = definition.getServices();
- for (Iterator it = services.keySet().iterator(); it.hasNext();)
- wsdlService.add(parseQName((javax.xml.namespace.QName) it.next()));
- Map bindings = definition.getBindings();
- for (Iterator it = bindings.keySet().iterator(); it.hasNext();)
- wsdlBinding.add(parseQName((javax.xml.namespace.QName) it.next()));
- }
- return definition;
- }
-
- private boolean endpointPresent(Definition definition)
- {
- return (definition.getServices().size() > 0);
- }
-
- public String[] getArguments()
- {
- return args_;
- }
-
- public void setArguments(String[] args)
- {
- args_ = args;
- }
-
- public WWWAuthenticationHandler getWWWAuthenticationHandler()
- {
- return wwwAuthHandler_;
- }
-
- public void setWWWAuthenticationHandler(WWWAuthenticationHandler wwwAuthHandler)
- {
- wwwAuthHandler_ = wwwAuthHandler;
- }
-
- private void parseArguments() throws IllegalArgumentsException
- {
- clearParsedArgs();
- for (int i = 0; i < args_.length; i++)
- {
- if (ARG_WSIL.equals(args_[i]))
- wsil_ = args_[++i];
- else if (ARG_WSDL.equals(args_[i]))
- wsdls_.add(args_[++i]);
- else if (ARG_RESOLVE_WSDL.equals(args_[i]))
- resolveWSDL_ = true;
- else if (ARG_HTTP_BASIC_AUTH_USERNAME.equals(args_[i]))
- httpUsername_ = args_[++i];
- else if (ARG_HTTP_BASIC_AUTH_PASSWORD.equals(args_[i]))
- httpPassword_ = args_[++i];
- else
- throw new IllegalArgumentsException(args_[i]);
- }
- }
-
- private QName parseQName(String qnameString)
- {
- int colonIndex = qnameString.indexOf(':');
- String ns = (colonIndex != -1) ? qnameString.substring(0, colonIndex) : "";
- String localpart = (colonIndex != -1) ? qnameString.substring(colonIndex + 1, qnameString.length()) : qnameString;
- return new QName(ns, localpart);
- }
-
- private QName parseQName(javax.xml.namespace.QName qname)
- {
- return new QName(qname.getNamespaceURI(), qname.getLocalPart());
- }
-
- private String Element2String(Element e) throws TransformerConfigurationException, TransformerException, IOException
- {
- byte[] b = new byte[0];
- if (e != null)
- {
- DOMSource domSource = new DOMSource(e);
- Transformer serializer = TransformerFactory.newInstance().newTransformer();
- serializer.setOutputProperty(OutputKeys.INDENT, "yes");
- serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- serializer.transform(domSource, new StreamResult(baos));
- baos.close();
- b = baos.toByteArray();
- }
- return new String(b);
- }
-
- private String platform2File(URIFactory uriFactory, String uri)
- {
- try
- {
- return uriFactory.newURI(uri).asFile().toURL().toString();
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- }
- return uri;
- }
-
- private final char FWD_SLASH = '/';
- private final char BWD_SLASH = '\\';
- private final String parentDir = "../";
-
- private String getRelativeURI(String baseURI, String targetURI)
- {
- try
- {
- String baseURICopy = baseURI.replace(BWD_SLASH, FWD_SLASH);
- String targetURICopy = targetURI.replace(BWD_SLASH, FWD_SLASH);
- int matchingIndex = -1;
- int index = targetURICopy.indexOf(FWD_SLASH);
- while (index != -1)
- {
- if (baseURICopy.startsWith(targetURICopy.substring(0, index + 1)))
- {
- matchingIndex = index;
- index = targetURICopy.indexOf(FWD_SLASH, index + 1);
- }
- else
- break;
- }
- if (matchingIndex != -1)
- {
- int slashCount = -1;
- int fromIndex = matchingIndex;
- while (fromIndex != -1)
- {
- slashCount++;
- fromIndex = baseURICopy.indexOf(FWD_SLASH, fromIndex + 1);
- }
- StringBuffer relativeURI = new StringBuffer();
- for (int i = 0; i < slashCount; i++)
- relativeURI.append(parentDir);
- relativeURI.append(targetURI.substring(matchingIndex + 1, targetURI.length()));
- return relativeURI.toString();
- }
- }
- catch (Throwable t)
- {
- }
- return targetURI;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/DomElementHelper.java b/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/DomElementHelper.java
deleted file mode 100644
index 641cdf6..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/DomElementHelper.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.util;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import org.w3c.dom.Document;
-
-/**
- * @author gilberta
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class DomElementHelper {
-
-
- public static org.w3c.dom.Element createDomElementFromXMLString(java.lang.String xmlString )
- {
- java.io.StringReader stringReader = new java.io.StringReader(xmlString);
- org.xml.sax.InputSource inputSource = new org.xml.sax.InputSource(stringReader);
- try
- {
- DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
- Document document = docBuilder.parse(inputSource);
- return document.getDocumentElement();
- }
- catch (Throwable t)
- {
- return null;
- }
- }
-
- public static java.lang.String domWriter(org.w3c.dom.Node node,java.lang.StringBuffer buffer)
- {
- if ( node == null ) {
- return "";
- }
- int type = node.getNodeType();
- switch ( type ) {
- case org.w3c.dom.Node.DOCUMENT_NODE: {
- buffer.append(JspUtils.markup("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") + "<br>");
- domWriter(((org.w3c.dom.Document)node).getDocumentElement(),buffer);
- break;
- }
- case org.w3c.dom.Node.ELEMENT_NODE: {
- buffer.append(JspUtils.markup("<" + node.getNodeName()));
- org.w3c.dom.Attr attrs[] = sortAttributes(node.getAttributes());
- for ( int i = 0; i < attrs.length; i++ ) {
- org.w3c.dom.Attr attr = attrs[i];
- buffer.append(" " + attr.getNodeName() + "=\"" + JspUtils.markup(attr.getNodeValue()) + "\"");
- }
- buffer.append(JspUtils.markup(">"));
- org.w3c.dom.NodeList children = node.getChildNodes();
- if ( children != null ) {
- int len = children.getLength();
- for ( int i = 0; i < len; i++ ) {
- if(((org.w3c.dom.Node)children.item(i)).getNodeType() == org.w3c.dom.Node.ELEMENT_NODE)
- buffer.append("<br>");
- domWriter(children.item(i),buffer);
- }
- }
- buffer.append(JspUtils.markup("</" + node.getNodeName() + ">"));
- break;
- }
- case org.w3c.dom.Node.ENTITY_REFERENCE_NODE: {
- org.w3c.dom.NodeList children = node.getChildNodes();
- if ( children != null ) {
- int len = children.getLength();
- for ( int i = 0; i < len; i++ )
- {
- buffer.append(children.item(i));
- }
- }
- break;
- }
- case org.w3c.dom.Node.CDATA_SECTION_NODE: {
- buffer.append(JspUtils.markup(node.getNodeValue()));
- break;
- }
- case org.w3c.dom.Node.TEXT_NODE:{
- buffer.append(JspUtils.markup(node.getNodeValue()));
- break;
- }
- case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE:{
- buffer.append(JspUtils.markup("<?"));
- buffer.append(node.getNodeName());
- String data = node.getNodeValue();
- if ( data != null && data.length() > 0 ){
- buffer.append(" ");
- buffer.append(data);
- }
- buffer.append(JspUtils.markup("?>"));
- break;
- }
- }
- return buffer.toString();
- }
-
- public static org.w3c.dom.Attr[] sortAttributes(org.w3c.dom.NamedNodeMap attrs)
- {
- int len = (attrs != null) ? attrs.getLength() : 0;
- org.w3c.dom.Attr array[] = new org.w3c.dom.Attr[len];
- for ( int i = 0; i < len; i++ ){
- array[i] = (org.w3c.dom.Attr)attrs.item(i);
- }
- for ( int i = 0; i < len - 1; i++ ) {
- String name = array[i].getNodeName();
- int index = i;
- for ( int j = i + 1; j < len; j++ ) {
- String curName = array[j].getNodeName();
- if ( curName.compareTo(name) < 0 ) {
- name = curName;
- index = j;
- }
- }
- if ( index != i ) {
- org.w3c.dom.Attr temp = array[i];
- array[i] = array[index];
- array[index] = temp;
- }
- }
- return (array);
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/JspUtils.java b/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/JspUtils.java
deleted file mode 100644
index abb9013..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/JspUtils.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.util;
-
-/**
- * @author gilberta
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class JspUtils {
- public static String markup(String text) {
- if (text == null) {
- return null;
- }
-
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < text.length(); i++) {
- char c = text.charAt(i);
- switch (c) {
- case '<':
- buffer.append("<");
- break;
- case '&':
- buffer.append("&");
- break;
- case '>':
- buffer.append(">");
- break;
- case '"':
- buffer.append(""");
- break;
- default:
- buffer.append(c);
- break;
- }
- }
- return buffer.toString();
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/SoapElementHelper.java b/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/SoapElementHelper.java
deleted file mode 100644
index 6cd5e2e..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/SoapElementHelper.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.util;
-
-/**
- * @author gilberta
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class SoapElementHelper {
- public static javax.xml.soap.SOAPElement createSOAPElementFromXMLString(String xmlString) throws SoapElementRuntimeException
- {
- throw new SoapElementRuntimeException("SoapElement is not supported by the sample on the current runtime. Please use WebSphere v5.1 or higher.");
- }
-
- public static java.lang.String soapElementWriter(javax.xml.soap.SOAPElement node,java.lang.StringBuffer buffer)
- {
- if (node == null ) {
- return "";
- }
-
- buffer.append(JspUtils.markup("<" + node.getElementName().getLocalName()));
- java.util.Iterator attrs = node.getAllAttributes();
- while(attrs.hasNext()) {
- javax.xml.soap.Name attr = (javax.xml.soap.Name)attrs.next();
- buffer.append(" " + attr.getQualifiedName() + "=\"" + JspUtils.markup(node.getAttributeValue(attr)) + "\"");
- }
- buffer.append(JspUtils.markup(">"));
- java.util.Iterator children = node.getChildElements();
- if ( children != null ) {
- while(children.hasNext()){
- javax.xml.soap.Node childNode = (javax.xml.soap.Node)children.next();
- if(childNode instanceof javax.xml.soap.SOAPElement){
- buffer.append("<br>");
- soapElementWriter((javax.xml.soap.SOAPElement)childNode,buffer);
- }
- else
- buffer.append(JspUtils.markup(((javax.xml.soap.Text)childNode).getValue()));
- }
- buffer.append(JspUtils.markup("</" + node.getElementName().getLocalName() + ">"));
- }
- return buffer.toString();
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/SoapElementRuntimeException.java b/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/SoapElementRuntimeException.java
deleted file mode 100644
index d28dc9a..0000000
--- a/bundles/org.eclipse.jst.ws.consumption/webserviceutils/org/eclipse/jst/ws/util/SoapElementRuntimeException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.util;
-
-/**
- * @author gilberta
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class SoapElementRuntimeException extends Exception {
-
- public SoapElementRuntimeException(String message){
- super(message);
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.creation.ejb.ui/.cvsignore b/bundles/org.eclipse.jst.ws.creation.ejb.ui/.cvsignore
deleted file mode 100644
index c14487c..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ejb.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/bundles/org.eclipse.jst.ws.creation.ejb.ui/.project b/bundles/org.eclipse.jst.ws.creation.ejb.ui/.project
deleted file mode 100644
index 8023461..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ejb.ui/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.ws.creation.ejb.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.ws.creation.ejb.ui/build.properties b/bundles/org.eclipse.jst.ws.creation.ejb.ui/build.properties
deleted file mode 100644
index fd8e379..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ejb.ui/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-bin.includes = plugin.xml,\
- plugin.properties
-src.includes = plugin.xml,\
- *.properties
diff --git a/bundles/org.eclipse.jst.ws.creation.ejb.ui/plugin.properties b/bundles/org.eclipse.jst.ws.creation.ejb.ui/plugin.properties
deleted file mode 100644
index 13fe654..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ejb.ui/plugin.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Web Services Creation EJB Graphical User Interface
-PLUGIN_PROVIDER=Eclipse.org
-
-#
-# Web service types
-#
-WEBSERVICETYPE_NAME_EJB_TP=EJB Web Service
-WEBSERVICETYPE_NAME_WSDL_EJB_TP=Skeleton EJB Web Service
-
-#
-# Pop-up actions
-#
-ACTION_DEPLOY_WEBSERVICE=Create Web service
-
diff --git a/bundles/org.eclipse.jst.ws.creation.ejb.ui/plugin.xml b/bundles/org.eclipse.jst.ws.creation.ejb.ui/plugin.xml
deleted file mode 100644
index 33d9d4f..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ejb.ui/plugin.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id="org.eclipse.jst.ws.creation.ejb.ui"
- version="1.0.0"
- name="%PLUGIN_NAME"
- provider-name="%PLUGIN_PROVIDER">
-
- <requires>
- <import plugin="org.eclipse.wst.command.env"/>
- <import plugin="org.eclipse.wst.command.env.ui"/>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <import plugin="org.eclipse.jst.ws"/>
- <import plugin="org.eclipse.jst.ws.consumption"/>
- <import plugin="org.eclipse.jst.ws.ui"/>
- <import plugin="org.eclipse.jst.ws.consumption.ui"/>
- <import plugin="org.eclipse.jst.ws.creation.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.emf.common"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="com.ibm.wtp.emf.workbench"/>
- </requires>
-
- <!-- EJB Web Service Types -->
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.webServiceServerRuntimeType">
-
- <webServiceType
- label="%WEBSERVICETYPE_NAME_WSDL_EJB_TP"
- resourceTypeMetadata="File IResource"
- extensionMetadata=".wsdl"
- objectSelectionWidget="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.WSDLSelectionWidget"
- includeNatures="org.eclipse.jst.j2ee.ejb.EJBNature"
- excludeNatures=""
- id="org.eclipse.jst.ws.type.wsdl.ejb">
- </webServiceType>
-
- <webServiceType
- label="%WEBSERVICETYPE_NAME_EJB_TP"
- resourceTypeMetadata="EJBObject org.eclipse.jst.j2ee.ejb.EnterpriseBean SessionImpl"
- extensionMetadata=".java .class .SessionImpl"
- objectSelectionWidget="org.eclipse.jst.ws.internal.consumption.ui.widgets.object.EJBSelectionWidget"
- includeNatures="org.eclipse.jst.j2ee.ejb.EJBNature"
- excludeNatures=""
- id="org.eclipse.jst.ws.type.ejb">
- </webServiceType>
-
- </extension>
-
- <!-- Popups -->
-
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.jst.j2ee.ejb.EnterpriseBean"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.java">
- <action
- label="%ACTION_DEPLOY_WEBSERVICE"
- class="org.eclipse.wst.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.ejb.popupMenu/popupActions"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- </action>
- </objectContribution>
- </extension>
-
-</plugin>
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/.classpath b/bundles/org.eclipse.jst.ws.creation.ui/.classpath
deleted file mode 100644
index 275b34c..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/.cvsignore b/bundles/org.eclipse.jst.ws.creation.ui/.cvsignore
deleted file mode 100644
index 60463af..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-build.xml
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/.project b/bundles/org.eclipse.jst.ws.creation.ui/.project
deleted file mode 100644
index ef454e4..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.ws.creation.ui</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.wst.command.env</project>
- <project>org.eclipse.wst.command.env.core</project>
- <project>org.eclipse.jst.ws</project>
- <project>org.eclipse.jst.ws.consumption</project>
- <project>org.eclipse.jst.ws.consumption.ui</project>
- <project>org.eclipse.jst.ws.ui</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/build.properties b/bundles/org.eclipse.jst.ws.creation.ui/build.properties
deleted file mode 100644
index a88e997..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-source.wss-ui.jar = src/
-bin.includes = wss-ui.jar,\
- icons/,\
- plugin.properties,\
- plugin.xml
-src.includes = build.properties,\
- icons/,\
- plugin.properties,\
- plugin.xml,\
- src/
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/icons/export_ws.gif b/bundles/org.eclipse.jst.ws.creation.ui/icons/export_ws.gif
deleted file mode 100644
index ca44ef8..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/icons/export_ws.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/icons/export_ws_wiz.gif b/bundles/org.eclipse.jst.ws.creation.ui/icons/export_ws_wiz.gif
deleted file mode 100644
index 74fcd77..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/icons/export_ws_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/icons/full/ctool16/new_webserv_wiz.gif b/bundles/org.eclipse.jst.ws.creation.ui/icons/full/ctool16/new_webserv_wiz.gif
deleted file mode 100644
index 2d737f0..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/icons/full/ctool16/new_webserv_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/icons/full/wizban/webservices_wiz.gif b/bundles/org.eclipse.jst.ws.creation.ui/icons/full/wizban/webservices_wiz.gif
deleted file mode 100644
index abd1f9c..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/icons/full/wizban/webservices_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/plugin.properties b/bundles/org.eclipse.jst.ws.creation.ui/plugin.properties
deleted file mode 100644
index c124705..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/plugin.properties
+++ /dev/null
@@ -1,62 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Web Services Creation Graphical User Interface
-PLUGIN_PROVIDER=Eclipse.org
-
-PLUGIN_NEW_CATEGORY_NAME_WS=Web Services
-PLUGIN_NEW_WIZARD_NAME_WS_SERVICE=Web Service
-PLUGIN_EXPORT_WIZARD_NAME_WS=Web Service
-PLUGIN_NEW_WIZARD_DESC_WS_SERVICE=Create a new XML web service.
-PLUGIN_EXPORT_WIZARD_DESC_WS=A wizard for exporting a web service.
-
-#
-# Web Services Preferance Pages
-#
-# Dialogs
-CHECKBOX_SHOW_DEPLOY_WEB_SERVICE_DIALOG=Hide Create Web service Dialog
-CHECKBOX_SHOW_GENERATE_SKELETON_DIALOG=Hide Generate Java Bean Skeleton Dialog
-CHECKBOX_SHOW_GENERATE_WSDL_FILES_DIALOG=Hide Generate WSDL Files Dialog
-CHECKBOX_SHOW_PUBLISH_WSDL_DIALOG=Hide Publish WSDL Dialog
-
-PREFERENCE_CATEGORY_SCENARIO_DEFAULTS=Scenario Defaults
-
-
-#
-# Preferences Tooltips
-#
-#Action Dialogs
-TOOLTIP_PPAD_CHECKBOX_DEPLOY=Hides the dialog for deploying a Web service action
-TOOLTIP_PPAD_CHECKBOX_SKELETON=Hides the dialog for generating Java bean Skeleton action
-TOOLTIP_PPAD_CHECKBOX_WSDL=Hides the dialog for generating WSDL files action
-TOOLTIP_PPAD_CHECKBOX_PUBLISH=Hides the dialog for publishing the WSDL action
-
-#
-# Pop-up actions
-#
-ACTION_DEPLOY_WEBSERVICE=Create Web service
-ACTION_GENERATE_JAVA_SKELETON=Generate Java bean skeleton
-ACTION_PUBLISH_WSDL=Publish WSDL file
-
-#
-# Wizards.
-#
-WIZARD_TITLE_WSS=Web Service
-
-
-#
-# Pop-up actions
-#
-ACTION_DEPLOY_WEBSERVICE=Create Web service
-
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/plugin.xml b/bundles/org.eclipse.jst.ws.creation.ui/plugin.xml
deleted file mode 100644
index 62ddc4b..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/plugin.xml
+++ /dev/null
@@ -1,271 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id="org.eclipse.jst.ws.creation.ui"
- version="1.0.0"
- name="%PLUGIN_NAME"
- provider-name="%PLUGIN_PROVIDER"
- class="org.eclipse.jst.ws.internal.creation.ui.plugin.WebServiceCreationUIPlugin">
-
- <runtime>
- <library name="wss-ui.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.wst.command.env"/>
- <import plugin="org.eclipse.wst.command.env.ui"/>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <import plugin="org.eclipse.jst.ws"/>
- <import plugin="org.eclipse.jst.ws.consumption"/>
- <import plugin="org.eclipse.jst.ws.ui"/>
- <import plugin="org.eclipse.jst.ws.consumption.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.emf.common"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="com.ibm.wtp.emf.workbench"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.wst.common.emfworkbench.integration"/>
- <import plugin="org.eclipse.jst.j2ee"/>
- <import plugin="org.eclipse.jst.j2ee.core"/>
- <import plugin="org.eclipse.jst.j2ee.ejb"/>
- </requires>
-
- <!-- Wizards -->
-
- <extension
- point="org.eclipse.ui.newWizards">
- <category
- name="%PLUGIN_NEW_CATEGORY_NAME_WS"
- id="org.eclipse.jst.ws.ui.new">
- </category>
- <wizard
- name="%PLUGIN_NEW_WIZARD_NAME_WS_SERVICE"
- icon="icons/full/ctool16/new_webserv_wiz.gif"
- category="org.eclipse.jst.ws.ui.new"
- class="org.eclipse.wst.command.env.ui.widgets.DynamicWizard"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- <description>
- %PLUGIN_NEW_WIZARD_DESC_WS_SERVICE
- </description>
- </wizard>
- </extension>
-
- <extension
- point="org.eclipse.wst.command.env.dynamicWizard">
- <dynamicWizard
- iconbanner="icons/full/wizban/webservices_wiz.gif"
- title="%WIZARD_TITLE_WSS"
- class="org.eclipse.jst.ws.internal.creation.ui.widgets.binding.ServerWidgetBinding"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- </dynamicWizard>
- </extension>
-
- <extension
- point="org.eclipse.ui.exportWizards">
- <wizard
- name="%PLUGIN_EXPORT_WIZARD_NAME_WS"
- icon="icons/export_ws.gif"
- class="org.eclipse.wst.command.env.ui.widgets.DynamicWizard"
- id="wsexport">
- <description>
- %PLUGIN_EXPORT_WIZARD_DESC_WS
- </description>
- </wizard>
- </extension>
-
- <extension
- point="org.eclipse.wst.command.env.dynamicWizard">
- <dynamicWizard
- iconbanner="icons/export_ws_wiz.gif"
- name="%PLUGIN_EXPORT_WIZARD_NAME_WS"
- class="org.eclipse.jst.ws.internal.creation.ui.widgets.binding.ExportWSWidgetBinding"
- id="wsexport">
- </dynamicWizard>
- </extension>
-
- <extension
- point="org.eclipse.wst.command.env.dynamicWizard">
- <dynamicWizard
- iconbanner="icons/export_ws_wiz.gif"
- name="%PLUGIN_EXPORT_WIZARD_NAME_WS"
- class="org.eclipse.jst.ws.internal.creation.ui.widgets.binding.ExportWSWidgetBinding"
- id="org.eclipse.jst.ws.creation.ui.wizard.publish">
- </dynamicWizard>
- </extension>
-
- <!-- "Don't Show Me" Preferences -->
-
- <extension
- point="org.eclipse.wst.command.env.actionDialogPreferenceType">
-
- <actionDialogPreferenceType
- name="%CHECKBOX_SHOW_DEPLOY_WEB_SERVICE_DIALOG"
- tooltip="%TOOLTIP_PPAD_CHECKBOX_DEPLOY"
- infopop="org.eclipse.jst.ws.creation.ui.PPAD0006"
- category="org.eclipse.jst.wss.popup.category"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.java">
- </actionDialogPreferenceType>
-
- <actionDialogPreferenceType
- name="%CHECKBOX_SHOW_GENERATE_SKELETON_DIALOG"
- tooltip="%TOOLTIP_PPAD_CHECKBOX_SKELETON"
- infopop="org.eclipse.jst.ws.creation.ui.PPAD0008"
- category="org.eclipse.jst.wss.popup.category"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.skeleton">
- </actionDialogPreferenceType>
-
- <actionDialogPreferenceType
- name="%CHECKBOX_SHOW_PUBLISH_WSDL_DIALOG"
- tooltip="%TOOLTIP_PPAD_CHECKBOX_PUBLISH"
- infopop="org.eclipse.jst.ws.creation.ui.PPAD0009"
- category="org.eclipse.jst.wss.popup.category"
- id="org.eclipse.jst.ws.creation.ui.wizard.publish">
- </actionDialogPreferenceType>
-
- </extension>
-
- <!-- Popups -->
-
- <extension
- point="org.eclipse.ui.popupMenus">
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.java"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.java">
- <action
- label="%ACTION_DEPLOY_WEBSERVICE"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.jdt.internal.core.CompilationUnit"
- nameFilter="*.java"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.java">
- <action
- label="%ACTION_DEPLOY_WEBSERVICE"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.wsdl"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.skeleton">
- <action
- label="%ACTION_GENERATE_JAVA_SKELETON"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.wst.wsdl.Service"
- nameFilter="*"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.skeleton">
- <action
- label="%ACTION_GENERATE_JAVA_SKELETON"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl"
- nameFilter="*"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.skeleton">
- <action
- label="%ACTION_GENERATE_JAVA_SKELETON"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.jst.ws.wsclient.ServiceRef"
- nameFilter="*"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.skeleton">
- <action
- label="%ACTION_GENERATE_JAVA_SKELETON"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.jst.ws.wsdd.ServiceImplBean"
- nameFilter="*"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.java">
- <action
- label="%ACTION_DEPLOY_WEBSERVICE"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.jst.ws.wsdd.BeanLink"
- nameFilter="*"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.java">
- <action
- label="%ACTION_DEPLOY_WEBSERVICE"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="additions"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.wsil"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.skeleton">
- <action
- label="%ACTION_GENERATE_JAVA_SKELETON"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard">
- </action>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.wsdl"
- id="org.eclipse.jst.ws.creation.ui.wizard.publish">
- <action
- label="%ACTION_PUBLISH_WSDL"
- class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- id="org.eclipse.jst.ws.creation.ui.wizard.publish">
- </action>
- </objectContribution>
-
- </extension>
-
- <!-- Preference Pages -->
-
- <extension point="org.eclipse.ui.preferencePages">
- <page
- name="%PREFERENCE_CATEGORY_SCENARIO_DEFAULTS"
- category="org.eclipse.jst.ws.internal.ui.preferences.name"
- class="org.eclipse.jst.ws.internal.creation.ui.preferences.ScenarioDefaultsPreferencePage"
- id="org.eclipse.jst.ws.internal.creation.ui.preferences.ScenarioDefaultsPreferencePage">
- </page>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/creation/ui/plugin.properties b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/creation/ui/plugin.properties
deleted file mode 100644
index 6a4c47a..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/creation/ui/plugin.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# WSDL Test Errors
-#
-MSG_ERROR_UNABLE_TO_LAUNCH_WSDL_TEST=IWAB0361E An error occurred. Unable to launch WSDL test facility.
-
-
-#
-# Wizard pages
-#
-PAGE_TITLE_OBJECT_SELECTION=Object Selection Page
-PAGE_DESC_OBJECT_SELECTION=Object Selection Page
-
-
-
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/plugin/WebServiceCreationUIPlugin.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/plugin/WebServiceCreationUIPlugin.java
deleted file mode 100644
index cffafef..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/plugin/WebServiceCreationUIPlugin.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.creation.ui.plugin;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-
-
-/**
-* This is the plugin class for the Web Services Creation UI plugin.
-* <p>
-* The Web Services Creation UI plugin's sole function is to add
-* user interface of the Web Services Creation Wizard, contained in
-* the org.eclipse.jst.ws.ui plugin.
-*/
-public class WebServiceCreationUIPlugin extends Plugin
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- /**
- * The identifier of the descriptor of this plugin in plugin.xml.
- */
- public static final String ID = "org.eclipse.jst.ws.creation.ui";
-
- /**
- * The reference to the singleton instance of this plugin.
- */
- private static WebServiceCreationUIPlugin instance_;
- private Log log_;
-
- /**
- * Constructs a runtime plugin object for this plugin.
- * The "plugin" element in plugin.xml should include the attribute
- * class = "org.eclipse.jst.ws.internal.creation.ui.plugin.WebServiceCreationUIPlugin".
- * @param descriptor The descriptor of this plugin.
- */
- public WebServiceCreationUIPlugin ( IPluginDescriptor descriptor )
- {
- super(descriptor);
- if (instance_ == null)
- {
- instance_ = this;
- }
- log_ = new EclipseLog();
- }
-
- /**
- * Returns the singleton instance of this plugin. Equivalent to calling
- * (WebServiceCreationUIPlugin)Platform.getPlugin("org.eclipse.jst.ws.creation.ui");
- * @return The WebServiceCreationUIPlugin singleton.
- */
- public static WebServiceCreationUIPlugin getInstance ()
- {
- return instance_;
- }
-
- /**
- * Called once by the platform when this plugin is first loaded.
- * @throws CoreException If this plugin fails to start.
- */
- public void startup () throws CoreException
- {
- log_.log(Log.INFO, 5064, this, "startup", "Starting plugin org.eclipse.jst.ws.creation.ui");
- super.startup();
- }
-
- /**
- * Called once by the platform when this plugin is unloaded.
- * @throws CoreException If this plugin fails to shutdown.
- */
- public void shutdown () throws CoreException
- {
- log_.log(Log.INFO, 5065, this, "shutdown", "Shutting plugin org.eclipse.jst.ws.creation.ui");
- super.shutdown();
- }
-
- /**
- * Returns the message string identified by the given key from
- * plugin.properties.
- * @return The String message.
- */
- public static String getMessage ( String key )
- {
- MessageUtils msgUtils = new MessageUtils( "org.eclipse.jst.ws.creation.ui.plugin", instance_ );
-
- if( key.startsWith("%"))
- {
- key = key.substring( 1, key.length() );
- }
-
- return msgUtils.getMessage(key);
- }
-
- /**
- * Returns the message string identified by the given key from
- * plugin.properties. Substitution sequences in the message string
- * are replaced by the given array of substitution objects (which
- * are most frequently strings). See the JDK's
- * {@link java.text.MessageFormat java.text.MessageFormat}
- * class for further details on substitution.
- * @return The String message.
- */
- public static String getMessage ( String key, Object[] args )
- {
- return MessageFormat.format(getMessage(key),args);
- }
-
- /**
- * Returns an image descriptor for the named resource
- * as relative to the plugin install location.
- * @return An image descriptor, possibly null.
- */
- public static ImageDescriptor getImageDescriptor ( String name )
- {
- try
- {
- URL installURL = instance_.getDescriptor().getInstallURL();
- URL imageURL = new URL(installURL,name);
- return ImageDescriptor.createFromURL(imageURL);
- }
- catch (MalformedURLException e)
- {
- return null;
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/preferences/ScenarioDefaultsPreferencePage.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/preferences/ScenarioDefaultsPreferencePage.java
deleted file mode 100644
index d0ab4aa..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/preferences/ScenarioDefaultsPreferencePage.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.creation.ui.preferences;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.ws.internal.context.ScenarioContext;
-import org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidget;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-
-
-/**
- *
- */
-public class ScenarioDefaultsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
-{
- private ServerWizardWidget serverWidget_ = null;
-
- public void init(IWorkbench workbench) { }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
-
- protected Control createContents(Composite parent)
- {
- UIUtils utils = new UIUtils(null, null);
-
- Composite page = utils.createComposite( parent, 1 );
-
- serverWidget_ = new ServerWizardWidget( false );
- serverWidget_.addControls( page, new Listener()
- {
- public void handleEvent( Event evt ){}
- } );
- initializeValues();
- return page;
- }
-
- private void initializeValues()
- {
- ScenarioContext context = WebServicePlugin.getInstance().getScenarioContext();
-
- // Set values from context.
- TypeRuntimeServer serverIds = new TypeRuntimeServer();
- TypeRuntimeServer clientIds = new TypeRuntimeServer();
-
- serverIds.setTypeId( context.getWebServiceType() );
- clientIds.setTypeId( context.getClientWebServiceType() );
-
- serverWidget_.setServiceTypeRuntimeServer( serverIds );
- serverWidget_.setClientTypeRuntimeServer( clientIds );
- serverWidget_.setGenerateProxy( new Boolean(context.getGenerateProxy()) );
- serverWidget_.setPublishService( new Boolean(context.getLaunchWebServiceExplorer()) );
- serverWidget_.setStartService( new Boolean(context.getStartWebService()) );
- serverWidget_.setTestService( new Boolean(context.getTestWebService()) );
- serverWidget_.setMonitorService(new Boolean(context.getMonitorWebService()));
- serverWidget_.internalize();
- }
-
- /**
- * Does anything necessary because the default button has been pressed.
- */
- protected void performDefaults()
- {
- super.performDefaults();
- setToDefaults();
- }
-
- private void setToDefaults()
- {
- ScenarioContext context = WebServicePlugin.getInstance().getScenarioContext();
-
- // Set values from context.
- TypeRuntimeServer serverIds = new TypeRuntimeServer();
- TypeRuntimeServer clientIds = new TypeRuntimeServer();
-
- serverIds.setTypeId( context.getWebServiceTypeDefault() );
- clientIds.setTypeId( context.getClientWebServiceTypeDefault() );
-
- serverWidget_.setServiceTypeRuntimeServer( serverIds );
- serverWidget_.setClientTypeRuntimeServer( clientIds );
- serverWidget_.setGenerateProxy( new Boolean(context.getGenerateProxyDefault()) );
- serverWidget_.setPublishService( new Boolean(context.getLaunchWebServiceExplorerDefault()) );
- serverWidget_.setStartService( new Boolean(context.getStartWebServiceDefault()) );
- serverWidget_.setTestService( new Boolean(context.getTestWebServiceDefault()) );
- serverWidget_.setMonitorService(new Boolean(context.getMonitorWebServiceDefault()));
- serverWidget_.internalize();
- }
-
- /**
- * Do anything necessary because the OK button has been pressed.
- * @return whether it is okay to close the preference page
- */
- public boolean performOk()
- {
- storeValues();
- return true;
- }
-
- private void storeValues()
- {
- ScenarioContext context = WebServicePlugin.getInstance().getScenarioContext();
-
- TypeRuntimeServer serverIds = serverWidget_.getServiceTypeRuntimeServer();
- TypeRuntimeServer clientIds = serverWidget_.getClientTypeRuntimeServer();
-
- context.setWebServiceType( serverIds.getTypeId() );
- context.setClientWebServiceType( clientIds.getTypeId() );
- context.setGenerateProxy( serverWidget_.getGenerateProxy().booleanValue() );
- context.setLaunchWebServiceExplorer( serverWidget_.getPublishService().booleanValue() );
- context.setStartWebService( serverWidget_.getStartService().booleanValue() );
- context.setTestWebService( serverWidget_.getTestService().booleanValue() );
- context.setMonitorWebService(serverWidget_.getMonitorService().booleanValue());
- }
-
- protected void performApply()
- {
- performOk();
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidget.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidget.java
deleted file mode 100644
index dec82a6..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidget.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.creation.ui.widgets;
-
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.PreferencesSelectionWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.WebServiceClientTypeWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.data.LabelsAndIds;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class ServerWizardWidget extends SimpleWidgetDataContributor
-{
- private WebServiceClientTypeWidget clientWidget_;
- private PreferencesSelectionWidget preferencesWidget_;
- private Listener statusListener_;
- private TypeRuntimeServer ids_;
- private LabelsAndIds labelIds_;
- private boolean displayPreferences_;
-
- /*CONTEXT_ID PWPR0001 for the Project Page*/
- private String INFOPOP_PWPR_PAGE = "PWPR0001";
-
- /*CONTEXT_ID PWPR0005 for the Generate Proxy check box of the Project Page*/
- private String INFOPOP_PWPR_CHECKBOX_GENERATE_PROXY = "PWPR0005";
- private Button generateProxy_;
-
- /*CONTEXT_ID PWPR0010 for the Web Service Type combo box of the Project Page*/
- private String INFOPOP_PWPR_COMBO_TYPE = "PWPR0010";
- private Combo webserviceType_;
-
- /*CONTEXT_ID PWPR0011 for the Wizard Scenario Service group of the Project Page*/
- private String INFOPOP_PWPR_GROUP_SCENARIO_SERVICE = "PWPR0011";
- private Button startService_;
-
- /*CONTEXT_ID PWPR0009 for the Start Web Project check box check box of the Project Page*/
- private String INFOPOP_PWPR_CHECKBOX_START_WEB_PROJECT = "PWPR0009";
-
- /*CONTEXT_ID PWPR0013 for the test service checkbox of the project page*/
- private String INFOPOP_PWPR_CHECKBOX_TEST_SERVICE = "PWPR0013";
- private Button testService_;
-
- /*CONTEXT_ID PWPR0014 for the monitor service checkbox of the projec page*/
- private String INFOPOP_PWPR_CHECKBOX_MONITOR_SERVICE = "PWPR0014";
- private Button monitorService;
-
- /*CONTEXT_ID PWPR0012 for the Launch UDDI check box of the Project Page*/
- private String INFOPOP_PWPR_CHECKBOX_LAUNCH_WS = "PWPR0012";
- private Button launchUddi_;
-
- public ServerWizardWidget( boolean displayPreferences )
- {
- displayPreferences_ = displayPreferences;
- }
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener)
- {
- String pluginId = "org.eclipse.jst.ws.consumption.ui";
- String createPluginId = "org.eclipse.jst.ws.creation.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId + ".plugin", this );
- UIUtils utils = new UIUtils( msgUtils, createPluginId );
-
- statusListener_ = statusListener;
-
- WorkbenchHelp.setHelp( parent, pluginId + "." + INFOPOP_PWPR_PAGE );
-
- Composite serverComposite = utils.createComposite( parent, 1 );
-
- Group serviceGroup = utils.createGroup( serverComposite, "GROUP_SCENARIO_SERVICE",
- "TOOLTIP_PWPR_GROUP_SCENARIO_SERVICE",
- INFOPOP_PWPR_GROUP_SCENARIO_SERVICE,
- 2, 10, 10);
-
-
- // Create webservice combo box.
- webserviceType_ = utils.createCombo( serviceGroup, "LABEL_WEBSERVICETYPE",
- "TOOLTIP_PWPR_COMBO_TYPE",
- INFOPOP_PWPR_COMBO_TYPE,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
- webserviceType_.addListener( SWT.Modify, statusListener );
-
- Composite buttonsGroup = utils.createComposite( serviceGroup, 1 );
- GridData buttonGrid = new GridData();
- buttonGrid.horizontalSpan = 2;
- buttonsGroup.setLayoutData( buttonGrid );
-
- // Create start service check box.
- startService_ = utils.createCheckbox( buttonsGroup, "BUTTON_START_WEB_PROJECT",
- "TOOLTIP_PWPR_CHECKBOX_START_WEB_PROJECT",
- INFOPOP_PWPR_CHECKBOX_START_WEB_PROJECT );
- startService_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- handleStartPressed();
- }
- });
-
- launchUddi_ = utils.createCheckbox( buttonsGroup, "BUTTON_WS_PUBLISH",
- "TOOLTIP_PWPR_CHECKBOX_LAUNCH_WS",
- INFOPOP_PWPR_CHECKBOX_LAUNCH_WS );
-
- Composite proxyComposite = utils.createComposite( serverComposite, 1, 5, 0 );
-
- // Create generate proxy check box.
- generateProxy_ = utils.createCheckbox( proxyComposite, "BUTTON_GENERATE_PROXY",
- "TOOLTIP_PWPR_CHECKBOX_GENERATE_PROXY",
- INFOPOP_PWPR_CHECKBOX_GENERATE_PROXY );
- generateProxy_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- clientWidget_.enableWidget( generateProxy_.getSelection() );
- }
- });
-
- // Create client selection widget.
- clientWidget_ = new WebServiceClientTypeWidget();
- clientWidget_.addControls( serverComposite, statusListener );
-
- Composite testGroup = utils.createComposite(serverComposite,1);
-
- // Create test service check box.
- testService_ = utils.createCheckbox( testGroup, "CHECKBOX_TEST_WEBSERVICE",
- "TOOLTIP_PWPR_CHECKBOX_TEST_SERVICE",
- INFOPOP_PWPR_CHECKBOX_TEST_SERVICE );
-
- monitorService = utils.createCheckbox( testGroup, "CHECKBOX_MONITOR_WEBSERVICE",
- "TOOLTIP_PWPR_CHECKBOX_MONITOR_SERVICE",
- INFOPOP_PWPR_CHECKBOX_MONITOR_SERVICE );
-
- if( displayPreferences_ )
- {
- // Create the preferences widgets.
- preferencesWidget_ = new PreferencesSelectionWidget();
- preferencesWidget_.addControls( serverComposite, statusListener );
- }
-
- return this;
- }
-
- private void handleStartPressed()
- {
- boolean enabled = startService_.getSelection();
-
- testService_.setEnabled( enabled );
- monitorService.setEnabled(enabled);
- launchUddi_.setEnabled( enabled );
- generateProxy_.setEnabled( enabled );
- clientWidget_.enableWidget( getGenerateProxy().booleanValue() );
- }
-
- public void setClientTypeRuntimeServer( TypeRuntimeServer ids )
- {
- clientWidget_.setTypeRuntimeServer( ids );
- }
-
- public TypeRuntimeServer getClientTypeRuntimeServer()
- {
- return clientWidget_.getTypeRuntimeServer();
- }
-
- public void setServiceTypeRuntimeServer( TypeRuntimeServer ids )
- {
- WebServiceServerRuntimeTypeRegistry registry = WebServiceServerRuntimeTypeRegistry.getInstance();
- LabelsAndIds labelIds = registry.getServiceTypeLabels();
- int selection = 0;
- String[] serviceIds = labelIds.getIds_();
- String selectedId = ids.getTypeId();
-
- webserviceType_.removeListener( SWT.Modify, statusListener_ );
- webserviceType_.setItems( labelIds.getLabels_() );
-
- // Now find the selected one.
- for( int index = 0; index < serviceIds.length; index++ )
- {
- if( selectedId.equals( serviceIds[index ]) )
- {
- selection = index;
- break;
- }
- }
-
- webserviceType_.select( selection );
- webserviceType_.addListener( SWT.Modify, statusListener_ );
- ids_ = ids;
- labelIds_ = labelIds;
- }
-
- public TypeRuntimeServer getServiceTypeRuntimeServer()
- {
- int selectionIndex = webserviceType_.getSelectionIndex();
-
- ids_.setTypeId( labelIds_.getIds_()[selectionIndex] );
-
- return ids_;
- }
-
- public Boolean getStartService()
- {
- return new Boolean( startService_.getSelection() );
- }
-
- public void setStartService( Boolean value )
- {
- startService_.setSelection( value.booleanValue() );
- }
-
- public Boolean getTestService()
- {
- return new Boolean( testService_.getSelection() && startService_.getSelection() );
- }
-
- public void setTestService( Boolean value )
- {
- testService_.setSelection( value.booleanValue() );
- }
-
- public Boolean getMonitorService()
- {
- return new Boolean(monitorService.getSelection() && startService_.getSelection());
- }
-
- public void setMonitorService(Boolean value)
- {
- monitorService.setSelection(value.booleanValue());
- }
-
- public Boolean getPublishService()
- {
- return new Boolean( launchUddi_.getSelection() && startService_.getSelection() );
- }
-
- public void setPublishService( Boolean value )
- {
- launchUddi_.setSelection( value.booleanValue() );
- }
-
- public Boolean getGenerateProxy()
- {
- return new Boolean( generateProxy_.getSelection() && startService_.getSelection() );
- }
-
- public void setGenerateProxy( Boolean value )
- {
- generateProxy_.setSelection( value.booleanValue() );
- }
-
- public ResourceContext getResourceContext()
- {
- return preferencesWidget_.getResourceContext();
- }
-
- public void setResourceContext( ResourceContext context )
- {
- preferencesWidget_.setResourceContext( context );
- }
-
- public void internalize()
- {
- handleStartPressed();
- }
-
- public Status getStatus()
- {
- Status status = new SimpleStatus( "" );
-
- // If the webservice has not been selected then user can not move
- // forward to the next page.
- if( webserviceType_.getText().equals("") )
- {
- status = new SimpleStatus( "", "", Status.ERROR );
- }
-
- return status;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetDefaultingCommand.java
deleted file mode 100644
index 5b198e4..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetDefaultingCommand.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.creation.ui.widgets;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientWizardWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-public class ServerWizardWidgetDefaultingCommand extends ClientWizardWidgetDefaultingCommand
-{
- private TypeRuntimeServer typeRuntimeServer_;
- private IStructuredSelection initialSelection_;
-
- public Status execute(Environment env)
- {
- WebServiceServerRuntimeTypeRegistry registry = WebServiceServerRuntimeTypeRegistry.getInstance();
-
- String type = getScenarioContext().getWebServiceType();
- String runtime = registry.getDefaultRuntimeValueFor( type );
- String serverID = registry.getDefaultServerValueFor( type );
- String factoryID = registry.getServerFactoryIdFromServerId( serverID );
-
- typeRuntimeServer_ = new TypeRuntimeServer();
-
- typeRuntimeServer_.setTypeId( type );
- typeRuntimeServer_.setRuntimeId( runtime );
- typeRuntimeServer_.setServerId( factoryID );
-
- //Default the typeId from the initial selection
- String[] typeIds = registry.getWebServiceTypeBySelection(initialSelection_);
- if (typeIds!=null && typeIds.length>0)
- {
- typeRuntimeServer_.setTypeId(typeIds[0]);
- }
-
- return new SimpleStatus("");
- }
-
- public void setInitialSelection(IStructuredSelection selection)
- {
- initialSelection_ = selection;
- }
-
- public TypeRuntimeServer getServiceTypeRuntimeServer()
- {
- return typeRuntimeServer_;
- }
-
- public Boolean getStartService()
- {
- return new Boolean( getScenarioContext().getStartWebService() );
- }
-
- public Boolean getPublishService()
- {
- return new Boolean( getScenarioContext().getLaunchWebServiceExplorer() );
- }
-
- public Boolean getGenerateProxy()
- {
- return new Boolean( getScenarioContext().getGenerateProxy() );
- }
-
- public Boolean getMonitorService()
- {
- return new Boolean(getScenarioContext().getMonitorWebService());
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetOutputCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetOutputCommand.java
deleted file mode 100644
index 504fd97..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetOutputCommand.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.creation.ui.widgets;
-
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientWizardWidgetOutputCommand;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-
-
-public class ServerWizardWidgetOutputCommand extends ClientWizardWidgetOutputCommand
-{
- private TypeRuntimeServer typeRuntimeServer_;
- private boolean startService_;
- private boolean testService_;
- private boolean publishService_;
- private boolean generateProxy_;
-
-
- public TypeRuntimeServer getServiceTypeRuntimeServer()
- {
- return typeRuntimeServer_;
- }
-
- public boolean getStartService()
- {
- return startService_;
- }
-
- public boolean getTestService()
- {
- return testService_;
- }
-
- public boolean getPublishService()
- {
- return publishService_;
- }
-
- public boolean getGenerateProxy()
- {
- return generateProxy_;
- }
-
- /**
- * @param generateProxy_ The generateProxy_ to set.
- */
- public void setGenerateProxy(boolean generateProxy_)
- {
- this.generateProxy_ = generateProxy_;
- }
- /**
- * @param publishService_ The publishService_ to set.
- */
- public void setPublishService(boolean publishService_)
- {
- this.publishService_ = publishService_;
- }
- /**
- * @param startService_ The startService_ to set.
- */
- public void setStartService(boolean startService_)
- {
- this.startService_ = startService_;
- }
- /**
- * @param testService_ The testService_ to set.
- */
- public void setTestService(boolean testService_)
- {
- this.testService_ = testService_;
- }
- /**
- * @param typeRuntimeServer_ The typeRuntimeServer_ to set.
- */
- public void setServiceTypeRuntimeServer(TypeRuntimeServer typeRuntimeServer_)
- {
- this.typeRuntimeServer_ = typeRuntimeServer_;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ExportWSWidgetBinding.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ExportWSWidgetBinding.java
deleted file mode 100644
index bd0b1ec..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ExportWSWidgetBinding.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.creation.ui.widgets.binding;
-
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.PublishToPrivateUDDICommandFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.PublishWSWidget;
-import org.eclipse.jst.ws.internal.ui.wse.LaunchWebServicesExplorerCommand;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class ExportWSWidgetBinding implements CommandWidgetBinding
-{
- private CanFinishRegistry canFinishRegistry;
- private WidgetRegistry widgetRegistry;
- private DataMappingRegistry dataMappingRegistry;
- private PublishToPrivateUDDICommandFragment publishToPrivateUDDICmdFrag;
-
- public ExportWSWidgetBinding()
- {
- publishToPrivateUDDICmdFrag = new PublishToPrivateUDDICommandFragment();
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create()
- */
- public CommandFragmentFactory create()
- {
- return new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- SequenceFragment root = new SequenceFragment();
- root.add(new SimpleFragment("WSExport"));
- root.add(publishToPrivateUDDICmdFrag);
- root.add(new SimpleFragment(new LaunchWebServicesExplorerCommand(), ""));
- return root;
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- this.canFinishRegistry = canFinishRegistry;
- publishToPrivateUDDICmdFrag.registerCanFinish(this.canFinishRegistry);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- this.dataMappingRegistry = dataRegistry;
- publishToPrivateUDDICmdFrag.registerDataMappings(this.dataMappingRegistry);
-
- // PublishToPrivateUDDICommandFragment
- dataMappingRegistry.addMapping(PublishWSWidget.class, "PublishToPrivateUDDI", PublishToPrivateUDDICommandFragment.class);
-
- // LaunchWebServicesExplorerCommand
- dataMappingRegistry.addMapping(PublishWSWidget.class, "ForceLaunchOutsideIDE", LaunchWebServicesExplorerCommand.class);
- dataMappingRegistry.addMapping(PublishWSWidget.class, "LaunchOptions", LaunchWebServicesExplorerCommand.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- this.widgetRegistry = widgetRegistry;
- publishToPrivateUDDICmdFrag.registerWidgetMappings(this.widgetRegistry);
-
- widgetRegistry.add("WSExport",
- msgUtils.getMessage("PAGE_TITLE_WS_PUBLISH"),
- msgUtils.getMessage("PAGE_DESC_WS_PUBLISH"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new PublishWSWidget(true);
- }
- }
- );
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/PublishWSDLWidgetBinding.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/PublishWSDLWidgetBinding.java
deleted file mode 100644
index 1bc3060..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/PublishWSDLWidgetBinding.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.creation.ui.widgets.binding;
-
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class PublishWSDLWidgetBinding implements CommandWidgetBinding
-{
- public PublishWSDLWidgetBinding()
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create()
- */
- public CommandFragmentFactory create()
- {
- return new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- return new SimpleFragment();
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- }
-
- /* (non-Javadoc),
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ServerWidgetBinding.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ServerWidgetBinding.java
deleted file mode 100644
index ef06a5c..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ServerWidgetBinding.java
+++ /dev/null
@@ -1,574 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.creation.ui.widgets.binding;
-
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.command.common.ClientServerDeployableConfigCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.ComputeEndpointCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.CreateClientProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.CreateMonitorCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.CreateServiceProjectCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.ManageServerStartUpCommand;
-import org.eclipse.jst.ws.internal.consumption.command.common.ServerDeployableConfigurationCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.command.data.ServerInstToIServerTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.common.FinishFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.PublishToPrivateUDDICommandFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.PublishWSWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionOutputCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.AddModuleDependenciesCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestDelegateCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishDefaultCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishJavaTestFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishTestFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.TestDefaultingFragment;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WSDLTestLaunchCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WebServiceClientTestArrivalCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceClientTypeRegistry;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidget;
-import org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidgetOutputCommand;
-import org.eclipse.jst.ws.internal.creation.ui.widgets.runtime.ServerRuntimeSelectionWidget;
-import org.eclipse.jst.ws.internal.creation.ui.widgets.runtime.ServerRuntimeSelectionWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.creation.ui.widgets.test.LaunchFragment;
-import org.eclipse.jst.ws.internal.creation.ui.widgets.test.ServiceTestFragment;
-import org.eclipse.jst.ws.internal.creation.ui.widgets.test.ServiceTestWidget;
-import org.eclipse.jst.ws.internal.creation.ui.widgets.test.WebServiceTestDefaultingCommand;
-import org.eclipse.jst.ws.internal.ui.wse.LaunchWebServicesExplorerCommand;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.SelectionCommand;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-public class ServerWidgetBinding implements CommandWidgetBinding
-{
- private CanFinishRegistry canFinishRegistry_;
- private WidgetRegistry widgetRegistry_;
- private DataMappingRegistry dataMappingRegistry_;
- private PublishToPrivateUDDICommandFragment publishToPrivateUDDICmdFrag;
-
- public ServerWidgetBinding()
- {
- publishToPrivateUDDICmdFrag = new PublishToPrivateUDDICommandFragment();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create()
- */
- public CommandFragmentFactory create()
- {
- return new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- return new ServiceRootCommandFragment();
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- canFinishRegistry_ = canFinishRegistry;
- publishToPrivateUDDICmdFrag.registerCanFinish(canFinishRegistry_);
- }
-
- /* (non-Javadoc),
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- dataMappingRegistry_ = dataRegistry;
-
- // Before ServerWizardWidget
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerWizardWidget.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "StartService", ServerWizardWidget.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "TestService", ServerWizardWidget.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "MonitorService", ServerWizardWidget.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "MonitorService", CreateMonitorCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "MonitorService", ComputeEndpointCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "PublishService", ServerWizardWidget.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "GenerateProxy", ServerWizardWidget.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ServerWizardWidget.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ResourceContext", ServerWizardWidget.class);
-
- // After ServerWizardWidget
- dataRegistry.addMapping(ServerWizardWidget.class, "ServiceTypeRuntimeServer", ServerWizardWidgetOutputCommand.class );
- dataRegistry.addMapping(ServerWizardWidget.class, "StartService", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidget.class, "TestService", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidget.class, "MonitorService", CreateMonitorCommand.class);
- dataRegistry.addMapping(ServerWizardWidget.class, "MonitorService", ComputeEndpointCommand.class);
- dataRegistry.addMapping(ServerWizardWidget.class, "PublishService", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidget.class, "GenerateProxy", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidget.class, "ClientTypeRuntimeServer", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidget.class, "ResourceContext", ServerWizardWidgetOutputCommand.class);
-
- // Before ObjectSelectionWidget
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService", ClientTestWidget.class );
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService",FinishTestFragment.class);
-
- // Before ServerRuntimeSelectionWidget
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "GenerateProxy", ServerRuntimeSelectionWidget.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceProject2EARProject", ServerRuntimeSelectionWidget.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "Runtime2ClientTypes", ServerRuntimeSelectionWidget.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerRuntimeSelectionWidget.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ServerRuntimeSelectionWidget.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceJ2EEVersion", ServerRuntimeSelectionWidget.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientJ2EEVersion", ServerRuntimeSelectionWidget.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceNeedEAR", ServerRuntimeSelectionWidget.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientNeedEAR", ServerRuntimeSelectionWidget.class);
-
-
- // After ServerRuntimeSelectionWidget
- dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceTypeRuntimeServer", ServerExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceJ2EEVersion", ServerExtensionDefaultingCommand.class );
- dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientTypeRuntimeServer", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientJ2EEVersion", ClientExtensionDefaultingCommand.class );
- dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceProject2EARProject", ServerExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "Runtime2ClientTypes", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceNeedEAR", ServerExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientNeedEAR", ClientExtensionDefaultingCommand.class);
-
-
- // Map fragments that depend on data.
- dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientTypeRuntimeServer", ClientExtensionFragment.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceTypeRuntimeServer", ServerExtensionFragment.class);
-
- // CreateMonitorCommand
- dataRegistry.addMapping(CreateMonitorCommand.class, "MonitoredPort", ComputeEndpointCommand.class);
-
- // ComputeEndpointCommand
- dataRegistry.addMapping(ComputeEndpointCommand.class, "Endpoint", ServiceTestWidget.class);
- dataRegistry.addMapping(ComputeEndpointCommand.class, "Endpoint", ClientTestDelegateCommand.class);
-
- //ServiceTestWidget mappings
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", ServiceTestWidget.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", ServiceTestWidget.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", CreateMonitorCommand.class);
- dataRegistry.addMapping(ServerExtensionOutputCommand.class, "WsdlURI", ServiceTestWidget.class);
- dataRegistry.addMapping(ServerExtensionOutputCommand.class, "WsdlURI", ComputeEndpointCommand.class);
- dataRegistry.addMapping(ServerExtensionOutputCommand.class, "WebServicesParser", ComputeEndpointCommand.class);
- dataRegistry.addMapping(WebServiceTestDefaultingCommand.class, "ServiceTestFacilities", ServiceTestWidget.class);
- dataRegistry.addMapping(WebServiceTestDefaultingCommand.class, "Environment", ServiceTestWidget.class);
- dataRegistry.addMapping(ServiceTestWidget.class, "LaunchedServiceTestName", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServiceTestWidget.class, "LaunchedServiceTestName", FinishTestFragment.class);
- dataRegistry.addMapping(ServiceTestWidget.class, "LaunchedServiceTestName", TestDefaultingFragment.class);
-
- // CreateClientProjectCommand
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", CreateClientProjectCommand.class, "ProxyProject", new StringToIProjectTransformer());
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", CreateClientProjectCommand.class, "ProxyProjectEAR", new StringToIProjectTransformer());
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectType", CreateClientProjectCommand.class, "ClientProjectTypeId", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServer", CreateClientProjectCommand.class, "ServerFactoryId", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientJ2EEVersion", CreateClientProjectCommand.class, "J2EEVersion", null);
- dataRegistry.addMapping(ClientServerDeployableConfigCommand.class, "ServiceExistingServerInstId", CreateClientProjectCommand.class, "ExistingServerId", null);
- dataRegistry.addMapping(ClientServerDeployableConfigCommand.class, "AddedProjectToServer", CreateClientProjectCommand.class);
-
- // Before Client Test widget.
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ClientTestWidget.class );
-
- // Before ClientTestWidget
-
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject", ClientTestWidget.class );
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR", ClientTestWidget.class );
- dataRegistry.addMapping(TestDefaultingFragment.class, "TestFacility",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Folder",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "JspFolder",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "RunClientTest",ClientTestWidget.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Methods",ClientTestWidget.class);
-
-
- // After ClientTestWidget
- dataRegistry.addMapping(ClientTestWidget.class, "SampleProjectEAR",FinishDefaultCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "SampleProject",FinishDefaultCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "TestFacility",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "Folder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "JspFolder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "RunClientTest",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "Methods",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientTestWidget.class, "TestService",FinishTestFragment.class);
- dataRegistry.addMapping(ClientTestWidget.class, "TestID",FinishTestFragment.class);
- dataRegistry.addMapping(ClientTestWidget.class, "IsTestWidget",FinishTestFragment.class);
- // PublishWSWidget
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "PublishService", PublishWSWidget.class, "PublishToPublicUDDI", null);
-
- // PublishToPrivateUDDICommandFragment
- dataRegistry.addMapping(PublishWSWidget.class, "PublishToPrivateUDDI", PublishToPrivateUDDICommandFragment.class);
-
- // LaunchWebServicesExplorerCommand
- dataRegistry.addMapping(PublishWSWidget.class, "PublishToPrivateUDDI", LaunchFragment.class);
- dataRegistry.addMapping(PublishWSWidget.class, "PublishToPublicUDDI", LaunchFragment.class);
- // TODO Need defaults for these properties.
- dataRegistry.addMapping(PublishWSWidget.class, "ForceLaunchOutsideIDE", LaunchWebServicesExplorerCommand.class);
- dataRegistry.addMapping(PublishWSWidget.class, "LaunchOptions", LaunchWebServicesExplorerCommand.class);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
-
- widgetRegistry_ = widgetRegistry;
- publishToPrivateUDDICmdFrag.registerWidgetMappings(widgetRegistry_);
-
- widgetRegistry.add( "ServerWizardWidget",
- msgUtils.getMessage("PAGE_TITLE_WS_PROJECT"),
- msgUtils.getMessage("PAGE_DESC_WS_PROJECT"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new ServerWizardWidget( true );
- }
- } );
-
- MessageUtils creationUIMessageUtils = new MessageUtils("org.eclipse.jst.ws.creation.ui.plugin", this);
- widgetRegistry.add( "ObjectSelectionWidget",
- creationUIMessageUtils.getMessage("PAGE_TITLE_OBJECT_SELECTION"),
- creationUIMessageUtils.getMessage("PAGE_DESC_OBJECT_SELECTION"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new ObjectSelectionWidget();
- }
- });
-
- widgetRegistry.add( "ServerRuntimeSelectionWidget",
- msgUtils.getMessage("PAGE_TITLE_WS_RUNTIME_SELECTION"),
- msgUtils.getMessage("PAGE_DESC_WS_RUNTIME_SELECTION"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new ServerRuntimeSelectionWidget();
- }
- } );
-
- widgetRegistry.add( "TestService",
- msgUtils.getMessage("PAGE_TITLE_WSTEST"),
- msgUtils.getMessage("PAGE_DESC_WSTEST"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new ServiceTestWidget();
- }
- } );
-
- widgetRegistry.add( "ClientTestWidget",
- msgUtils.getMessage("PAGE_TITLE_WS_SAMPLE"),
- msgUtils.getMessage("PAGE_DESC_WS_SAMPLE"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new ClientTestWidget();
- }
- });
-
- widgetRegistry.add( "Publish",
- msgUtils.getMessage("PAGE_TITLE_WS_PUBLISH"),
- msgUtils.getMessage("PAGE_DESC_WS_PUBLISH"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new PublishWSWidget(true);
- }
- } );
- }
-
- private class InitRegistries extends SimpleCommand
- {
- private WebServiceClientTypeRegistry clientRegistry_ = WebServiceClientTypeRegistry.getInstance();
- private WebServiceServerRuntimeTypeRegistry serverRegistry_ = WebServiceServerRuntimeTypeRegistry.getInstance();
-
- public Status execute(Environment environment)
- {
- clientRegistry_.setDataMappingRegistry( dataMappingRegistry_ );
- clientRegistry_.setWidgetRegistry( widgetRegistry_ );
- clientRegistry_.setCanFinishRegistry( canFinishRegistry_ );
-
- serverRegistry_.setDataMappingRegistry( dataMappingRegistry_ );
- serverRegistry_.setWidgetRegistry( widgetRegistry_ );
- serverRegistry_.setCanFinishRegistry( canFinishRegistry_ );
-
- return new SimpleStatus( "" );
- }
- }
-
- private class ClientFragment extends BooleanFragment
- {
- boolean genProxy_ = false;
-
- public ClientFragment()
- {
- setCondition( new Condition()
- {
- public boolean evaluate()
- {
- return genProxy_;
- }
- });
-
- SequenceFragment clientRoot = new SequenceFragment();
-
- clientRoot.add( new SimpleFragment( new ClientExtensionDefaultingCommand( false ), ""));
- clientRoot.add(new SimpleFragment(new ClientServerDeployableConfigCommand(), "")); //Note: added here for client
- clientRoot.add( new SimpleFragment( new CreateClientProjectCommand(), ""));
- clientRoot.add( new ClientExtensionFragment() );
- clientRoot.add( new SimpleFragment( new ClientExtensionOutputCommand(), "" ));
-
- setTrueFragment( clientRoot );
- }
-
- public void setGenerateProxy( boolean genProxy )
- {
- genProxy_ = genProxy;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragment#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- // Map the output of the service scenario to the client scenario.
- dataRegistry.addMapping( ServerExtensionOutputCommand.class, "WebServicesParser", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping( ServerExtensionOutputCommand.class, "WsdlURI", ClientExtensionDefaultingCommand.class );
- }
- }
-
- private class ServiceRootCommandFragment extends SequenceFragment
- {
- public ServiceRootCommandFragment()
- {
- add( new SimpleFragment( new InitRegistries(), "" ) );
- add( new SimpleFragment( new ServerWizardWidgetDefaultingCommand(), ""));
- add( new SimpleFragment( "ServerWizardWidget" ) );
- add( new SimpleFragment( new ServerWizardWidgetOutputCommand(), "" ));
- add( new ObjectSelectionFragment() );
- add( new SimpleFragment( new ServerRuntimeSelectionWidgetDefaultingCommand(), ""));
- add( new SimpleFragment( "ServerRuntimeSelectionWidget" ) );
- add( new SimpleFragment( new ServerExtensionDefaultingCommand(), ""));
- add(new SimpleFragment(new ServerDeployableConfigurationCommand(), "")); //Note: added here
- add( new SimpleFragment( new CreateServiceProjectCommand(), ""));
- add( new ServerExtensionFragment() );
- add( new SimpleFragment( new ServerExtensionOutputCommand(), "" ));
- add(new SimpleFragment(new CreateMonitorCommand(), ""));
- add(new SimpleFragment(new ComputeEndpointCommand(), ""));
- add( new ServiceTestFragment( "TestService") );
- add( new SimpleFragment(new TestDefaultingFragment(),""));
- add( new ClientFragment() );
- add( new SimpleFragment(new ManageServerStartUpCommand(),""));
- add( new ClientTestFragment( "ClientTestWidget") );
- add( new SimpleFragment( "Publish") );
- add(publishToPrivateUDDICmdFrag);
- add(new LaunchFragment());
- add(new FinishFragment());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragment#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- publishToPrivateUDDICmdFrag.registerDataMappings(dataMappingRegistry_);
-
- dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ServerWizardWidgetDefaultingCommand.class );
-
- //dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ServerRuntimeSelectionWidgetDefaultingCommand.class, "InitialSelection", null);
- //dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientInitialSelection", null);
-
- dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "ObjectSelection", ServerRuntimeSelectionWidgetDefaultingCommand.class, "InitialSelection", null);
- dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "ObjectSelection", ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientInitialSelection", null);
- dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "Project", ServerRuntimeSelectionWidgetDefaultingCommand.class, "InitialProject", null);
- dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "Project", ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientInitialProject", null);
- dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "WebServicesParser", ServerExtensionDefaultingCommand.class );
-
- // Map ServerWizardWidgetDefaultingCommand
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "GenerateProxy", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "StartService", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "TestService", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "PublishService", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "GenerateProxy", ServerWizardWidgetOutputCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ResourceContext", ServerWizardWidgetOutputCommand.class);
-
- // Map ServerWizardWidgetOutputCommand.
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "ServiceTypeRuntimeServer", ObjectSelectionFragment.class, "TypeRuntimeServer", null);
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "ClientTypeRuntimeServer", ServerRuntimeSelectionWidgetDefaultingCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "ServiceTypeRuntimeServer", ServerRuntimeSelectionWidgetDefaultingCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "StartService", ServerExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService", ServerExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "PublishService", ServerExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "PublishService", PublishWSWidget.class, "PublishToPublicUDDI", null);
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "GenerateProxy", ServerRuntimeSelectionWidgetDefaultingCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "ResourceContext", ClientExtensionDefaultingCommand.class);
-
- //to the test wizard
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "GenerateProxy", ServiceTestFragment.class);
- dataRegistry.addMapping(ServerExtensionOutputCommand.class, "WsdlURI", WSDLTestLaunchCommand.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", WSDLTestLaunchCommand.class);
-
-
-
- // Map ServerRuntimeSelectionWidgetDefaultingCommand
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceProject2EARProject", ServerExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "Runtime2ClientTypes", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceJ2EEVersion", ServerExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientJ2EEVersion", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "GenerateProxy", ClientFragment.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "GenerateProxy", ClientExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceNeedEAR", ServerExtensionDefaultingCommand.class);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientNeedEAR", ClientExtensionDefaultingCommand.class);
-
-
- // Map ServerExtensionDefaultingCommand
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerExtensionFragment.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "TestService", ServiceTestFragment.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "Publish", PublishToPrivateUDDICommandFragment.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer",WSDLTestLaunchCommand.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", ClientTestDelegateCommand.class);
-
- // Map CreateServiceProjectCommand
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", CreateServiceProjectCommand.class, "ProjectName", null);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProjectEAR", CreateServiceProjectCommand.class, "EarProjectName", null);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerServer", CreateServiceProjectCommand.class,"ServerFactoryId",null);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceJ2EEVersion", CreateServiceProjectCommand.class, "J2EEVersion", null);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class,"ServiceNeedEAR",CreateServiceProjectCommand.class,"NeedEAR",null);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class,"IsServiceProjectEJB",CreateServiceProjectCommand.class);
-
-
- // Map ClientExtensionDefaultingCommand
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", ClientExtensionFragment.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", WebServiceClientTestArrivalCommand.class, "ClientIds", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", FinishDefaultCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "TestService", ClientTestFragment.class );
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "TestService", ClientTestWidget.class );
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "LaunchedServiceTestName", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", AddModuleDependenciesCommand.class );
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientJ2EEVersion", WebServiceClientTestArrivalCommand.class, "J2eeVersion", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServer", ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "Runtime2ClientTypes", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "GenerateProxy", ClientTestFragment.class);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "GenerateProxy", FinishJavaTestFragment.class);
-
- //ServerDeployableConfigurationCommand
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "StartService", ServerDeployableConfigurationCommand.class );
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", ServerDeployableConfigurationCommand.class, "ServiceProject", new StringToIProjectTransformer());
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ServerExtensionOutputCommand.class, "WsdlURI", ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceServerInstanceId", ServerDeployableConfigurationCommand.class,"ServiceExistingServer", new ServerInstToIServerTransformer());
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerServer", ServerDeployableConfigurationCommand.class,"ServiceServerTypeID", null);
- dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ServerDeployableConfigurationCommand.class, "ClientTypeRuntimeServer", null );
- dataRegistry.addMapping(ServerDeployableConfigurationCommand.class, "ServiceExistingServerInstId", ServerExtensionDefaultingCommand.class,"ServiceExistingServerInstanceId",null);
- dataRegistry.addMapping(ServerDeployableConfigurationCommand.class, "SampleExistingServerInstId", ClientExtensionDefaultingCommand.class,"ClientExistingServerInstanceId", null);
- dataRegistry.addMapping(ServerDeployableConfigurationCommand.class, "ServiceExistingServerInstId", CreateServiceProjectCommand.class,"ExistingServerId", null);
- dataRegistry.addMapping(ServerDeployableConfigurationCommand.class, "AddedProjectToServer", CreateServiceProjectCommand.class);
- dataRegistry.addMapping(ServerDeployableConfigurationCommand.class, "ServiceExistingServerInstId", CreateMonitorCommand.class, "ServiceServerInstanceId", null);
- dataRegistry.addMapping(ClientServerDeployableConfigCommand.class, "ServiceExistingServerInstId", FinishDefaultCommand.class, "ExistingServerId", null);
-
- // Map ServerExtensionOutputCommand for ServerStart()
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProjectEAR", ServerExtensionOutputCommand.class, "EarProjectName", null);
- dataRegistry.addMapping(ServerDeployableConfigurationCommand.class, "ServiceExistingServerInstId", ServerExtensionOutputCommand.class,"ExistingServerId", null);
-
- // Map CreateClientProjectCommand
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", CreateClientProjectCommand.class, "ProxyProject", new StringToIProjectTransformer());
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", CreateClientProjectCommand.class, "ProxyProjectEAR", new StringToIProjectTransformer());
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServerInstance", CreateClientProjectCommand.class, "ExistingServer", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServer", CreateClientProjectCommand.class, "ServerFactoryId", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientJ2EEVersion", CreateClientProjectCommand.class, "J2EEVersion", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientNeedEAR", CreateClientProjectCommand.class, "NeedEAR", null);
-
- //ServerDeployableConfigurationCommand for client side
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", ClientServerDeployableConfigCommand.class, "SampleProject", new StringToIProjectTransformer());
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", ClientServerDeployableConfigCommand.class,"ClientTypeRuntimeServer", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServerInstance", ClientServerDeployableConfigCommand.class,"SampleExistingServer", new ServerInstToIServerTransformer());
-
- // MAP post server config call
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", ClientExtensionOutputCommand.class, "EarProjectName", null);
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServerInstance", ClientExtensionOutputCommand.class, "ExistingServerId", null);
-
- // Map ClientExtensionOutputCommand
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", ClientTestFragment.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", FinishTestFragment.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "ProxyBean", WebServiceClientTestArrivalCommand.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "ProxyBean", ClientTestDelegateCommand.class);
- dataRegistry.addMapping(ClientExtensionOutputCommand.class, "SetEndpointMethod", ClientTestDelegateCommand.class);
-
- // Map ManageServerStartUpCommand
- dataRegistry.addMapping(ServerExtensionOutputCommand.class, "IsWebProjectStartupRequested", ManageServerStartUpCommand.class);
-
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "StartService", ManageServerStartUpCommand.class);
- dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService", ManageServerStartUpCommand.class);
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", ManageServerStartUpCommand.class, "ServiceProject", new StringToIProjectTransformer());
- dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerServer", ManageServerStartUpCommand.class,"ServiceServerTypeId", null);
- dataRegistry.addMapping(ServerDeployableConfigurationCommand.class, "ServiceExistingServerInstId", ManageServerStartUpCommand.class,"ServiceExistingServer", new ServerInstToIServerTransformer());
-
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", ManageServerStartUpCommand.class, "SampleProject", new StringToIProjectTransformer());
- dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServerInstance", ManageServerStartUpCommand.class,"SampleExistingServer", new ServerInstToIServerTransformer());
-
- // Map WebServiceClientTestArrivalCommand
- dataRegistry.addMapping(TestDefaultingFragment.class, "TestFacility",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Folder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "JspFolder",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "RunClientTest",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Methods",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR",ClientTestDelegateCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject",AddModuleDependenciesCommand.class);
- dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR",AddModuleDependenciesCommand.class);
-
- //Map Finish Command
-
-
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidget.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidget.java
deleted file mode 100644
index 5b43c06..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidget.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.creation.ui.widgets.runtime;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.common.ValidationUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ProjectSelectionWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.RuntimeServerSelectionWidget;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-/*
- *
- * ServerRuntimeSelectionWidget
- * This widget is the parent widget for server and client deployment/environment settings
- *
- */
-public class ServerRuntimeSelectionWidget extends SimpleWidgetDataContributor
-{
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- private String createPluginId_ = "org.eclipse.jst.ws.creation.ui";
-
- /* CONTEXT_ID PWRS0002 for the Wizard Scenario Service configuration of the Runtime Selection Page */
- private String INFOPOP_PWRS_GROUP_SERVICE = "PWRS0002";
-
- private RuntimeServerSelectionWidget runtimeWidget_;
- private ProjectSelectionWidget projectWidget_;
- private ClientRuntimeSelectionWidget clientWidget_;
- private SelectionListChoices serviceChoices_;
- private TextModifyListener textListener_;
- private MessageUtils msgUtils_;
-
- private boolean isClientWidgetVisible_ = true;
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- msgUtils_ = new MessageUtils( pluginId_ + ".plugin", this );
- UIUtils uiUtils = new UIUtils(msgUtils_, createPluginId_ );
-
- Composite root = uiUtils.createComposite( parent, 1 );
-
- Text messageText = new Text( root, SWT.WRAP | SWT.MULTI | SWT.READ_ONLY );
-
- GridData gd = new GridData();
- gd.horizontalIndent = 10;
-
- messageText.setLayoutData(gd);
- messageText.setText(
- msgUtils_.getMessage("MSG_GENERAL_PROJECT_AND_EAR", new String[] { msgUtils_.getMessage("MSG_SERVICE_SUB")})
- + "\n"
- + msgUtils_.getMessage("MSG_EAR_PROJECT_WILL_BE_CREATED"));
-
- Composite serverComp = uiUtils.createComposite( root, 1, 5, 0 );
-
- Group serverGroup = uiUtils.createGroup( serverComp, "LABEL_SELECTION_VIEW_TITLE",
- null, INFOPOP_PWRS_GROUP_SERVICE,
- 2, 5, 5);
-
- runtimeWidget_ = new RuntimeServerSelectionWidget( false );
- runtimeWidget_.addControls( serverGroup, statusListener );
- textListener_ = new TextModifyListener();
- runtimeWidget_.addModifyListener( textListener_ );
-
- projectWidget_ = new ProjectSelectionWidget();
- projectWidget_.addControls( serverGroup, statusListener );
-
- clientWidget_ = new ClientRuntimeSelectionWidget();
- clientWidget_.addControls( root, statusListener );
-
- return this;
- }
-
- //If generate proxy is not selected, don't show the client portion of the page.
- public void setGenerateProxy( Boolean value )
- {
- clientWidget_.setVisible( value.booleanValue() );
- isClientWidgetVisible_ = value.booleanValue();
- }
-
- public TypeRuntimeServer getServiceTypeRuntimeServer()
- {
- return runtimeWidget_.getTypeRuntimeServer();
- }
-
- public void setServiceTypeRuntimeServer( TypeRuntimeServer ids )
- {
- runtimeWidget_.removeModifyListener( textListener_ );
- runtimeWidget_.setTypeRuntimeServer( ids );
- projectWidget_.setTypeRuntimeServer(ids);
- runtimeWidget_.addModifyListener( textListener_ );
- }
-
- public TypeRuntimeServer getClientTypeRuntimeServer()
- {
- return clientWidget_.getClientTypeRuntimeServer();
- }
-
- public void setClientTypeRuntimeServer( TypeRuntimeServer ids )
- {
- clientWidget_.setClientTypeRuntimeServer( ids );
- }
-
- public SelectionListChoices getServiceProject2EARProject()
- {
- return projectWidget_.getProjectChoices();
- }
-
- public void setServiceProject2EARProject(SelectionListChoices serviceProject2EARProject)
- {
- projectWidget_.setProjectChoices(serviceProject2EARProject);
- }
-
- public SelectionListChoices getRuntime2ClientTypes()
- {
- return clientWidget_.getRuntime2ClientTypes();
- }
-
- public void setRuntime2ClientTypes(SelectionListChoices runtime2ClientTypes)
- {
- clientWidget_.setRuntime2ClientTypes(runtime2ClientTypes);
- }
-
- public String getServiceJ2EEVersion()
- {
- return runtimeWidget_.getJ2EEVersion();
- }
-
- public void setServiceJ2EEVersion(String j2eeVersion)
- {
- runtimeWidget_.setJ2EEVersion(j2eeVersion);
- projectWidget_.setJ2EEVersion(j2eeVersion);
- }
-
- public String getClientJ2EEVersion()
- {
- return clientWidget_.getJ2EEVersion();
- }
-
- public void setClientJ2EEVersion(String j2eeVersion)
- {
- clientWidget_.setJ2EEVersion(j2eeVersion);
- }
-
- public boolean getServiceNeedEAR()
- {
- return projectWidget_.getNeedEAR();
- }
-
- public void setServiceNeedEAR(boolean b)
- {
- projectWidget_.setNeedEAR(b);
- }
-
- public boolean getClientNeedEAR()
- {
- return clientWidget_.getClientNeedEAR();
- }
-
- public void setClientNeedEAR(boolean b)
- {
- clientWidget_.setClientNeedEAR(b);
- }
-
- private class TextModifyListener implements ModifyListener
- {
- public void modifyText(ModifyEvent e)
- {
- if( clientWidget_.isVisible() )
- {
- TypeRuntimeServer serviceIds = runtimeWidget_.getTypeRuntimeServer();
- TypeRuntimeServer clientIds = clientWidget_.getClientTypeRuntimeServer();
-
- clientIds.setRuntimeId( serviceIds.getRuntimeId() );
- clientIds.setServerId( serviceIds.getServerId() );
- clientIds.setServerInstanceId( serviceIds.getServerInstanceId() );
-
- clientWidget_.setClientTypeRuntimeServer( clientIds );
- clientWidget_.setJ2EEVersion(runtimeWidget_.getJ2EEVersion());
- }
-
- //Set the current server selection and J2EE level on the ProjectSelectionWidget
- projectWidget_.setTypeRuntimeServer(runtimeWidget_.getTypeRuntimeServer());
- projectWidget_.setJ2EEVersion(runtimeWidget_.getJ2EEVersion());
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus()
- */
- public Status getStatus()
- {
- Status serviceStatus = runtimeWidget_.getStatus();
- Status clientStatus = clientWidget_.getStatus();
- Status projectStatus = projectWidget_.getStatus();
-
- Status finalStatus = new SimpleStatus( "" );
-
- // call child widgets' getStatus()
- if( serviceStatus.getSeverity() == Status.ERROR )
- {
- finalStatus = serviceStatus;
- }
- else if( clientStatus.getSeverity() == Status.ERROR )
- {
- if (isClientWidgetVisible_)
- finalStatus = clientStatus;
- }
- else if ( projectStatus.getSeverity()== Status.ERROR) {
- finalStatus = projectStatus;
- }
-
- //Validate service side server target and J2EE level
- SelectionListChoices serviceProjects = projectWidget_.getProjectChoices();
- String serviceEARName = null;
- String serviceProjName = null;
- String serviceServerFactoryId = null;
- ValidationUtils valUtils = new ValidationUtils();
- if (serviceProjects!=null)
- {
- serviceEARName = serviceProjects.getChoice().getList().getSelection();
- serviceProjName = serviceProjects.getList().getSelection();
- serviceServerFactoryId = runtimeWidget_.getTypeRuntimeServer().getServerId();
- String serviceJ2EElevel = runtimeWidget_.getJ2EEVersion();
- Status serviceProjectStatus = valUtils.validateProjectTargetAndJ2EE(serviceProjName, serviceEARName, serviceServerFactoryId, serviceJ2EElevel);
- if(serviceProjectStatus.getSeverity()==Status.ERROR)
- {
- finalStatus = serviceProjectStatus;
- }
- }
-
- //Ensure the service project type (Web/EJB) is valid
- if (serviceProjName!=null && serviceProjName.length()>0)
- {
- IProject serviceProj = (IProject)((new StringToIProjectTransformer().transform(serviceProjName)));
- if (serviceProj.exists())
- {
- //Determine whether an EJB project is required
- String webServiceRuntimeId = runtimeWidget_.getTypeRuntimeServer().getRuntimeId();
- String webServiceTypeId = runtimeWidget_.getTypeRuntimeServer().getTypeId();
- WebServiceServerRuntimeTypeRegistry wssrtRegistry = WebServiceServerRuntimeTypeRegistry.getInstance();
- String serverTypeId = wssrtRegistry.getWebServiceServerByFactoryId(serviceServerFactoryId).getId();
- boolean isEJBRequired = wssrtRegistry.requiresEJBModuleFor(serverTypeId, webServiceRuntimeId, webServiceTypeId);
- if (!isEJBRequired)
- {
- //Check the Web service type to see if an EJB project is required
- isEJBRequired = wssrtRegistry.requiresEJBProject(webServiceTypeId);
- }
-
- if (isEJBRequired && !ResourceUtils.isEJBProject(serviceProj))
- {
- finalStatus = new SimpleStatus("",msgUtils_.getMessage("MSG_INVALID_EJB_PROJECT",new String[]{serviceProjName}),Status.ERROR);
- }
- if (!isEJBRequired && !ResourceUtils.isWebProject(serviceProj))
- {
- finalStatus = new SimpleStatus("",msgUtils_.getMessage("MSG_INVALID_WEB_PROJECT",new String[]{serviceProjName}),Status.ERROR);
- }
- }
- }
-
- if (isClientWidgetVisible_)
- {
- SelectionListChoices clientProjects = clientWidget_.getProjectSelectionWidget().getProjectChoices();
- if (clientProjects!=null && serviceProjects!=null)
- {
- String clientEARName = clientProjects.getChoice().getList().getSelection();
- String clientProjName = clientProjects.getList().getSelection();
-
- // check same EAR-ness -----
- String warning_msg = getEARProjectWarningMessage(serviceEARName, clientEARName);
-
- if( clientProjName != null && serviceProjName != null &&
- clientProjName.equalsIgnoreCase( serviceProjName ))
- {
- if (finalStatus.getSeverity()!=Status.ERROR)
- {
- warning_msg = msgUtils_.getMessage( "MSG_SAME_CLIENT_AND_SERVICE_EARS", new String[]{ "WEB" } );
- finalStatus = new SimpleStatus( "", warning_msg, Status.WARNING );
- }
- }
- else if (warning_msg != null)
- {
- if (finalStatus.getSeverity()!=Status.ERROR)
- return new SimpleStatus( "", warning_msg, Status.WARNING );
- }
- }
- }
-
- // TODO: validate projects (i.e 1.2 vs 1.3 Web Projects) against servers
-
-
-
- return finalStatus;
- }
-
- private String getEARProjectWarningMessage(String serviceEARName, String clientEARName ) {
-
- // check if service and client share the same EAR
- if (serviceEARName!=null && clientEARName!=null) {
-
- if (clientEARName.equalsIgnoreCase(serviceEARName) && clientEARName.length()>0) {
- return msgUtils_.getMessage("MSG_SAME_CLIENT_AND_SERVICE_EARS", new String[]{ "EAR" });
- }
- }
-
- return null;
-
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidgetDefaultingCommand.java
deleted file mode 100644
index d0a106d..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidgetDefaultingCommand.java
+++ /dev/null
@@ -1,548 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.creation.ui.widgets.runtime;
-
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer;
-import org.eclipse.jst.ws.internal.consumption.ui.common.ServerSelectionUtils;
-import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin;
-import org.eclipse.jst.ws.internal.consumption.ui.preferences.PersistentServerRuntimeContext;
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidgetDefaultingCommand;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.IWebServiceRuntime;
-import org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeTypeRegistry;
-import org.eclipse.jst.ws.internal.context.ProjectTopologyContext;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.SelectionList;
-import org.eclipse.wst.command.env.core.selection.SelectionListChoices;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerUtil;
-
-public class ServerRuntimeSelectionWidgetDefaultingCommand extends ClientRuntimeSelectionWidgetDefaultingCommand
-{
- private String DEFAULT_CLIENT_EAR_PROJECT_EXT = "EAR";
- private boolean generateProxy_;
-
- // webServiceRuntimeJ2EEType contains the default Web service runtime and J2EE level based on the initial selection.
- // If the initialSeleciton does not result in a valid Web service runtime and J2EE level, webServiceRuntimeJ2EEType
- // should remain null for the life of this instance.
- private WSRuntimeJ2EEType webServiceRuntimeJ2EEType = null;
-
- private TypeRuntimeServer serviceIds_;
- private SelectionListChoices serviceProject2EARProject_;
- private IStructuredSelection initialSelection_;
- private IProject initialProject_;
- private String serviceJ2EEVersion_;
- private boolean serviceNeedEAR_ = true;
-
- public ServerRuntimeSelectionWidgetDefaultingCommand()
- {
- super();
- }
-
- public Status execute(Environment env)
- {
- try
- {
- Status clientSideStatus = super.execute(env);
- if (clientSideStatus.getSeverity()==Status.ERROR)
- {
- return clientSideStatus;
- }
-
- Status status = new SimpleStatus("");
-
- setDefaultServiceRuntimeFromPreference();
- setDefaultServiceJ2EEVersionFromPreference();
- webServiceRuntimeJ2EEType = getWSRuntimeAndJ2EEFromProject(initialProject_);
- if (webServiceRuntimeJ2EEType != null)
- {
- serviceJ2EEVersion_ = webServiceRuntimeJ2EEType.getJ2eeVersionId();
- serviceIds_.setRuntimeId(webServiceRuntimeJ2EEType.getWsrId());
- }
-
- // Set the default client type to a web client type.
- setWebClientType();
-
- // Default projects EARs and servers.
- setDefaultProjects();
- setDefaultEARs();
- setDefaultServer();
- updateServiceEARs();
- updateClientEARs();
- return status;
- } catch (Exception e)
- {
- //Catch all Exceptions in order to give some feedback to the user
- Status errorStatus = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED",new String[]{e.getMessage()}),Status.ERROR, e);
- env.getStatusHandler().reportError(errorStatus);
- return errorStatus;
- }
-
- }
-
- private void setWebClientType()
- {
- SelectionListChoices choices = getRuntime2ClientTypes();
- String webId = "org.eclipse.jst.ws.consumption.ui.clientProjectType.Web";
-
- if( choices != null )
- {
- choices.getChoice().getList().setSelectionValue( webId );
- }
- }
-
- private WSRuntimeJ2EEType getWSRuntimeAndJ2EEFromProject(IProject project)
- {
- WSRuntimeJ2EEType wsrJ2EE = null;
- //If there is a valid initial selection, use it to determine
- //reasonable J2EE version and Web service runtime values
-
- if (project != null && project.exists())
- {
- if (ResourceUtils.isWebProject(project) || ResourceUtils.isEJBProject(project))
- {
- WebServiceServerRuntimeTypeRegistry wssrtReg = WebServiceServerRuntimeTypeRegistry.getInstance();
-
- //Get the J2EE level
- int versionId = J2EEUtils.getJ2EEVersion(project);
- String versionString = String.valueOf(versionId);
-
- //Get the runtime target of the project
- IRuntime runtimeTarget = ServerSelectionUtils.getRuntimeTarget(project.getName());
- String runtimeTargetId = null;
- if (runtimeTarget != null)
- runtimeTargetId = runtimeTarget.getRuntimeType().getId();
-
- //If the preferred Web service runtime supports this J2EE level and this server target, keep it
- if (wssrtReg.doesRuntimeSupportJ2EELevel(versionString, serviceIds_.getRuntimeId()) &&
- ((runtimeTarget == null) ||
- (runtimeTarget != null && wssrtReg.doesRuntimeSupportServerTarget(runtimeTargetId, serviceIds_.getRuntimeId()))
- )
- )
-
- {
- //Set the J2EE level and Web service runtime
- wsrJ2EE = new WSRuntimeJ2EEType();
- wsrJ2EE.setWsrId(serviceIds_.getRuntimeId());
- wsrJ2EE.setJ2eeVersionId(versionString);
- return wsrJ2EE;
-
- } else
- {
- //Look for a runtime that matches both the J2EE level and the server target.
- String[] validRuntimes = wssrtReg.getRuntimesByType(serviceIds_.getTypeId());
- for (int i = 0; i < validRuntimes.length; i++)
- {
- if (wssrtReg.doesRuntimeSupportJ2EELevel(versionString, validRuntimes[i]) &&
- ((runtimeTarget == null) ||
- (runtimeTarget!=null && wssrtReg.doesRuntimeSupportServerTarget(runtimeTargetId, validRuntimes[i]))
- )
- )
- {
- wsrJ2EE = new WSRuntimeJ2EEType();
- wsrJ2EE.setWsrId(validRuntimes[i]);
- wsrJ2EE.setJ2eeVersionId(versionString);
- return wsrJ2EE;
- }
- }
- }
- }
- }
- return wsrJ2EE;
- }
-
- private void setDefaultServiceRuntimeFromPreference()
- {
-
- PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- String pRuntimeId = context.getRuntimeId();
- WebServiceServerRuntimeTypeRegistry wssrtReg = WebServiceServerRuntimeTypeRegistry.getInstance();
- //if the preferred runtime in compatible with the type, select it.
- if (wssrtReg.isRuntimeSupportedForType(serviceIds_.getTypeId(), pRuntimeId))
- {
- serviceIds_.setRuntimeId(pRuntimeId);
- }
- else
- {
- //Set the Web service runtime to one that is supported by the selected type.
- String[] validRuntimes = wssrtReg.getRuntimesByType(serviceIds_.getTypeId());
- if (validRuntimes != null && validRuntimes.length>0)
- {
- serviceIds_.setRuntimeId(validRuntimes[0]);
- }
- }
- }
-
-
- private void setDefaultServiceJ2EEVersionFromPreference()
- {
- if (serviceIds_ != null)
- {
- String runtimeId = serviceIds_.getRuntimeId();
- if (runtimeId != null)
- {
- IWebServiceRuntime wsr = WebServiceServerRuntimeTypeRegistry.getInstance().getWebServiceRuntimeById(runtimeId);
- if (wsr != null)
- {
- String[] versions = wsr.getJ2EEVersions();
- //If the preferred J2EE version is in versions, pick the preferred one.
- //Otherwise, pick the first one.
- if (versions != null && versions.length > 0)
- {
- PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext();
- String pJ2EE = context.getJ2EEVersion();
- if (pJ2EE!=null && pJ2EE.length()>0)
- {
- for (int i=0;i<versions.length;i++)
- {
- if (versions[i].equals(pJ2EE))
- {
- serviceJ2EEVersion_ = versions[i];
- return;
- }
- }
- }
- serviceJ2EEVersion_ = versions[0];
- return;
- }
-
- }
- }
- }
- }
- private void setDefaultProjects()
- {
-
- //Handle the case where no valid initial selection exists
- if (initialProject_== null || (initialProject_!=null && webServiceRuntimeJ2EEType==null))
- {
- //Select the first existing project that is valid.
-
- setServiceProjectToFirstValid();
- String serviceProjectName = getServiceProject2EARProject().getList().getSelection();
-
- //Select a client project with "client" added to the above project name.
- String clientProjectName = ResourceUtils.getClientWebProjectName(serviceProjectName, serviceIds_.getTypeId() );
- getRuntime2ClientTypes().getChoice().getChoice().getList().setSelectionValue(clientProjectName);
- return;
- }
-
-
-
- //Set the service project selection to this initialProject
- getServiceProject2EARProject().getList().setSelectionValue(initialProject_.getName());
- String clientProjectName = ResourceUtils.getClientWebProjectName(initialProject_.getName(), serviceIds_.getTypeId() );
- //Set the client project selection to clientProject
- getRuntime2ClientTypes().getChoice().getChoice().getList().setSelectionValue(clientProjectName);
-
- }
-
- private void setServiceProjectToFirstValid()
- {
- WebServiceServerRuntimeTypeRegistry wssrtReg = WebServiceServerRuntimeTypeRegistry.getInstance();
- String[] projectNames = getServiceProject2EARProject().getList().getList();
- for (int i=0;i<projectNames.length; i++)
- {
- IProject project = (IProject)((new StringToIProjectTransformer().transform(projectNames[i])));
- if (project.isOpen() && (ResourceUtils.isWebProject(project) || ResourceUtils.isEJBProject(project)))
- {
- //Get the J2EE level
- int versionId = J2EEUtils.getJ2EEVersion(project);
- String versionString = String.valueOf(versionId);
-
- //Get the runtime target of the project
- IRuntime runtimeTarget = ServerSelectionUtils.getRuntimeTarget(project.getName());
- String runtimeTargetId = null;
- if (runtimeTarget != null)
- runtimeTargetId = runtimeTarget.getRuntimeType().getId();
-
- if (serviceJ2EEVersion_!=null && serviceJ2EEVersion_.length()>0 && serviceJ2EEVersion_.equals(versionString))
- {
- if (wssrtReg.doesRuntimeSupportJ2EELevel(versionString, serviceIds_.getRuntimeId()) &&
- ((runtimeTarget == null) ||
- ((runtimeTarget!=null) && wssrtReg.doesRuntimeSupportServerTarget(runtimeTargetId, serviceIds_.getRuntimeId())))
- )
- {
- getServiceProject2EARProject().getList().setSelectionValue(projectNames[i]);
- return;
- }
- }
- }
- }
-
- //Didn't find a single project that worked. Default to a new project name.
- getServiceProject2EARProject().getList().setSelectionValue(ResourceUtils.getDefaultWebProjectName());
- }
-
-
- private void setDefaultEARs()
- {
-
- //Service-side
- String initialProjectName = getServiceProject2EARProject().getList().getSelection();
- IProject initialProject = (IProject)((new StringToIProjectTransformer()).transform(initialProjectName));
- IProject defaultServiceEAR = getDefaultEARFromServiceProject(initialProject);
- getServiceProject2EARProject().getChoice().getList().setSelectionValue(defaultServiceEAR.getName());
-
- //Client-side
- String initialClientProjectName = getRuntime2ClientTypes().getChoice().getChoice().getList().getSelection();
- IProject initialClientProject = (IProject)((new StringToIProjectTransformer()).transform(initialClientProjectName));
- IProject defaultClientEAR = getDefaultEARFromClientProject(initialClientProject);
-
- //If the client project exists and the default EAR is the same as that of the service project,
- //pick the defaultClientEAR
- if(initialClientProject!=null && initialClientProject.exists()
- && defaultClientEAR.getName().equalsIgnoreCase(defaultServiceEAR.getName()))
- {
- getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setSelectionValue(defaultClientEAR.getName());
- }
- else
- {
- ProjectTopologyContext ptc= WebServicePlugin.getInstance().getProjectTopologyContext();
- if (!ptc.isUseTwoEARs()) {
- getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setSelectionValue(defaultServiceEAR.getName());
- }
- else {
- IProject proxyEARProject = getUniqueClientEAR(defaultClientEAR.getName(), defaultServiceEAR.getName(), initialClientProjectName);
- getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setSelectionValue(proxyEARProject.getName());
- }
- }
- }
-
- private IProject getUniqueClientEAR(String earProject, String serviceProject, String clientProjectName) {
-
- String projectName = new String();
- if (!earProject.equalsIgnoreCase(serviceProject)) {
- projectName = earProject;
- }
- else {
- projectName = clientProjectName+DEFAULT_CLIENT_EAR_PROJECT_EXT;
- int i=1;
- while (projectName.equalsIgnoreCase(serviceProject)) {
- projectName = projectName+i;
- i++;
- }
- }
- return projectName.equals("") ? null : ResourceUtils.getWorkspaceRoot().getProject(projectName);
-
- }
-
- private void setDefaultServer()
- {
- //Calculate reasonable default server based on the default project selection.
-
- String initialProjectName = getServiceProject2EARProject().getList().getSelection();
- IProject initialProject = (IProject)((new StringToIProjectTransformer()).transform(initialProjectName));
- if (initialProject.exists())
- {
- String[] serverInfo = ServerSelectionUtils.getServerInfoFromExistingProject(initialProject, serviceIds_.getTypeId(), serviceIds_.getRuntimeId(), true);
- if (serverInfo!=null)
- {
- if (serverInfo[0]!=null && serverInfo[0].length()>0)
- {
- serviceIds_.setServerId(serverInfo[0]);
- }
- if (serverInfo[1]!=null && serverInfo[1].length()>0)
- {
- serviceIds_.setServerInstanceId(serverInfo[1]);
- }
- }
- }
- else //the project does not exist.
- {
- //Does the EAR exist?
- String initialEARProjectName = getServiceProject2EARProject().getChoice().getList().getSelection();
- IProject initialEARProject = (IProject)((new StringToIProjectTransformer()).transform(initialEARProjectName));
- if (initialEARProject.exists())
- {
- String[] serverInfo = ServerSelectionUtils.getServerInfoFromExistingProject(initialEARProject, serviceIds_.getTypeId(), serviceIds_.getRuntimeId(), false);
- if (serverInfo!=null)
- {
- if (serverInfo[0]!=null && serverInfo[0].length()>0)
- {
- serviceIds_.setServerId(serverInfo[0]);
- }
- if (serverInfo[1]!=null && serverInfo[1].length()>0)
- {
- serviceIds_.setServerInstanceId(serverInfo[1]);
- }
- }
- }
- else
- {
- //We have a new project and EAR. Use the runtime/server selection
- //preferences to set the default server/server type.
- //Pick a server type that is compatible with the Web service runtime
- //If there is an existing server that works, pick that one.
-
- String[] serverInfo = ServerSelectionUtils.getServerFromWebServceRuntimeAndJ2EE(serviceIds_.getRuntimeId(), serviceJ2EEVersion_);
- if (serverInfo!=null)
- {
- if (serverInfo[0]!=null && serverInfo[0].length()>0)
- {
- serviceIds_.setServerId(serverInfo[0]);
- }
- if (serverInfo[1]!=null && serverInfo[1].length()>0)
- {
- serviceIds_.setServerInstanceId(serverInfo[1]);
- }
- }
- }
-
- }
-
-
- //Default the client server
- }
-
- private void updateServiceEARs()
- {
- //Set EAR selection to null if the project/server defaults imply an EAR should not be created
- String serviceProjectName = getServiceProject2EARProject().getList().getSelection();
- IProject serviceProject = (IProject)((new StringToIProjectTransformer()).transform(serviceProjectName));
- if (serviceProject != null && serviceProject.exists())
- {
- //Get the runtime target on the serviceProject
- IRuntime serviceTarget = ServerSelectionUtils.getRuntimeTarget(serviceProjectName);
- String j2eeVersion = String.valueOf(J2EEUtils.getJ2EEVersion(serviceProject));
- if (serviceTarget != null)
- {
- if (!ServerUtils.isTargetValidForEAR(serviceTarget.getRuntimeType().getId(),j2eeVersion))
- {
- //Default the EAR selection to be empty
- getServiceProject2EARProject().getChoice().getList().setIndex(-1);
- serviceNeedEAR_ = false;
- }
-
- }
- }
- else
- {
- //Use the server type
- String serverTargetId = ServerUtils.getRuntimeTargetIdFromFactoryId(serviceIds_.getServerId());
- if (serverTargetId!=null && serverTargetId.length()>0)
- {
- if (!ServerUtils.isTargetValidForEAR(serverTargetId,serviceJ2EEVersion_))
- {
- //Default the EAR selection to be empty
- getServiceProject2EARProject().getChoice().getList().setIndex(-1);
- serviceNeedEAR_ = false;
- }
- }
- }
-
-
- }
- public void setInitialSelection(IStructuredSelection selection)
- {
- initialSelection_ = selection;
- }
-
- public void setInitialProject(IProject initialProject)
- {
- initialProject_ = initialProject;
- }
-
- public void setServiceTypeRuntimeServer( TypeRuntimeServer ids )
- {
- serviceIds_ = ids;
- }
-
- public TypeRuntimeServer getServiceTypeRuntimeServer()
- {
- return serviceIds_;
- }
-
- public SelectionListChoices getServiceProject2EARProject()
- {
- if (serviceProject2EARProject_ == null)
- {
- IProject[] projects = WebServiceServerRuntimeTypeRegistry.getInstance().getProjectsByWebServiceType(serviceIds_.getTypeId());
-
- String[] projectNames = new String[projects.length];
- for (int i = 0; i < projects.length; i++) {
- projectNames[i] = projects[i].getName();
- }
- SelectionList list = new SelectionList(projectNames, 0);
- Vector choices = new Vector();
- for (int i = 0; i < projects.length; i++)
- choices.add(getProjectEARChoice(projects[i]));
-
- serviceProject2EARProject_ = new SelectionListChoices(list, choices, getEARProjects());
- }
- return serviceProject2EARProject_;
- }
-
- /**
- * @return Returns the generateProxy_.
- */
- public boolean getGenerateProxy()
- {
- return generateProxy_;
- }
- /**
- * @param generateProxy_ The generateProxy_ to set.
- */
- public void setGenerateProxy(boolean generateProxy_)
- {
- this.generateProxy_ = generateProxy_;
- }
-
- public String getServiceJ2EEVersion()
- {
- return serviceJ2EEVersion_;
- }
-
- public boolean getServiceNeedEAR()
- {
- return serviceNeedEAR_;
- }
-
- private IProject getDefaultEARFromServiceProject(IProject project)
- {
- if (project!=null && project.exists())
- {
- IServer[] configuredServers = ServerUtil.getServersByModule(ResourceUtils.getModule(project), null);
- IServer firstSupportedServer = ServerSelectionUtils.getFirstSupportedServer(configuredServers, serviceIds_.getTypeId() );
-
- EARNatureRuntime[] earProjects = J2EEUtils.getEARProjects(project, firstSupportedServer);
- if (earProjects!=null && earProjects[0] instanceof EARNatureRuntime)
- return earProjects[0].getProject();
- }
-
- int versionId = -1;
- if (serviceJ2EEVersion_ != null && serviceJ2EEVersion_.length()>0)
- {
- versionId = Integer.parseInt(serviceJ2EEVersion_);
- }
- EARNatureRuntime newEAR = J2EEUtils.getEAR(versionId);
- IProject earProject = ResourceUtils.getWorkspaceRoot().getProject(ResourceUtils.getDefaultServiceEARProjectName());
-
- if (newEAR!=null)
- earProject = newEAR.getProject();
-
- return earProject;
- }
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/LaunchFragment.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/LaunchFragment.java
deleted file mode 100644
index 90d5814..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/LaunchFragment.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/**
- */
-package org.eclipse.jst.ws.internal.creation.ui.widgets.test;
-
-import org.eclipse.jst.ws.internal.ui.wse.LaunchWebServicesExplorerCommand;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-
-
-public class LaunchFragment extends BooleanFragment
-{
- private boolean publishToPublicUDDI_;
- private boolean publishToPrivateUDDI_;
-
- public LaunchFragment()
- {
- Condition condition = new Condition()
- {
- public boolean evaluate()
- {
- return (publishToPublicUDDI_ || publishToPrivateUDDI_);
- }
- };
- setCondition( condition );
- setTrueFragment( new SimpleFragment( new LaunchWebServicesExplorerCommand(), "" ) );
- }
-
- public void setPublishToPublicUDDI(boolean publishToPublicUDDI)
- {
- publishToPublicUDDI_ = publishToPublicUDDI;
- }
-
- public void setPublishToPrivateUDDI(boolean publishToPrivateUDDI)
- {
- publishToPrivateUDDI_ = publishToPrivateUDDI;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestFragment.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestFragment.java
deleted file mode 100644
index fe9d04c..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestFragment.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/**
- */
-package org.eclipse.jst.ws.internal.creation.ui.widgets.test;
-
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WSDLTestLaunchCommand;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.BooleanFragment;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-
-
-public class ServiceTestFragment extends BooleanFragment
-{
- private boolean testService;
- private boolean generateProxy;
-
-
- public ServiceTestFragment( String id )
- {
- SequenceFragment testRoot = new SequenceFragment();
- Condition condition = new Condition()
- {
- public boolean evaluate()
- {
- return testService;
- }
- };
- setCondition( condition );
-
- testRoot.add( new SimpleFragment( new WebServiceTestDefaultingCommand(), "" ) );
- testRoot.add( new SimpleFragment( id ) );
- setTrueFragment( testRoot );
-
- }
-
-
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
-
- dataRegistry.addMapping(WebServiceTestDefaultingCommand.class, "TestID",WSDLTestLaunchCommand.class);
-
- //from the wizard
- dataRegistry.addMapping(ServiceTestWidget.class, "TestID",WSDLTestLaunchCommand.class);
- dataRegistry.addMapping(WebServiceTestDefaultingCommand.class, "ExternalBrowser",WSDLTestLaunchCommand.class);
- }
-
- public void setGenerateProxy(boolean generateProxy)
- {
- this.generateProxy = generateProxy;
- }
-
- public boolean getGenerateProxy()
- {
- return generateProxy;
- }
-
- /**
- * @return Returns the testService.
- */
- public void setTestService( boolean testService )
- {
- this.testService = testService;
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestWidget.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestWidget.java
deleted file mode 100644
index a01b179..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestWidget.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.creation.ui.widgets.test;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WSDLTestLaunchCommand;
-import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
-import org.eclipse.jst.ws.internal.ui.common.UIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.SelectionList;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-public class ServiceTestWidget extends SimpleWidgetDataContributor
-{
- private String pluginId_ = "org.eclipse.jst.ws.consumption.ui";
- private String createPluginId_ = "org.eclipse.jst.ws.creation.ui";
-
- private Combo testTypeCombo_;
- /*CONTEXT_ID PSTP0001 for the Test Type Combo box of the Service Test Page*/
- private final String INFOPOP_PSTP_COMBOBOX_TEST = "PSTP0001";
- private final String TOOLTIP_PSTP_COMBOBOX_TEST = "TOOLTIP_PSTP_COMBOBOX_TEST";
-
- private Button launchButton_;
- /*CONTEXT_ID PSTP0002 for the launch button of the Service Test Page*/
- private final String INFOPOP_PSTP_LAUNCH_BUTTON = "PSTP0002";
- private final String TOOLTIP_PSTP_LAUNCH_BUTTON = "TOOLTIP_PSTP_LAUNCH_BUTTON";
-
- private SelectionList facilities_;
-
- public WidgetDataEvents addControls( Composite parent, Listener statusListener )
- {
- MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this );
- UIUtils uiUtils = new UIUtils(msgUtils, createPluginId_ );
-
- Composite testComposite = uiUtils.createComposite( parent, 3, 0, 0 );
-
- testTypeCombo_ = uiUtils.createCombo( testComposite, "LABEL_TEST_TYPES",
- TOOLTIP_PSTP_COMBOBOX_TEST,
- INFOPOP_PSTP_COMBOBOX_TEST,
- SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
-
- launchButton_ = uiUtils.createPushButton( testComposite, "BUTTON_LAUNCH_SERVICE_TEST",
- TOOLTIP_PSTP_LAUNCH_BUTTON,
- INFOPOP_PSTP_LAUNCH_BUTTON );
- launchButton_.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent event )
- {
- handleLaunchButton();
- }
- });
-
-
- return this;
- }
-
- private TypeRuntimeServer serviceids;
- private String serverProject;
- private String wsdlURI;
- private String launchedServiceTestName = "";
- private Environment env;
- private List endpoints;
-
- private void handleLaunchButton()
- {
-
- String testID = testTypeCombo_.getText();
- launchedServiceTestName = testID;
- WSDLTestLaunchCommand wtlc = new WSDLTestLaunchCommand();
- wtlc.setTestID(testID);
- wtlc.setServiceTypeRuntimeServer(serviceids);
- wtlc.setServerProject(serverProject);
- wtlc.setWsdlURI(wsdlURI);
- wtlc.setExternalBrowser(true);
- wtlc.setEndpoint(endpoints);
- Status status = wtlc.execute(env);
- }
-
- public void setServiceTestFacilities( SelectionList facilities )
- {
- facilities_ = facilities;
- testTypeCombo_.setItems( facilities.getList() );
- testTypeCombo_.select( facilities.getIndex() );
- }
-
- public SelectionList getServiceTestFacilities()
- {
- facilities_.setIndex( testTypeCombo_.getSelectionIndex() );
- return facilities_;
- }
-
- public String getTestID()
- {
- return testTypeCombo_.getText();
- }
-
- public void setWsdlURI(String wsdlURI)
- {
- this.wsdlURI = wsdlURI;
- }
-
- public void setServerProject(String serverProject)
- {
- this.serverProject = serverProject;
- }
-
- public void setServiceTypeRuntimeServer(TypeRuntimeServer serviceids)
- {
- this.serviceids = serviceids;
- }
-
- public String getLaunchedServiceTestName()
- {
- return launchedServiceTestName;
- }
-
- public void setEnvironment(Environment env)
- {
- this.env = env;
- }
-
- public void setEndpoint(String endpoint)
- {
- if (endpoint != null && endpoint.length() > 0)
- {
- Vector v = new Vector();
- v.add(endpoint);
- setEndpoints(v);
- }
- }
-
- public void setEndpoints(List endpoints)
- {
- this.endpoints = endpoints;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/WebServiceTestDefaultingCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/WebServiceTestDefaultingCommand.java
deleted file mode 100644
index d87ff12..0000000
--- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/WebServiceTestDefaultingCommand.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Apr 15, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.ws.internal.creation.ui.widgets.test;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.eclipse.jst.ws.internal.context.ScenarioContext;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestExtension;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.selection.SelectionList;
-
-
-/**
- * @author gilberta
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-public class WebServiceTestDefaultingCommand extends SimpleCommand
-{
-
- private SelectionList serviceTestFacilities;
- private Environment environment;
- private String testID;
-
- public Status execute(Environment env)
- {
- ScenarioContext scenarioContext = WebServicePlugin.getInstance().getScenarioContext().copy();
- testID = scenarioContext.getNonJavaTestService();
- String[] testTypes = scenarioContext.getWebServiceTestTypes();
-
-
- environment = env;
- Status status = new SimpleStatus("");
- WebServiceTestRegistry wsttRegistry = WebServiceTestRegistry.getInstance();
-
-
- Vector wsdlNames = new Vector();
- for(int i =0 ;i<testTypes.length;i++){
- WebServiceTestExtension wscte = (WebServiceTestExtension)wsttRegistry.getWebServiceExtensionsByName(testTypes[i]);
- if(!wscte.isJava()){
- wsdlNames.addElement(testTypes[i]);
- }
- }
-
- String javaNamesArray[] = new String[wsdlNames.size()];
- Enumeration e = wsdlNames.elements();
- int i = 0;
- while(e.hasMoreElements()){
- javaNamesArray[i] = (String)e.nextElement();
- i++;
- }
-
-
- serviceTestFacilities = new SelectionList(javaNamesArray,0);
-
- return status;
- }
-
- public SelectionList getServiceTestFacilities()
- {
- return serviceTestFacilities;
- }
-
- public String getTestID()
- {
- return testID;
- }
-
- public Environment getEnvironment()
- {
- return environment;
- }
-
- public boolean getExternalBrowser()
- {
- return false;
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/.classpath b/bundles/org.eclipse.jst.ws.uddiregistry/.classpath
deleted file mode 100644
index 275b34c..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/.cvsignore b/bundles/org.eclipse.jst.ws.uddiregistry/.cvsignore
deleted file mode 100644
index 60463af..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-build.xml
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/.project b/bundles/org.eclipse.jst.ws.uddiregistry/.project
deleted file mode 100644
index cd999f6..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.ws.uddiregistry</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.wst.command.env</project>
- <project>org.eclipse.wst.command.env.core</project>
- <project>org.eclipse.jst.ws</project>
- <project>org.eclipse.jst.ws.consumption</project>
- <project>org.eclipse.jst.ws.consumption.ui</project>
- <project>org.eclipse.jst.ws.ui</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/build.properties b/bundles/org.eclipse.jst.ws.uddiregistry/build.properties
deleted file mode 100644
index b3ed10f..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-source.uddiregistry.jar = src/
-bin.includes = uddiregistry.jar,\
- icons/,\
- plugin.properties,\
- plugin.xml
-src.includes = build.properties,\
- icons/,\
- plugin.properties,\
- plugin.xml,\
- src/
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/icons/registry.gif b/bundles/org.eclipse.jst.ws.uddiregistry/icons/registry.gif
deleted file mode 100644
index 5b43cae..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/icons/registry.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/icons/uddiprivateconfig_wiz.gif b/bundles/org.eclipse.jst.ws.uddiregistry/icons/uddiprivateconfig_wiz.gif
deleted file mode 100644
index 31611ec..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/icons/uddiprivateconfig_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/plugin.properties b/bundles/org.eclipse.jst.ws.uddiregistry/plugin.properties
deleted file mode 100644
index 644bff8..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/plugin.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Web Services Universal Description Discovery and Integration Registry
-PLUGIN_PROVIDER=Eclipse.org
-
-PLUGIN_NEW_WIZARD_NAME_WS_UNIT_TEST_UDDI=Unit Test UDDI
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/plugin.xml b/bundles/org.eclipse.jst.ws.uddiregistry/plugin.xml
deleted file mode 100644
index fb3b51b..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/plugin.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id="org.eclipse.jst.ws.uddiregistry"
- version="1.0.0"
- name="%PLUGIN_NAME"
- provider-name="%PLUGIN_PROVIDER"
- class="org.eclipse.jst.ws.internal.uddiregistry.plugin.WebServiceUDDIRegistryPlugin">
-
- <runtime>
- <library name="uddiregistry.jar">
- <export name="*"/>
- </library>
- </runtime>
-<!--
- <description>
- %PLUGIN_DESC
- </description>
- -->
- <requires>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.emf.common"/>
- <import plugin="org.eclipse.jst.ws"/>
- <import plugin="org.eclipse.jst.ws.ui"/>
- <import plugin="org.eclipse.jst.ws.consumption"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <import plugin="org.eclipse.wst.command.env"/>
- <import plugin="org.eclipse.wst.command.env.ui"/>
- <import plugin="org.eclipse.wst.server.core"/>
- </requires>
-
-
- <extension-point id="privateUDDIRegistryType" name="Private UDDI Registry Types"/>
-
- <extension
- point="org.eclipse.jst.ws.consumption.ui.privateUDDIRegistryType">
- <privateUDDIRegistryType
- name="%PRIVATE_UDDI_REGISTRY_TYPE_IMPL"
- class="org.eclipse.jst.ws.internal.uddiregistry.wizard.PrivateUDDIRegistryTypeImpl"
- id="org.eclipse.jst.ws.internal.uddiregistry.wizard.PrivateUDDIRegistryTypeImpl">
- </privateUDDIRegistryType>
- </extension>
- <extension
- point="org.eclipse.ui.newWizards">
- <wizard
- name="%PLUGIN_NEW_WIZARD_NAME_WS_UNIT_TEST_UDDI"
- icon="icons/registry.gif"
- category="org.eclipse.jst.ws.ui.new"
- class="org.eclipse.wst.command.env.ui.widgets.DynamicWizard"
- id="org.eclipse.jst.ws.internal.uddiregistry.widgets.binding.PrivateUDDIWidgetBinding">
- </wizard>
- </extension>
- <extension
- point="org.eclipse.wst.command.env.dynamicWizard">
- <dynamicWizard
- name="%PLUGIN_NEW_WIZARD_NAME_WS_UNIT_TEST_UDDI"
- class="org.eclipse.jst.ws.internal.uddiregistry.widgets.binding.PrivateUDDIWidgetBinding"
- iconbanner="icons/uddiprivateconfig_wiz.gif"
- id="org.eclipse.jst.ws.internal.uddiregistry.widgets.binding.PrivateUDDIWidgetBinding">
- </dynamicWizard>
- </extension>
- <!--
- <extension
- point="org.eclipse.ui.newWizards">
- <wizard
- name="%PLUGIN_NEW_WIZARD_NAME_WS_UNIT_TEST_UDDI"
- icon="icons/registry.gif"
- category="org.eclipse.jst.ws.ui.new"
- class="org.eclipse.jst.ws.internal.uddiregistry.wizard.PrivateUDDIWizard"
- id="org.eclipse.jst.ws.internal.uddiregistry.wizard.PrivateUDDIWizard">
- <description>
- %PLUGIN_NEW_WIZARD_DESC_WS_UNIT_TEST_UDDI
- </description>
- <selection
- class="org.eclipse.core.resources.IResource">
- </selection>
- </wizard>
- </extension>
- -->
-</plugin>
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/plugin/WebServiceUDDIRegistryPlugin.java b/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/plugin/WebServiceUDDIRegistryPlugin.java
deleted file mode 100644
index 04613a1..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/plugin/WebServiceUDDIRegistryPlugin.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.uddiregistry.plugin;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-
-/**
-* This is the plugin class for the Web Services UDDI Registry plugin.
-* <p>
-* The Web Services UDDI Registry plugin's is to add the
-* option to create a unit test UDDI registry
-*/
-public class WebServiceUDDIRegistryPlugin extends Plugin
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
- /**
- * The identifier of the descriptor of this plugin in plugin.xml.
- */
- public static final String ID = "org.eclipse.jst.ws.uddiregistry";
-
- /**
- * The reference to the singleton instance of this plugin.
- */
- private static WebServiceUDDIRegistryPlugin instance_;
- private Log log_;
-
- /**
- * Constructs a runtime plugin object for this plugin.
- * The "plugin" element in plugin.xml should include the attribute
- * class = "org.eclipse.jst.ws.internal.uddiregistry.plugin.WebServiceUDDIRegistryPlugin".
- * @param descriptor The descriptor of this plugin.
- */
- public WebServiceUDDIRegistryPlugin ( IPluginDescriptor descriptor )
- {
- super(descriptor);
- if (instance_ == null)
- {
- instance_ = this;
- }
- log_ = new EclipseLog();
- }
-
- /**
- * Returns the singleton instance of this plugin. Equivalent to calling
- * (WebServiceUDDIRegistryPlugin)Platform.getPlugin("org.eclipse.jst.ws.uddiregistry");
- * @return The WebServiceUDDIRegistryPlugin singleton.
- */
- public static WebServiceUDDIRegistryPlugin getInstance ()
- {
- return instance_;
- }
-
- /**
- * Called once by the platform when this plugin is first loaded.
- * @throws CoreException If this plugin fails to start.
- */
- public void startup () throws CoreException
- {
- log_.log(Log.INFO, 5072, this, "startup", "Starting plugin org.eclipse.jst.ws.uddiregistry");
- super.startup();
- }
-
- /**
- * Called once by the platform when this plugin is unloaded.
- * @throws CoreException If this plugin fails to shutdown.
- */
- public void shutdown () throws CoreException
- {
- log_.log(Log.INFO, 5073, this, "shutdown", "Shutting plugin org.eclipse.jst.ws.uddiregistry");
- super.shutdown();
- }
-
- /**
- * Returns an image descriptor for the named resource
- * as relative to the plugin install location.
- * @return An image descriptor, possibly null.
- */
- public static ImageDescriptor getImageDescriptor ( String name )
- {
- try
- {
- URL installURL = instance_.getDescriptor().getInstallURL();
- URL imageURL = new URL(installURL,name);
- return ImageDescriptor.createFromURL(imageURL);
- }
- catch (MalformedURLException e)
- {
- return null;
- }
- }
-
- /**
- * Returns the message string identified by the given key from
- * plugin.properties.
- * @return The String message.
- */
- public static String getMessage ( String key )
- {
- return instance_.getDescriptor().getResourceString(key);
- }
-
- /**
- * Returns the message string identified by the given key from
- * plugin.properties. Substitution sequences in the message string
- * are replaced by the given array of substitution objects (which
- * are most frequently strings). See the JDK's
- * {@link java.text.MessageFormat java.text.MessageFormat}
- * class for further details on substitution.
- * @return The String message.
- */
- public static String getMessage ( String key, Object[] args )
- {
- return MessageFormat.format(getMessage(key),args);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionCommand.java b/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionCommand.java
deleted file mode 100644
index 390584b..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionCommand.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.uddiregistry.widgets;
-
-import org.eclipse.jst.ws.internal.uddiregistry.wizard.PrivateUDDIRegistryType;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-/*
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.jst.ws.internal.uddiregistry.plugin.WebServiceUDDIRegistryPlugin;
-*/
-
-public class PrivateUDDISelectionCommand extends SimpleCommand
-{
- private byte operationType;
- private PrivateUDDIRegistryType registryType;
-
- /*
- public Status execute(Environment env)
- {
- MessageUtils msgUtils = new MessageUtils(WebServiceUDDIRegistryPlugin.ID + ".plugin", this);
- if (registryType != null)
- {
- switch (operationType)
- {
- case PrivateUDDIRegistryType.OP_DEPLOY:
- return registryType.deploy(env);
- case PrivateUDDIRegistryType.OP_UPDATE:
- return registryType.update(env);
- case PrivateUDDIRegistryType.OP_REMOVE:
- return registryType.remove(env);
- default:
- }
- }
- return new SimpleStatus("");
- }
- */
-
- public PrivateUDDIRegistryType getRegistryType()
- {
- return getPrivateUDDIRegistryType();
- }
-
- public byte getOperationType()
- {
- return operationType;
- }
-
- public PrivateUDDIRegistryType getPrivateUDDIRegistryType()
- {
- return registryType;
- }
-
- public void setRegistryType(PrivateUDDIRegistryType regType)
- {
- setPrivateUDDIRegistryType(regType);
- }
-
- public void setOperationType(byte type)
- {
- operationType = type;
- }
-
- public void setPrivateUDDIRegistryType(PrivateUDDIRegistryType regType)
- {
- registryType = regType;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionCommandFragment.java b/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionCommandFragment.java
deleted file mode 100644
index fd74116..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionCommandFragment.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.uddiregistry.widgets;
-
-import org.eclipse.jst.ws.internal.uddiregistry.wizard.PrivateUDDIRegistryType;
-import org.eclipse.wst.command.env.core.CommandFactory;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.AbstractCommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class PrivateUDDISelectionCommandFragment extends AbstractCommandFragment
-{
- private PrivateUDDIRegistryType registryType;
- private DataMappingRegistry dataMappingRegistry;
- private CanFinishRegistry canFinishRegistry;
- private WidgetRegistry widgetRegistry;
-
- public PrivateUDDISelectionCommandFragment()
- {
- super((CommandFactory)null, "");
- }
-
- /**
- * Gets the first child fragment for this fragment.
- *
- * @return returns the first child fragment for this fragment. Returns
- * null when there is no first child.
- **/
- public CommandFragment getFirstSubFragment()
- {
- if (registryType != null)
- {
- registryType.registerCanFinish(canFinishRegistry);
- registryType.registerDataMappings(dataMappingRegistry);
- registryType.registerWidgetMappings(widgetRegistry);
- return registryType.create().create();
- }
- else
- return null;
- }
-
- /**
- * Gets the next child fragment for this fragment.
- *
- * @return returns the next child fragment for this fragment. Returns null
- * when there is no next child.
- **/
- public CommandFragment getNextSubFragment(CommandFragment fragment)
- {
- return null;
- }
-
- /*
- * This method is called to retrieve the data mappings for this command fragment.
- */
- public void registerDataMappings(DataMappingRegistry registry)
- {
- dataMappingRegistry = registry;
- }
-
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- this.canFinishRegistry = canFinishRegistry;
- }
-
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- this.widgetRegistry = widgetRegistry;
- }
-
- /**
- * All wizard fragments need to be cloneable.
- **/
- public Object clone()
- {
- PrivateUDDISelectionCommandFragment fragment = new PrivateUDDISelectionCommandFragment();
- fragment.registerDataMappings(dataMappingRegistry);
- fragment.registerCanFinish(canFinishRegistry);
- fragment.registerWidgetMappings(widgetRegistry);
- fragment.setPrivateUDDIRegistryType(registryType);
- return fragment;
- }
-
- public void setPrivateUDDIRegistryType(PrivateUDDIRegistryType registryType)
- {
- this.registryType = registryType;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionWidget.java b/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionWidget.java
deleted file mode 100644
index 98996c3..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionWidget.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.uddiregistry.widgets;
-
-import org.eclipse.jst.ws.internal.uddiregistry.plugin.WebServiceUDDIRegistryPlugin;
-import org.eclipse.jst.ws.internal.uddiregistry.wizard.PrivateUDDIRegistryType;
-import org.eclipse.jst.ws.internal.uddiregistry.wizard.PrivateUDDIRegistryTypeRegistry;
-import org.eclipse.swt.SWT;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.SimpleWidgetDataContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-/**
-* This UDDI configuration page prompts the user
-* for the information required to configure the
-* unit test UDDI registry.
-*/
-public class PrivateUDDISelectionWidget extends SimpleWidgetDataContributor
-{
- private MessageUtils msgUtils;
- private Listener statusListener;
-
- private Button deployRadio_;
- private Label typesLabel_;
- private Combo typesCombo_;
- private Button updateRadio_;
- private Button removeRadio_;
- private PrivateUDDIRegistryType[] types_;
- private PrivateUDDIRegistryType installedType_;
-
- // Infopop
- private final String INFOPOP_PUPR_PRIVATE_UDDI_PAGE = WebServiceUDDIRegistryPlugin.ID + ".pupr0001";
- private final String INFOPOP_PUPR_PRIVATE_UDDI_TYPE = WebServiceUDDIRegistryPlugin.ID + ".pupr0002";
- private final String INFOPOP_PUPR_DEPLOY_PRIVATE_UDDI = WebServiceUDDIRegistryPlugin.ID + ".pupr0003";
- private final String INFOPOP_PUPR_UPDATE_PRIVATE_UDDI = WebServiceUDDIRegistryPlugin.ID + ".pupr0005";
- private final String INFOPOP_PUPR_REMOVE_PRIVATE_UDDI = WebServiceUDDIRegistryPlugin.ID + ".pupr0004";
-
- public PrivateUDDISelectionWidget()
- {
- msgUtils = new MessageUtils(WebServiceUDDIRegistryPlugin.ID + ".plugin", this );
- }
-
- public WidgetDataEvents addControls(Composite parent, Listener statusListener)
- {
- this.statusListener = statusListener;
- parent.setToolTipText(msgUtils.getMessage("TOOLTIP_PUPR_PRIVATE_UDDI_PAGE"));
- WorkbenchHelp.setHelp(parent, INFOPOP_PUPR_PRIVATE_UDDI_PAGE);
-
- GridLayout gl;
- GridData gd;
-
- Listener listener = new Listener()
- {
- public void handleEvent(Event event)
- {
- handleWidgetEvent(event);
- }
- };
-
- deployRadio_ = new Button(parent, SWT.RADIO);
- deployRadio_.setText(msgUtils.getMessage("BUTTON_DEPLOY_UDDI_REGISTRY"));
- deployRadio_.setSelection(true);
- deployRadio_.addListener(SWT.Selection, listener);
- deployRadio_.setToolTipText(msgUtils.getMessage("TOOLTIP_PUPR_DEPLOY_PRIVATE_UDDI"));
- WorkbenchHelp.setHelp(deployRadio_, INFOPOP_PUPR_DEPLOY_PRIVATE_UDDI);
-
- Composite typeComposite = new Composite(parent,SWT.NONE);
- gl = new GridLayout();
- gl.numColumns = 2;
- gl.marginHeight = 5;
- gl.verticalSpacing = 15;
- gl.marginWidth = 20;
- typeComposite.setLayout(gl);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- typeComposite.setLayoutData(gd);
-
- typesLabel_ = new Label(typeComposite, SWT.WRAP);
- typesLabel_.setText(msgUtils.getMessage("LABEL_PRIVATE_UDDI_REGISTRY_TYPES"));
- typesLabel_.setToolTipText(msgUtils.getMessage("TOOLTIP_PUPR_PRIVATE_UDDI_TYPE"));
- WorkbenchHelp.setHelp(typesLabel_, INFOPOP_PUPR_PRIVATE_UDDI_TYPE);
-
- typesCombo_ = new Combo(typeComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- typesCombo_.setLayoutData(gd);
- typesCombo_.addListener(SWT.Selection, listener);
- typesCombo_.setToolTipText(msgUtils.getMessage("TOOLTIP_PUPR_PRIVATE_UDDI_TYPE"));
- WorkbenchHelp.setHelp(typesCombo_, INFOPOP_PUPR_PRIVATE_UDDI_TYPE);
-
- updateRadio_ = new Button(parent,SWT.RADIO);
- updateRadio_.setText(msgUtils.getMessage("BUTTON_UPDATE_UDDI_REGISTRY"));
- updateRadio_.setSelection(false);
- updateRadio_.addListener(SWT.Selection,listener);
- updateRadio_.setToolTipText(msgUtils.getMessage("TOOLTIP_PUPR_UPDATE_PRIVATE_UDDI"));
- WorkbenchHelp.setHelp(updateRadio_, INFOPOP_PUPR_UPDATE_PRIVATE_UDDI);
-
- removeRadio_ = new Button(parent, SWT.RADIO);
- removeRadio_.setText(msgUtils.getMessage("BUTTON_REMOVE_UDDI_REGISTRY"));
- removeRadio_.setSelection(false);
- removeRadio_.addListener(SWT.Selection, listener);
- removeRadio_.setToolTipText(msgUtils.getMessage("TOOLTIP_PUPR_REMOVE_PRIVATE_UDDI"));
- WorkbenchHelp.setHelp(removeRadio_, INFOPOP_PUPR_REMOVE_PRIVATE_UDDI);
-
- loadTypes();
- init();
- return this;
- }
-
- private final void loadTypes()
- {
- types_ = PrivateUDDIRegistryTypeRegistry.getInstance().getTypes();
- }
-
- private final void init()
- {
- for (int i = 0; i < types_.length; i++)
- {
- if (types_[i] != null)
- {
- typesCombo_.add(types_[i].getName());
- if (types_[i].isPrivateUDDIRegistryInstalled())
- installedType_ = types_[i];
- }
- }
- if (typesCombo_.getItemCount() > 0)
- typesCombo_.setText(typesCombo_.getItem(0));
- if (installedType_ != null)
- {
- updateRadio_.setEnabled(true);
- removeRadio_.setEnabled(true);
- }
- else
- {
- updateRadio_.setEnabled(false);
- removeRadio_.setEnabled(false);
- }
- }
-
- private void handleWidgetEvent(Event event)
- {
- if (event.widget == removeRadio_ || event.widget == updateRadio_)
- {
- boolean isUpdateOrRemoveSelected = ((Button)event.widget).getSelection();
- typesLabel_.setEnabled(!isUpdateOrRemoveSelected);
- typesCombo_.setEnabled(!isUpdateOrRemoveSelected);
- }
- else if (event.widget == deployRadio_)
- {
- boolean isDeploySelected = ((Button)event.widget).getSelection();
- typesLabel_.setEnabled(isDeploySelected);
- typesCombo_.setEnabled(isDeploySelected);
- }
- statusListener.handleEvent(event);
- }
-
- public PrivateUDDIRegistryType getPrivateUDDIRegistryType()
- {
- if (deployRadio_.getSelection())
- {
- String selectedRegistryName = typesCombo_.getText();
- for (int i = 0; i < types_.length; i++)
- if (selectedRegistryName.equals(types_[i].getName()))
- return types_[i];
- return null;
- }
- else
- return installedType_;
- }
-
- public byte getOperationType()
- {
- if (deployRadio_.getSelection())
- return PrivateUDDIRegistryType.OP_DEPLOY;
- else if (updateRadio_.getSelection())
- return PrivateUDDIRegistryType.OP_UPDATE;
- else if (removeRadio_.getSelection())
- return PrivateUDDIRegistryType.OP_REMOVE;
- else
- return PrivateUDDIRegistryType.OP_DEPLOY;
- }
-
- public Status getStatus()
- {
- PrivateUDDIRegistryType privateUDDIRegistryType = getPrivateUDDIRegistryType();
- if (privateUDDIRegistryType != null)
- return privateUDDIRegistryType.getOperationStatus(getOperationType());
- else
- return new SimpleStatus("", msgUtils.getMessage("MSG_ERROR_NO_UDDI_REGISTRY_AVAILABLE"), Status.ERROR);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionWidgetConditionCommand.java b/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionWidgetConditionCommand.java
deleted file mode 100644
index 1f692d2..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/PrivateUDDISelectionWidgetConditionCommand.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.uddiregistry.widgets;
-
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class PrivateUDDISelectionWidgetConditionCommand extends SimpleCommand implements Condition
-{
- private boolean condition;
-
- public PrivateUDDISelectionWidgetConditionCommand()
- {
- condition = true;
- }
-
- public Status execute(Environment env)
- {
- condition = !condition;
- return new SimpleStatus("");
- }
-
- public Status undo(Environment env)
- {
- condition = !condition;
- return new SimpleStatus("");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.Command#isUndoable()
- */
- public boolean isUndoable()
- {
- return true;
- }
-
- public boolean evaluate()
- {
- return condition;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/binding/PrivateUDDIWidgetBinding.java b/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/binding/PrivateUDDIWidgetBinding.java
deleted file mode 100644
index b4b7bd7..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/widgets/binding/PrivateUDDIWidgetBinding.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.uddiregistry.widgets.binding;
-
-import org.eclipse.jst.ws.internal.uddiregistry.plugin.WebServiceUDDIRegistryPlugin;
-import org.eclipse.jst.ws.internal.uddiregistry.widgets.PrivateUDDISelectionCommand;
-import org.eclipse.jst.ws.internal.uddiregistry.widgets.PrivateUDDISelectionCommandFragment;
-import org.eclipse.jst.ws.internal.uddiregistry.widgets.PrivateUDDISelectionWidget;
-import org.eclipse.jst.ws.internal.uddiregistry.widgets.PrivateUDDISelectionWidgetConditionCommand;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class PrivateUDDIWidgetBinding implements CommandWidgetBinding
-{
- private CanFinishRegistry canFinishRegistry;
- private WidgetRegistry widgetRegistry;
- private DataMappingRegistry dataMappingRegistry;
- private PrivateUDDISelectionCommandFragment privateUDDISelFragment;
- private PrivateUDDISelectionWidgetConditionCommand conditionCommand;
-
- public PrivateUDDIWidgetBinding()
- {
- privateUDDISelFragment = new PrivateUDDISelectionCommandFragment();
- conditionCommand = new PrivateUDDISelectionWidgetConditionCommand();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create()
- */
- public CommandFragmentFactory create()
- {
- return new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- SequenceFragment root = new SequenceFragment();
- root.add(new SimpleFragment(conditionCommand, ""));
- root.add(new SimpleFragment("PrivateUDDISelectionWidget"));
- root.add(new SimpleFragment(conditionCommand, ""));
- root.add(new SimpleFragment(new PrivateUDDISelectionCommand(), ""));
- root.add(privateUDDISelFragment);
- return root;
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- this.canFinishRegistry = canFinishRegistry;
- privateUDDISelFragment.registerCanFinish(this.canFinishRegistry);
-
- canFinishRegistry.addCondition(conditionCommand);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- dataMappingRegistry = dataRegistry;
- privateUDDISelFragment.registerDataMappings(dataMappingRegistry);
-
- // PrivateUDDISelectionCommand
- dataMappingRegistry.addMapping(PrivateUDDISelectionWidget.class, "PrivateUDDIRegistryType", PrivateUDDISelectionCommand.class);
- dataMappingRegistry.addMapping(PrivateUDDISelectionWidget.class, "OperationType", PrivateUDDISelectionCommand.class);
-
- // PrivateUDDISelectionCommandFragment
- dataMappingRegistry.addMapping(PrivateUDDISelectionWidget.class, "PrivateUDDIRegistryType", PrivateUDDISelectionCommandFragment.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- MessageUtils msgUtils = new MessageUtils(WebServiceUDDIRegistryPlugin.ID + ".plugin", this);
- this.widgetRegistry = widgetRegistry;
- privateUDDISelFragment.registerWidgetMappings(this.widgetRegistry);
-
- widgetRegistry.add("PrivateUDDISelectionWidget",
- msgUtils.getMessage("PAGE_TITLE_PRIVATE_UDDI_CONFIG"),
- msgUtils.getMessage("PAGE_DESC_PRIVATE_UDDI_CONFIG"),
- new WidgetContributorFactory()
- {
- public WidgetContributor create()
- {
- return new PrivateUDDISelectionWidget();
- }
- }
- );
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/wizard/PrivateUDDIRegistryType.java b/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/wizard/PrivateUDDIRegistryType.java
deleted file mode 100644
index 8b5b024..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/wizard/PrivateUDDIRegistryType.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.uddiregistry.wizard;
-
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-
-
-public interface PrivateUDDIRegistryType extends CommandWidgetBinding
-{
- // operation types
- public static byte OP_DEPLOY = 0x0;
- public static byte OP_UPDATE = 0x1;
- public static byte OP_REMOVE = 0x2;
-
- // general information
- public String getID();
- public String getName();
- public boolean isPrivateUDDIRegistryInstalled();
- public Status getOperationStatus(byte operation);
-
- // registry URLs
- public String getInquiryAPI();
- public String getPublishAPI();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/wizard/PrivateUDDIRegistryTypeImpl.java b/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/wizard/PrivateUDDIRegistryTypeImpl.java
deleted file mode 100644
index 07bbc78..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/wizard/PrivateUDDIRegistryTypeImpl.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.uddiregistry.wizard;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.eclipse.jst.ws.internal.uddiregistry.widgets.binding.PrivateUDDIWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-
-
-public class PrivateUDDIRegistryTypeImpl implements org.eclipse.jst.ws.internal.ui.uddi.PrivateUDDIRegistryType
-{
- public PrivateUDDIRegistryTypeImpl() {
- }
-
- public boolean isPrivateUDDIRegistryInstalled() {
- PrivateUDDIRegistryType[] types = PrivateUDDIRegistryTypeRegistry.getInstance().getTypes();
- for (int i = 0; i < types.length; i++) {
- if (types[i].isPrivateUDDIRegistryInstalled())
- return true;
- }
- return false;
- }
-
- public String[] getPrivateUDDIRegistryInquiryAPI() {
- Vector inquiryAPIVector = new Vector();
- PrivateUDDIRegistryType[] types = PrivateUDDIRegistryTypeRegistry.getInstance().getTypes();
- for (int i = 0; i < types.length; i++) {
- if (types[i].isPrivateUDDIRegistryInstalled()) {
- String inquiryAPI = types[i].getInquiryAPI();
- if (inquiryAPI != null && inquiryAPI.startsWith("http"))
- inquiryAPIVector.add(inquiryAPI);
- }
- }
-
- String[] inquiryAPIArray = new String[inquiryAPIVector.size()];
- Enumeration e = inquiryAPIVector.elements();
- int j = 0;
- while(e.hasMoreElements()) {
- inquiryAPIArray[j] = (String)e.nextElement();
- j++;
- }
- return inquiryAPIArray;
- }
-
- public String[] getPrivateUDDIRegistryPublishAPI() {
- Vector publishAPIVector = new Vector();
- PrivateUDDIRegistryType[] types = PrivateUDDIRegistryTypeRegistry.getInstance().getTypes();
- for (int i = 0; i < types.length; i++) {
- if (types[i].isPrivateUDDIRegistryInstalled()) {
- String publishAPI = types[i].getPublishAPI();
- if (publishAPI != null && publishAPI.startsWith("http"))
- publishAPIVector.add(publishAPI);
- }
- }
-
- String[] publishAPIArray = new String[publishAPIVector.size()];
- Enumeration e = publishAPIVector.elements();
- int j = 0;
- while(e.hasMoreElements()) {
- publishAPIArray[j] = (String)e.nextElement();
- j++;
- }
- return publishAPIArray;
- }
-
- public CommandWidgetBinding getBinding()
- {
- return new PrivateUDDIWidgetBinding();
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/wizard/PrivateUDDIRegistryTypeRegistry.java b/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/wizard/PrivateUDDIRegistryTypeRegistry.java
deleted file mode 100644
index 11cf2c6..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/internal/uddiregistry/wizard/PrivateUDDIRegistryTypeRegistry.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.uddiregistry.wizard;
-
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-
-public class PrivateUDDIRegistryTypeRegistry {
-
- private static PrivateUDDIRegistryTypeRegistry instance_;
- private IConfigurationElement[] configElements_;
-
- private PrivateUDDIRegistryTypeRegistry() {
- }
-
- /**
- * Returns a singleton instance of this class.
- * @return A singleton WebServiceClientTypeRegistry object.
- */
- public static PrivateUDDIRegistryTypeRegistry getInstance() {
- if (instance_ == null) {
- instance_ = new PrivateUDDIRegistryTypeRegistry();
- instance_.getConfigElements();
- }
- return instance_;
- }
-
- public IConfigurationElement[] getConfigElements() {
- IPluginRegistry reg = Platform.getPluginRegistry();
- configElements_ = reg.getConfigurationElementsFor(
- "org.eclipse.jst.ws.uddiregistry",
- "privateUDDIRegistryType");
- Vector v = new Vector();
- for (int i = 0; i < configElements_.length; i++)
- {
- int weight = getWeight(configElements_[i]);
- int index = -1;
- for (int j = v.size()-1; j >= 0; j--)
- {
- if (weight > getWeight((IConfigurationElement)v.get(j)))
- index = j;
- else
- break;
- }
- if (index != -1)
- v.add(index, configElements_[i]);
- else
- v.add(configElements_[i]);
- }
- v.copyInto(configElements_);
- return configElements_;
- }
-
- private int getWeight(IConfigurationElement e)
- {
- try
- {
- return Integer.parseInt(e.getAttribute("weight"));
- }
- catch (NumberFormatException nfe)
- {
- return -1;
- }
- }
-
- private IConfigurationElement getConfigElementByID(String id) {
- for (int i = 0; i <configElements_.length; i++) {
- if (configElements_[i].getAttribute("id").equals(id))
- return configElements_[i];
- }
- return null;
- }
-
- public PrivateUDDIRegistryType[] getTypes() {
- Vector types = new Vector();
- for (int i = 0; i < configElements_.length; i++) {
- try {
- Object typeObj = configElements_[i].createExecutableExtension("class");
- if (typeObj instanceof PrivateUDDIRegistryType)
- types.add(typeObj);
- }
- catch (Exception e) {}
- }
-
- PrivateUDDIRegistryType[] typesArray = new PrivateUDDIRegistryType[types.size()];
- for (int j = 0; j < types.size(); j++) {
- typesArray[j] = (PrivateUDDIRegistryType)types.elementAt(j);
- }
- return typesArray;
- }
-
- public PrivateUDDIRegistryType getTypeByID(String id) {
- try {
- Object typeObj = getConfigElementByID(id).createExecutableExtension("class");
- if (typeObj instanceof PrivateUDDIRegistryType)
- return (PrivateUDDIRegistryType)typeObj;
- }
- catch (Exception e) {}
- return null;
- }
-
- public String[] getSupportedServerFactoryIDByID(String id) {
- IConfigurationElement configElement = getConfigElementByID(id);
- if (configElement == null)
- return new String[0];
- Vector idVector = new Vector();
- StringTokenizer st = new StringTokenizer(configElement.getAttribute("serverFactoryID"), ",");
- while (st.hasMoreTokens()) {
- idVector.add(st.nextToken());
- }
- String[] ids = new String[idVector.size()];
- for (int i = 0; i < idVector.size(); i++) {
- ids[i] = (String)idVector.elementAt(i);
- }
- return ids;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/uddiregistry/plugin.properties b/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/uddiregistry/plugin.properties
deleted file mode 100644
index c4d8af3..0000000
--- a/bundles/org.eclipse.jst.ws.uddiregistry/src/org/eclipse/jst/ws/uddiregistry/plugin.properties
+++ /dev/null
@@ -1,55 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# PrivateUDDIConfigPage
-#
-PAGE_TITLE_PRIVATE_UDDI_CONFIG=Unit Test UDDI Registry Configuration
-PAGE_DESC_PRIVATE_UDDI_CONFIG=Configure the unit test UDDI registry.
-
-#
-# Tooltip for PrivateUDDIConfigPage
-#
-TOOLTIP_PUPR_PRIVATE_UDDI_PAGE=Deploy or remove a Unit Test UDDI Registry
-TOOLTIP_PUPR_PRIVATE_UDDI_TYPE=Choose the type of Unit Test UDDI Registry you want to deploy
-TOOLTIP_PUPR_DEPLOY_PRIVATE_UDDI=Deploy a Unit Test UDDI Registry
-TOOLTIP_PUPR_UPDATE_PRIVATE_UDDI=Update the existing Unit Test UDDI Registry
-TOOLTIP_PUPR_REMOVE_PRIVATE_UDDI=Remove the existing Unit Test UDDI Registry
-
-#
-# Common wizard strings.
-#
-LABEL_PRIVATE_UDDI_REGISTRY_TYPES=Private UDDI Registry type:
-BUTTON_DEPLOY_UDDI_REGISTRY=Deploy the Unit Test UDDI Registry
-BUTTON_UPDATE_UDDI_REGISTRY=Update the previously deployed UDDI registry
-BUTTON_REMOVE_UDDI_REGISTRY=Remove the previously deployed UDDI registry
-
-#
-# Wizard page task labels and descriptions
-# (used only for progress indication).
-#
-
-#
-# Dialog messages
-#
-
-#
-# Progress messages
-#
-
-#
-# Warning messages
-#
-
-#
-# Error messages
-#
-MSG_ERROR_NO_UDDI_REGISTRY_AVAILABLE=IWAB0363E No UDDI registry available.
diff --git a/bundles/org.eclipse.jst.ws.ui/.classpath b/bundles/org.eclipse.jst.ws.ui/.classpath
deleted file mode 100644
index 275b34c..0000000
--- a/bundles/org.eclipse.jst.ws.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.ws.ui/.cvsignore b/bundles/org.eclipse.jst.ws.ui/.cvsignore
deleted file mode 100644
index 60463af..0000000
--- a/bundles/org.eclipse.jst.ws.ui/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-build.xml
diff --git a/bundles/org.eclipse.jst.ws.ui/.project b/bundles/org.eclipse.jst.ws.ui/.project
deleted file mode 100644
index 17ef9ac..0000000
--- a/bundles/org.eclipse.jst.ws.ui/.project
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.ws.ui</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.wst.command.env</project>
- <project>org.eclipse.wst.command.env.core</project>
- <project>org.eclipse.jst.ws</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.ws.ui/build.properties b/bundles/org.eclipse.jst.ws.ui/build.properties
deleted file mode 100644
index 2e4ccc8..0000000
--- a/bundles/org.eclipse.jst.ws.ui/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-source.ws-ui.jar = src/
-bin.includes = ws-ui.jar,\
- icons/,\
- plugin.properties,\
- plugin.xml
-src.includes = build.properties,\
- doc/,\
- icons/,\
- plugin.properties,\
- plugin.xml,\
- src/,\
- test/
diff --git a/bundles/org.eclipse.jst.ws.ui/icons/jar_obj.gif b/bundles/org.eclipse.jst.ws.ui/icons/jar_obj.gif
deleted file mode 100644
index 152f4f2..0000000
--- a/bundles/org.eclipse.jst.ws.ui/icons/jar_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.ws.ui/plugin.properties b/bundles/org.eclipse.jst.ws.ui/plugin.properties
deleted file mode 100644
index a7aee78..0000000
--- a/bundles/org.eclipse.jst.ws.ui/plugin.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Web Services Graphical User Interface
-PLUGIN_PROVIDER=Eclipse.org
-
-PLUGIN_NEW_CATEGORY_NAME_WS=Web Services
-
-#
-# Web Services Preferance Pages
-#
-# Categories
-PREFERENCE_CATEGORY_RESOURCE_MANAGEMENT=Resource Management
-
-#
-# WS-I Preference pages
-#
-# WS-I Compliance Page
-#
-PREFERENCE_CATEGORY_WSI=WS-I Compliance
-
-#
-# Popup action Category
-#
-LABEL_POPUP_CATEGORY_WEB_SERVICES=Web Services
-
-
-
-
-
-
diff --git a/bundles/org.eclipse.jst.ws.ui/plugin.xml b/bundles/org.eclipse.jst.ws.ui/plugin.xml
deleted file mode 100644
index a6203d2..0000000
--- a/bundles/org.eclipse.jst.ws.ui/plugin.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id="org.eclipse.jst.ws.ui"
- version="1.0.0"
- name="%PLUGIN_NAME"
- provider-name="%PLUGIN_PROVIDER"
- class="org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin">
-
- <runtime>
- <library name="ws-ui.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.wst.command.env"/>
- <import plugin="org.eclipse.wst.command.env.ui"/>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <import plugin="org.eclipse.jst.ws"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="com.ibm.wtp.emf.workbench"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.wst.common.emfworkbench.integration"/>
- <import plugin="org.eclipse.jst.j2ee"/>
- </requires>
-
- <extension
- point="org.eclipse.ui.newWizards">
- <category
- name="%PLUGIN_NEW_CATEGORY_NAME_WS"
- id="org.eclipse.jst.ws.ui.new">
- </category>
- </extension>
-
- <extension
- point="org.eclipse.ui.preferencePages">
-
- <page
- name="%PLUGIN_NEW_CATEGORY_NAME_WS"
- class="org.eclipse.jst.ws.internal.ui.preferences.WebServicesPreferencePage"
- id="org.eclipse.jst.ws.internal.ui.preferences.name">
- </page>
-
- <page
- name="%PREFERENCE_CATEGORY_RESOURCE_MANAGEMENT"
- category="org.eclipse.jst.ws.internal.ui.preferences.name"
- class="org.eclipse.jst.ws.internal.ui.preferences.ResourceManagmentPreferencePage"
- id="org.eclipse.jst.ws.internal.ui.preferences.ResourceManagmentPreferencePage">
- </page>
-
- <page
- name="%PREFERENCE_CATEGORY_WSI"
- category="org.eclipse.jst.ws.internal.ui.preferences.name"
- class="org.eclipse.jst.ws.internal.ui.wsi.preferences.WSICompliancePreferencePage"
- id="org.eclipse.jst.ws.internal.ui.wsi.preferences.WSICompliancePreferencePage">
- </page>
-
- </extension>
-
- <extension
- point="org.eclipse.ui.propertyPages">
-
- <page
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true"
- name="%PREFERENCE_CATEGORY_WSI"
- class="org.eclipse.jst.ws.internal.ui.wsi.properties.WSICompliancePropertyPage"
- id="org.eclipse.jst.ws.internal.ui.wsi.properties.WSICompliancePropertyPage">
- <filter
- name="nature"
- value="org.eclipse.jdt.core.javanature">
- </filter>
- </page>
-
- <page
- objectClass="org.eclipse.core.resources.IJavaProject"
- adaptable="true"
- name="%PREFERENCE_CATEGORY_WSI"
- class="org.eclipse.jst.ws.internal.ui.wsi.properties.WSICompliancePropertyPage"
- id="org.eclipse.jst.ws.internal.ui.wsi.properties.WSICompliancePropertyPage">
- <filter
- name="nature"
- value="org.eclipse.jdt.core.javanature">
- </filter>
- </page>
-
- </extension>
-
- <extension
- point="org.eclipse.ui.popupMenus">
-
- <objectContribution
- objectClass="org.eclipse.core.resources.IResource"
- adaptable="true"
- id="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu">
- <menu
- label="%LABEL_POPUP_CATEGORY_WEB_SERVICES"
- path="additions"
- id="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu">
- <separator
- name="popupActions">
- </separator>
- </menu>
- </objectContribution>
-
- <objectContribution
- objectClass="org.eclipse.jst.j2ee.ejb.EnterpriseBean"
- adaptable="true"
- id="org.eclipse.jst.ws.atk.ui.webservice.category.ejb.popupMenu">
- <menu
- label="%LABEL_POPUP_CATEGORY_WEB_SERVICES"
- path="additions"
- id="org.eclipse.jst.ws.atk.ui.webservice.category.ejb.popupMenu">
- <separator
- name="popupActions">
- </separator>
- </menu>
- </objectContribution>
-
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/LaunchImportWizardAction.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/LaunchImportWizardAction.java
deleted file mode 100644
index ad92688..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/LaunchImportWizardAction.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.ui.action;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.command.env.ui.widgets.DynamicWizard;
-
-
-/**
- * This class launches the import wizard.
- */
-public class LaunchImportWizardAction implements IActionDelegate
-{
- private IStructuredSelection selection_;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action)
- {
- DynamicWizard wizard = new DynamicWizard();
-
- try
- {
- wizard.setInitialData( "wsimport" );
- wizard.init( PlatformUI.getWorkbench(), selection_ );
- }
- catch( CoreException exc )
- {
- // Do nothing.
- return;
- }
-
- WizardDialog dialog= new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
- dialog.setPageSize( 500, 400 );
- dialog.create();
- dialog.open();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection)
- {
- if( selection instanceof IStructuredSelection )
- {
- selection_ = (IStructuredSelection)selection;
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeploy.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeploy.java
deleted file mode 100644
index e8d48b7..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeploy.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.action;
-import org.eclipse.core.resources.IResource;
-
-
-public interface WebServiceDeploy {
- public void run(IResource selection);
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeployAction.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeployAction.java
deleted file mode 100644
index b2d1f4b..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WebServiceDeployAction.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.action;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.ws.internal.common.ServerUtils;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.IModule;
-
-public class WebServiceDeployAction extends WindowActionDelegate {
-public void run(org.eclipse.jface.action.IAction action) {
-
- IProject project = getSelectedResourceProject();
-
- String [] typeIds = ServerUtils.getServerTypeIdsByModule(project);
- Object theAction = null;
-
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] elements = reg.getConfigurationElementsFor("org.eclipse.jst.ws.ui", "webservicedeploy");
- try {
-
- if (typeIds == null || typeIds.length <= 0)
- {
- // that means the module is not attached to a server then pick the first extension found
- theAction = elements[0].createExecutableExtension("class");
- }
- else if ( typeIds.length == 1)
- {
- // that means the module is attached to one server then finds it id and a matchin extension or give a message
- for (int i = 0; i < elements.length; i++)
- {
- String id = elements[i].getAttribute("factoryId");
- if ( typeIds[0].equals(id))
- {
- theAction = elements[i].createExecutableExtension("class");
- break;
- }
- }
- if (theAction == null )
- {
- // give a message
- }
- }
- else
- {
- // The module is attached to more than one server find the first server-extension couple
- // TBD: add a dialog to choose the server for deployment
- for (int i = 0; i < elements.length; i++)
- {
- String id = elements[i].getAttribute("factoryId");
- for ( int k=0; k< typeIds.length; k++)
- {
- if ( typeIds[k].equals(id))
- {
- theAction = elements[i].createExecutableExtension("class");
- break;
- }
- }
- if (theAction != null) break;
- }
- if (theAction == null)
- {
- // give a Message
- }
- }
-
- if (theAction instanceof WebServiceDeploy)
- ((WebServiceDeploy)theAction).run(project);
- }
-
- catch (Exception e) {}
-}
-
-
- private IModule getModule(IProject project) {
-
- IModule[] modules = ServerUtil.getModules(project);
- if (modules!=null && modules.length!=0) {
- return modules[0];
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WindowActionDelegate.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WindowActionDelegate.java
deleted file mode 100644
index 3a77df9..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/action/WindowActionDelegate.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.action;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-import com.ibm.wtp.emf.workbench.ProjectUtilities;
-
-
-public abstract class WindowActionDelegate implements IWorkbenchWindowActionDelegate {
-protected IStructuredSelection fSelection;
-
-public WindowActionDelegate() {
- super();
- }
-
-public void dispose()
- {
- }
-
-public void init(org.eclipse.ui.IWorkbenchWindow window) { }
-
-public void selectionChanged(org.eclipse.jface.action.IAction action,
- org.eclipse.jface.viewers.ISelection selection) {
- if (selection instanceof IStructuredSelection)
- fSelection = (IStructuredSelection) selection;
- }
-
-public void setSelection(IStructuredSelection selection) {
- fSelection = selection;
-}
-public IStructuredSelection getSelection() {
- return fSelection;
-}
-
-public IProject getSelectedResourceProject() {
- IProject project = null;
- IResource resource_ = null;
- try {
- if (fSelection != null && fSelection.size() == 1) {
- Object obj = fSelection.getFirstElement();
-
- if (obj != null) {
- if ( obj instanceof IResource)
- {
- resource_ = (IResource) obj;
- }
- else if (obj instanceof ICompilationUnit)
- {
- ICompilationUnit compUnit = (ICompilationUnit)obj;
- resource_= compUnit.getCorrespondingResource();
- }
- else if (obj instanceof IJavaProject) {
- project = ((IJavaProject) obj).getProject();
- }
-
- else if (obj instanceof EObject) {
- project = ProjectUtilities.getProject((EObject) obj);
- }
-
- if ( resource_ != null )
- project = resource_.getProject();
-
- }
- }
- }
- catch (Exception e) {}
- return project;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/DialogResourceBrowser.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/DialogResourceBrowser.java
deleted file mode 100644
index e0099a8..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/DialogResourceBrowser.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.common;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jst.j2ee.internal.project.J2EENature;
-import org.eclipse.jst.ws.internal.ui.dialog.DialogUtils;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
-* This class provides a dialog for browsing workspace resources.
-* See also {@link DialogUtils#browseResources}.
-*/
-public class DialogResourceBrowser extends Dialog
-{
- private final String INFOPOP_RESOURCE_TREE = WebServiceUIPlugin.ID + ".DRES0001";
-
- private Shell shell_;
- private IResource root_;
- private IFilter[] filters_;
- private boolean multipleSelectionEnabled_;
- private IResource[] selection_;
- private Tree resourceTree_;
- private TreeViewer fileViewer_;
-
- public DialogResourceBrowser(Shell shell, IResource root, IFilter filter)
- {
- this(shell, root, new IFilter[]{filter});
- }
-
- /**
- * Constructs a new <code>DialogResourceBrowser</code>
- * under the given <code>parent Shell</code>.
- * The dialog renders all resources including and
- * under the given <code>root IResource</code>
- * @param parent The parent {@link org.eclipse.swt.widgets.Shell}.
- * or null to create a top-level shell.
- * @param root The root {@link org.eclipse.core.resources.IResource},
- * or null to begin with the workspace root.
- * @param filters An array of java.lang.String
- */
- public DialogResourceBrowser(Shell shell, IResource root, IFilter[] filters)
- {
- super(shell);
- shell_ = shell;
-
- IResource moduleRoot = root;
- if (root instanceof IProject)
- {
- IProject p = (IProject)moduleRoot;
- J2EENature nature = (J2EENature) J2EENature.getRegisteredRuntime(p);
- if (nature != null)
- {
- moduleRoot = nature.getModuleServerRoot();
- }
-
- }
-
- root_ = (moduleRoot == null) ? ResourcesPlugin.getWorkspace().getRoot() : moduleRoot;
- filters_ = (filters == null) ? new IFilter[0] : filters;
- multipleSelectionEnabled_ = false;
- setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);
- }
-
- /**
- * Enables or disables multiple selection in the tree view.
- * Multiple selection is disabled by default.
- * @param multipleSelectionEnabled True to enabled or false to disable.
- */
- public void setMultipleSelectionEnabled(boolean multipleSelectionEnabled)
- {
- multipleSelectionEnabled_ = multipleSelectionEnabled;
- }
-
- /**
- * Returns the selections made in the dialog if OK was pressed,
- * or null if Cancel was pressed. Returns null if the dialog
- * has never been opened.
- * @return An array of selected resources, possibly empty, possibly null.
- */
- public IResource[] getSelection()
- {
- return selection_;
- }
-
- public IResource getFirstSelection()
- {
- if (selection_ != null && selection_.length > 0)
- return selection_[0];
- else
- return null;
- }
-
- /**
- * Called when the Cancel button is pressed.
- * Insures that {@link #getResult} will return null.
- */
- protected void cancelPressed()
- {
- selection_ = null;
- setReturnCode(Dialog.CANCEL);
- super.cancelPressed();
- }
-
- /**
- * Called when the OK button is pressed.
- * Squirrels away the list of zero or more selected
- * <code>IResource</code>s to be returned by {@link #getResult}.
- */
- protected void okPressed()
- {
- ISelection selection = fileViewer_.getSelection();
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- selection_ = new IResource[structuredSelection.size()];
- int i = 0;
- Iterator it = structuredSelection.iterator();
- while (it.hasNext())
- {
- Object object = it.next();
- if (object instanceof IResource)
- selection_[i++] = (IResource)object;
- }
- }
- setReturnCode(Dialog.OK);
- super.okPressed();
- }
-
- /**
- * See {@link org.eclipse.jface.window.Window#configureShell}.
- * @param shell The shell.
- */
- protected void configureShell(Shell shell)
- {
- super.configureShell(shell);
- shell.setText(getMessage("%DIALOG_TITLE_RESOURCE_BROWSER"));
- }
-
- /**
- * Creates the dialog area.
- * @param parent The parent composite.
- * @return The control area.
- */
- protected Control createDialogArea(Composite parent)
- {
- Composite composite = (Composite)super.createDialogArea(parent);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL);
- gd.widthHint = 400;
- gd.heightHint = 300;
- gd.grabExcessVerticalSpace = true;
- gd.grabExcessHorizontalSpace = true;
- composite.setLayoutData(gd);
-
- if (multipleSelectionEnabled_)
- {
- resourceTree_ = new Tree(composite,SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- }
- else
- {
- resourceTree_ = new Tree(composite,SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- }
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL);
- gd.grabExcessVerticalSpace = true;
- gd.grabExcessHorizontalSpace = true;
- resourceTree_.setLayoutData(gd);
- resourceTree_.setToolTipText(getMessage("%TOOLTIP_RESOURCE_TREE"));
- WorkbenchHelp.setHelp(resourceTree_, new Object[]{INFOPOP_RESOURCE_TREE});
-
- fileViewer_ = new TreeViewer(resourceTree_);
- fileViewer_.setContentProvider(new WorkbenchContentProvider());
- fileViewer_.setLabelProvider(new DecoratingLabelProvider(new WorkbenchLabelProvider(), WebServiceUIPlugin.getInstance().getWorkbench().getDecoratorManager().getLabelDecorator()));
- fileViewer_.addFilter(
- new ViewerFilter()
- {
- public boolean select(Viewer viewer, Object parentObject, Object object)
- {
- if ((object instanceof IResource) && ((IResource)object).getType() != IResource.FILE)
- return true;
- else
- {
- for (int i = 0; i < filters_.length; i++)
- {
- if (filters_[i].accepts(object))
- return true;
- }
- return false;
- }
- }
- }
- );
- fileViewer_.setInput(root_);
- return composite;
- }
-
- private String getMessage(String msgId)
- {
- return WebServiceUIPlugin.getMessage(msgId);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/FileExtensionFilter.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/FileExtensionFilter.java
deleted file mode 100644
index ed355c4..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/FileExtensionFilter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.common;
-
-import org.eclipse.core.resources.IFile;
-
-/**
-* This is the interface for a class of objects that filter
-* other objects for inclusion or exclusion by some consumer.
-*/
-public class FileExtensionFilter implements IFilter
-{
- private String[] extensions_;
-
- public FileExtensionFilter(String[] extensions)
- {
- extensions_ = (extensions != null) ? extensions : new String[0];
- }
-
- /**
- * Returns the locale-specific name of this filter.
- * @return The locale-specific name of this filter.
- */
- public String getName()
- {
- return "org.eclipse.jst.ws.atk.ui.editor.common.FileExtensionFilter";
- }
-
- /**
- * Returns the locale-specific description of this filter.
- * @return The locale-specific description of this filter.
- */
- public String getDescription()
- {
- return "org.eclipse.jst.ws.atk.ui.editor.common.FileExtensionFilter";
- }
-
- /**
- * Returns true if and only if this <code>Filter</code>
- * accepts the given <code>object</code>. This method
- * must return true if and only if {@link #statusOf}
- * returns an <code>IStatus</code> with a severity of
- * less than <code>IStatus.ERROR</code>.
- * @param object The object to filter.
- * @return True if and only if this <code>Filter</code>
- * accepts the given <code>object</code>.
- */
- public boolean accepts(Object object)
- {
- if (object instanceof IFile)
- {
- IFile file = (IFile)object;
- for (int i = 0; i < extensions_.length; i++)
- {
- if (file.getFileExtension() != null && file.getFileExtension().equals(extensions_[i]))
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/IFilter.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/IFilter.java
deleted file mode 100644
index 2e5db8b..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/IFilter.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.common;
-
-/**
-* This is the interface for a class of objects that filter
-* other objects for inclusion or exclusion by some consumer.
-*/
-public interface IFilter
-{
- /**
- * Returns the locale-specific name of this filter.
- * @return The locale-specific name of this filter.
- */
- public String getName();
-
- /**
- * Returns the locale-specific description of this filter.
- * @return The locale-specific description of this filter.
- */
- public String getDescription();
-
- /**
- * Returns true if and only if this <code>Filter</code>
- * accepts the given <code>object</code>. This method
- * must return true if and only if {@link #statusOf}
- * returns an <code>IStatus</code> with a severity of
- * less than <code>IStatus.ERROR</code>.
- * @param object The object to filter.
- * @return True if and only if this <code>Filter</code>
- * accepts the given <code>object</code>.
- */
- public boolean accepts(Object object);
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/UIUtils.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/UIUtils.java
deleted file mode 100644
index ac7b81d..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/common/UIUtils.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.ui.common;
-
-import org.eclipse.swt.SWT;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-
-
-public class UIUtils
-{
- String infoPopid_;
- MessageUtils msgUtils_;
-
- public UIUtils( MessageUtils msgUtils, String infoPopid )
- {
- msgUtils_ = msgUtils;
- infoPopid_ = infoPopid;
- }
-
- public Button createRadioButton( Composite parent, String labelName, String tooltip, String infopop )
- {
- return createButton( SWT.RADIO, parent, labelName, tooltip, infopop );
- }
-
- public Button createCheckbox( Composite parent, String labelName, String tooltip, String infopop )
- {
- return createButton( SWT.CHECK, parent, labelName, tooltip, infopop );
- }
-
- public Button createPushButton( Composite parent, String labelName, String tooltip, String infopop )
- {
- return createButton( SWT.NONE, parent, labelName, tooltip, infopop );
- }
-
- public Button createButton( int kind, Composite parent, String labelName, String tooltip, String infopop )
- {
- Button button = new Button( parent, kind );
-
- tooltip = tooltip == null ? labelName : tooltip;
- button.setText( msgUtils_.getMessage( labelName ) );
- button.setToolTipText( msgUtils_.getMessage( tooltip ) );
-
- if( infopop != null ) WorkbenchHelp.setHelp( button, infoPopid_ + "." + infopop );
-
- return button;
- }
-
- public Combo createCombo( Composite parent, String labelName, String tooltip, String infopop, int style )
- {
- tooltip = tooltip == null ? labelName : tooltip;
-
- if( labelName != null )
- {
- Label label = new Label( parent, SWT.WRAP);
- label.setText( msgUtils_.getMessage( labelName ) );
- label.setToolTipText( msgUtils_.getMessage( tooltip ) );
- }
-
- Combo combo = new Combo( parent, style );
- GridData griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
-
- combo.setLayoutData( griddata );
- combo.setToolTipText( msgUtils_.getMessage(tooltip));
-
- if( infopop != null ) WorkbenchHelp.setHelp( combo, infoPopid_ + "." + infopop );
-
- return combo;
- }
-
- public Text createText( Composite parent, String labelName, String tooltip, String infopop, int style )
- {
- tooltip = tooltip == null ? labelName : tooltip;
-
- if( labelName != null )
- {
- Label label = new Label( parent, SWT.WRAP);
- label.setText( msgUtils_.getMessage( labelName ) );
- label.setToolTipText( msgUtils_.getMessage( tooltip ) );
- }
-
- Text text = new Text( parent, style );
- GridData griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
-
- text.setLayoutData( griddata );
- text.setToolTipText( msgUtils_.getMessage(tooltip));
-
- if( infopop != null ) WorkbenchHelp.setHelp( text, infoPopid_ + "." + infopop );
-
- return text;
- }
-
- public Composite createComposite( Composite parent, int columns )
- {
- return createComposite( parent, columns, -1, -1 );
- }
-
- public Composite createComposite( Composite parent, int columns, int marginHeight, int marginWidth )
- {
- Composite composite = new Composite( parent, SWT.NONE );
-
- GridLayout gridlayout = new GridLayout();
- gridlayout.numColumns = columns;
-
- if( marginHeight >= 0 ) gridlayout.marginHeight = marginHeight;
- if( marginWidth >= 0 ) gridlayout.marginWidth = marginWidth;
-
- composite.setLayout( gridlayout );
- GridData griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- composite.setLayoutData( griddata );
-
- return composite;
-
- }
- public Group createGroup( Composite parent, String groupName, String tooltip, String infopop )
- {
- return createGroup( parent, groupName, tooltip, infopop, 1, -1, -1 );
- }
-
- public Group createGroup( Composite parent, String groupName, String tooltip, String infopop, int columns, int marginHeight, int marginWidth )
- {
- Group newGroup = new Group( parent, SWT.NONE );
- GridData griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- GridLayout gridlayout = new GridLayout();
-
- gridlayout.numColumns = columns;
-
- if( marginHeight >= 0 ) gridlayout.marginHeight = marginHeight;
- if( marginWidth >= 0 ) gridlayout.marginWidth = marginWidth;
-
- tooltip = tooltip == null ? groupName : tooltip;
- newGroup.setLayout( gridlayout );
- newGroup.setText( msgUtils_.getMessage( groupName ) );
- newGroup.setLayoutData( griddata );
- newGroup.setToolTipText( msgUtils_.getMessage( tooltip ));
-
- if( infopop != null ) WorkbenchHelp.setHelp(newGroup, infoPopid_ + "." + infopop);
-
- return newGroup;
- }
-
- public Tree createTree( Composite parent, String tooltip, String infopop, int style )
- {
-
- tooltip = tooltip == null ? "" : tooltip;
-
- Tree tree = new Tree( parent, style );
-
- tree.setLayoutData( createFillAll() );
- tree.setToolTipText( msgUtils_.getMessage(tooltip));
-
- if( infopop != null ) WorkbenchHelp.setHelp( tree, infoPopid_ + "." + infopop );
-
- return tree;
-
- }
-
- public Table createTable( Composite parent, String tooltip, String infopop, int style )
- {
-
- tooltip = tooltip == null ? "" : tooltip;
-
- Table table = new Table( parent, style );
-
- //table.setLayoutData( createFillAll() );
- table.setToolTipText( msgUtils_.getMessage(tooltip));
-
- if( infopop != null ) WorkbenchHelp.setHelp( table, infoPopid_ + "." + infopop );
-
- return table;
-
- }
-
- public Label createHorizontalSeparator( Composite parent, int spacing )
- {
- Composite composite = createComposite( parent, 1, spacing, -1 );
-
- Label separator = new Label( composite, SWT.SEPARATOR | SWT.HORIZONTAL );
-
- GridData griddata = new GridData( GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL );
- separator.setLayoutData( griddata );
-
- return separator;
- }
-
- public GridData createFillAll()
- {
- GridData data = new GridData( GridData.HORIZONTAL_ALIGN_FILL |
- GridData.GRAB_HORIZONTAL |
- GridData.VERTICAL_ALIGN_FILL |
- GridData.GRAB_VERTICAL );
- return data;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/DialogUtils.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/DialogUtils.java
deleted file mode 100644
index 84eaf01..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/DialogUtils.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.dialog;
-
-import java.util.Vector;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.jst.ws.internal.common.Filter;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-import org.eclipse.ui.dialogs.SelectionDialog;
-
-
-/**
-* Contains utility methods for launching various common dialogs.
-*/
-public final class DialogUtils
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- /**
- * Raises a dialog for browsing containers.
- * @param parentShell The parent shell, optionally null.
- * @param initialPathname The initial selection.
- * @return The selected container or null if the dialog
- * is cancelled, or there is no selection, or the selection
- * is not a project or a folder.
- */
- public static String browseContainers ( Shell parentShell, String initialPathname )
- {
- String selectedPathname = null;
- IPath initialPath = new Path(initialPathname);
- IResource initialResource = ResourceUtils.getWorkspaceRoot().findMember(initialPath);
- if (initialResource == null)
- {
- if (initialPath.segmentCount() == 1)
- {
- initialResource = ResourceUtils.getWorkspaceRoot().getProject(initialPath.segment(0));
- }
- else if (initialPath.segmentCount() > 1)
- {
- initialResource = ResourceUtils.getWorkspaceRoot().getFolder(initialPath);
- }
- }
- else
- {
- if (initialResource.getType() == IResource.FILE)
- {
- initialResource = initialResource.getParent();
- }
- }
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(parentShell,(IContainer)initialResource,true,null);
- dialog.open();
- Object[] result = dialog.getResult();
- if (result != null && result.length > 0)
- {
- if (result[0] instanceof IPath)
- {
- IPath path = (IPath)result[0];
- selectedPathname = path.toString();
- }
- }
- return selectedPathname;
- }
-
- /**
- * Raises a dialog for browsing resources.
- * @param parentShell The parent shell, optionally null.
- * @param topResource The resource under which to browse.
- * If null, all resources in the workspace are browsed.
- * @param initialSelection The initial selection, or null for none.
- * If the initial selection is not null and exists in the set of
- * resources found by the browser, that resource is selected by default.
- * @param filter The resource filter object.
- * @return The selected resource.
- */
- public static IResource browseResources ( Shell parentShell, IResource topResource, IResource initialSelection, Filter filter)
- {
- ResourceSelectionDialog rds = new ResourceSelectionDialog(parentShell,topResource,initialSelection,filter);
- rds.setMultipleSelectionEnabled(false);
- if (rds.open() == Dialog.OK)
- {
- IResource[] resources = rds.getResult();
- if (resources != null && resources.length > 0)
- {
- return resources[0];
- }
- }
- return null;
- }
-
- /**
- * <b>Implementation remains TBD.</b><br>
- * Raises a dialog for browsing classes on a project's class path.
- * @param parentShell The parent shell, optionally null.
- * @param project The project.
- * @return The qualified name of the selected java class.
- */
- public static String browseClasses ( Shell parentShell, IProject project )
- {
- return browseClasses(parentShell, project, (IRunnableContext)null);
- }
-
- public static String browseClasses ( Shell parentShell, IProject project, IWizardContainer container)
- {
- return browseClasses(parentShell, project, (IRunnableContext)container);
- }
-
- /**
- * Raises a dialog for browsing classes on a project's class path.
- * @param parentShell The parent shell, optionally null.
- * @param project The project.
- * @param container The container of the launching wizard.
- * @return The qualified name of the selected java class.
- */
- public static String browseClasses ( Shell parentShell,
- IProject project,
- IRunnableContext ctxt)
- {
- return browseClasses(parentShell, new IResource[] {project}, ctxt);
- }
-
- public static String browseClasses(Shell parentShell, IResource[] resources, IRunnableContext ctxt)
- {
- IType itype = browseClassesAsIType(parentShell, resources, ctxt);
- if (itype != null)
- return itype.getFullyQualifiedName();
- else
- return null;
- }
-
- public static IType browseClassesAsIType(Shell parentShell, IResource[] resources, IRunnableContext ctxt)
- {
- Vector javaElements = new Vector();
- for (int i = 0; i < resources.length; i++)
- {
- IJavaElement javaElement = JavaCore.create(resources[i]);
- if (javaElement != null)
- javaElements.add(javaElement);
- }
- IJavaElement[] elements = (IJavaElement[])javaElements.toArray(new IJavaElement[0]);
-
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- scope.setIncludesClasspaths(true);
- scope.setIncludesBinaries(true);
-
- //Creating and opening a TypeSelectionDialog
- try
- {
- SelectionDialog dialog = JavaUI.createTypeDialog(parentShell, ctxt, scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false);
- dialog.setTitle(WebServiceUIPlugin.getMessage("%DIALOG_TITLE_CLASS_BROWSE"));
- dialog.setMessage(WebServiceUIPlugin.getMessage("%DIALOG_TITLE_CLASS_BROWSE"));
- dialog.open();
-
- //Getting the result and returning it
- Object[] results = dialog.getResult();
- if (results != null && results.length > 0)
- {
- if (results[0] instanceof IType)
- {
- return (IType)results[0];
- }
- }
- }
- catch (JavaModelException jme)
- {
- }
- return null;
- }
-
- /**
- * Raises a dialog for browsing interfaces on a project's class path.
- * @param parentShell The parent shell, optionally null.
- * @param project The project.
- * @param container The container of the launching wizard.
- * @return The qualified name of the selected java interface.
- */
- public static String browseInterfaces( Shell parentShell,
- IProject project,
- IWizardContainer container)
-
- {
- String interfaceName = null;
-
- //Limiting search scope to the project
- IResource[] resources = new IResource[1];
- resources[0]=project;
- IJavaElement[] elements = new IJavaElement[1];
- elements[0] = JavaCore.create(resources[0]);
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- scope.setIncludesClasspaths(true);
- scope.setIncludesBinaries(true);
-
- //Creating and opening a TypeSelectionDialog
- try
- {
- SelectionDialog dialog = JavaUI.createTypeDialog(parentShell, container, scope, IJavaElementSearchConstants.CONSIDER_TYPES, false);
- dialog.setTitle(WebServiceUIPlugin.getMessage("%DIALOG_TITLE_INTERFACE_BROWSE"));
- dialog.setMessage(WebServiceUIPlugin.getMessage("%DIALOG_TITLE_INTERFACE_BROWSE"));
- dialog.open();
-
- //Getting the result and returning it
- Object[] results = dialog.getResult();
- if (results != null && results.length > 0)
- {
- if (results[0] instanceof IType)
- {
- IType resultInterface = (IType)results[0];
- interfaceName = resultInterface.getFullyQualifiedName();
- }
- }
- }
- catch (JavaModelException jme)
- {
- }
-
- return interfaceName;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/ResourceSelectionDialog.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/ResourceSelectionDialog.java
deleted file mode 100644
index 453f1e5..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/dialog/ResourceSelectionDialog.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.dialog;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jst.ws.internal.common.AnyFilter;
-import org.eclipse.jst.ws.internal.common.Filter;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-
-/**
-* This class provides a dialog for browsing workspace resources.
-* See also {@link DialogUtils#browseResources}.
-*/
-public class ResourceSelectionDialog extends Dialog implements Listener
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- //
- // Dialog controls.
- //
- private Label filterLabel_;
- private Combo filterCombo_;
- /*CONTEXT_ID DRES0001 for the Resource Type combo box of the Resource Selection Dialog*/
- private static final String INFOPOP_DRES_COMBO_RESOURCE_TYPE = WebServiceUIPlugin.ID + ".DRES0001";
- private static final String TOOLTIP_DRES_COMBO_RESOURCE_TYPE = "%TOOLTIP_DRES_COMBO_RESOURCE_TYPE";
- //
- private Tree resourceTree_;
- private TreeViewer fileViewer_;
- /*CONTEXT_ID DRES0002 for the Resource tree of the Resource Selection Dialog*/
- private static final String INFOPOP_DRES_TREE_RESOURCE = WebServiceUIPlugin.ID + ".DRES0002";
- private static final String TOOLTIP_DRES_TREE_RESOURCE = "%TOOLTIP_DRES_TREE_RESOURCE";
-
- //
- // Essential goodies.
- //
- private Shell shell_;
- private IResource root_;
- private IResource initialSelection_;
- private Filter[] filters_;
- private Filter currentFilter_;
- private IResource[] selection_;
- private boolean multipleSelectionEnabled_;
-
- /**
- * Constructs a new <code>ResourceSelectionDialog</code>
- * under the given <code>parent Shell</code>.
- * The dialog renders all resources including and
- * under the given <code>root IResource</code>.
- * @param parent The parent {@link org.eclipse.swt.widgets.Shell},
- * or null to create a top-level shell.
- * @param root The root {@link org.eclipse.core.resources.IResource},
- * or null to begin with the workspace root.
- * @param initialSelection The initially selected object or null if none.
- */
- public ResourceSelectionDialog ( Shell parent, IResource root, IResource initialSelection )
- {
- this(parent,root,initialSelection,new Filter[] {new AnyFilter()});
- }
-
- /**
- * Constructs a new <code>ResourceSelectionDialog</code>
- * under the given <code>parent Shell</code>.
- * The dialog renders all resources including and
- * under the given <code>root IResource</code> that
- * are accepted by the given filter.
- * See {@link org.eclipse.jst.ws.internal.common.Filter#accepts}.
- * @param parent The parent {@link org.eclipse.swt.widgets.Shell},
- * or null to create a top-level shell.
- * @param root The root {@link org.eclipse.core.resources.IResource},
- * or null to begin with the workspace root.
- * @param initialSelection The initially selected object or null if none.
- * @param filter The {@link org.eclipse.jst.ws.internal.common.Filter},
- * or null to default to all resources under the <code>root</code>.
- */
- public ResourceSelectionDialog ( Shell parent, IResource root, IResource initialSelection, Filter filter )
- {
- this(parent,root,initialSelection,new Filter[] {filter});
- }
-
- /**
- * Constructs a new <code>ResourceSelectionDialog</code>
- * under the given <code>parent Shell</code>.
- * The dialog renders all resources including and
- * under the given <code>root IResource</code> that
- * are accepted by the given filters.
- * See {@link org.eclipse.jst.ws.internal.common.Filter#accepts}.
- * @param parent The parent {@link org.eclipse.swt.widgets.Shell}.
- * or null to create a top-level shell.
- * @param root The root {@link org.eclipse.core.resources.IResource},
- * or null to begin with the workspace root.
- * @param initialSelection The initially selected object or null if none.
- * @param filters An array of {@link org.eclipse.jst.ws.internal.common.Filter}
- * objects.
- * If the array is null or of length zero, then all resources are accepted
- * (ie. equivalent to <code>ResourceSelectionDialog(parent,root)</code>.
- * If the array is of length one, then the dialog will consist of a single
- * control showing a list of all filtered resources.
- * If the array is of length greater than one, then the dialog will
- * consist of a combo box containing the names of the filters and with the
- * first filter (ie. <code>filters[0]</code>) selected by default, followed
- * by a control showing a list of all resources filtered by the selected filter.
- */
- public ResourceSelectionDialog ( Shell parent, IResource root, IResource initialSelection, Filter[] filters )
- {
- super(parent);
- shell_ = parent;
- root_ = root == null ? ResourceUtils.getWorkspaceRoot() : root;
- initialSelection_ = initialSelection;
- filters_ = (filters == null || filters.length == 0) ? new Filter[] {new AnyFilter()} : filters;
- currentFilter_ = filters_[0];
- multipleSelectionEnabled_ = false;
- setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);
- }
-
- /**
- * Enables or disables multiple selection in the tree view.
- * Multiple selection is disabled by default.
- * @param multipleSelectionEnabled True to enabled or false to disable.
- */
- public void setMultipleSelectionEnabled ( boolean multipleSelectionEnabled )
- {
- multipleSelectionEnabled_ = multipleSelectionEnabled;
- }
-
- /**
- * Returns the selections made in the dialog if OK was pressed,
- * or null if Cancel was pressed. Returns null if the dialog
- * has never been opened.
- * @return An array of selected resources, possibly empty, possibly null.
- */
- public IResource[] getResult ()
- {
- return selection_;
- }
-
- /**
- * Called when the Cancel button is pressed.
- * Insures that {@link #getResult} will return null.
- */
- protected void cancelPressed ()
- {
- selection_ = null;
- setReturnCode(Dialog.CANCEL);
- super.cancelPressed();
- }
-
- /**
- * Called when the OK button is pressed.
- * Squirrels away the list of zero or more selected
- * <code>IResource</code>s to be returned by {@link #getResult}.
- */
- protected void okPressed ()
- {
- ISelection selection = fileViewer_.getSelection();
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- selection_ = new IResource[structuredSelection.size()];
- int i=0;
- Iterator iter = structuredSelection.iterator();
- while (iter.hasNext())
- {
- Object object = iter.next();
- if (object instanceof IResource)
- {
- selection_[i++] = (IResource)object;
- }
- }
- }
- setReturnCode(Dialog.OK);
- super.okPressed();
- }
-
- /**
- * See {@link org.eclipse.jface.window.Window#configureShell}.
- * @param shell The shell.
- */
- protected void configureShell ( Shell shell )
- {
- super.configureShell(shell);
- shell.setText(WebServiceUIPlugin.getMessage("%DIALOG_TITLE_RESOURCE_BROWSE"));
- }
-
- /**
- * Creates the dialog area.
- * @param parent The parent composite.
- * @return The control area.
- */
- protected Control createDialogArea ( Composite parent )
- {
- GridLayout gl;
- GridData gd;
-
- Composite composite = (Composite)super.createDialogArea(parent);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL);
- gd.widthHint = 400;
- gd.heightHint = 300;
- gd.grabExcessVerticalSpace = true;
- gd.grabExcessHorizontalSpace = true;
- composite.setLayoutData(gd);
-
- if (filters_.length > 1)
- {
- Composite f = new Composite(composite,SWT.NONE);
- gl = new GridLayout();
- gl.numColumns = 2;
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- f.setLayout(gl);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- f.setLayoutData(gd);
-
- filterLabel_ = new Label(f,SWT.WRAP);
- filterLabel_.setText(WebServiceUIPlugin.getMessage("%LABEL_RESOURCE_FILTER"));
- filterLabel_.setToolTipText(WebServiceUIPlugin.getMessage(TOOLTIP_DRES_COMBO_RESOURCE_TYPE));
-
- filterCombo_ = new Combo(f,SWT.DROP_DOWN | SWT.READ_ONLY);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- filterCombo_.setLayoutData(gd);
- filterCombo_.addListener(SWT.Selection,this);
- filterCombo_.setToolTipText(WebServiceUIPlugin.getMessage(TOOLTIP_DRES_COMBO_RESOURCE_TYPE));
- WorkbenchHelp.setHelp(filterCombo_,new Object[] {INFOPOP_DRES_COMBO_RESOURCE_TYPE});
- }
-
- if (multipleSelectionEnabled_)
- {
- resourceTree_ = new Tree(composite,SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- }
- else
- {
- resourceTree_ = new Tree(composite,SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- }
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL);
- gd.grabExcessVerticalSpace = true;
- gd.grabExcessHorizontalSpace = true;
- resourceTree_.setLayoutData(gd);
-// resourceTree_.addListener(SWT.Selection,this);
- resourceTree_.setToolTipText(WebServiceUIPlugin.getMessage(TOOLTIP_DRES_TREE_RESOURCE));
- WorkbenchHelp.setHelp(resourceTree_,new Object[] {INFOPOP_DRES_TREE_RESOURCE});
-
- fileViewer_ = new TreeViewer(resourceTree_);
- fileViewer_.setContentProvider(new WorkbenchContentProvider());
- fileViewer_.setLabelProvider(
- new DecoratingLabelProvider(
- new WorkbenchLabelProvider(),
- WebServiceUIPlugin.getInstance().getWorkbench().getDecoratorManager().getLabelDecorator()));
- fileViewer_.addFilter(
- new ViewerFilter ()
- {
- public boolean select ( Viewer viewer, Object parentObject, Object object )
- {
- return
- (
- ((object instanceof IResource) && ((IResource)object).getType() != IResource.FILE)
- || (ResourceSelectionDialog.this.currentFilter_.accepts(object))
- );
- }
- }
- );
- fileViewer_.setInput(root_);
- fileViewer_.addSelectionChangedListener(
- new ISelectionChangedListener ()
- {
- public void selectionChanged ( SelectionChangedEvent event )
- {
-// ResourceSelectionDialog.this.validatePageToStatus();
- }
- }
- );
- if (initialSelection_ != null)
- {
- fileViewer_.setSelection(new StructuredSelection(ResourceSelectionDialog.this.initialSelection_),true);
- }
-
- return composite;
- }
-
- /**
- * Called when an event occurs on the page.
- * Handles the event and revalidates the page.
- * @param event The event that occured.
- */
- public void handleEvent ( Event event )
- {
-// validatePageToStatus();
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/plugin/WebServiceUIPlugin.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/plugin/WebServiceUIPlugin.java
deleted file mode 100644
index eb28781..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/plugin/WebServiceUIPlugin.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.ui.plugin;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.ws.internal.ui.preferences.PersistentActionDialogsContext;
-import org.eclipse.jst.ws.internal.ui.wsi.preferences.PersistentWSIAPContext;
-import org.eclipse.jst.ws.internal.ui.wsi.preferences.PersistentWSIContext;
-import org.eclipse.jst.ws.internal.ui.wsi.preferences.PersistentWSISSBPContext;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-
-
-
-/**
-* This is the plugin class for the Web Services plugin.
-* <p>
-* This plugin contains the graphic user interface to the
-* Web Services runtime found in org.eclipse.jst.ws.
-*/
-public class WebServiceUIPlugin extends AbstractUIPlugin
-{
- // Copyright
- public static final String copyright =
- "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * The identifier of the descriptor of this plugin in plugin.xml.
- */
- public static final String ID = "org.eclipse.jst.ws.ui";
-
- /**
- * The reference to the singleton instance of this plugin.
- */
- private static WebServiceUIPlugin instance_;
-
- private PersistentWSISSBPContext wsiSSBPContext_;
- private PersistentWSIAPContext wsiAPContext_;
- private PersistentActionDialogsContext actionDialogsContext_;
- private Log log_;
-
- /**
- * Constructs a runtime plugin object for this plugin.
- * The "plugin" element in plugin.xml should include the attribute
- * class = "org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin".
- * @param descriptor The descriptor of this plugin.
- */
- public WebServiceUIPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- if (instance_ == null) {
- instance_ = this;
- }
- log_ = new EclipseLog();
- }
-
- /**
- * Returns the singleton instance of this plugin. Equivalent to calling
- * (WebServiceUIPlugin)Platform.getPlugin("org.eclipse.jst.ws.ui");
- * @return The WebServiceUIPlugin singleton.
- */
- static public WebServiceUIPlugin getInstance() {
- return instance_;
- }
-
- /**
- * Called once by the platform when this plugin is first loaded.
- * @throws CoreException If this plugin fails to start.
- */
- public void startup() throws CoreException {
- log_.log(Log.INFO, 5040, this, "startup", "Starting plugin org.eclipse.jst.ws.ui");
- super.startup();
- }
-
- /**
- * Called once by the platform when this plugin is unloaded.
- * @throws CoreException If this plugin fails to shutdown.
- */
- public void shutdown() throws CoreException {
- log_.log(Log.INFO, 5041, this, "shutdown", "Shutting plugin org.eclipse.jst.ws.ui");
- super.shutdown();
- }
-
- /**
- * Get WSI Context
- * @deprecated use getWSISSBPContext or getWSIAPContext instead
- *
- */
- public PersistentWSIContext getWSIContext()
- { // defaulting to get WSI Simple SOAP Basic Profile context
- return getWSISSBPContext();
- }
-
- /**
- * Get WSI Simple SOAP Basic Profile Context
- *
- */
- public PersistentWSISSBPContext getWSISSBPContext()
- {
- if (wsiSSBPContext_ == null)
- {
- wsiSSBPContext_ = new PersistentWSISSBPContext();
- wsiSSBPContext_.load();
- }
- return wsiSSBPContext_;
- }
-
- /**
- * Get WSI Attachment Profile Context
- *
- */
- public PersistentWSIAPContext getWSIAPContext()
- {
- if (wsiAPContext_ == null)
- {
- wsiAPContext_ = new PersistentWSIAPContext();
- wsiAPContext_.load();
- }
- return wsiAPContext_;
- }
-
- public PersistentActionDialogsContext getActionDialogsContext()
- {
- if (actionDialogsContext_ == null)
- {
- actionDialogsContext_ = new PersistentActionDialogsContext();
- actionDialogsContext_.load();
- }
- return actionDialogsContext_;
- }
-
- /**
- * Returns the message string identified by the given key from
- * the plugin.properties file for the appropriate locale.
- * @param key The message key string prefixed by a "%" symbol.
- * That is, the string passed in must be of the form "%KEY"
- * where the plugin.properties file contains a line of the
- * form: "KEY = value".
- * @return The locale-specific message.
- */
- public static String getMessage(String key)
- {
- MessageUtils msgUtils = new MessageUtils( "org.eclipse.jst.ws.ui.plugin", instance_ );
-
- if( key.startsWith("%"))
- {
- key = key.substring( 1, key.length() );
- }
-
- return msgUtils.getMessage(key);
- }
-
- /**
- * Returns the message string identified by the given key from
- * the plugin.properties file for the appropriate locale.
- * Substitution sequences in the message string
- * are replaced by the given array of substitution objects (which
- * are most frequently strings). See java.text.MessageFormat for
- * further details on substitution.
- * @param key The message key string prefixed by a "%" symbol.
- * That is, the string passed in must be of the form "%KEY"
- * where the plugin.properties file contains a line of the
- * form: "KEY = value".
- * @param args The substitution values for the message
- * as required by the message in plugin.properties and
- * by the rules of class java.text.MessageFormat.
- * @return The locale-specific message.
- */
- public static String getMessage(String key, Object[] args) {
- return MessageFormat.format(getMessage(key), args);
- }
-
- /**
- * Returns an image descriptor for the named resource
- * as relative to the plugin install location.
- * @return An image descriptor, possibly null.
- */
- public static ImageDescriptor getImageDescriptor(String name) {
- try {
- URL installURL = instance_.getDescriptor().getInstallURL();
- URL imageURL = new URL(installURL, name);
- return ImageDescriptor.createFromURL(imageURL);
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
- public String getPluginStateLocation() {
- return Platform.getPluginStateLocation(this).toOSString();
- }
-
- public String getPluginInstallLocation() {
- try {
- return Platform.resolve(getDescriptor().getInstallURL()).getFile();
- } catch (Exception e) {
- return null;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceType.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceType.java
deleted file mode 100644
index 7e2ba9c..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceType.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.preferences;
-
-public class ActionDialogPreferenceType {
-
- private String id_;
- public void setId (String id) {
- id_ = id;
- }
- public String getId() {
- return id_;
- }
-
- private String name_;
- public void setName(String name) {
- name_ = name;
- }
- public String getName() {
- return name_;
- }
-
- private String infopop_;
- public void setInfopop (String infopop) {
- infopop_ = infopop;
- }
- public String getInfopop () {
- return infopop_;
- }
-
- private String tooltip_;
- public void setTooltip (String tooltip) {
- tooltip_= tooltip;
- }
- public String getTooltip () {
- return tooltip_;
- }
-
- }
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceTypeRegistry.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceTypeRegistry.java
deleted file mode 100644
index 3831648..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogPreferenceTypeRegistry.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.preferences;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-
-public class ActionDialogPreferenceTypeRegistry
-{
- private static ActionDialogPreferenceTypeRegistry instance_;
-
- private Hashtable typesByName_;
-
- //
- // Loads WebServiceType objects into this registry.
- // This is done by querying the plugin registry for all extensions
- // hanging on the webServiceType extension point. Extensions
- // must implement the org.eclipse.jst.ws.ui.wizard.WebServiceType
- // interface.
- //
- private void loadDialogsPreferences ()
- {
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] config = reg.getConfigurationElementsFor(
- "org.eclipse.jst.ws.ui",
- "actionDialogPreferenceType");
- for(int idx=0; idx<config.length; idx++)
- {
- IConfigurationElement elem = config[idx];
- try
- {
- Object actionDialogPreferenceType = elem.createExecutableExtension("class");
- if (actionDialogPreferenceType instanceof ActionDialogPreferenceType)
- {
- ActionDialogPreferenceType dialog = (ActionDialogPreferenceType) actionDialogPreferenceType;
- dialog.setId((String)elem.getAttribute("id"));
- dialog.setName((String)elem.getAttribute("name"));
- dialog.setInfopop((String)elem.getAttribute("infopop"));
- dialog.setTooltip((String)elem.getAttribute("tooltip"));
- add(dialog);
- }
- } catch (CoreException e)
- {
- }
- }
- }
-
- //
- // Loads actionDialogPreferenceType objects into this registry.
- // See method getInstance().
- //
- private void load ()
- {
- typesByName_ = new Hashtable();
- loadDialogsPreferences();
- }
-
- //
- // Add the given WebServiceType to this registry.
- // See method load().
- //
- private void add ( ActionDialogPreferenceType dialog )
- {
- typesByName_.put(dialog.getId(),dialog);
- }
-
- /**
- * Returns a singleton instance of this class.
- * @return A singleton WebServiceTypeRegistry object.
- */
- public static ActionDialogPreferenceTypeRegistry getInstance ()
- {
- if (instance_ == null)
- {
- instance_ = new ActionDialogPreferenceTypeRegistry();
- instance_.load();
- }
- return instance_;
- }
-
- /**
- * Returns all registered <code>WebServiceType</code> objects.
- * @return All registered <code>WebServiceType</code> objects.
- */
- public ActionDialogPreferenceType[] getActionDialogsPrefrences ()
- {
- ActionDialogPreferenceType[] dialogs = new ActionDialogPreferenceType[typesByName_.size()];
- Enumeration e = typesByName_.elements();
- for (int i=0; e.hasMoreElements(); i++)
- {
- dialogs[i] = (ActionDialogPreferenceType)e.nextElement();
- }
- return dialogs;
- }
-
- public ActionDialogPreferenceType getActionDialogPrefrenceTypeByName (String name)
- {
- return (name == null ? null : (ActionDialogPreferenceType)typesByName_.get(name));
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogsPreferencePage.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogsPreferencePage.java
deleted file mode 100644
index 70b7967..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ActionDialogsPreferencePage.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.ui.preferences;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.DialogPageContextComputer;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-;
-
-public class ActionDialogsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Listener
-{
- /*CONTEXT_ID PPAD0001 for the Action Dialogs Preference Page*/
- private String INFOPOP_PPAD_PAGE = WebServiceUIPlugin.ID + ".PPAD0001";
- //
- private Button showAll;
- /*CONTEXT_ID PPAD0002 for the show all check box on the Action Dialogs Preference Page*/
- private String INFOPOP_PPAD_BUTTON_SHOW_ALL = WebServiceUIPlugin.ID + ".PPAD0002";
- //
- private Button hideAll;
- /*CONTEXT_ID PPAD0003 for the hide all check box on the Action Dialogs Preference Page*/
- private String INFOPOP_PPAD_BUTTON_HIDE_ALL = WebServiceUIPlugin.ID + ".PPAD0003";
-
- private Hashtable checkBoxes_;
-
- /**
- * Creates preference page controls on demand.
- * @param parent the parent for the preference page
- */
- protected Control createContents(Composite superparent)
- {
- checkBoxes_ = new Hashtable();
- addOptionalDialogsCheckBoxes (superparent);
- new Label(superparent, SWT.HORIZONTAL);
-
- Composite parent = new Composite( superparent, SWT.NONE );
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- parent.setLayout( layout );
- parent.setToolTipText(getMessage("%TOOLTIP_PPAD_PAGE"));
- WorkbenchHelp.setHelp(parent,new DialogPageContextComputer(this,INFOPOP_PPAD_PAGE));
-
- showAll = new Button(parent, SWT.NONE);
- showAll.setText(getMessage("%BUTTON_SHOW_ALL_DIALOGS"));
- showAll.addListener(SWT.Selection, this);
- showAll.setToolTipText(getMessage("%TOOLTIP_PPAD_BUTTON_SHOW_ALL"));
- WorkbenchHelp.setHelp(showAll,new DialogPageContextComputer(this,INFOPOP_PPAD_BUTTON_SHOW_ALL));
-
- hideAll = new Button(parent, SWT.NONE);
- hideAll.setText(getMessage("%BUTTON_HIDE_ALL_DIALOGS"));
- hideAll.addListener ( SWT.Selection, this);
- hideAll.setToolTipText(getMessage("%TOOLTIP_PPAD_BUTTON_HIDE_ALL"));
- WorkbenchHelp.setHelp(hideAll,new DialogPageContextComputer(this,INFOPOP_PPAD_BUTTON_HIDE_ALL));
-
- initializeValues();
- org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent);
- return parent;
- }
-
- private String getMessage(String key)
- {
- return WebServiceUIPlugin.getMessage(key);
- }
-
- public void handleEvent (Event event)
- {
- if (showAll == event.widget)
- handleShowAllEvent();
-
- else if ( hideAll == event.widget)
- handleHideAllEvent();
- }
-
- private void handleShowAllEvent ()
- {
- Enumeration e = checkBoxes_.elements();
- for (int i=0; e.hasMoreElements(); i++)
- {
- Button dialog = (Button) e.nextElement();
- dialog.setSelection( true );
- }
- }
-
- private void handleHideAllEvent ()
- {
- Enumeration e = checkBoxes_.elements();
- for (int i=0; e.hasMoreElements(); i++)
- {
- Button dialog = (Button) e.nextElement();
- dialog.setSelection( false );
- }
- }
-
- private void addOptionalDialogsCheckBoxes ( Composite parent)
- {
- PersistentActionDialogsContext context = WebServiceUIPlugin.getInstance().getActionDialogsContext();
- ActionDialogPreferenceType[] dialogs = context.getDialogs();
- for (int i = 0; i < dialogs.length; i++) {
- Button checkBox = createCheckBox(parent , dialogs[i].getName());
- checkBox.setToolTipText(getMessage(dialogs[i].getTooltip()));
- WorkbenchHelp.setHelp(checkBox,new DialogPageContextComputer(this,dialogs[i].getInfopop()));
- checkBoxes_.put(dialogs[i].getId(), checkBox);
- }
- }
-
- private Button createCheckBox( Composite parent, String text )
- {
- Button button = new Button( parent, SWT.CHECK );
- button.setText( text );
- return button;
- }
-
- /**
- * Does anything necessary because the default button has been pressed.
- */
- protected void performDefaults()
- {
- super.performDefaults();
- initializeDefaults();
- }
-
- /**
- * Do anything necessary because the OK button has been pressed.
- * @return whether it is okay to close the preference page
- */
- public boolean performOk()
- {
- storeValues();
- return true;
- }
-
- protected void performApply()
- {
- performOk();
- }
-
- /**
- * @see IWorkbenchPreferencePage
- */
- public void init(IWorkbench workbench) { }
-
- /**
- * The proxy information is stored in the preference store.
- */
- public IPreferenceStore getPreferenceStore()
- {
- return WebServiceUIPlugin.getInstance().getPreferenceStore();
- }
-
- /**
- * Initializes states of the controls using default values
- * in the preference store.
- */
- private void initializeDefaults()
- {
- Enumeration e = checkBoxes_.elements();
- for (int i=0; e.hasMoreElements(); i++)
- {
- Button dialog = (Button) e.nextElement();
- dialog.setSelection(true);
- }
- }
-
- /**
- * Initializes states of the controls from the preferences.
- */
- private void initializeValues()
- {
- PersistentActionDialogsContext context = WebServiceUIPlugin.getInstance().getActionDialogsContext();
- Enumeration e = checkBoxes_.keys();
- for (int i=0; e.hasMoreElements(); i++)
- {
- String id = (String) e.nextElement();
- Button button = (Button) checkBoxes_.get(id);
- button.setSelection(context.isActionDialogEnabled(id));
- }
- }
-
- /**
- * Stores the values of the controls back to the preference store.
- */
- private void storeValues()
- {
- PersistentActionDialogsContext context = WebServiceUIPlugin.getInstance().getActionDialogsContext();
-
- Enumeration e = checkBoxes_.keys();
- for (int i=0; e.hasMoreElements(); i++)
- {
- String id = (String) e.nextElement();
- context.setActionDialogEnabled(id, ((Button)checkBoxes_.get(id)).getSelection());
- }
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/PersistentActionDialogsContext.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/PersistentActionDialogsContext.java
deleted file mode 100644
index 7b3b67b..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/PersistentActionDialogsContext.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.preferences;
-
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.wst.command.env.context.PersistentContext;
-
-
-public class PersistentActionDialogsContext extends PersistentContext
-{
- private ActionDialogPreferenceType [] dialogs_;
-
-public PersistentActionDialogsContext ()
-{
- super( WebServiceUIPlugin.getInstance());
-}
-public void load()
-{
- ActionDialogPreferenceTypeRegistry reg = ActionDialogPreferenceTypeRegistry.getInstance();
- dialogs_ = reg.getActionDialogsPrefrences();
- for (int i = 0; i < dialogs_.length; i++) {
- setDefault(dialogs_[i].getId(), true);
- }
-}
-
-public ActionDialogPreferenceType[] getDialogs()
-{
- return dialogs_;
-}
-
-public void setActionDialogEnabled ( String id, boolean value)
-{
- setValue (id, value);
-}
-
-public boolean isActionDialogEnabled( String id)
-{
- if (id == null )
- return true;
- return getValueAsBoolean(id);
-}
-
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ProjectTopologyPreferencePage.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ProjectTopologyPreferencePage.java
deleted file mode 100644
index 1fcbd40..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ProjectTopologyPreferencePage.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.preferences;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.ws.internal.context.ProjectTopologyContext;
-import org.eclipse.jst.ws.internal.context.ProjectTopologyDefaults;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-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.Control;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.DialogPageContextComputer;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-
-
-public class ProjectTopologyPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, SelectionListener
-{
- /*CONTEXT_ID PPSD0001 for the Project Topology Preference Page*/
- private String INFOPOP_PTPP_PAGE = WebServiceUIPlugin.ID + ".PPTP0001";
-
- private TableViewer clientTypeViewer_;
- private Button moveUp_;
- private Button moveDown_;
- private Vector clientTypes_;
- /* CONTEXT_ID PTPP0002 for the client type table viewer on the Project Topology Preference Page */
- private final String INFOPOP_PTPP_CLIENT_TYPE = WebServiceUIPlugin.ID + ".PTPP0002";
- /* CONTEXT_ID PTPP0003 for the move up button on the Project Topology Preference Page */
- private final String INFOPOP_PTPP_MOVE_UP = WebServiceUIPlugin.ID + ".PTPP0003";
- /* CONTEXT_ID PTPP0004 for the move down button on the Project Topology Preference Page */
- private final String INFOPOP_PTPP_MOVE_DOWN = WebServiceUIPlugin.ID + ".PTPP0004";
-
- private Button twoEAR_;
- /* CONTEXT_ID PTPP0005 for the enable 2 EARs checkbox on the Project Topology Preference Page */
- private final String INFOPOP_PTPP_TWO_EAR_CHECKBOX = WebServiceUIPlugin.ID + ".PTPP0005";
-
- /**
- * Creates preference page controls on demand.
- * @param parent the parent for the preference page
- */
- protected Control createContents(Composite superparent)
- {
- Composite parent = new Composite( superparent, SWT.NONE );
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- parent.setLayout( layout );
- parent.setToolTipText(getMessage("%TOOLTIP_PTPP_PAGE"));
- parent.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
- WorkbenchHelp.setHelp(parent,new DialogPageContextComputer(this,INFOPOP_PTPP_PAGE));
-
- Text clientTypeLabel = new Text(parent, SWT.READ_ONLY | SWT.WRAP);
- clientTypeLabel.setText(getMessage("%LABEL_CLIENT_TYPE_NAME"));
-
- Composite clientTypeComposite = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- clientTypeComposite.setLayout(gl);
-
- Table table= new Table(clientTypeComposite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- gd.widthHint = 256;
- table.setLayoutData(gd);
- table.setToolTipText(getMessage("%TOOLTIP_CLIENT_TYPE_TABLE_VIEWER"));
-
- clientTypes_ = new Vector();
- clientTypeViewer_ = new TableViewer(table);
- clientTypeViewer_.setContentProvider(new ClientTypeContentProvider());
- clientTypeViewer_.setLabelProvider(new ClientTypeLabelProvider());
- clientTypeViewer_.setInput(clientTypes_);
-
- TableLayout tableLayout = new TableLayout();
- TableColumn tableColumn = new TableColumn(table, SWT.NONE);
- tableColumn.setText(getMessage("%LABEL_CLIENT_TYPE"));
- ColumnWeightData columnData = new ColumnWeightData(256, 256, false);
- tableLayout.addColumnData(columnData);
- table.setLayout(tableLayout);
-
- Composite c = new Composite(clientTypeComposite, SWT.NONE);
- gl = new GridLayout();
- gl.numColumns = 1;
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- c.setLayout(gl);
-
- moveUp_ = new Button(c, SWT.PUSH);
- moveUp_.setText(getMessage("%LABEL_MOVE_UP"));
- moveUp_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- moveUp_.addSelectionListener(this);
- moveUp_.setToolTipText(getMessage("%TOOLTIP_MOVE_UP"));
-
- moveDown_ = new Button(c, SWT.PUSH);
- moveDown_.setText(getMessage("%LABEL_MOVE_DOWN"));
- moveDown_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- moveDown_.addSelectionListener(this);
- moveDown_.setToolTipText(getMessage("%TOOLTIP_MOVE_DOWN"));
-
- twoEAR_ = new Button(parent, SWT.CHECK);
- twoEAR_.setText(getMessage("%LABEL_ENABLE_TWO_EARS"));
- twoEAR_.setToolTipText(getMessage("%TOOLTIP_ENABLE_TWO_EARS"));
-
- initializeValues();
- org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent);
-
- return parent;
- }
-
- private String getMessage(String key)
- {
- return WebServiceUIPlugin.getMessage(key);
- }
-
- /**
- * Does anything necessary because the default button has been pressed.
- */
- protected void performDefaults()
- {
- super.performDefaults();
- initializeDefaults();
- }
-
- /**
- * Do anything necessary because the OK button has been pressed.
- * @return whether it is okay to close the preference page
- */
- public boolean performOk()
- {
- storeValues();
- return true;
- }
-
- protected void performApply()
- {
- performOk();
- }
-
- /**
- * @see IWorkbenchPreferencePage
- */
- public void init(IWorkbench workbench) { }
-
- /**
- * Initializes states of the controls to their burned-in defaults.
- */
- private void initializeDefaults()
- {
- clientTypes_.clear();
- String[] types = ProjectTopologyDefaults.getClientTypes();
- for (int i = 0; i < types.length; i++)
- clientTypes_.add(types[i]);
- clientTypeViewer_.refresh();
- twoEAR_.setSelection(true);
- }
-
- /**
- * Initializes states of the controls from the preference helper.
- */
- private void initializeValues()
- {
- ProjectTopologyContext context = WebServicePlugin.getInstance().getProjectTopologyContext();
- String[] types = context.getClientTypes();
- for (int i = 0; i < types.length; i++)
- clientTypes_.add(types[i]);
- // check whether we missed any types from the default list
- boolean missed = false;
- types = ProjectTopologyDefaults.getClientTypes();
- for (int i = 0; i < types.length; i++)
- {
- if (clientTypes_.indexOf(types[i]) == -1)
- {
- clientTypes_.add(types[i]);
- missed = true;
- }
- }
- if (missed)
- {
- types = new String[clientTypes_.size()];
- clientTypes_.copyInto(types);
- context.setClientTypes(types);
- }
- // refresh viewer
- clientTypeViewer_.refresh();
- twoEAR_.setSelection(context.isUseTwoEARs());
- }
-
- /**
- * Stores the values of the controls back to the preference helper.
- */
- private void storeValues()
- {
- ProjectTopologyContext context = WebServicePlugin.getInstance().getProjectTopologyContext();
- String[] types = new String[clientTypes_.size()];
- clientTypes_.copyInto(types);
- context.setClientTypes(types);
- context.setUseTwoEARs(twoEAR_.getSelection());
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- int index = clientTypeViewer_.getTable().getSelectionIndex();
- if (index != -1)
- {
- if (e.widget == moveUp_ && index > 0)
- {
- Object object = clientTypes_.remove(index);
- clientTypes_.insertElementAt(object, index-1);
- clientTypeViewer_.refresh();
- }
- else if (e.widget == moveDown_ && index < clientTypes_.size()-1)
- {
- Object object = clientTypes_.remove(index);
- clientTypes_.insertElementAt(object, index+1);
- clientTypeViewer_.refresh();
- }
- }
- }
-
- private class ClientTypeContentProvider implements IStructuredContentProvider
- {
- /**
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object value)
- {
- return ((Vector)value).toArray(new String[0]);
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose()
- {
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer arg0, Object arg1, Object arg2)
- {
- }
- }
-
- private class ClientTypeLabelProvider extends LabelProvider
- {
- private IConfigurationElement[] configElements_;
-
- public ClientTypeLabelProvider()
- {
- IPluginRegistry reg = Platform.getPluginRegistry();
- configElements_ = reg.getConfigurationElementsFor("org.eclipse.jst.ws.consumption.ui", "clientProjectType");
- }
-
- private IConfigurationElement getElementByAttribute(String name, String value)
- {
- for (int i = 0; i < configElements_.length; i++)
- if (configElements_[i].getAttribute(name).equals(value))
- return configElements_[i];
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(Object)
- */
- public Image getImage(Object arg0)
- {
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(Object)
- */
- public String getText(Object value)
- {
- return getElementByAttribute("id", value.toString()).getAttribute("label");
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ResourceManagmentPreferencePage.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ResourceManagmentPreferencePage.java
deleted file mode 100644
index 83f0df0..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ResourceManagmentPreferencePage.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.ui.preferences;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.DialogPageContextComputer;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.core.context.ResourceDefaults;
-
-
-
-public class ResourceManagmentPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
-{
- /*CONTEXT_ID PPRM0001 for the Resource Managment Preference Page*/
- private String INFOPOP_PPRM_PAGE = WebServiceUIPlugin.ID + ".PPRM0001";
- //
- private Button overWriteFiles;
- /*CONTEXT_ID PPRM0002 for the file overwrite check box on the Resource Management Preference Page*/
- private String INFOPOP_PPRM_CHECKBOX_OVERWRITE_FILES = WebServiceUIPlugin.ID + ".PPRM0002";
- //
- private Button createFolders;
- /*CONTEXT_ID PPRM0003 for the create folders check box on the Resource Management Preference Page*/
- private String INFOPOP_PPRM_CHECKBOX_CREATE_FOLDERS = WebServiceUIPlugin.ID + ".PPRM0003";
- //
- private Button checkoutFiles;
- /*CONTEXT_ID PPRM0004 for the checkout files check box on the Resource Management Preference Page*/
- private String INFOPOP_PPRM_CHECKBOX_CHECK_OUT = WebServiceUIPlugin.ID + ".PPRM0004";
-
- /**
- * Creates preference page controls on demand.
- * @param parent the parent for the preference page
- */
- protected Control createContents(Composite superparent)
- {
- Composite parent = new Composite( superparent, SWT.NONE );
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- parent.setLayout( layout );
- parent.setToolTipText(getMessage("%TOOLTIP_PPRM_PAGE"));
- WorkbenchHelp.setHelp(parent, new DialogPageContextComputer(this, INFOPOP_PPRM_PAGE));
-
- overWriteFiles = createCheckBox(parent, WebServiceUIPlugin.getMessage("%BUTTON_OVERWRITE_FILES" ));
- overWriteFiles.setToolTipText(getMessage("%TOOLTIP_PPRM_CHECKBOX_OVERWRITE_FILES"));
- WorkbenchHelp.setHelp(overWriteFiles, new DialogPageContextComputer(this, INFOPOP_PPRM_CHECKBOX_OVERWRITE_FILES));
-
- createFolders = createCheckBox(parent, WebServiceUIPlugin.getMessage("%BUTTON_CREATE_FOLDERS" ));
- createFolders.setToolTipText(getMessage("%TOOLTIP_PPRM_CHECKBOX_CREATE_FOLDERS"));
- WorkbenchHelp.setHelp(createFolders, new DialogPageContextComputer(this, INFOPOP_PPRM_CHECKBOX_CREATE_FOLDERS));
-
- checkoutFiles = createCheckBox(parent, WebServiceUIPlugin.getMessage("%BUTTON_CHECKOUT_FILES" ));
- checkoutFiles.setToolTipText(getMessage("%TOOLTIP_PPRM_CHECKBOX_CHECK_OUT"));
- WorkbenchHelp.setHelp(checkoutFiles, new DialogPageContextComputer(this, INFOPOP_PPRM_CHECKBOX_CHECK_OUT));
-
- initializeValues();
- org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent);
-
- return parent;
- }
-
- private String getMessage(String key)
- {
- return WebServiceUIPlugin.getMessage(key);
- }
-
- private Button createCheckBox( Composite parent, String text )
- {
- Button button = new Button( parent, SWT.CHECK );
- button.setText( text );
- return button;
- }
-
- /**
- * Does anything necessary because the default button has been pressed.
- */
- protected void performDefaults()
- {
- super.performDefaults();
- initializeDefaults();
- }
-
- /**
- * Do anything necessary because the OK button has been pressed.
- * @return whether it is okay to close the preference page
- */
- public boolean performOk()
- {
- storeValues();
- return true;
- }
-
- protected void performApply()
- {
- performOk();
- }
-
- /**
- * @see IWorkbenchPreferencePage
- */
- public void init(IWorkbench workbench) { }
-
- /**
- * Initializes states of the controls using default values
- * in the preference store.
- */
- private void initializeDefaults()
- {
- overWriteFiles.setSelection( ResourceDefaults.getOverwriteFilesDefault());
- createFolders.setSelection( ResourceDefaults.getCreateFoldersDefault());
- checkoutFiles.setSelection( ResourceDefaults.getCheckoutFilesDefault());
- }
-
- /**
- * Initializes states of the controls from the preference store.
- */
- private void initializeValues()
- {
- // get the persistent context from the plugin
- ResourceContext context = WebServicePlugin.getInstance().getResourceContext();
- overWriteFiles.setSelection( context.isOverwriteFilesEnabled());
- createFolders.setSelection( context.isCreateFoldersEnabled());
- checkoutFiles.setSelection( context.isCheckoutFilesEnabled());
- }
-
- /**
- * Stores the values of the controls back to the preference store.
- */
- private void storeValues()
- {
- // get the persistent context from the plugin
- ResourceContext context = WebServicePlugin.getInstance().getResourceContext();
- context.setOverwriteFilesEnabled( overWriteFiles.getSelection() );
- context.setCreateFoldersEnabled( createFolders.getSelection() );
- context.setCheckoutFilesEnabled( checkoutFiles.getSelection() );
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ScenarioDefaultsPreferencePage.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ScenarioDefaultsPreferencePage.java
deleted file mode 100644
index f1486be..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/ScenarioDefaultsPreferencePage.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.ui.preferences;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.ws.internal.context.ScenarioContext;
-import org.eclipse.jst.ws.internal.context.ScenarioDefaults;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.DialogPageContextComputer;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-
-
-public class ScenarioDefaultsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, SelectionListener
-{
-
- private TableViewer webServiceTestTypeViewer_;
- private Button moveUp_;
- private Button moveDown_;
- private Vector webServiceTestTypes_;
-
- /*CONTEXT_ID PPSD0001 for the Scenario Defaults Preference Page*/
- private String INFOPOP_PPSD_PAGE = WebServiceUIPlugin.ID + ".PPSD0001";
- //
- private Button launchSample;
- /*CONTEXT_ID PPSD0002 for the launch sample check box on the Scenario Defaults Preference Page*/
- private final String INFOPOP_PPSD_CHECKBOX_LAUNCH_SAMPLE = WebServiceUIPlugin.ID + ".PPSD0002";
- //
- private Label sampleGenerationLabel_;
- private Combo sampleGenerationTypes_;
- /*CONTEXT_ID PPSD0004 for the sample JSP type combo box on the Scenario Defaults Preference Page*/
- private final String INFOPOP_PPSD_COMBO_SAMPLE_GEN = WebServiceUIPlugin.ID + ".PPSD0004";
-
- private Label wsexplorerTypesLabel_;
- private Combo wsexplorerTypes_;
- /*CONTEXT_ID PPSD0003 for the web explorer type combo box on the Scenario Defaults Preference Page*/
- private final String INFOPOP_PPSD_COMBO_EXPLORER = WebServiceUIPlugin.ID + ".PPSD0003";
-
- /**
- * Creates preference page controls on demand.
- * @param parent the parent for the preference page
- */
- protected Control createContents(Composite superparent)
- {
-
- Composite parent = new Composite( superparent, SWT.NONE );
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- parent.setLayout( layout );
- parent.setToolTipText(getMessage("%TOOLTIP_PPSD_PAGE"));
- parent.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
- WorkbenchHelp.setHelp(parent,new DialogPageContextComputer(this,INFOPOP_PPSD_PAGE));
-
- launchSample = createCheckBox(parent, getMessage("%BUTTON_LAUNCH_SAMPLE"));
- launchSample.setToolTipText(getMessage("%TOOLTIP_PPSD_CHECKBOX_LAUNCH_SAMPLE"));
- WorkbenchHelp.setHelp(launchSample, new DialogPageContextComputer(this, INFOPOP_PPSD_CHECKBOX_LAUNCH_SAMPLE));
-
-
- Text testServiceTypeLabel = new Text(parent, SWT.READ_ONLY | SWT.WRAP);
- testServiceTypeLabel.setText(getMessage("%LABEL_SAMPLE_TYPES"));
-
- Composite webServiceTestTypeComposite = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- webServiceTestTypeComposite.setLayout(gl);
-
- Table table= new Table(webServiceTestTypeComposite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- gd.widthHint = 256;
- table.setLayoutData(gd);
- table.setToolTipText(getMessage("%TOOLTIP_CLIENT_TYPE_TABLE_VIEWER"));
-
- webServiceTestTypes_ = new Vector();
- webServiceTestTypeViewer_ = new TableViewer(table);
- webServiceTestTypeViewer_.setContentProvider(new WebServiceTestTypeContentProvider());
- webServiceTestTypeViewer_.setLabelProvider(new WebServiceTestTypeLabelProvider());
- webServiceTestTypeViewer_.setInput(webServiceTestTypes_);
-
- TableLayout tableLayout = new TableLayout();
- TableColumn tableColumn = new TableColumn(table, SWT.NONE);
- tableColumn.setText(getMessage("%LABEL_CLIENT_TYPE_NAME"));
- ColumnWeightData columnData = new ColumnWeightData(256, 256, false);
- tableLayout.addColumnData(columnData);
- table.setLayout(tableLayout);
-
- Composite c = new Composite(webServiceTestTypeComposite, SWT.NONE);
- gl = new GridLayout();
- gl.numColumns = 1;
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- c.setLayout(gl);
-
- moveUp_ = new Button(c, SWT.PUSH);
- moveUp_.setText(getMessage("%LABEL_MOVE_UP"));
- moveUp_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- moveUp_.addSelectionListener(this);
- moveUp_.setToolTipText(getMessage("%TOOLTIP_MOVE_UP"));
-
- moveDown_ = new Button(c, SWT.PUSH);
- moveDown_.setText(getMessage("%LABEL_MOVE_DOWN"));
- moveDown_.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- moveDown_.addSelectionListener(this);
- moveDown_.setToolTipText(getMessage("%TOOLTIP_MOVE_DOWN"));
-
- initializeValues();
- org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent);
-
- return parent;
- }
-
- private String getMessage(String key)
- {
- return WebServiceUIPlugin.getMessage(key);
- }
-
- private Button createCheckBox( Composite parent, String text )
- {
- Button button = new Button( parent, SWT.CHECK );
- button.setText( text );
- return button;
- }
-
- /**
- * Does anything necessary because the default button has been pressed.
- */
- protected void performDefaults()
- {
- super.performDefaults();
- initializeDefaults();
- }
-
- /**
- * Do anything necessary because the OK button has been pressed.
- * @return whether it is okay to close the preference page
- */
- public boolean performOk()
- {
- try{
- storeValues();
- }catch (Exception exc){
- exc.printStackTrace();}
- return true;
- }
-
- protected void performApply()
- {
- try{
- performOk();
- }catch(NullPointerException exc){
- exc.printStackTrace();
- }
- }
-
- /**
- * @see IWorkbenchPreferencePage
- */
- public void init(IWorkbench workbench) { }
-
- /**
- * Initializes states of the controls to their burned-in defaults.
- */
- private void initializeDefaults()
- {
- ScenarioDefaults defaults = new ScenarioDefaults();
- //pgm launchSample.setSelection( defaults.getLaunchSampleDefault());
-
- webServiceTestTypes_.clear();
- String[] types = defaults.getWebServiceTestTypes();
- for (int i = 0; i < types.length; i++)
- webServiceTestTypes_.add(types[i]);
- webServiceTestTypeViewer_.refresh();
- }
-
- /**
- * Initializes states of the controls from the preference helper.
- */
- private void initializeValues()
- {
- ScenarioContext context = WebServicePlugin.getInstance().getScenarioContext();
- ScenarioDefaults defaults = new ScenarioDefaults();
- //pgm launchSample.setSelection( context.isLaunchSampleEnabled());
-
- String[] types = context.getWebServiceTestTypes();
- for (int i = 0; i < types.length; i++)
- webServiceTestTypes_.add(types[i]);
- // check whether we missed any types from the default list
- boolean missed = false;
- types = defaults.getWebServiceTestTypes();
- for (int i = 0; i < types.length; i++)
- {
- if (webServiceTestTypes_.indexOf(types[i]) == -1)
- {
- webServiceTestTypes_.add(types[i]);
- missed = true;
- }
- }
- if (missed)
- {
- types = new String[webServiceTestTypes_.size()];
- webServiceTestTypes_.copyInto(types);
- context.setWebServiceTestTypes(types);
- }
- // refresh viewer
- webServiceTestTypeViewer_.refresh();
- }
-
- /**
- * Stores the values of the controls back to the preference helper.
- */
- private void storeValues()
- {
- ScenarioContext context = WebServicePlugin.getInstance().getScenarioContext();
- String[] types = new String[webServiceTestTypes_.size()];
- webServiceTestTypes_.copyInto(types);
- context.setWebServiceTestTypes(types);
-
- //pgm context.setLaunchSampleEnabled(launchSample.getSelection());
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- int index = webServiceTestTypeViewer_.getTable().getSelectionIndex();
- if (index != -1)
- {
- if (e.widget == moveUp_ && index > 0)
- {
- Object object = webServiceTestTypes_.remove(index);
- webServiceTestTypes_.insertElementAt(object, index-1);
- webServiceTestTypeViewer_.refresh();
- }
- else if (e.widget == moveDown_ && index < webServiceTestTypes_.size()-1)
- {
- Object object = webServiceTestTypes_.remove(index);
- webServiceTestTypes_.insertElementAt(object, index+1);
- webServiceTestTypeViewer_.refresh();
- }
- }
- }
-
- private class WebServiceTestTypeContentProvider implements IStructuredContentProvider
- {
- /**
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object value)
- {
- return ((Vector)value).toArray(new String[0]);
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose()
- {
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer arg0, Object arg1, Object arg2)
- {
- }
- }
-
- private class WebServiceTestTypeLabelProvider extends LabelProvider
- {
- private IConfigurationElement[] configElements_;
-
- public WebServiceTestTypeLabelProvider()
- {
- WebServiceTestRegistry wstr = WebServiceTestRegistry.getInstance();
- configElements_ = wstr.getConfigElements();
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(Object)
- */
- public Image getImage(Object arg0)
- {
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(Object)
- */
- public String getText(Object value)
- {
- //return getElementByAttribute("id", value.toString()).getAttribute("label");
- return value.toString();
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/WebServicesPreferencePage.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/WebServicesPreferencePage.java
deleted file mode 100644
index 3910d08..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/preferences/WebServicesPreferencePage.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.ui.preferences;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-/**
- * The WebServicesPreferencePage
- */
-public class WebServicesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
-/**
- * Creates and returns the SWT control for the customized body
- * of this preference page under the given parent composite.
- * <p>
- * This framework method must be implemented by concrete
- * subclasses.
- * </p>
- *
- * @param parent the parent composite
- * @return the new control
- */
-protected Control createContents(org.eclipse.swt.widgets.Composite parent) {
- return new Composite(parent, SWT.NULL);
-}
-/**
- * Do any initialization required by the desktop. By default do nothing.
- */
-public void init(IWorkbench desktop) {}
-}
-
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/uddi/PrivateUDDIRegistryType.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/uddi/PrivateUDDIRegistryType.java
deleted file mode 100644
index a518889..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/uddi/PrivateUDDIRegistryType.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.ui.uddi;
-
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-
-public interface PrivateUDDIRegistryType
-{
- public boolean isPrivateUDDIRegistryInstalled();
- public String[] getPrivateUDDIRegistryInquiryAPI();
- public String[] getPrivateUDDIRegistryPublishAPI();
- public CommandWidgetBinding getBinding();
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/LaunchOption.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/LaunchOption.java
deleted file mode 100644
index 25da75f..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/LaunchOption.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.wse;
-
-public class LaunchOption
-{
- private String key_;
- private String option_;
-
- public LaunchOption(String key, String option)
- {
- key_ = key;
- option_ = option;
- }
-
- public String getKey()
- {
- return key_;
- }
-
- public String getOption()
- {
- return option_;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/LaunchWebServicesExplorerCommand.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/LaunchWebServicesExplorerCommand.java
deleted file mode 100644
index 9d47364..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/LaunchWebServicesExplorerCommand.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.wse;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URLEncoder;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.ws.internal.common.EnvironmentUtils;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-
-public class LaunchWebServicesExplorerCommand extends SimpleCommand
-{
- private boolean forceLaunchOutsideIDE_;
- private LaunchOption[] launchOptions;
-
- public LaunchWebServicesExplorerCommand()
- {
- super("LaunchWebServicesExplorerCommand", "LaunchWebServicesExplorerCommand");
- }
-
-
- private final WSExplorerType getWSExplorerType()
- {
- String wsexplorerTypeName = WebServicePlugin.getInstance().getScenarioContext().getNonJavaTestService();
- WSExplorerTypesRegistry wsexplorerReg = WSExplorerTypesRegistry.getInstance();
- WSExplorerType wsexplorerType = wsexplorerReg.getWSExplorerTypeByName(wsexplorerTypeName);
- if (wsexplorerType == null)
- wsexplorerType = wsexplorerReg.getWSExplorerTypeByRank(0);
- return wsexplorerType;
- }
-
- public void writeCategoryInfo(String inquiryURL, String categoriesDirectory)
- {
- try
- {
- Properties p = new Properties();
- p.setProperty(WSExplorerType.CATEGORIES_DIRECTORY, categoriesDirectory);
- StringBuffer propertiesFileName = new StringBuffer();
- propertiesFileName.append(getWSExplorerType().getMetadataDirectory());
- File metadataDirectoryFile = new File(propertiesFileName.toString());
- if (!metadataDirectoryFile.exists())
- metadataDirectoryFile.mkdirs();
- propertiesFileName.append(URLEncoder.encode(inquiryURL)).append(".properties");
- FileOutputStream fout = new FileOutputStream(propertiesFileName.toString());
- p.save(fout, null);
- fout.close();
- }
- catch (IOException e)
- {
- }
- }
-
- public IStatus execute()
- {
- return getWSExplorerType().launch(null, null, launchOptions, forceLaunchOutsideIDE_);
- }
-
- public Status execute(Environment env)
- {
- return EnvironmentUtils.convertIStatusToStatus(getWSExplorerType().launch(null, null, launchOptions, forceLaunchOutsideIDE_));
- }
-
- /**
- * @param forceLaunchOutsideIDE The forceLaunchOutsideIDE to set.
- */
- public void setForceLaunchOutsideIDE(boolean forceLaunchOutsideIDE)
- {
- this.forceLaunchOutsideIDE_ = forceLaunchOutsideIDE;
- }
-
- /**
- * @param launchOptions The launchOptions to set.
- */
- public void setLaunchOptions(LaunchOption[] launchOptions)
- {
- this.launchOptions = launchOptions;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/WSExplorerType.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/WSExplorerType.java
deleted file mode 100644
index 1700a91..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/WSExplorerType.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.ui.wse;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbench;
-
-public interface WSExplorerType
-{
- public static final String LAUNCH_UNIQUE_SESSION = "launchUniqueSession";
-
- // WSDL Page preload constants
- public static final String WSDL_URL = "wsdl";
- public static final String WEB_SERVICE_ENDPOINT = "webServiceEndpoint";
- public static final String SERVICE_QNAME_STRING = "serviceQNameString";
- public static final String BINDING_NAME_STRING = "bindingNameString";
-
- // UDDI Page preload constants
- public static final String INQUIRY_URL = "inquiry";
- public static final String PUBLISH_URL = "publish";
- public static final String SERVICE_NAME = "serviceName";
- public static final String SERVICE_KEY = "serviceKey";
- public static final String CATEGORIES_DIRECTORY = "categoriesDirectory";
-
- public String getContextName();
- public String getParentPluginID();
- public String getWARLocation();
- public String getWebAppLocation();
- public String getWelcomeURL();
- public String getLaunchOptionRegistryURL();
- public String getBaseURL();
- public String getMetadataDirectory();
-
- public IStatus launch(IWorkbench wb, IStructuredSelection sel, LaunchOption[] options,boolean forLaunchOutsideIDE);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/WSExplorerTypesRegistry.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/WSExplorerTypesRegistry.java
deleted file mode 100644
index 4ac8e4a..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wse/WSExplorerTypesRegistry.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.wse;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-
-public class WSExplorerTypesRegistry {
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private static WSExplorerTypesRegistry instance_;
- private Vector configElements_;
- private Vector wsexplorerTypes_;
-
- private WSExplorerTypesRegistry() {
- configElements_ = new Vector();
- wsexplorerTypes_ = new Vector();
- init();
- }
-
- /**
- * Returns a singleton instance of this class.
- * @return A singleton WebServiceClientTypeRegistry object.
- */
- public static WSExplorerTypesRegistry getInstance() {
- if (instance_ == null) {
- instance_ = new WSExplorerTypesRegistry();
- }
- return instance_;
- }
-
- public void init() {
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] config = reg.getConfigurationElementsFor("org.eclipse.jst.ws.explorer", "wsexplorerType");
- for (int i = 0; i < config.length; i++) {
- try {
- Object configElement = config[i].createExecutableExtension("class");
- if (configElement instanceof WSExplorerType) {
- configElements_.add(config[i]);
- wsexplorerTypes_.add(configElement);
- }
- }
- catch (CoreException e) {
- }
- }
- }
-
- public int getNumOfTypes() {
- return wsexplorerTypes_.size();
- }
-
- public WSExplorerType[] getAllWSExplorerTypes() {
- WSExplorerType[] types = new WSExplorerType[wsexplorerTypes_.size()];
- wsexplorerTypes_.copyInto(types);
- return types;
- }
-
- public IConfigurationElement[] getAllConfigElements() {
- IConfigurationElement[] configElements = new IConfigurationElement[configElements_.size()];
- configElements_.copyInto(configElements);
- return configElements;
- }
-
- private WSExplorerType getWSExplorerTypeByAttribute(String attribute, String value) {
- for (int i = 0; i < configElements_.size(); i++) {
- IConfigurationElement configElement = (IConfigurationElement)configElements_.elementAt(i);
- if (configElement.getAttribute(attribute).equals(value))
- return (WSExplorerType)wsexplorerTypes_.elementAt(i);
- }
- return null;
- }
-
- public WSExplorerType getWSExplorerTypeByRank(int rank) {
- return getWSExplorerTypeByAttribute("rank", String.valueOf(rank));
- }
-
- public WSExplorerType getWSExplorerTypeByID(String id) {
- return getWSExplorerTypeByAttribute("id", id);
- }
-
- public WSExplorerType getWSExplorerTypeByName(String name) {
- return getWSExplorerTypeByAttribute("name", name);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/PersistentWSIAPContext.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/PersistentWSIAPContext.java
deleted file mode 100644
index 9214b5f..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/PersistentWSIAPContext.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.wsi.preferences;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-
-
-
-public class PersistentWSIAPContext extends PersistentWSIContext
-{
- private static final String NON_WSI_AP_COMPLIANCE = "nonWSIAPCompliance";
-
-public PersistentWSIAPContext ()
-{
- super();
- non_wsi_compliance = NON_WSI_AP_COMPLIANCE;
- name = new QualifiedName(WebServiceUIPlugin.ID , non_wsi_compliance);
- wsiWarning_ = "WSI_AP_WARNING";
- wsiError_ = "WSI_AP_ERROR";
-}
-
-public String getPersistentWSICompliance ()
-{
- String property = getValueAsString(non_wsi_compliance);
- // default to Warning if no init has been done from ini file
- if (property == null || property.equals("")) {
- setValue( non_wsi_compliance, IGNORE_NON_WSI);
- return IGNORE_NON_WSI;
- }
- else
- return property;
-}
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/PersistentWSIContext.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/PersistentWSIContext.java
deleted file mode 100644
index c1e2aca..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/PersistentWSIContext.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.wsi.preferences;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.wst.command.env.context.PersistentContext;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-
-
-
-public class PersistentWSIContext extends PersistentContext
-{
- public static final String STOP_NON_WSI = "0";
- public static final String WARN_NON_WSI = "1";
- public static final String IGNORE_NON_WSI = "2";
- public static final String FOLLOW_WSI_PREFERENCE = "3";
-
- protected QualifiedName name = null; // set in subclass
- protected String non_wsi_compliance;
- private static final String NON_WSI_SSBP_COMPLIANCE = "nonWSISSBPCompliance";
- protected String wsiWarning_; // set in subclass
- protected String wsiError_; // set in subclass
-
-public PersistentWSIContext ()
-{
- super( WebServiceUIPlugin.getInstance());
-
-// NOTE: name, wsiWarning_ and wsiError_ should be set in the subclasses. This is providing defaulting only.
- non_wsi_compliance = NON_WSI_SSBP_COMPLIANCE;
- name = new QualifiedName(WebServiceUIPlugin.ID , non_wsi_compliance);
- wsiWarning_ = "WSI_SSBP_WARNING";
- wsiError_ = "WSI_SSBP_ERROR";
-}
-
-public void load()
-{
- // let the default be read from plugin_costomization.ini file
- // setDefault(non_wsi_compliance, WARN_NON_WSI);
-}
-
-// to be used only by the preference page
-public void updateWSICompliances ( String value)
-{
- setValue( non_wsi_compliance, value);
-}
-
-public String getPersistentWSICompliance ()
-{
- String property = getValueAsString(non_wsi_compliance);
- // default to Warning if no init has been done from ini file
- if (property == null || property.equals("")) {
- setValue( non_wsi_compliance, WARN_NON_WSI);
- return WARN_NON_WSI;
- }
- else
- return property;
-}
-
-public boolean StopNonWSICompliances()
-{
- return STOP_NON_WSI.equals(getPersistentWSICompliance());
-}
-
-public boolean WarnNonWSICompliances()
-{
- return WARN_NON_WSI.equals(getPersistentWSICompliance());
-}
-
-public boolean IgnoreNonWSICompliances()
-{
- return IGNORE_NON_WSI.equals(getPersistentWSICompliance());
-}
-
-// to be used only by the property page
-public void updateProjectWSICompliances ( IProject project, String value)
-{
- try {
- project.setPersistentProperty(name, value);
- }
- catch (CoreException e) {
- System.out.println("No such Project");
- Log log = new EclipseLog();
- log.log(Log.INFO, 5084, this, "updateProjectWSICompliances", "No such Project "+project);
- }
-}
-
-public boolean projectStopNonWSICompliances(IProject project)
-{
- return STOP_NON_WSI.equals(getProjectPersistentProperty(project));
-}
-
-public boolean projectWarnNonWSICompliances(IProject project)
-{
- return WARN_NON_WSI.equals(getProjectPersistentProperty(project));
-}
-
-public boolean projectIgnoreNonWSICompliances(IProject project)
-{
- return IGNORE_NON_WSI.equals(getProjectPersistentProperty(project));
-}
-
-
-// to be used only by the property page
-public boolean projectFollowWSIPreferance(IProject project)
-{
- try {
- String property = project.getPersistentProperty(name);
- return (property == null || property.equals("") || property.equals(FOLLOW_WSI_PREFERENCE));
- }
- catch (CoreException e) {
- return true;
- }
-}
-
-private String getProjectPersistentProperty(IProject project)
-{
- String property = getProjectWSICompliance(project);
- if (property.equals(FOLLOW_WSI_PREFERENCE)) {
- property = getPersistentWSICompliance();
- }
- return property;
- }
-
-public String getProjectWSICompliance(IProject project)
-{
- try {
- String property = project.getPersistentProperty(name);
- if (property == null || property.equals(""))
- {
- property = FOLLOW_WSI_PREFERENCE;
- }
- return property;
- }
- catch (CoreException e) {
- System.out.println("No such Project");
- return getPersistentWSICompliance();
- }
-}
-
-public String getWarning()
-{
- return wsiWarning_;
-}
-
-public String getError()
-{
- return wsiError_;
-}
-
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/PersistentWSISSBPContext.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/PersistentWSISSBPContext.java
deleted file mode 100644
index 8d7bcb4..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/PersistentWSISSBPContext.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.wsi.preferences;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-
-
-
-public class PersistentWSISSBPContext extends PersistentWSIContext
-{
- private static final String NON_WSI_SSBP_COMPLIANCE = "nonWSISSBPCompliance";
-
-public PersistentWSISSBPContext ()
-{
- super();
- non_wsi_compliance = NON_WSI_SSBP_COMPLIANCE;
- name = new QualifiedName(WebServiceUIPlugin.ID , non_wsi_compliance);
- wsiWarning_ = "WSI_SSBP_WARNING";
- wsiError_ = "WSI_SSBP_ERROR";
-}
-
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/WSICompliancePreferencePage.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/WSICompliancePreferencePage.java
deleted file mode 100644
index 934a005..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/WSICompliancePreferencePage.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.ui.wsi.preferences;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.swt.SWT;
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.DialogPageContextComputer;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-
-
-public class WSICompliancePreferencePage extends PreferencePage implements IWorkbenchPreferencePage
-{
- private MessageUtils msgUtils_;
-
- /*CONTEXT_ID PWSI0001 for the WS-I Preference Page*/
- private String INFOPOP_PWSI_PAGE = WebServiceUIPlugin.ID + ".PWSI0000";
- //
-
- private Label wsi_ssbp_Label_;
- private Combo wsi_ssbp_Types_;
-
- /*CONTEXT_ID PWSI0001 for the stop WS-I SSBP Non compliance Preference Page*/
- private String INFOPOP_PWSI_SSBP_COMBO_STOP_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0001";
- /*CONTEXT_ID PWSI0002 for the warn WS-I SSBP Non compliance Preference Page*/
- private String INFOPOP_PWSI_SSBP_COMBO_WARN_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0002";
- /*CONTEXT_ID PWSI0003 for the ignore WS-I SSBP Non compliance Preference Page*/
- private String INFOPOP_PWSI_SSBP_COMBO_IGNORE_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0003";
- /*CONTEXT_ID PWSI0004 for the WS-I SSBP type combo box on the WS-I AP Non compliance Preference Page*/
- private String INFOPOP_PWSI_SSBP_COMBO_TYPE = WebServiceUIPlugin.ID + ".PWSI0004";
-
- private Label wsi_ap_Label_;
- private Combo wsi_ap_Types_;
-
- /*CONTEXT_ID PWSI0005 for the stop WS-I AP Non compliance Preference Page*/
- private String INFOPOP_PWSI_AP_COMBO_STOP_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0005";
- /*CONTEXT_ID PWSI0006 for the warn WS-I AP Non compliance Preference Page*/
- private String INFOPOP_PWSI_AP_COMBO_WARN_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0006";
- /*CONTEXT_ID PWSI0007 for the ignore WS-I AP Non compliance Preference Page*/
- private String INFOPOP_PWSI_AP_COMBO_IGNORE_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0007";
- /*CONTEXT_ID PWSI0008 for the WS-I AP type combo box on the WS-I AP Non compliance Preference Page*/
- private String INFOPOP_PWSI_AP_COMBO_TYPE = WebServiceUIPlugin.ID + ".PWSI0008";
-
- /**
- * Creates preference page controls on demand.
- * @param parent the parent for the preference page
- */
- protected Control createContents(Composite superparent)
- {
- String pluginId = "org.eclipse.jst.ws.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
-
- Composite parent = new Composite( superparent, SWT.NONE );
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- parent.setLayout( layout );
- parent.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
- parent.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWSI_PAGE"));
- WorkbenchHelp.setHelp(parent, new DialogPageContextComputer(this, INFOPOP_PWSI_PAGE));
-
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- gl.marginHeight = 0;
- gl.marginWidth = 0;
-
- Composite wsi_Composite = new Composite (parent, SWT.NONE);
- wsi_Composite.setLayout(gl);
- wsi_Composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
- wsi_ssbp_Label_ = new Label(wsi_Composite, SWT.NONE);
- wsi_ssbp_Label_.setText(msgUtils_.getMessage("LABEL_WSI_SSBP"));
- wsi_ssbp_Label_.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWSI_SSBP_LABEL"));
- wsi_ssbp_Types_ = new Combo(wsi_Composite, SWT.DROP_DOWN | SWT.READ_ONLY);
- wsi_ssbp_Types_.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
- wsi_ssbp_Types_.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWSI_SSBP_COMBO"));
- WorkbenchHelp.setHelp(wsi_ssbp_Types_, new DialogPageContextComputer(this, INFOPOP_PWSI_SSBP_COMBO_TYPE));
-
- wsi_ssbp_Types_.add(msgUtils_.getMessage("STOP_NON_WSI"));
- wsi_ssbp_Types_.add(msgUtils_.getMessage("WARN_NON_WSI"));
- wsi_ssbp_Types_.add(msgUtils_.getMessage("IGNORE_NON_WSI"));
-
- wsi_ap_Label_ = new Label(wsi_Composite, SWT.NONE);
- wsi_ap_Label_.setText(msgUtils_.getMessage("LABEL_WSI_AP"));
- wsi_ap_Label_.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWSI_AP_LABEL"));
- wsi_ap_Types_ = new Combo(wsi_Composite, SWT.DROP_DOWN | SWT.READ_ONLY);
- wsi_ap_Types_.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
- wsi_ap_Types_.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWSI_AP_COMBO"));
- WorkbenchHelp.setHelp(wsi_ap_Types_, new DialogPageContextComputer(this, INFOPOP_PWSI_AP_COMBO_TYPE));
-
- wsi_ap_Types_.add(msgUtils_.getMessage("STOP_NON_WSI"));
- wsi_ap_Types_.add(msgUtils_.getMessage("WARN_NON_WSI"));
- wsi_ap_Types_.add(msgUtils_.getMessage("IGNORE_NON_WSI"));
-
- initializeValues();
- org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent);
- return parent;
- }
-
- private Button createRadioButton( Composite parent, String text )
- {
- Button button = new Button( parent, SWT.RADIO );
- button.setText( text );
- return button;
- }
-
- /**
- * Does anything necessary because the default button has been pressed.
- */
- protected void performDefaults()
- {
- super.performDefaults();
- initializeDefaults();
- }
-
- /**
- * Do anything necessary because the OK button has been pressed.
- * @return whether it is okay to close the preference page
- */
- public boolean performOk()
- {
- storeValues();
- return true;
- }
-
- protected void performApply()
- {
- performOk();
- }
-
- /**
- * @see IWorkbenchPreferencePage
- */
- public void init(IWorkbench workbench) { }
-
- /**
- * Initializes states of the controls using default values
- * in the preference store.
- */
- private void initializeDefaults()
- {
- // force WSI compliance by default
-
- wsi_ssbp_Types_.select(wsi_ssbp_Types_.indexOf(msgUtils_.getMessage("WARN_NON_WSI")));
- wsi_ap_Types_.select(wsi_ap_Types_.indexOf(msgUtils_.getMessage("IGNORE_NON_WSI")));
- }
-
- /**
- * Initializes states of the controls from the preference store.
- */
- private void initializeValues()
- {
-
- String WSIText = getWSISelection(WebServiceUIPlugin.getInstance().getWSISSBPContext());
- wsi_ssbp_Types_.select(wsi_ssbp_Types_.indexOf(WSIText));
-
- String WSIAPText = getWSISelection(WebServiceUIPlugin.getInstance().getWSIAPContext());
- wsi_ap_Types_.select(wsi_ap_Types_.indexOf(WSIAPText));
- }
-
- private String getWSISelection(PersistentWSIContext context)
- {
-
- String WSIvalue = context.getPersistentWSICompliance();
- String WSIText = msgUtils_.getMessage("WARN_NON_WSI");
- if (PersistentWSIContext.STOP_NON_WSI.equals(WSIvalue)) {
- WSIText = msgUtils_.getMessage("STOP_NON_WSI");
- } else if (PersistentWSIContext.IGNORE_NON_WSI.equals(WSIvalue)) {
- WSIText = msgUtils_.getMessage("IGNORE_NON_WSI");
- }
- return WSIText;
- }
- /**
- * Stores the values of the controls back to the preference store.
- */
- private void storeValues()
- {
- updateWSIContext(wsi_ssbp_Types_.getSelectionIndex(), WebServiceUIPlugin.getInstance().getWSISSBPContext());
- updateWSIContext(wsi_ap_Types_.getSelectionIndex(), WebServiceUIPlugin.getInstance().getWSIAPContext());
- }
-
- private void updateWSIContext(int selectionIndex, PersistentWSIContext context)
- {
- // get the persistent context from the plugin
-
- String value=null;
- switch (selectionIndex) {
- case 0:
- value = PersistentWSIContext.STOP_NON_WSI;
- break;
- case 1:
- value = PersistentWSIContext.WARN_NON_WSI;
- break;
- case 2:
- value = PersistentWSIContext.IGNORE_NON_WSI;
- break;
- }
- context.updateWSICompliances(value);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/WSIComplianceUtils.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/WSIComplianceUtils.java
deleted file mode 100644
index cee1655..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/preferences/WSIComplianceUtils.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ui.wsi.preferences;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.wst.command.env.core.common.Choice;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-
-
-public class WSIComplianceUtils
-{
-private static final int IGNORE_ID =0;
-private static final int IGNORE_ALL_ID =1;
-private static final int CANCEL_ID =2;
-
-private static MessageUtils msgUtils_;
-
-/**
- * @deprecated use getWSISeverity (IProject project, PersistentWSIContext context) instead
- * @param project
- * @return int
- */
-public static int getWSISeverity (IProject project)
-{
- return getWSISeverity (project, WebServiceUIPlugin.getInstance().getWSISSBPContext());
-}
-/**
- * @param project
- * @param context
- * @return
- */
-public static int getWSISeverity (IProject project, PersistentWSIContext context)
-{
- if (context.projectStopNonWSICompliances(project))
- return Status.ERROR;
- else if (context.projectWarnNonWSICompliances(project))
- return Status.WARNING;
- else
- return Status.INFO;
-}
-
-/**
- * @deprecated use checkWSICompliance ( StatusHandler monitor, Status[] status, IProject project, PersistentWSIContext context) instead
- * @param monitor StatusHandler
- * @param status Status[]
- * @param project IProject
- * @return boolean true if to continue
- */
-public static boolean checkWSICompliance ( StatusHandler monitor, Status[] status, IProject project)
-{ // check for SSBP by default
- return checkWSICompliance ( monitor, status, project, WebServiceUIPlugin.getInstance().getWSISSBPContext());
-}
-/**
- * @param monitor StatusHandler
- * @param status Status[]
- * @param project IProject
- * @param context PersistentWSIContext
- * @return boolean true if to continue
- */
-public static boolean checkWSICompliance ( StatusHandler monitor, Status[] status, IProject project, PersistentWSIContext context)
-{
- String pluginId = "org.eclipse.jst.ws.ui";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", WebServiceUIPlugin.getInstance());
-
- if (context.projectStopNonWSICompliances(project))
- {
- // emit an error message and return false
- SimpleStatus status_ = new SimpleStatus(WebServiceUIPlugin.ID, msgUtils_.getMessage(context.getError()), Status.ERROR);
- // adding all messages from WSI Incompliances
- for (int i = 0; i< status.length; i++)
- status_.addChild(status[i]);
- monitor.reportError(status_);
- return false;
- }
- else if (context.projectWarnNonWSICompliances(project))
- {
- // give a warning message with the options to stop, ignore this one, or ignore all coming messages
- SimpleStatus status_ = new SimpleStatus(WebServiceUIPlugin.ID, msgUtils_.getMessage(context.getWarning()), Status.WARNING);
- // adding all messages from WSI Incompliances
- for (int i = 0; i< status.length; i++)
- status_.addChild(status[i]);
-
- Choice ignoreChoice = new Choice('I', msgUtils_.getMessage("IGNORE_LABEL"), msgUtils_.getMessage("IGNORE_DESCRIPTION"));
- Choice ignoreAllChoice = new Choice('A', msgUtils_.getMessage("IGNORE_ALL_LABEL"), msgUtils_.getMessage("IGNORE_ALL_DESCRIPTION"));
- Choice cancelChoice = new Choice('C', msgUtils_.getMessage("CANCEL_LABEL"), msgUtils_.getMessage("CANCEL_DESCRIPTION"));
- Choice result = monitor.report(status_, new Choice[]{ignoreChoice, ignoreAllChoice, cancelChoice});
-
- // if the user closes the message box or selects ignore continue
- if (result == null || (result.getLabel().equals(ignoreChoice.getLabel())))
- return true;
- // if the user selects ignore all, change the preference
- else if (result.getLabel().equals(ignoreAllChoice.getLabel()))
- {
- context.updateProjectWSICompliances(project, PersistentWSIContext.IGNORE_NON_WSI);
- return true;
- }
- // if the user selects to cancel , do not continue with the command
- else if (result.getLabel().equals(cancelChoice.getLabel()))
- return false;
- }
- return true;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/properties/WSICompliancePropertyPage.java b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/properties/WSICompliancePropertyPage.java
deleted file mode 100644
index da70e08..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/internal/ui/wsi/properties/WSICompliancePropertyPage.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.ui.wsi.properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.ws.internal.ui.plugin.WebServiceUIPlugin;
-import org.eclipse.jst.ws.internal.ui.wsi.preferences.PersistentWSIContext;
-import org.eclipse.swt.SWT;
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPropertyPage;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.ui.help.DialogPageContextComputer;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-
-
-public class WSICompliancePropertyPage extends PropertyPage
-{
- private MessageUtils msgUtils_;
-
- /*CONTEXT_ID PWSI0001 for the WS-I Preference Page*/
- private String INFOPOP_PWSI_PAGE = WebServiceUIPlugin.ID + ".PWSI0000";
- //
-
- private Label wsi_ssbp_Label_;
- private Combo wsi_ssbp_Types_;
-
- /*CONTEXT_ID PWSI0001 for the stop WS-I SSBP Non compliance Preference Page*/
- private String INFOPOP_PWSI_SSBP_COMBO_STOP_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0001";
- /*CONTEXT_ID PWSI0002 for the warn WS-I SSBP Non compliance Preference Page*/
- private String INFOPOP_PWSI_SSBP_COMBO_WARN_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0002";
- /*CONTEXT_ID PWSI0003 for the ignore WS-I SSBP Non compliance Preference Page*/
- private String INFOPOP_PWSI_SSBP_COMBO_IGNORE_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0003";
- /*CONTEXT_ID PWSI0004 for the WS-I SSBP type combo box on the WS-I AP Non compliance Preference Page*/
- private String INFOPOP_PWSI_SSBP_COMBO_TYPE = WebServiceUIPlugin.ID + ".PWSI0004";
-
- private Label wsi_ap_Label_;
- private Combo wsi_ap_Types_;
-
- /*CONTEXT_ID PWSI0005 for the stop WS-I AP Non compliance Preference Page*/
- private String INFOPOP_PWSI_AP_COMBO_STOP_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0005";
- /*CONTEXT_ID PWSI0006 for the warn WS-I AP Non compliance Preference Page*/
- private String INFOPOP_PWSI_AP_COMBO_WARN_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0006";
- /*CONTEXT_ID PWSI0007 for the ignore WS-I AP Non compliance Preference Page*/
- private String INFOPOP_PWSI_AP_COMBO_IGNORE_NON_WSI = WebServiceUIPlugin.ID + ".PWSI0007";
- /*CONTEXT_ID PWSI0008 for the WS-I AP type combo box on the WS-I AP Non compliance Preference Page*/
- private String INFOPOP_PWSI_AP_COMBO_TYPE = WebServiceUIPlugin.ID + ".PWSI0008";
-
- /*CONTEXT_ID PWSI0009 for the WS-I follow preference radio button the WS-I SSBP compliance project property Page*/
- private String INFOPOPP_PWSI_RADIO_FOLLOW_WSI_SSBP_PREFERENCE = WebServiceUIPlugin.ID + ".PWSI0009";
- /*CONTEXT_ID PWSI0010 for the WS-I follow preference radio button the WS-I AP compliance project property Page*/
- private String INFOPOPP_PWSI_RADIO_FOLLOW_WSI_AP_PREFERENCE = WebServiceUIPlugin.ID + ".PWSI0010";
-
- /**
- * Creates preference page controls on demand.
- * @param parent the parent for the preference page
- */
- protected Control createContents(Composite superparent)
- {
- String pluginId = "org.eclipse.jst.ws.ui";
- msgUtils_ = new MessageUtils( pluginId + ".plugin", this );
-
- Composite parent = new Composite( superparent, SWT.NONE );
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- parent.setLayout( layout );
- parent.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
- parent.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWSI_PAGE"));
- WorkbenchHelp.setHelp(parent, new DialogPageContextComputer(this, INFOPOP_PWSI_PAGE));
-
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- gl.marginHeight = 0;
- gl.marginWidth = 0;
-
- Composite wsi_Composite = new Composite (parent, SWT.NONE);
- wsi_Composite.setLayout(gl);
- wsi_Composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
-
- wsi_ssbp_Label_ = new Label(wsi_Composite, SWT.NONE);
- wsi_ssbp_Label_.setText(msgUtils_.getMessage("LABEL_WSI_SSBP"));
- wsi_ssbp_Label_.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWSI_SSBP_LABEL"));
- wsi_ssbp_Types_ = new Combo(wsi_Composite, SWT.DROP_DOWN | SWT.READ_ONLY);
- wsi_ssbp_Types_.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWSI_SSBP_COMBO"));
- wsi_ssbp_Types_.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
- WorkbenchHelp.setHelp(wsi_ssbp_Types_, new DialogPageContextComputer(this, INFOPOP_PWSI_SSBP_COMBO_TYPE));
-
- wsi_ssbp_Types_.add(msgUtils_.getMessage("STOP_NON_WSI"));
- wsi_ssbp_Types_.add(msgUtils_.getMessage("WARN_NON_WSI"));
- wsi_ssbp_Types_.add(msgUtils_.getMessage("IGNORE_NON_WSI"));
- wsi_ssbp_Types_.add(msgUtils_.getMessage("FOLLOW_WSI_PREFERENCE"));
-
- wsi_ap_Label_ = new Label(wsi_Composite, SWT.NONE);
- wsi_ap_Label_.setText(msgUtils_.getMessage("LABEL_WSI_AP"));
- wsi_ap_Label_.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWSI_AP_LABEL"));
- wsi_ap_Types_ = new Combo(wsi_Composite, SWT.DROP_DOWN | SWT.READ_ONLY);
- wsi_ap_Types_.setToolTipText(msgUtils_.getMessage("TOOLTIP_PWSI_AP_COMBO"));
- wsi_ap_Types_.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
- WorkbenchHelp.setHelp(wsi_ap_Types_, new DialogPageContextComputer(this, INFOPOP_PWSI_AP_COMBO_TYPE));
-
- wsi_ap_Types_.add(msgUtils_.getMessage("STOP_NON_WSI"));
- wsi_ap_Types_.add(msgUtils_.getMessage("WARN_NON_WSI"));
- wsi_ap_Types_.add(msgUtils_.getMessage("IGNORE_NON_WSI"));
- wsi_ap_Types_.add(msgUtils_.getMessage("FOLLOW_WSI_PREFERENCE"));
-
- initializeValues();
- org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent);
- return parent;
- }
-
- private String getMessage(String key)
- {
- return WebServiceUIPlugin.getMessage(key);
- }
-
- private Button createRadioButton( Composite parent, String text )
- {
- Button button = new Button( parent, SWT.RADIO );
- button.setText( text );
- return button;
- }
-
- /**
- * Does anything necessary because the default button has been pressed.
- */
- protected void performDefaults()
- {
- super.performDefaults();
- initializeDefaults();
- }
-
- /**
- * Do anything necessary because the OK button has been pressed.
- * @return whether it is okay to close the preference page
- */
- public boolean performOk()
- {
- storeValues();
- return true;
- }
-
- protected void performApply()
- {
- performOk();
- }
-
- /**
- * @see IWorkbenchPropertyPage
- */
- public void init(IWorkbench workbench) {
- }
-
- /**
- * Initializes states of the controls using default values
- * in the preference store.
- */
- private void initializeDefaults()
- {
- wsi_ssbp_Types_.select(wsi_ssbp_Types_.indexOf(msgUtils_.getMessage("FOLLOW_WSI_PREFERENCE")));
- wsi_ap_Types_.select(wsi_ap_Types_.indexOf(msgUtils_.getMessage("FOLLOW_WSI_PREFERENCE")));
- }
-
- /**
- * Initializes states of the controls from the preference store.
- */
- private void initializeValues() {
- String WSIText = getWSISelection(WebServiceUIPlugin.getInstance().getWSISSBPContext());
- wsi_ssbp_Types_.select(wsi_ssbp_Types_.indexOf(WSIText));
-
- String WSIAPText = getWSISelection(WebServiceUIPlugin.getInstance().getWSIAPContext());
- wsi_ap_Types_.select(wsi_ap_Types_.indexOf(WSIAPText));
- }
-
- private String getWSISelection(PersistentWSIContext context)
- {
-
- IProject project = (IProject) getElement();
- String WSIvalue = context.getProjectWSICompliance(project);
- String WSIText = msgUtils_.getMessage("FOLLOW_WSI_PREFERENCE");
- if (PersistentWSIContext.STOP_NON_WSI.equals(WSIvalue)) {
- WSIText = msgUtils_.getMessage("STOP_NON_WSI");
- } else if (PersistentWSIContext.WARN_NON_WSI.equals(WSIvalue)) {
- WSIText = msgUtils_.getMessage("WARN_NON_WSI");
- } else if (PersistentWSIContext.IGNORE_NON_WSI.equals(WSIvalue)) {
- WSIText = msgUtils_.getMessage("IGNORE_NON_WSI");
- }
- return WSIText;
- }
-
- /**
- * Stores the values of the controls back to the preference store.
- */
- private void storeValues()
- {
- updateWSIContext(wsi_ssbp_Types_.getSelectionIndex(), WebServiceUIPlugin.getInstance().getWSISSBPContext());
- updateWSIContext(wsi_ap_Types_.getSelectionIndex(), WebServiceUIPlugin.getInstance().getWSIAPContext());
- }
-
- private void updateWSIContext(int selectionIndex, PersistentWSIContext context)
- {
- String value = PersistentWSIContext.FOLLOW_WSI_PREFERENCE;
- IProject project = (IProject) getElement();
-
- switch (selectionIndex) {
- case 0:
- value = PersistentWSIContext.STOP_NON_WSI;
- break;
- case 1:
- value = PersistentWSIContext.WARN_NON_WSI;
- break;
- case 2:
- value = PersistentWSIContext.IGNORE_NON_WSI;
- break;
- case 3:
- value = PersistentWSIContext.FOLLOW_WSI_PREFERENCE;
- break;
- }
- context.updateProjectWSICompliances(project, value);
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/ui/plugin.properties b/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/ui/plugin.properties
deleted file mode 100644
index ed16a1f..0000000
--- a/bundles/org.eclipse.jst.ws.ui/src/org/eclipse/jst/ws/ui/plugin.properties
+++ /dev/null
@@ -1,187 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Web Services Graphical User Interface
-PLUGIN_VENDOR=International Business Machines Corp.
-PLUGIN_DESC=\
-The Web services GUI plugin delivers the graphical \
-user interface to the Web services function of the \
-Web services plugin.
-
-PLUGIN_NEW_CATEGORY_NAME_WS=Web Services
-
-#
-# Web Services Preferance Pages
-#
-# Categories
-PREFERENCE_CATEGORY_RESOURCE_MANAGEMENT=Resource Management
-PREFERENCE_CATEGORY_CODE_GENERATION=Code Generation
-PREFERENCE_CATEGORY_SCENARIO_DEFAULTS=Scenario Defaults
-PREFERENCE_CATEGORY_PROJECT_TOPOLOGY=Project Topology
-PREFERENCE_CATEGORY_DRIVER_JARS=JDBC drivers
-
-
-#
-#Scenario Defaults
-BUTTON_LAUNCH_SAMPLE=Launch the sample when generated
-LABEL_UDDI_CAT_DATA_COLUMN_DELIM=User defined UDDI Category data column delimiter:
-LABEL_UDDI_CAT_DATA_STRING_DELIM=User defined UDDI Category data string delimiter:
-MSG_ERROR_COLUMN_STRING_DELIMS_IDENTICAL=IWAB0481E UDDI column and string delimiters must not be identical.
-LABEL_MOVE_UP=Move up
-LABEL_MOVE_DOWN=Move down
-
-#
-# Preferences Tooltips
-#
-
-#Scenario Defaults
-TOOLTIP_PPSD_PAGE=Set the defaults for the Web service scenarios.
-TOOLTIP_PPSD_CHECKBOX_LAUNCH_SAMPLE=Launch the sample application after generation.
-TOOLTIP_PPSD_COMBO_SAMPLE_GEN=Select the type of sample JSP to be generated.
-TOOLTIP_PPSD_COMBO_EXPLORER=Select the type of the Web services explorer to be used.
-TOOLTIP_PPSD_UDDI_CAT_DATA_COLUMN_DELIM=column delimiter for user defined UDDI category data
-TOOLTIP_PPSD_UDDI_CAT_DATA_STRING_DELIM=string delimiter for user defined UDDI category data
-TOOLTIP_CLIENT_TYPE_TABLE_VIEWER=Preferred order of the list of client types
-TOOLTIP_MOVE_UP=Move the selected client type up the list
-TOOLTIP_MOVE_DOWN=Move the selected client type down the list
-
-#
-# Resource Managment
-TOOLTIP_PPRM_PAGE=Set preferences that control resources used/generated by the Web service.
-TOOLTIP_PPRM_CHECKBOX_OVERWRITE_FILES=Overwrite files without warning.
-TOOLTIP_PPRM_CHECKBOX_CREATE_FOLDERS=Create folders when necessary.
-TOOLTIP_PPRM_CHECKBOX_CHECK_OUT=Check out files without warning.
-BUTTON_CREATE_FOLDERS=Create folders when necessary
-BUTTON_OVERWRITE_FILES=Overwrite files without warning
-BUTTON_CHECKOUT_FILES=Check out files without warning
-
-#
-# General messages.
-#
-ISTATUS_WITHOUT_EXCEPTION={0}
-ISTATUS_WITH_EXCEPTION={0}\nException: {1}
-MSG_INFO_SAVED_STATUS=IWAB0297I Press the Details button to see informational messages.
-
-#
-# TypeSelectionDialog
-#
-DIALOG_TITLE_CLASS_BROWSE=Browse Classes
-DIALOG_TITLE_INTERFACE_BROWSE=Browse Interfaces
-
-#
-# Common wizard strings.
-#
-LABEL_WSEXPLORER_TYPES=Web Services Explorer
-LABEL_SAMPLE_TYPES=Java proxy sample
-
-#
-# ResourceSelectionDialog
-#
-DIALOG_TITLE_RESOURCE_BROWSE=Browse Files
-LABEL_RESOURCE_FILTER=Filter:
-
-#
-# Tooltips for dialog.ResourceSelectionDialog
-# DRES=Dialog/RESources
-#
-TOOLTIP_DRES_COMBO_RESOURCE_TYPE=Type of resources to browse.
-TOOLTIP_DRES_TREE_RESOURCE=Resources available for selection.
-
-
-
-#
-# HTTP Basic Authentication
-#
-PREFERENCE_CATEGORY_HTTP_BASIC_AUTH=HTTP Basic Auth
-CHECKBOX_PREFERENCE_ENABLE_HTTP_BASIC_AUTH=Enable HTTP basic authentication
-LABEL_PREFERENCE_HTTP_BASIC_AUTH_USERNAME=HTTP basic auth user name:
-LABEL_PREFERENCE_HTTP_BASIC_AUTH_PASSWORD=HTTP basic auth password:
-
-TOOLTIP_ENABLE_HTTP_BASIC_AUTH=Specify HTTP basic authentication setting for Web services toolings.
-TOOLTIP_HTTP_BASIC_AUTH_USERNAME=User name for HTTP basic authentication.
-TOOLTIP_HTTP_BASIC_AUTH_PASSWORD=Password for HTTP basic authentication.
-
-
-#
-# Messages for project topology preference page
-#
-TOOLTIP_PTPP_PAGE=Preference that control the project topology of your Web service and client scenarios.
-TOOLTIP_ENABLE_TWO_EARS=Enable this option if you want to generate your Web service and Web service client in different EAR projects.
-
-LABEL_ENABLE_TWO_EARS=Generate Web service and Web service client in different EAR projects
-LABEL_CLIENT_TYPE_NAME=Client type:
-
-#
-# WS-I Preference pages
-#
-# WS-I Compliance Page
-#
-PREFERENCE_CATEGORY_WSI=WS-I Compliance
-STOP_NON_WSI=Require compliance
-WARN_NON_WSI=Suggest compliance
-IGNORE_NON_WSI=Ignore compliance
-FOLLOW_WSI_PREFERENCE=Follow Preference
-
-TOOLTIP_PWSI_PAGE=Web Services Interoperability
-TOOLTIP_PWSI_RADIO_STOP_NON_WSI=Stop and produce an error message if you make a choice that does not comply with WS-I.
-TOOLTIP_PWSI_RADIO_WARNING_NON_WSI=Produce a warning message if you make a choice that does not comply with WS-I.
-TOOLTIP_PWSI_RADIO_IGNORE_NON_WSI=Silently allow choices that do not comply with WS-I.
-TOOLTIP_PWSI_RADIO_FOLLOW_WSI_PREFERENCE=Project would use WS-I compliance level set in Workspace Preference.
-
-LABEL_WSI_SSBP=WS-I SSBP compliance level
-TOOLTIP_PWSI_SSBP_LABEL=WS-I Simple SOAP Basic Profile compliance level
-TOOLTIP_PWSI_SSBP_COMBO=Choose the WS-I Simple SOAP Basic Profile compliance level
-
-LABEL_WSI_AP=WS-I AP compliance level
-TOOLTIP_PWSI_AP_LABEL=WS-I Attachment Profile compliance level
-TOOLTIP_PWSI_AP_COMBO=Choose the WS-I Attachment Profile compliance level
-
-#
-# ActionDialogs Page
-#
-PREFERENCE_CATEGORY_DIALOGS=Dialogs
-
-
-#
-# WS-I Compliance Messages
-#
-WSI_SSBP_ERROR=You have made a choice that may result in a Web service that does not comply with WS-I Simple SOAP Basic Profile. Your current Web services preference is set to require compliance with WS-I SSBP.
-WSI_SSBP_WARNING=You have made a choice that may result in a Web service that does not comply with WS-I Simple SOAP Basic Profile. Do you wish to ignore this warning and continue?
-WSI_SSBP_INCOMPLIANT_RUNTIME=The selected Web Service runtime does not comply with WS-I Simple SOAP Basic Profile.
-WSI_AP_ERROR=You have made a choice that may result in a Web service that does not comply with WS-I Attachment Profile. Your current Web services preference is set to require compliance with WS-I AP.
-WSI_AP_WARNING=You have made a choice that may result in a Web service that does not comply with WS-I Attachment Profile. Do you wish to ignore this warning and continue?
-WSI_AP_INCOMPLIANT_RUNTIME=The selected Web Service runtime does not comply with WS-I Attachment Profile.
-IGNORE_LABEL=Ignore
-IGNORE_DESCRIPTION=Ignore the WS-I non-compliance and continue
-IGNORE_ALL_LABEL=Ignore All
-IGNORE_ALL_DESCRIPTION=Always ignore the WS-I non-compliance and continue
-CANCEL_LABEL=Cancel
-TASK_LABEL_WSI_NONCOMPLIANT=Check for WSI Compliance
-TASK_DESC_WSI_NONCOMPLIANT=Check for WSI Compliance
-CANCEL_DESCRIPTION=Cancel
-NOT_OK=Cannot continue due to WS-I non-compliance
-
-#
-# Resource Browser
-#
-DIALOG_TITLE_RESOURCE_BROWSER=Resource browser
-TOOLTIP_RESOURCE_TREE=Choose a resource.
-
-
-
-
-
-
-
-
diff --git a/bundles/org.eclipse.jst.ws/.classpath b/bundles/org.eclipse.jst.ws/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/bundles/org.eclipse.jst.ws/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.ws/.cvsignore b/bundles/org.eclipse.jst.ws/.cvsignore
deleted file mode 100644
index 60463af..0000000
--- a/bundles/org.eclipse.jst.ws/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-build.xml
diff --git a/bundles/org.eclipse.jst.ws/.project b/bundles/org.eclipse.jst.ws/.project
deleted file mode 100644
index 1ff6289..0000000
--- a/bundles/org.eclipse.jst.ws/.project
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.ws</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.wst.command.env</project>
- <project>org.eclipse.wst.command.env.core</project>
- <project>org.eclipse.wst.wsdl</project>
- <project>org.eclipse.wst.ws.uddi4j</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jst.ws/build.properties b/bundles/org.eclipse.jst.ws/build.properties
deleted file mode 100644
index 768202b..0000000
--- a/bundles/org.eclipse.jst.ws/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-src.includes = build.properties,\
- doc/,\
- plugin.properties,\
- plugin.xml,\
- readme.html,\
- samples/,\
- src/,\
- test/,\
- xsd/,\
- runtime/
-bin.includes = plugin.properties,\
- plugin.xml,\
- readme.html,\
- samples/,\
- xsd/,\
- ws.jar
-source.ws.jar = src/
diff --git a/bundles/org.eclipse.jst.ws/plugin.properties b/bundles/org.eclipse.jst.ws/plugin.properties
deleted file mode 100644
index 505a8be..0000000
--- a/bundles/org.eclipse.jst.ws/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Web Services
-PLUGIN_PROVIDER=Eclipse.org
diff --git a/bundles/org.eclipse.jst.ws/plugin.xml b/bundles/org.eclipse.jst.ws/plugin.xml
deleted file mode 100644
index c78daa3..0000000
--- a/bundles/org.eclipse.jst.ws/plugin.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id="org.eclipse.jst.ws"
- version="1.0.0"
- name="%PLUGIN_NAME"
- provider-name="%PLUGIN_PROVIDER"
- class="org.eclipse.jst.ws.internal.plugin.WebServicePlugin">
-
- <runtime>
- <library name="ws.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.wst.command.env"/>
- <import plugin="org.eclipse.wst.command.env.ui"/>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <import plugin="org.eclipse.jem.workbench"/>
- <import plugin="org.eclipse.jem"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.emf.common"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.wst.ws.uddi4j"/>
- <import plugin="org.eclipse.jface"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="com.ibm.wtp.emf.workbench"/>
- <import plugin="org.eclipse.wst.server.core"/>
- <import plugin="org.eclipse.wst.server.ui"/>
- <import plugin="org.eclipse.wst.wsdl"/>
- <import plugin="org.eclipse.jst.j2ee.core"/>
- <import plugin="org.eclipse.jst.j2ee.ejb"/>
- <import plugin="org.eclipse.jst.j2ee"/>
- <import plugin="org.eclipse.jst.j2ee.web"/>
- <import plugin="org.eclipse.wst.common.emfworkbench.integration"/>
- <import plugin="org.eclipse.wst.web"/>
- </requires>
-
-</plugin>
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/command/NullStatusMonitor.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/command/NullStatusMonitor.java
deleted file mode 100644
index fb2cbc2..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/command/NullStatusMonitor.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.command;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IStatus;
-
-/**
-* A NullStatusRenderer throws away IStatus information.
-*/
-public class NullStatusMonitor implements StatusMonitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- protected boolean result;
-
- /**
- * Default constructor.
- */
- public NullStatusMonitor () {}
- /**
- * Does nothing.
- */
- public int reportStatus(IStatus status, Vector options) { return 0; }
- public boolean reportStatus(IStatus status)
- {
- switch (status.getSeverity())
- {
- case IStatus.ERROR:
- case IStatus.WARNING:
- result = false;
- break;
- case IStatus.INFO:
- default: //IStatus.OK
- result = true;
- break;
- }
- return result;
- }
- public void dumpSavedStatus() { }
- public boolean canContinue()
- {
- return result;
- }
-
- public void reset () {
- result = true;
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/command/StatusMonitor.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/command/StatusMonitor.java
deleted file mode 100644
index cfe91de..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/command/StatusMonitor.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.command;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IStatus;
-
-/**
-* A StatusMonitor reports IStatus information to a display system.
-*/
-public interface StatusMonitor
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * reports the contents of the given status object.
- * Subclasses must implement this method to report
- * IStatus information to a given display system,
- * such as SWT, the command line, or a trace file.
- */
- public int reportStatus(IStatus status, Vector options);
- public boolean reportStatus(IStatus status);
- public void dumpSavedStatus();
- public boolean canContinue();
- public void reset();
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/command/StatusRenderer.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/command/StatusRenderer.java
deleted file mode 100644
index 0cff3a6..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/command/StatusRenderer.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.command;
-
-import org.eclipse.core.runtime.IStatus;
-
-/**
-* A StatusRenderer renders IStatus information to a display system.
-*/
-public interface StatusRenderer
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Renders the contents of the given status object.
- * Subclasses must implement this method to render
- * IStatus information to a given display system,
- * such as SWT, the command line, or a trace file.
- */
- public void render ( IStatus status );
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/AnyFilter.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/AnyFilter.java
deleted file mode 100644
index ba00a10..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/AnyFilter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.common;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-
-
-/**
-* This is a kind of {@link Filter} that accepts all objects,
-* and is a suitable base class for new <code>Filters</code>.
-*/
-public class AnyFilter implements Filter
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Constructs a new <code>AnyFilter</code>.
- */
- public AnyFilter ()
- {
- }
-
- /**
- * Returns the locale-specific name of this filter.
- * @return The locale-specific name of this filter.
- */
- public String getName ()
- {
- return WebServicePlugin.getMessage("%ANY_FILTER_NAME");
- }
-
- /**
- * Returns the locale-specific description of this filter.
- * @return The locale-specific description of this filter.
- */
- public String getDescription ()
- {
- return WebServicePlugin.getMessage("%ANY_FILTER_DESC");
- }
-
- /**
- * Returns an {@link org.eclipse.core.runtime.IStatus}
- * describing the <code>Filter</code>'s assessment of
- * the given <code>object</code>.
- * See {@link Filter#statusOf} for general comments.
- * The default implementation of <code>AnyFilter</code>
- * returns a status with severity <code>IStatus.OK</code>.
- * Subclasses may override.
- * @param object The object to filter.
- * @return An {@link org.eclipse.core.runtime.IStatus}.
- */
- public IStatus statusOf ( Object object )
- {
- return new Status(IStatus.OK,WebServicePlugin.ID,0,"",null);
- }
-
- /**
- * Returns true if and only if {@link #statusOf} returns
- * an {@link org.eclipse.core.runtime.IStatus} with a
- * severity of less than <code>IStatus.ERROR</code>.
- * Subclasses may override to provide a higher-performance
- * implementation.
- * @param object The object to filter.
- * @return True if and only if {@link #statusOf} returns
- * an {@link org.eclipse.core.runtime.IStatus} with a
- * severity of less than <code>IStatus.ERROR</code>.
- */
- public boolean accepts ( Object object )
- {
- return !statusOf(object).matches(IStatus.ERROR);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/EnvironmentUtils.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/EnvironmentUtils.java
deleted file mode 100644
index dfec491..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/EnvironmentUtils.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.common;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.ProgressMonitor;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.core.context.TransientResourceContext;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseEnvironment;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseProgressMonitor;
-
-
-
-/**
- *
- */
-public final class EnvironmentUtils
-{
- /**
- * @param env
- * @return IProgressMonitor
- */
- public static IProgressMonitor getIProgressMonitor(Environment env)
- {
- ProgressMonitor monitor = env.getProgressMonitor();
- IProgressMonitor eclipseMonitor = null;
- if (monitor instanceof EclipseProgressMonitor)
- {
- eclipseMonitor = ((EclipseProgressMonitor)monitor).getMonitor();
- }
- return eclipseMonitor;
- }
-
-
-
- /**
- *
- * @param env This should be an EclipseEnvironment.
- * @return Returns a ResourceContext.
- */
- public static ResourceContext getResourceContext( Environment env )
- {
- ResourceContext context = null;
-
- if( env instanceof EclipseEnvironment )
- {
- context = ((EclipseEnvironment)env).getResourceContext();
- }
- else
- {
- context = new TransientResourceContext();
- }
-
- return context;
- }
-
- /**
- * @param istatus
- * @return Status
- */
-
- public static Status convertIStatusToStatus(IStatus istatus)
- {
- Status status;
- String message = istatus.getMessage();
- IStatus[] children = istatus.getChildren();
- int noOfChildren = children.length;
- if (noOfChildren > 0)
- {
- Status[] statusChildren = new Status[noOfChildren];
- for (int i=0;i<noOfChildren;i++)
- {
- statusChildren[i] = convertIStatusToStatus(children[i]);
- }
-
- status = new SimpleStatus("",message,statusChildren);
- }
- else
- {
- int severity = istatus.getSeverity();
- int statusSeverity = Status.OK;
- switch (severity)
- {
- case IStatus.ERROR:
- statusSeverity = Status.ERROR;
- break;
- case IStatus.WARNING:
- statusSeverity = Status.WARNING;
- break;
- case IStatus.INFO :
- statusSeverity = Status.INFO;
- break;
- case IStatus.OK:
- statusSeverity = Status.OK;
- break;
- default:
- }
- Throwable e = istatus.getException();
- status = new SimpleStatus("",message,statusSeverity,e);
- }
-
- return status;
- }
-
- public static IStatus convertStatusToIStatus(Status status, String pluginId)
- {
- IStatus istatus;
- String message = status.getMessage();
- Throwable throwable = status.getThrowable();
- if (status.hasChildren())
- {
- Status[] children = status.getChildren();
- int noOfChildren = children.length;
- IStatus[] istatusChildren = new IStatus[noOfChildren];
- for (int i=0;i<noOfChildren;i++)
- {
- istatusChildren[i] = convertStatusToIStatus(children[i], pluginId);
- }
-
- istatus = new MultiStatus(pluginId,0,istatusChildren,message,throwable);
- }
- else
- {
- int severity = status.getSeverity();
- int istatusSeverity = IStatus.OK;
- switch (severity)
- {
- case Status.ERROR:
- istatusSeverity = IStatus.ERROR;
- break;
- case Status.WARNING:
- istatusSeverity = IStatus.WARNING;
- break;
- case Status.INFO:
- istatusSeverity = IStatus.INFO;
- break;
- case Status.OK:
- istatusSeverity = IStatus.OK;
- break;
- default:
- }
- istatus = new org.eclipse.core.runtime.Status(istatusSeverity,pluginId,0,message,throwable);
- }
-
- return istatus;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/Filter.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/Filter.java
deleted file mode 100644
index 91f0bf8..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/Filter.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.common;
-
-import org.eclipse.core.runtime.IStatus;
-
-/**
-* This is the interface for a class of objects that filter
-* other objects for inclusion or exclusion by some consumer.
-*/
-public interface Filter
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Returns the locale-specific name of this filter.
- * @return The locale-specific name of this filter.
- */
- public String getName ();
-
- /**
- * Returns the locale-specific description of this filter.
- * @return The locale-specific description of this filter.
- */
- public String getDescription ();
-
- /**
- * Returns an {@link org.eclipse.core.runtime.IStatus}
- * describing the <code>Filter</code>'s assessment of
- * the given <code>object</code>.
- * The severity of the
- * returned <code>IStatus</code> is as follows:
- * <ul>
- * <li>
- * {@link org.eclipse.core.runtime.IStatus#OK}
- * if the <code>Filter</code> accepts the <code>object</code>
- * with no further information for the caller (meaning the
- * {@link org.eclipse.core.runtime.IStatus#getMessage} and
- * {@link org.eclipse.core.runtime.IStatus#getException} methods
- * are ignored).
- * <li>
- * {@link org.eclipse.core.runtime.IStatus#INFO}
- * if the <code>Filter</code> accepts the <code>object</code>
- * Additional information may be available from the
- * {@link org.eclipse.core.runtime.IStatus#getMessage} and
- * {@link org.eclipse.core.runtime.IStatus#getException} methods.
- * <li>
- * {@link org.eclipse.core.runtime.IStatus#WARNING}
- * if the <code>Filter</code> accepts the <code>object</code>.
- * Additional information may be available from the
- * {@link org.eclipse.core.runtime.IStatus#getMessage} and
- * {@link org.eclipse.core.runtime.IStatus#getException} methods.
- * <li>
- * {@link org.eclipse.core.runtime.IStatus#ERROR}
- * if the <code>Filter</code> does not accept the <code>object</code>.
- * Additional information may be available from the
- * {@link org.eclipse.core.runtime.IStatus#getMessage} and
- * {@link org.eclipse.core.runtime.IStatus#getException} methods.
- * </ul>
- * @param object The object to filter.
- * @return An {@link org.eclipse.core.runtime.IStatus}
- * describing the <code>Filter</code>'s assessment of
- * the given <code>object</code>.
- */
- public IStatus statusOf ( Object object );
-
- /**
- * Returns true if and only if this <code>Filter</code>
- * accepts the given <code>object</code>. This method
- * must return true if and only if {@link #statusOf}
- * returns an <code>IStatus</code> with a severity of
- * less than <code>IStatus.ERROR</code>.
- * @param object The object to filter.
- * @return True if and only if this <code>Filter</code>
- * accepts the given <code>object</code>.
- */
- public boolean accepts ( Object object );
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/IProjectToStringTransformer.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/IProjectToStringTransformer.java
deleted file mode 100644
index 7030001..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/IProjectToStringTransformer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.command.env.core.data.Transformer;
-
-
-
-/**
- * Transfroms a org.eclipse.core.runtime.IProject to java.lang.String
- */
-public class IProjectToStringTransformer implements Transformer {
-
- public Object transform(Object value)
- {
- IProject project = (IProject)value;
- return project.getName();
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/J2EEActionAdapterFactory.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/J2EEActionAdapterFactory.java
deleted file mode 100644
index 74cf4b1..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/J2EEActionAdapterFactory.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 8, 2004
- */
-package org.eclipse.jst.ws.internal.common;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.internal.impl.ServiceImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl;
-
-import com.ibm.wtp.emf.workbench.ProjectUtilities;
-
-
-/**
- * @author gilberta
- */
-public class J2EEActionAdapterFactory {
-
-
- public static String getWSDLURI(ServiceImpl serviceImpl)
- {
- Definition definition = serviceImpl.getEnclosingDefinition();
- String location = definition.getLocation();
-
- return location;
- }
-
- //has to be under the webcontent
- public static String WEB_CONTENT = "WebContent";
- public static String getWSDLURI(ServiceRef serviceImpl)
- {
- IProject project = ProjectUtilities.getProject(serviceImpl);
- IPath path = project.getLocation().addTrailingSeparator();
- path = path.append(WEB_CONTENT).addTrailingSeparator();
- path = path.append(serviceImpl.getWsdlFile());
- File file = new File(path.toString());
- try{
- URL url = file.toURL();
- return url.toString();
- }catch(MalformedURLException e){return null;}
-
- }
-
- public static String getWSDLURI(WSDLResourceImpl wsdlRI)
- {
- Definition definition = wsdlRI.getDefinition();
- String location = definition.getLocation();
-
- return location;
- }
-
- public static String getWSILPath(WSDLResourceImpl wsdlRI)
- {
- return convertToRelative(getWSDLURI(wsdlRI));
- }
-
- public static String getWSILPath(ServiceRef serviceImpl)
- {
- return convertToRelative(getWSDLURI(serviceImpl));
- }
-
- public static String getWSILPath(ServiceImpl serviceImpl)
- {
- return convertToRelative(getWSDLURI(serviceImpl));
- }
-
- public static String FILE="file:/";
- public static String FILEL="file:";
- public static String convertToRelative(String uri)
- {
- //remove file:
- String root = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
- root = FILE + root;
- String rootL = FILEL + root;
- if(uri.startsWith(root) || uri.startsWith(rootL)){
- return uri.substring(root.length());
- }
- return uri;
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/J2EEUtils.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/J2EEUtils.java
deleted file mode 100644
index b8a1c3d..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/J2EEUtils.java
+++ /dev/null
@@ -1,701 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.common;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jst.j2ee.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.applicationclient.creation.IApplicationClientNatureConstants;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.Session;
-import org.eclipse.jst.j2ee.ejb.SessionType;
-import org.eclipse.jst.j2ee.internal.earcreation.AddModuleToEARProjectCommand;
-import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
-import org.eclipse.jst.j2ee.internal.earcreation.IEARNatureConstants;
-import org.eclipse.jst.j2ee.internal.ejb.project.EJBNatureRuntime;
-import org.eclipse.jst.j2ee.internal.project.IEJBNatureConstants;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.project.J2EENature;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.IModule;
-
-import com.ibm.wtp.emf.workbench.ProjectUtilities;
-
-
-/**
- * This class contains some useful J2EE utilities.
- *
- * @author Peter Moogk
- * @date August 23, 2001
-**/
-public final class J2EEUtils
-{
- private static final String webProjectNature = IWebNatureConstants.J2EE_NATURE_ID;
- private static final String ejbProjectNature = IEJBNatureConstants.NATURE_ID;
- private static final String earProjectNature = IEARNatureConstants.NATURE_ID;
-
- /**
- * Returns the J2EE version id (defined in J2EEVersionConstants) of the project. If the
- * project does not have a J2EENature, -1 is returned.
- * @param p
- * @return the J2EE version id (defined in J2EEVersionConstants), -1 if p does not have a J2EENature.
- */
- public static int getJ2EEVersion(IProject p)
- {
- J2EENature nature = J2EENature.getRegisteredRuntime(p);
- if (nature != null)
- {
- return nature.getJ2EEVersion();
- }
- return -1;
- }
- /**
- * This method returns all of the EAR projects that reference the specified
- * project.
- **/
- public static EARNatureRuntime[] getEARProjects( IProject project )
- {
- EARNatureRuntime[] ears = J2EEProjectUtilities.getReferencingEARProjects(project);
- return ears;
- }
-
- public static String[] getEARProjectNamesForWebProject(IProject project) {
- Vector EARNames = new Vector();
- if (project!=null) {
- EARNatureRuntime[] ears = getEARProjects(project);
- for (int i=0; i<ears.length;i++) {
- EARNames.add(ears[i].getProject().getName());
- }
- }
- return EARNames.isEmpty() ? null : (String[])EARNames.toArray(new String[0]);
- }
-
- /**
- * This method returns all of the EAR projects that reference the specified
- * ejb project.
- **/
- public static EARNatureRuntime[] getEJBEARProjects( IProject project )
- {
- EARNatureRuntime[] ears = J2EEProjectUtilities.getReferencingEARProjects(project);
- return ears;
- }
-
- public static String[] getEARProjectNamesForEJBProject(IProject project) {
- Vector EARNames = new Vector();
- if (project!=null) {
- EARNatureRuntime[] ears = getEJBEARProjects(project);
- for (int i=0; i<ears.length;i++) {
- EARNames.add(ears[i].getProject().getName());
- }
- }
- return EARNames.isEmpty() ? null : (String[])EARNames.toArray(new String[0]);
- }
-
- public static EARNatureRuntime[] getAppClientEARProjects(IProject project)
- {
- EARNatureRuntime[] ears = J2EEProjectUtilities.getReferencingEARProjects(project);
- return ears;
- }
-
- /**
- * Returns the EAR nature runtime from an EAR project
- * @param IProject the EAR project
- * @return EARNatureRuntime of the project
- */
- public static EARNatureRuntime getEARNatureRuntimeFromProject(IProject project) {
- return EARNatureRuntime.getRuntime(project);
- }
-
-
- /**
- * This method returns a list of EAR names that are referenced by the specified
- * web project.
- **/
- public static String[] getEARNames( IProject project )
- {
- EARNatureRuntime[] ears = getEARProjects( project );
- String[] earNames = new String[ ears == null ? 0 : ears.length ];
-
- for( int index = 0; index < earNames.length; index++ )
- {
- earNames[index] = ears[index].getProject().getName();
- }
-
- return earNames;
- }
-
- /**
- * Find all EJB projects for a particular EAR Nature.
- * @return a vector of EJBNatureRuntimes.
- **/
- public static Vector getEJBProjects( EARNatureRuntime ear )
- {
- Vector ejbs = new Vector();
- Iterator earProjects = ear.getModuleProjects().values().iterator();
-
- while( earProjects.hasNext() )
- {
- Object object = earProjects.next();
-
- if( object != null )
- {
- J2EENature j2eeNature = (J2EENature)object;
-
- if( j2eeNature instanceof EJBNatureRuntime )
- {
- ejbs.add( j2eeNature );
- }
- }
- }
-
- return ejbs;
- }
-
-
- /**
- * Find all Web projects for a particular EAR Nature.
- * @return a vector of J2EEWebNatureRuntimes.
- **/
- public static Vector getWebProjects( EARNatureRuntime ear )
- {
- Vector webProjects = new Vector();
- Iterator earProjects = ear.getModuleProjects().values().iterator();
-
- while( earProjects.hasNext() )
- {
- Object object = earProjects.next();
-
- if( object != null )
- {
- J2EENature j2eeNature = (J2EENature)object;
-
- if( j2eeNature instanceof J2EEWebNatureRuntime )
- {
- webProjects.add( j2eeNature );
- }
- }
- }
-
- return webProjects;
- }
-
- /**
- * @return returns a list of projects names for a given ear.
- **/
- public static String[] getEJBProjectNames( EARNatureRuntime ear )
- {
- Vector ejbNatures = getEJBProjects( ear );
- String[] ejbProjectNames = new String[ejbNatures.size()];
-
- for( int index = 0; index < ejbProjectNames.length; index++ )
- {
- ejbProjectNames[index]
- = ((EJBNatureRuntime)(ejbNatures.elementAt( index ))).getProject().getName();
- }
-
- return ejbProjectNames;
- }
-
- /**
- * @return returns a Vector of bean String names.
- **/
- public static Vector getBeanNames( EJBJar jar )
- {
- // We currently only support Stateless session beans.
- //List cmpBeans = jar.getBeanManagedBeans();
- //List bmpBeans = jar.getContainerManagedBeans();
- List sessionBeans = jar.getSessionBeans();
-
- Vector names = new Vector();
-
- //getBeanNames( names, cmpBeans );
- //getBeanNames( names, bmpBeans );
- getBeanNames( names, sessionBeans );
-
- return names;
- }
-
- /**
- * @param names specifies that vector of strings that will be used to add bean
- * names to.
- * @param beans specifies a list of beans.
- **/
- private static void getBeanNames( Vector names, List beans )
- {
- Iterator iterator = beans.iterator();
-
- while( iterator.hasNext() )
- {
- EnterpriseBean bean = (EnterpriseBean)(iterator.next());
-
- if( bean.isSession() )
- {
- Session sessionBean = (Session)bean;
-
- if( sessionBean.getSessionType().getValue() == SessionType.STATELESS )
- {
- names.add( bean.getName() );
- }
- }
- }
- }
-
-
- /**
- * Get the WebProject, given the EJB
- */
- public static IProject getProjectFromEJB(EnterpriseBean ejb)
- {
- return ProjectUtilities.getProject(ejb);
- }
-
- /**
- * Get an array of IProject, given a Vector of J2EENature's
- */
- public static IProject[] getIProjectsFromJ2EENatures(Vector j2eenatureVector)
- {
- IProject[] projects = new IProject[j2eenatureVector==null? 0 : j2eenatureVector.size()];
- Enumeration e = j2eenatureVector.elements();
- int i=0;
- while (e.hasMoreElements())
- {
- J2EENature nature = (J2EENature)e.nextElement();
- IProject project = nature.getProject();
- projects[i] = project;
- i++;
- }
-
- return projects;
- }
-
- public static IProject[] getEARProjects()
- {
- Vector v = new Vector();
- IProject[] projects = ResourceUtils.getWorkspaceRoot().getProjects();
- for (int i = 0; i < projects.length; i++)
- {
- try
- {
- if (projects[i].hasNature(IEARNatureConstants.NATURE_ID))
- v.add(projects[i]);
- }
- catch (CoreException e)
- {
- }
-
- }
- IProject[] earProjects = new IProject[v.size()];
- v.copyInto(earProjects);
- return earProjects;
- }
-
- /**
- * Get a J2EE 1.2 EAR Project. Returns null if no J2EE 1.2 EAR Projects exist
- */
- public static EARNatureRuntime get12EAR()
- {
- try
- {
- IProject[] allEARs = getEARProjects();
- for (int i=0;i<allEARs.length;i++)
- {
- //return the first 1.2 EAR encountered
- EARNatureRuntime thisEAR = (EARNatureRuntime)(allEARs[i].getNature(IEARNatureConstants.NATURE_ID));
- if (thisEAR.getJ2EEVersion()==J2EEVersionConstants.J2EE_1_2_ID)
- {
- return thisEAR;
- }
- }
- }catch(CoreException ce)
- {
- return null;
- }
- return null;
-
- }
-
- /**
- * Get a J2EE 1.3 EAR Project. Returns null if no J2EE 1.3 EAR Projects exist
- */
- public static EARNatureRuntime get13EAR()
- {
- try
- {
- IProject[] allEARs = getEARProjects();
- for (int i=0;i<allEARs.length;i++)
- {
- //return the first 1.3 EAR encountered
- EARNatureRuntime thisEAR = (EARNatureRuntime)(allEARs[i].getNature(IEARNatureConstants.NATURE_ID));
- if (thisEAR.getJ2EEVersion()==J2EEVersionConstants.J2EE_1_3_ID)
- {
- return thisEAR;
- }
- }
- }catch(CoreException ce)
- {
- return null;
- }
- return null;
-
- }
-
- public static EARNatureRuntime getEAR(int versionId)
- {
- try
- {
- IProject[] allEARs = getEARProjects();
- for (int i=0;i<allEARs.length;i++)
- {
- EARNatureRuntime thisEAR = (EARNatureRuntime)(allEARs[i].getNature(IEARNatureConstants.NATURE_ID));
- if (thisEAR.getJ2EEVersion()==versionId)
- {
- return thisEAR;
- }
- }
- }catch(CoreException ce)
- {
- return null;
- }
- return null;
- }
-
- public static String getLabelFromJ2EEVersion(String j2eeVersionInt)
- {
- if (j2eeVersionInt==null || j2eeVersionInt.length()==0)
- return "";
-
- int j2eeVersion = Integer.parseInt(j2eeVersionInt);
- switch (j2eeVersion)
- {
- case J2EEVersionConstants.J2EE_1_2_ID:
- return J2EEVersionConstants.VERSION_1_2_TEXT;
- case J2EEVersionConstants.J2EE_1_3_ID:
- return J2EEVersionConstants.VERSION_1_3_TEXT;
- case J2EEVersionConstants.J2EE_1_4_ID:
- return J2EEVersionConstants.VERSION_1_4_TEXT;
- default:
- System.out.println("This is not a J2EE version!!");
- return "";
- }
- }
-
- public static String getJ2EEVersionFromLabel(String j2eeLabel)
- {
- String j2ee12String = String.valueOf(J2EEVersionConstants.J2EE_1_2_ID);
- String j2ee13String = String.valueOf(J2EEVersionConstants.J2EE_1_3_ID);
- String j2ee14String = String.valueOf(J2EEVersionConstants.J2EE_1_4_ID);
- if (j2eeLabel.equals(J2EEVersionConstants.VERSION_1_2_TEXT))
- return j2ee12String;
-
- if (j2eeLabel.equals(J2EEVersionConstants.VERSION_1_3_TEXT))
- return j2ee13String;
-
- if (j2eeLabel.equals(J2EEVersionConstants.VERSION_1_4_TEXT))
- return j2ee14String;
-
- return "";
-
- }
-
- //----------------------------------------------------------------------
-
- /**
- * Return all the ear projects in which this project is a nested module;
- * @param project The project
- * @return EARs EAR projects, possibly null
- */
- public static EARNatureRuntime[] getEARProjects(IProject serviceProject, IServer server) {
-
- EARNatureRuntime[] earProjects = null;
- EARNatureRuntime ear = null;
- IProject earProject = null;
-
- if (serviceProject != null && serviceProject.exists()) {
- try {
-
- EARNatureRuntime[] ears = null;
- boolean isWebEJBOrAppClient = serviceProject.hasNature(IWebNatureConstants.J2EE_NATURE_ID) ||
- serviceProject.hasNature(IEJBNatureConstants.NATURE_ID)||
- serviceProject.hasNature(IApplicationClientNatureConstants.NATURE_ID);
- if (!isWebEJBOrAppClient)
- {
- return null;
- }
-
- ears = J2EEProjectUtilities.getReferencingEARProjects(serviceProject);
-
- // separate EARs which are already deployed to the existing server
- if (ears != null && ears.length >= 1) {
- ArrayList preferredEARList = new ArrayList();
- ArrayList secondaryEARList = new ArrayList();
- for (int i = 0; i < ears.length; i++) {
- ear = ears[i];
- earProject = ear.getProject();
- IModule module = ResourceUtils.getModule(earProject);
- if (module != null) {
- if (server!=null || ServerUtil.containsModule(server, module, new NullProgressMonitor())) {
- preferredEARList.add(ear);
- }
- else {
- secondaryEARList.add(ear);
- }
- }
- }
- // add secondaryEARList items to end of primary list
- for (int j = 0; j < secondaryEARList.size(); j++) {
- preferredEARList.add(secondaryEARList.get(j));
- }
- // toArray
- if (preferredEARList != null) {
- earProjects = (EARNatureRuntime[])preferredEARList.toArray(new EARNatureRuntime[0]);
- }
- }
- }
- catch (CoreException ce) {
- Log log = new EclipseLog();
- log.log(Log.ERROR, 5039, J2EEUtils.class, "getEARProjects", ce);
-
- }
- }
- return earProjects;
- }
-
- /**
- * Returns EJB projects in the ears
- * @param earProjects
- * @return projects EJB projects
- */
- public static IProject[] getEJB2_0ProjectsFromEARS(EARNatureRuntime[] earProjects){
- if (earProjects==null)
- return null;
-
- ArrayList ejbProjects = new ArrayList();
- for (int i = 0; i < earProjects.length; i++) {
- if (earProjects[i] instanceof EARNatureRuntime){
- EARNatureRuntime ear = (EARNatureRuntime)earProjects[i];
- Map projectsInEAR = ear.getModuleProjects();
- if (projectsInEAR != null && !projectsInEAR.isEmpty()) {
- Iterator iter = projectsInEAR.values().iterator();
- while (iter.hasNext()) {
- Object MOFObject = iter.next();
- if (MOFObject instanceof EJBNatureRuntime){
- if (((EJBNatureRuntime)MOFObject).getModuleVersion() >= J2EEVersionConstants.EJB_2_0_ID){
- IProject project = ((EJBNatureRuntime)MOFObject).getProject();
- if (project!=null) {
- ejbProjects.add(project);
- }
- }
- }
- }
- }
- }
- } // end for earProjects loop
-
- return (IProject[])ejbProjects.toArray(new IProject[0]);
- }
-
- /**
- * Returns EJB projects in the ears
- * @param earProjects
- * @return projects EJB projects
- */
- public static IProject[] getEJBProjectsFromEARS(EARNatureRuntime[] earProjects){
- if (earProjects==null)
- return null;
-
- ArrayList ejbProjects = new ArrayList();
- for (int i = 0; i < earProjects.length; i++) {
- if (earProjects[i] instanceof EARNatureRuntime){
- EARNatureRuntime ear = (EARNatureRuntime)earProjects[i];
- Map projectsInEAR = ear.getModuleProjects();
- if (projectsInEAR != null && !projectsInEAR.isEmpty()) {
- Iterator iter = projectsInEAR.values().iterator();
- while (iter.hasNext()) {
- Object MOFObject = iter.next();
- if (MOFObject instanceof EJBNatureRuntime) {
-
- IProject project = ((EJBNatureRuntime)MOFObject).getProject();
- if (project!=null) {
- ejbProjects.add(project);
- }
-
- }
- }
- }
- }
- } // end for earProjects loop
-
- return (IProject[])ejbProjects.toArray(new IProject[0]);
- }
-
- public static IProject[] combineProjectArrays(IProject[] projectArray1, IProject[] projectArray2){
-
- // check if either or both arrays are null.
- if (projectArray1==null && projectArray2==null)
- return null;
- else if (projectArray1!=null && projectArray2==null)
- return projectArray1;
- else if (projectArray1==null && projectArray2!=null)
- return projectArray2;
-
-
- IProject[] combinedProjects = new IProject[projectArray1.length + projectArray2.length];
-
- System.arraycopy(projectArray1,0,combinedProjects,0,projectArray1.length);
- if (projectArray2.length>0){
- System.arraycopy(projectArray2,0,combinedProjects,projectArray1.length,projectArray2.length);
- }
-
- return combinedProjects;
- }
-
- /**
- * Returns all Web projects in the ear(s)
- * @param earProjects
- * @return projects Web projects
- */
- public static IProject[] getWebProjectsFromEARS(EARNatureRuntime[] earProjects){
- if (earProjects==null)
- return null;
-
- ArrayList webProjects = new ArrayList();
- for (int i = 0; i < earProjects.length; i++) {
- if (earProjects[i] instanceof EARNatureRuntime){
- EARNatureRuntime ear = (EARNatureRuntime)earProjects[i];
- Map projectsInEAR = ear.getModuleProjects();
- if (projectsInEAR != null && !projectsInEAR.isEmpty()) {
- Iterator iter = projectsInEAR.values().iterator();
- while (iter.hasNext()) {
- //IProjectNature nature = iter.next().getNature(IWebNatureConstants.J2EE_NATURE_ID);
- Object MOFObject = iter.next();
- if (MOFObject instanceof J2EEWebNatureRuntime) {
- IProject project = ((J2EEWebNatureRuntime)MOFObject).getProject();
- if (project!=null) {
- webProjects.add(project);
- }
-
- }
- }
- }
- }
- } // end for earProjects loop
-
- return (IProject[])webProjects.toArray(new IProject[0]);
- }
-
- public static boolean isEJB2_0Project(IProject project) {
-
- if (ResourceUtils.isEJBProject(project)) {
- try
- {
-
- if (project.hasNature(IEJBNatureConstants.NATURE_ID) && EJBNatureRuntime.getRuntime(project).getModuleVersion() >= J2EEVersionConstants.EJB_2_0_ID){
- return true;
- }
- }
- catch (CoreException e)
- {
- }
- }
- return false;
- }
-
- /**
- * Returns true if the given <code>project</code> is an EAR 1.2 or EAR 1.3 Project.
- * @param project The project.
- * @return True if the project is an EAR 1.2 or an EAR 1.3 Project.
- */
- public static boolean isEARProject ( IProject project )
- {
- try
- {
- if (project.hasNature(IEARNatureConstants.NATURE_ID))
- return true;
- }
- catch (CoreException e)
- {
- }
- return false;
- }
-
- public static boolean isEARAssociated(IProject module, IProject EAR) {
-
- EARNatureRuntime[] ears = getEARProjects(module, null);
- if (ears!=null && ears.length!=0) {
- Vector EARNames = new Vector();
- for (int i=0; i<ears.length;i++) {
- EARNames.add(ears[i].getProject().getName());
- }
- String[] earNames = (String[])EARNames.toArray(new String[0]);
- if (Arrays.binarySearch(earNames, EAR.getName())>=0) {
- return true;
- }
- }
- return false;
- }
-
- public static void associateWebProject(IProject module, IProject EARProject) {
- try {
-
- String uri = module.getName()+".war";
- String contextRoot = module.getName();
- AddModuleToEARProjectCommand amiec = new AddModuleToEARProjectCommand(module, EARProject, uri, contextRoot, null);
- if (amiec.canExecute())
- amiec.execute();
-/*
- EARNatureRuntime EARNature = (EARNatureRuntime)getEARNatureRuntimeFromProject(EARProject);
-
- Application application = EARNature.getApplication();
- Module mod = (Module)application.getFirstModule(module.getName());
- EAREditModel edm = EARNature.getEarEditModelForRead();
- edm.addModuleMapping(mod, EARProject);
- edm.releaseAccess();
-
-*/
- }
- catch(Exception e) {
-
- }
- }
-
- public static void associateEJBProject(IProject ejbProject, IProject EARProject) {
- try {
- String uri = ejbProject.getName()+".jar";
- String contextRoot = ejbProject.getName();
- AddModuleToEARProjectCommand amiec = new AddModuleToEARProjectCommand(ejbProject, EARProject, uri, contextRoot, null);
- if (amiec.canExecute())
- amiec.execute();
-
- }
- catch(Exception e) {
-
- }
-
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/JavaMOFUtils.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/JavaMOFUtils.java
deleted file mode 100644
index aa8cdbd..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/JavaMOFUtils.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.common;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jem.internal.plugin.JavaEMFNature;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.JavaVisibilityKind;
-import org.eclipse.jem.java.Method;
-import org.eclipse.jem.java.impl.JavaClassImpl;
-
-/**
-* This class contains some useful utilities for dealing with the JavaMOF
-*/
-
-public final class JavaMOFUtils
-{
- /**
- * Determine whether this class of the given name is loadable in the given
- * project.
- * @param className The fully qualified name of the class
- * @param project The project
- * @return True if the class is loadable and no exceptions are thrown.
- */
- public static boolean isClassLoadable(String className, IProject project) throws CoreException
- {
- return isClassLoadable(getJavaClass(className,project));
- }
-
- public static boolean isClassLoadable(JavaClass javaClass)
- {
- return javaClass.isExistingType();
- }
-
- /**
- * Determine whether the specified class has a public constructor
- * with an empty parameter list.
- * @param className The fully qualified name of the class
- * @param project The project
- * @return True if the class is loadable from the project and the
- * class has a public constructor with an empty parameter list
- */
- public static boolean hasPublicDefaultCtor(String className, IProject project) throws CoreException
- {
- return hasPublicDefaultCtor(getJavaClass(className, project));
- }
-
-
- public static boolean hasPublicDefaultCtor(JavaClass javaClass)
- {
-
- List methodList = javaClass.getMethods();
- if (methodList==null)
- return true;
-
- Iterator iMethods = methodList.iterator();
- boolean userDefinedCtor = false;
- while (iMethods.hasNext())
- {
- Method thisMethod = (Method)iMethods.next();
-
- if (thisMethod.isConstructor())
- {
- userDefinedCtor = true;
-
- //Since the user has defined a ctor, the default ctor is no longer available.
- //We must ensure that the user has provided a public ctor with no parameters.
-
- //check if public
- if (thisMethod.getJavaVisibility().getValue() == JavaVisibilityKind.PUBLIC)
- {
- //see if parameter list is empty
- List paramList = thisMethod.getParameters();
- if (paramList.isEmpty() )
- {
- return true;
- }
- }
- }
-
- }
-
- if (userDefinedCtor)
- {
- return false; //if the user defined a ctor and we still haven't
- //returned true, none of them were public with no parameters.
- }
- else
- {
- return true;
- }
-
- }
- /**
- * Determine whether the specified class implements the specified interface.
- * @param className The fully qualified name of the class
- * @param interfaceName The fully qualified name of the interface
- * @param project The project
- * @return True if the class and interface are loadable from the project and
- * the class implements the interface.
- */
- public static boolean implementsInterface(String className, String interfaceName, IProject project)
- throws CoreException
- {
- return implementsInterface(getJavaClass(className, project), getJavaClass(interfaceName, project));
- }
-
-public static boolean implementsInterface(JavaClass javaClass, JavaClass interfaceClass)
- {
-
- if (!javaClass.isExistingType()) return false;
-
- if (!interfaceClass.isExistingType()) return false;
-
- return javaClass.implementsInterface(interfaceClass);
- }
-
- /**
- * Determine whether the specified class extends the specified superclass
- * @param className The fully qualified name of the class
- * @param superClassName The fully qualified name of the superclass
- * @param project The project
- * @return True if the class and superClass are loadable from the project and
- * the class extends the superClass
- */
- public static boolean extendsClass(String className, String superClassName, IProject project)
- throws CoreException
- {
- return extendsClass(getJavaClass(className,project), getJavaClass(superClassName, project));
- }
-
- public static boolean extendsClass(JavaClass javaClass, JavaClass superClass)
- {
- return superClass.isAssignableFrom(javaClass);
- }
-
- /**
- * Determine whether the specified class is actually an interface
- * @param className The fully qualified name of the class
- * @param project The project
- * @return True if the class is loadable from the project and is
- * actually an interface
- */
- public static boolean isInterface(String className, IProject project) throws CoreException
- {
- return isInterface(getJavaClass(className, project));
- }
-
- public static boolean isInterface(JavaClass javaClass)
- {
- return javaClass.isInterface();
- }
- public static boolean hasAbstractMethods (String className, IProject project) throws CoreException
- {
- return hasAbstractMethods(getJavaClass(className, project));
- }
-
- public static boolean hasAbstractMethods (JavaClass javaClass)
- {
- List methodList = javaClass.getMethods();
- if (methodList==null)
- return false;
-
- Iterator iMethods = methodList.iterator();
- while (iMethods.hasNext())
- {
- Method thisMethod = (Method)iMethods.next();
- if ( thisMethod.isAbstract()) return true;
- }
- return false;
- }
-
- public static JavaClass getJavaClass(String className , IProject project) throws CoreException
- {
- JavaEMFNature jMOF = (JavaEMFNature)JavaEMFNature.createRuntime(project);
- return (JavaClass)JavaClassImpl.reflect(className, jMOF.getResourceSet());
- }
-
- public static boolean isValidSEIFile(JavaClass beanClass, JavaClass seiClass)
- {
- if (!seiClass.isInterface())
- return false;
-
- Vector beanMethodsList = new Vector();
- List beanMethods = beanClass.getMethods();
- Iterator beanMethodsIterator = beanMethods.iterator();
- while (beanMethodsIterator.hasNext())
- {
- Method thisMethod = (Method)beanMethodsIterator.next();
- beanMethodsList.add(thisMethod.getMethodElementSignature());
- }
-
- List seiMethods = seiClass.getMethods();
- if (beanMethods == null ) {
- if ( seiMethods == null) return true;
- else return false;
- }
- if (seiMethods == null) return false;
-
- Iterator seiMethodsIterator = seiMethods.iterator();
- while (seiMethodsIterator.hasNext())
- {
- Method thisMethod = (Method)seiMethodsIterator.next();
- if ( !beanMethodsList.contains(thisMethod.getMethodElementSignature())) {
- return false;
- }
- }
- return true;
-
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ResourceUtils.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ResourceUtils.java
deleted file mode 100644
index dab2eba..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ResourceUtils.java
+++ /dev/null
@@ -1,1983 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.common;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectNature;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.j2ee.applicationclient.creation.IApplicationClientNatureConstants;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
-import org.eclipse.jst.j2ee.internal.ejb.project.EJBNatureRuntime;
-import org.eclipse.jst.j2ee.internal.project.IEJBNatureConstants;
-import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants;
-import org.eclipse.jst.j2ee.internal.web.operations.IDynamicWebNature;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerPort;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.model.IURLProvider;
-
-import com.ibm.wtp.emf.workbench.ProjectUtilities;
-
-/**
- * This class contains useful methods for working with Eclipse resources.
- */
-public final class ResourceUtils {
-
- //
- // Keeps the IWorkspaceRoot hanging around. See getWorkspaceRoot().
- //
- private static IWorkspaceRoot root_ = null;
-
- //
- // Keeps the IWorkspace hanging around. See getWorkspace().
- //
- private static IWorkspace workspace_ = null;
-
- /**
- * As returned by {@link #getProjectType getProjectType()}, indicates that
- * the given project has no Java or Web nature.
- */
- public static byte PROJECT_TYPE_NONE = 0;
-
- /**
- * As returned by {@link #getProjectType getProjectType()}, indicates that
- * the given project has a Java project nature.
- */
- public static byte PROJECT_TYPE_JAVA = 1;
-
- /**
- * As returned by {@link #getProjectType getProjectType()}, indicates that
- * the given project has a Web project nature.
- */
- public static byte PROJECT_TYPE_WEB = 2;
-
- /**
- * As returned by {@link #getProjectType getProjectType()}, indicates that
- * the given project has an EJB project nature.
- */
- public static byte PROJECT_TYPE_EJB = 4;
-
- /**
- * Status Code explaining the CoreException thrown
- */
-
- private static final String ejbProjectNature = IEJBNatureConstants.NATURE_ID;
- // ksc private static final String ejb2ProjectNature =
- // IEJBNatureConstants.EJB_20_NATURE_ID;
-
- /**
- * The SOAP rpcrouter servlet extension to be added to web project URL
- */
- public static String SERVLET_EXT = "/servlet/rpcrouter";
-
- private static final String DEFAULT_CLIENT_WEB_PROJECT_EXT = "Client";
- private static final String DEFAULT_EJB_PROJECT_NAME = "WebServiceEJBProject";
- private static final String DEFAULT_WEB_PROJECT_NAME = "WebServiceProject";
- private static final String DEFAULT_ROUTER_PROJECT_EXT = "Router";
-
- private static final String DEFAULT_SERVICE_EAR_PROJECT_NAME = "WebServiceEAR";
- private static final String DEFAULT_CLIENT_EAR_PROJECT_NAME = "WebServiceClientEAR";
-
- /**
- * Returns the IWorkspaceRoot object.
- *
- * @return The IWorkspaceRoot object.
- */
- public static IWorkspaceRoot getWorkspaceRoot() {
- if (root_ == null) {
- root_ = ResourcesPlugin.getWorkspace().getRoot();
- }
- return root_;
- }
-
- /**
- * Returns the IWorkspace object.
- *
- * @return The IWorkspace object.
- */
- public static IWorkspace getWorkspace() {
- if (workspace_ == null) {
- if (root_ == null) {
- root_ = ResourcesPlugin.getWorkspace().getRoot();
- }
- workspace_ = root_.getWorkspace();
- }
- return workspace_;
- }
-
- /**
- * Returns an {@link org.eclipse.core.resources.IResource IResource}of the
- * given absolute pathname or null if no such resource exists.
- *
- * @param absolutePathname
- * The absolute path of the resource.
- * @return The <code>IResource</code>.
- */
- public static IResource findResource(String absolutePathname) {
- if (absolutePathname == null) {
- return null;
- }
- return findResource(new Path(absolutePathname));
- }
-
- /**
- * Returns an {@link org.eclipse.core.resources.IResource IResource}of the
- * given absolute path or null if no such resource exists.
- *
- * @param absolutePath
- * The absolute <code>IPath</code> of the resource.
- * @return The <code>IResource</code>.
- */
- public static IResource findResource(IPath absolutePath) {
- if (absolutePath == null) {
- return null;
- }
- return ResourceUtils.getWorkspaceRoot().findMember(absolutePath);
- }
-
- /**
- * Validates the given string as a name for a resource of the given type(s).
- * This method obeys the contract of
- * {@link org.eclipse.core.resources.IWorkspace#validateName IWorkspace.validateName()}.
- *
- * @param segment
- * The path to validate.
- * @param typeMask
- * The <code>IResource</code> type or types.
- * @return The status with a value if <code>IStatus.OK</code> if the path
- * is valid, or with appropriate severity and message information if
- * the path is not valid.
- */
- public static IStatus validateName(String segment, int typeMask) {
- return ResourcesPlugin.getWorkspace().validateName(segment, typeMask);
- }
-
- /**
- * Validates the given string as the path of a resource of the given
- * type(s). This method obeys the contract of
- * {@link org.eclipse.core.resources.IWorkspace#validatePath IWorkspace.validatePath()}.
- *
- * @param path
- * The path to validate.
- * @param typeMask
- * The <code>IResource</code> type or types.
- * @return The status with a value if <code>IStatus.OK</code> if the path
- * is valid, or with appropriate severity and message information if
- * the path is not valid.
- */
- public static IStatus validatePath(String path, int typeMask) {
- return ResourcesPlugin.getWorkspace().validatePath(path, typeMask);
- }
-
- /**
- * Validates the given Java type name.
- *
- * @param typeName
- * The Java type name.
- * @return The status with a value of <code>IStatus.OK</code> if the name
- * is valid, or with appropriate severity and message information if
- * name is not valid. The primitive types (boolean, char, byte,
- * short, int, long, float, double) are valid. Arrays of valid types
- * are themselves valid.
- */
- public static IStatus validateJavaTypeName(String typeName) {
- //
- // Strip off the trailing array bits, if any.
- //
- int a = typeName.indexOf('[');
- if (a > 0) {
- typeName = typeName.substring(0, a);
- }
- //
- // Allow primitives.
- //
- if (isPrimitiveJavaType(typeName)) {
- return new Status(IStatus.OK, WebServicePlugin.ID, 0, "", null);
- }
- //
- // Defer to JavaConventions.
- //
- return JavaConventions.validateJavaTypeName(typeName);
- }
-
- /**
- * Returns true if the given <code>typeName</code> is a Java primitive
- * (boolean, char, byte, short, int, long, float, double).
- *
- * @return True if the type name is a Java primitive.
- */
- public static boolean isPrimitiveJavaType(String typeName) {
- return (typeName.equals("boolean") || typeName.equals("char")
- || typeName.equals("byte") || typeName.equals("short")
- || typeName.equals("int") || typeName.equals("long")
- || typeName.equals("float") || typeName.equals("double"));
- }
-
- /**
- * Returns the handle of the IProject at the beginning of the given
- * <code>absolutePath</code>. Neither the given path nor the project need
- * exist in the workspace. The path must be absolute, and must consist of at
- * least one segment.
- *
- * @return An IProject handle for the project at the beginning of the given
- * <code>absolutePath</code>, or null if the path does not
- * specify a project.
- */
- public static IProject getProjectOf(IPath absolutePath) {
- if (absolutePath.isAbsolute()) {
- String projectName = absolutePath.segment(0);
- if (projectName != null) {
- return getWorkspaceRoot().getProject(projectName);
- }
- }
- return null;
- }
-
- /**
- * Returns true if the given <code>project</code> is a Java Project.
- *
- * @param project
- * The project.
- * @return True if the project is a Java Project.
- */
- public static boolean isJavaProject(IProject project) {
- return (JavaCore.create(project) != null);
- }
-
- /**
- * Returns true if the given <code>project</code> is a Java Project.
- *
- * @param project
- * The project.
- * @return True if the project is a Java Project.
- */
- public static boolean isTrueJavaProject(IProject project) {
- return (!isWebProject(project) && !isAppClientProject(project) && !isEARProject(project)
- && !isEJBProject(project) && isJavaProject(project));
- /*
- * try { String[] natures = project.getDescription().getNatureIds();
- * return (natures.length == 1 &&
- * natures[0].equals(JavaCore.NATURE_ID)); } catch (CoreException e) { }
- * return false;
- */
- }
-
- /**
- * Returns true if the given <code>project</code> is a Web Project.
- *
- * @param project
- * The project.
- * @return True if the project is a Web Project.
- */
- public static boolean isWebProject(IProject project) {
- try {
- IProjectNature nature = project
- .getNature(IWebNatureConstants.J2EE_NATURE_ID);
- return (nature != null && (nature instanceof IDynamicWebNature));
- } catch (CoreException e) {
- }
- return false;
- }
-
- public static boolean isEARProject(IProject project){
- if (EARNatureRuntime.getRuntime(project) != null) {
- return true;
- }
- return false;
- }
- /**
- * Returns true if the given <code>project</code> is an EJB 1.1 or EJB 2.0
- * Project.
- *
- * @param project
- * The project.
- * @return True if the project is an EJB 1.1 or an EJB 2.0 Project.
- */
- public static boolean isEJBProject(IProject project) {
- // ksc
- // try
- // {
- // IProjectNature nature = project.getNature(ejbProjectNature);
- // if (nature==null)
- // nature = project.getNature(ejb2ProjectNature);
- //
- // return (nature != null && (nature instanceof EJBNatureRuntime));
- // }
- // catch (CoreException e)
- // {
- // }
- // return false;
- if (EJBNatureRuntime.getRuntime(project) != null)
- return true;
- else
- return false;
- // ksc
- }
-
- /**
- * Returns true if the given <code>project</code> is an Application Client
- * Project.
- *
- * @param project
- * The project.
- * @return True if the project is an Application Client Project
- */
- public static boolean isAppClientProject(IProject project) {
- for (int i = 0; i < IApplicationClientNatureConstants.APPCLIENT_NATURE_IDS.length; i++) {
- try {
- if (project
- .hasNature(IApplicationClientNatureConstants.APPCLIENT_NATURE_IDS[i]))
- return true;
- } catch (CoreException e) {
- }
- }
- return false;
- }
-
- /**
- * Returns the type of the given <code>project</code> as a bitmask.
- * Relevant bitmask values are:
- * <ol>
- * <li>{@link #PROJECT_TYPE_JAVA PROJECT_TYPE_JAVA}
- * <li>{@link #PROJECT_TYPE_WEB PROJECT_TYPE_WEB}
- * <li>{@link #PROJECT_TYPE_EJB PROJECT_TYPE_EJB}
- * <li>{@link #PROJECT_TYPE_NONE PROJECT_TYPE_NONE}
- * </ol>
- *
- * @param project
- * The project.
- * @return The type bitmask of the project.
- */
- public static byte getProjectType(IProject project) {
- byte projectType = PROJECT_TYPE_NONE;
- if (ResourceUtils.isJavaProject(project)) {
- projectType |= PROJECT_TYPE_JAVA;
- }
- if (ResourceUtils.isWebProject(project)) {
- projectType |= PROJECT_TYPE_WEB;
- }
- if (ResourceUtils.isEJBProject(project)) {
- projectType |= PROJECT_TYPE_EJB;
- }
- Log log = new EclipseLog();
- log.log(Log.INFO, 5031, ResourceUtils.class, "getProjectType",
- "project=" + project + ",projectType=" + projectType);
-
- return projectType;
- }
-
- /**
- *
- *
- */
- public static String getProjectTypeAsString(IProject project) {
- if (ResourceUtils.isEJBProject(project))
- return WebServicePlugin.getMessage("%LABEL_EJB");
- else if (ResourceUtils.isWebProject(project))
- return WebServicePlugin.getMessage("%LABEL_WEB");
- else if (ResourceUtils.isJavaProject(project))
- return WebServicePlugin.getMessage("%LABEL_JAVA");
- else
- return "";
- }
-
- /**
- * Returns WebModule Deployable of the <code>project</code> as an
- * <code>IDeployable</code>, or null if the project has no Web nature.
- *
- * @param project
- * The project.
- * @return WebModule Deployable of the <code>project</code> or null if the
- * project has no Web nature.
- */
- public static IModule getModule(IProject project) {
- IModule[] modules = ServerUtil.getModules(project);
- if (modules!=null && modules.length!=0) {
- return modules[0];
- }
- return null;
- }
-
- /**
- * Returns the build output location of the <code>project</code> as an
- * <code>IPath</code>, or null if the project has no Java nature.
- *
- * @param project
- * The project.
- * @return The build output location of the <code>project</code> or null
- * if the project has no Java nature.
- */
- public static IPath getJavaOutputLocation(IProject project) {
- IPath outputLocation = null;
- try {
- IJavaProject javaProject = JavaCore.create(project);
- if (javaProject != null) {
- outputLocation = javaProject.getOutputLocation();
- }
- } catch (JavaModelException e) {
- }
- Log log = new EclipseLog();
- log.log(Log.INFO, 5032, ResourceUtils.class, "getJavaOutputLocation",
- "project=" + project + ",outputLocation=" + outputLocation);
-
- return outputLocation;
- }
-
- /**
- * Returns a build source location of the <code>project</code> as an
- * <code>IPath</code>, or null if the project either has no Java nature
- * or if the project's build classpath contains no folders local to the
- * project. If the project has more than one of its own folders on the build
- * classpath, then one of them is chosen arbitrarily as the build source
- * location. To work with all entries on the build classpath, use
- * {@link #getJavaPackageFragmentRoots getJavaPackageFragmentRoots()}or
- * {@link #getJavaClasspath getJavaClasspath()}.
- *
- * @param project
- * The project.
- * @return A build source location of the <code>project</code> or null if
- * the project has no Java nature or if the project's build
- * classpath contains no folders local to the project.
- */
- public static IPath getJavaSourceLocation(IProject project) {
- IPath sourceLocation = null;
- IPackageFragmentRoot[] fragmentRoots = getJavaPackageFragmentRoots(project);
- for (int i = 0; i < fragmentRoots.length && sourceLocation == null; i++) {
- try {
- IResource fragmentRoot = fragmentRoots[i]
- .getCorrespondingResource();
- if (fragmentRoot != null
- && (fragmentRoot.getProject().equals(project))
- && (fragmentRoot.getType() != IResource.FILE)) {
- sourceLocation = fragmentRoot.getFullPath();
- }
- } catch (JavaModelException e) {
- }
- }
-
- Log log = new EclipseLog();
- log.log(Log.INFO, 5030, ResourceUtils.class, "getJavaSourceLocation",
- "project=" + project + ",sourceLocation=" + sourceLocation);
- return sourceLocation;
- }
-
- public static IPath[] getAllJavaSourceLocations(IProject project) {
- Vector pathVector = new Vector();
- IPackageFragmentRoot[] fragmentRoots = getJavaPackageFragmentRoots(project);
-
- for (int i = 0; i < fragmentRoots.length; i++) {
- try {
- IResource fragmentRoot = fragmentRoots[i]
- .getCorrespondingResource();
- if (fragmentRoot != null
- && (fragmentRoot.getProject().equals(project))
- && (fragmentRoot.getType() != IResource.FILE)) {
- pathVector.add(fragmentRoot.getFullPath());
- }
- } catch (JavaModelException e) {
- }
- }
- Log log = new EclipseLog();
- log.log(Log.INFO, 5033, ResourceUtils.class,
- "getAllJavaSourceLocations", "project=" + project);
-
- return (IPath[]) pathVector.toArray(new Path[pathVector.size()]);
- }
-
- /**
- * Returns a build source package fragment root of the <code>project</code>
- * as an <code>IPackageFragmentRoot</code>, or null if the project either
- * has no Java nature or if the project's build classpath contains no
- * folders local to the project. If the project has more than one of its own
- * folders on the build classpath, then one of them is chosen arbitrarily as
- * the build source location.
- *
- * @param project
- * The project.
- * @return A build source package fragment root of the <code>project</code>
- * or null if the project has no Java nature or if the project's
- * build classpath contains no folders local to the project.
- */
- public static IPackageFragmentRoot getJavaSourcePackageFragmentRoot(
- IProject project) {
- IPackageFragmentRoot packageFragmentRoot = null;
- IPath javaSourceLocation = getJavaSourceLocation(project);
- try {
- IJavaProject javaProject = JavaCore.create(project);
- if (javaProject != null) {
- packageFragmentRoot = javaProject
- .findPackageFragmentRoot(javaSourceLocation);
-
- }
- } catch (JavaModelException e) {
- }
- Log log = new EclipseLog();
- log.log(Log.INFO, 5034, ResourceUtils.class,
- "getJavaSourcePackageFragmentRoot", "project=" + project
- + ",sourceLocation=" + javaSourceLocation
- + ",sourcePackageFragmentRoot=" + packageFragmentRoot);
-
- return packageFragmentRoot;
- }
-
- /**
- * Returns the package fragment roots of the <code>project</code> as an
- * array of <code>IPackageFragmentRoot</code> objects. If the project has
- * no Java nature then the returned array will be of length zero.
- *
- * @param project
- * The project.
- * @return The package fragment roots of the <code>project</code>.
- */
- public static IPackageFragmentRoot[] getJavaPackageFragmentRoots(
- IProject project) {
- try {
- IJavaProject javaProject = JavaCore.create(project);
- if (javaProject != null) {
- IPackageFragmentRoot[] packageFragmentRoots = javaProject
- .getPackageFragmentRoots();
- return packageFragmentRoots;
- }
- } catch (JavaModelException e) {
- }
- return new IPackageFragmentRoot[0];
- }
-
- /**
- * Returns the build classpath entries of the <code>project</code> as an
- * array of <code>IClasspathEntry</code> objects. If the project has no
- * Java nature then the returned array will be of length zero.
- *
- * @param project
- * The project.
- * @return The classpath entries of the <code>project</code>.
- */
- public static IClasspathEntry[] getJavaClasspath(IProject project) {
- try {
- IJavaProject javaProject = JavaCore.create(project);
- if (javaProject != null) {
- IClasspathEntry[] classpathEntries = javaProject
- .getRawClasspath();
- return classpathEntries;
- }
- } catch (JavaModelException e) {
- }
- return new IClasspathEntry[0];
- }
-
- /**
- * Returns the container corresponding to the web server module root of the
- * project (ie. the "webApplication" folder) or null if the project has no
- * Web nature.
- *
- * @param project
- * The project.
- * @return The web server module root container or null if the project has
- * no Web nature.
- */
- public static IContainer getWebModuleServerRoot(IProject project) {
- IContainer webModuleServerRoot = null;
- try {
- IProjectNature nature = project
- .getNature(IWebNatureConstants.J2EE_NATURE_ID);
- if (nature != null && (nature instanceof IDynamicWebNature)) {
- IDynamicWebNature webNature = (IDynamicWebNature) nature;
- webModuleServerRoot = webNature.getRootPublishableFolder();
- }
- } catch (CoreException e) {
- }
- Log log = new EclipseLog();
- log.log(Log.INFO, 5035, ResourceUtils.class, "getWebModuleServerRoot",
- "project=" + project + ",webModuleServerRoot="
- + webModuleServerRoot);
-
- return webModuleServerRoot;
- }
-
- /**
- * Returns the URL string corresponding to the web server module root of the
- * project in a server instance or null if the project has no Web nature or
- * has no association to a server instance.
- *
- * @param project
- * The project.
- * @return The web server module root URL or null if the project has no Web
- * nature or has no association to a server instance.
- */
- public static String getWebProjectURL(IProject project,
- String serverFactoryId, IServer server) {
-
- String webProjectURL = null;
- IModule module = getModule(project);
- if (module != null) {
- IServer serverInstance = ServerUtils.getServerForModule(module,
- serverFactoryId, server, true, new NullProgressMonitor());
- if (serverInstance != null) {
-// URL url = ((IURLProvider) serverInstance.getDelegate()).getModuleRootURL(module);
- URL url = ((IURLProvider)serverInstance.getAdapter(IURLProvider.class)).getModuleRootURL(module);
- if (url != null) {
- String s = url.toString();
- webProjectURL = (s.endsWith("/") ? s.substring(0, s
- .length() - 1) : s);
- }
- }
- }
-
- Log log = new EclipseLog();
- log.log(Log.INFO, 5036, ResourceUtils.class, "getWebProjectURL",
- "project=" + project + ",webProjectURL=" + webProjectURL);
-
- return webProjectURL;
- }
-
- /**
- * Returns the forged URL string corresponding to the web server module root
- * of the project in a server instance or null if the project has no Web
- * nature or has no association to a server instance.
- *
- * @param project
- * @return The web server module root URL or null if the project has no Web
- * nature or has no association to a server instance.
- */
-public static String getForgedWebProjectURL(IProject project, String serverFactoryId, IServer server){
-
- String webProjectURL = null;
- IModule module = getModule(project);
- if (module != null)
- {
- //IServer serverInstance = ServerUtils.getServerForModule(module,
- // serverFactoryId, server, true, new NullProgressMonitor());
- if (server != null)
- {
- String hostname = server.getHost();
-
- // get ServerPort
- int portNumber = 0;
-
- IServerPort[] ports = server.getServerPorts();
- IServerPort port = null;
- for (int it = 0; it<ports.length; it++)
- {
- IServerPort p = ports[it];
- String protocol = p.getProtocol();
- if (protocol != null && protocol.trim().toLowerCase().equals("http"))
- {
- port = p;
- portNumber = p.getPort();
- break;
- }
- }
-
-
-
- URL url = null;
- try {
- url = new URL("http", hostname, portNumber, "");
- }
- catch(Exception e){
- e.printStackTrace();
- }
-
-
- //URL url = ((IURLProvider) serverInstance.getDelegate()).getModuleRootURL(module);
-
- if (url != null)
- {
- String s = url.toString();
- webProjectURL = s + "/"+project.getName();
- //webProjectURL = (s.endsWith("/") ? s.substring(0,s.length()-1) : s);
- }
- }
- }
- Log log = new EclipseLog();
- log.log(Log.INFO, 5036, ResourceUtils.class, "getWebProjectURL", "project="+project+",webProjectURL="+webProjectURL);
- return webProjectURL;
- }
- /**
- * Returns the URL string corresponding to the web server module root of the
- * project in a server instance or null if the project has no Web nature or
- * has no association to a server instance.
- *
- * @param project
- * The project.
- * @return The web server module root URL or null if the project has no Web
- * nature or has no association to a server instance.
- */
- public static String getWebProjectURL(IProject project) {
- String webProjectURL = null;
- IModule module = getModule(project);
- if (module != null) {
- IServer serverInstance = ServerUtils.getServerForModule(module);
- if (serverInstance != null) {
- URL url = ((IURLProvider)serverInstance.getAdapter(IURLProvider.class)).getModuleRootURL(module);
- if (url != null) {
- String s = url.toString();
- webProjectURL = (s.endsWith("/") ? s.substring(0, s
- .length() - 1) : s);
- }
- }
- }
- Log log = new EclipseLog();
- log.log(Log.INFO, 5037, ResourceUtils.class, "getWebProjectURL",
- "project=" + project + ",webProjectURL=" + webProjectURL);
-
- return webProjectURL;
- }
-
- public static String getEncodedWebProjectURL(IProject project) {
- String url = getWebProjectURL(project);
- if (url != null) {
- int index = url.lastIndexOf('/');
- if (index != -1) {
- StringBuffer encodedURL = new StringBuffer();
- encodedURL.append(url.substring(0, index + 1));
- String ctxtRoot = URLEncoder.encode(url.substring(index + 1, url.length()));
-
- int plusIndex = ctxtRoot.indexOf('+');
- while (plusIndex != -1) {
- StringBuffer sb = new StringBuffer();
- sb.append(ctxtRoot.substring(0, plusIndex));
- sb.append("%20");
- sb.append(ctxtRoot.substring(plusIndex + 1, ctxtRoot
- .length()));
- ctxtRoot = sb.toString();
- plusIndex = ctxtRoot.indexOf('+');
- }
- encodedURL.append(ctxtRoot);
- url = encodedURL.toString();
- }
- }
- return url;
- }
-
- /**
- * Given the <code>absolutePath</code> of a Java resource, returns the
- * package name of the resource or null if the resource is not properly
- * located in a project or folder on the build classpath or that is the
- * build output path.
- *
- * @param absolutePath
- * The absolute path of the Java resource.
- * @return the package name of the Java resource.
- */
- public static String getJavaResourcePackageName(IPath absolutePath) {
- try {
- IPath javaFolderPath = absolutePath.removeLastSegments(1);
- IProject project = getProjectOf(absolutePath);
- IJavaProject javaProject = JavaCore.create(project);
- if (javaProject != null) {
- IPackageFragment fragment = javaProject
- .findPackageFragment(javaFolderPath);
- if (fragment != null) {
- return fragment.getElementName();
- }
- IPath outputPath = getJavaOutputLocation(project);
- if (outputPath.isPrefixOf(javaFolderPath)) {
- IPath javaPackagePath = javaFolderPath
- .removeFirstSegments(outputPath.segmentCount());
- return javaPackagePath.isEmpty() ? null : javaPackagePath
- .toString().replace(IPath.SEPARATOR, '.');
- }
- }
- } catch (JavaModelException e) {
- }
- return null;
- }
-
- /**
- * Given the <code>absolutePath</code> of a Java resource, returns the
- * package name of the resource as a relative pathname or null if the
- * resource is not properly located in a project or folder on the build
- * classpath.
- *
- * @param absolutePath
- * The absolute path of the Java resource.
- * @return the package name of the Java resource as a relative path.
- */
- public static IPath getJavaResourcePackagePath(IPath absolutePath) {
- String packageName = ResourceUtils
- .getJavaResourcePackageName(absolutePath);
- return (packageName == null ? null : new Path(packageName.replace('.',
- IPath.SEPARATOR)));
- }
-
- /**
- * Given the <code>absolutePath</code> of a Java resource, returns the
- * absolute path of the project or folder that is on the build classpath or
- * is the build output path and that contains the fully qualified Java
- * resource, or null if no such project or folder exists.
- *
- * @param absolutePath
- * The absolute path of the Java resource.
- * @return The absolute path of the project or folder containing the fully
- * qualified Java resource.
- */
- public static IPath getJavaResourceRootPath(IPath absolutePath) {
- try {
- IProject project = getProjectOf(absolutePath);
- IJavaProject javaProject = JavaCore.create(project);
- if (javaProject != null) {
- IPackageFragmentRoot[] pfrs = javaProject
- .getPackageFragmentRoots();
- for (int i = 0; i < pfrs.length; i++) {
- IResource fragmentRoot = pfrs[i].getCorrespondingResource();
- if (fragmentRoot != null) {
- IPath fragmentPath = fragmentRoot.getFullPath();
- if (fragmentPath.isPrefixOf(absolutePath)) {
- return fragmentPath;
- }
- }
- }
- IPath outputPath = getJavaOutputLocation(project);
- if (outputPath.isPrefixOf(absolutePath)) {
- return outputPath;
- }
- }
- } catch (JavaModelException e) {
- }
- return null;
- }
-
- /**
- * Determines an URL (HTTP or FILE) to an Eclipse resource, returning the
- * URL string if successful and false otherwise. A value of null will
- * definitely be returned if any of the following conditions are not met:
- * <ol>
- * <li>The absolute path begins with a Web Project.
- * <li>The leading portion of the absolute path matches the path of the
- * container returned by {#link #getWebModuleServerRoot
- * getWebModuleServerRoot} for the project.
- * <li>The path does not lead to the WEB-INF folder or any descendent
- * thereof.
- * <li>The Web Project is associated with an explicit or default server
- * instance.
- * </ol>
- *
- * @param absolutePath
- * The absolute path of the resource.
- * @return The URL of the file, or null if no URL can be determined.
- */
- public static String getURLFromPath(IPath absolutePath,
- String serverFactoryId, IServer server) {
- return getURLFromPath(absolutePath, getWebProjectURL(
- getProjectOf(absolutePath), serverFactoryId, server));
- }
-
- public static String getURLFromPath(IPath absolutePath, String webProjectURL) {
- StringBuffer url = new StringBuffer();
- IProject project = getProjectOf(absolutePath);
- IContainer webModuleServerRoot = getWebModuleServerRoot(project);
- if (webModuleServerRoot != null) {
- IPath webModuleServerRootPath = webModuleServerRoot.getFullPath();
- if (webModuleServerRootPath.isPrefixOf(absolutePath)) {
- int numSegment = webModuleServerRootPath.segmentCount();
- int numSegmentFromPath = absolutePath.segmentCount();
- if (numSegmentFromPath > numSegment) {
- String nextSegment = absolutePath.segment(numSegment);
- // check if the segment after the WebModuleServerRoot is
- // WEB-INF (ignoring case)
- if (nextSegment != null
- && !nextSegment.equalsIgnoreCase("WEB-INF")) {
- IPath relativePath = absolutePath
- .removeFirstSegments(numSegment);
- if (webProjectURL != null)
- url.append(webProjectURL).append(IPath.SEPARATOR)
- .append(relativePath.toString());
- }
- } else if (numSegmentFromPath == numSegment)
- url.append(webProjectURL);
- }
- }
- if (url.length() < 1) {
- IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
- url.append(getResourceURI(workspace.getFile(absolutePath)));
- }
- Log log = new EclipseLog();
- log.log(Log.INFO, 5038, ResourceUtils.class, "getURLFromPath",
- "absolutePath=" + absolutePath + ",url=" + url);
-
- return url.toString();
- }
-
- /**
- * Creates a file of the given <code>absolutePath</code> and returns its
- * handle as an <code>IFile</code>. If the file cannot be created, a
- * <code>CoreException</code> containing an <code>IStatus</code> object
- * is thrown.
- *
- * @param absolutePath
- * The absolute path of the file to create. The project at the
- * beginning of the path must already exist, that is, this method
- * cannot be used to create projects.
- * @param progressMonitor
- * The progress monitor for the operation, or null.
- * @return The {@link org.eclipse.core.resources.IFile IFile}handle of the
- * file.
- * @throws CoreException
- * An exception containing an
- * {@link org.eclipse.core.runtime.IStatus IStatus}with a
- * severity of <code>IStatus.ERROR</code> and a
- * locale-specific description of the cause.
- */
- // public static IFile createFile (
- // ResourceContext resourceContext,
- // IPath absolutePath,
- // InputStream inputStream,
- // IProgressMonitor progressMonitor,
- // StatusMonitor statusMonitor
- // )
- // throws CoreException
- // {
- // if (!absolutePath.isAbsolute())
- // {
- // throw new CoreException(new
- // Status(IStatus.ERROR,WebServicePlugin.ID,0,WebServicePlugin.getMessage("%MSG_ERROR_PATH_NOT_ABSOLUTE",new
- // Object[] {absolutePath.toString()}),null));
- // }
- // if (absolutePath.segmentCount() < 1)
- // {
- // throw new CoreException(new
- // Status(IStatus.ERROR,WebServicePlugin.ID,0,WebServicePlugin.getMessage("%MSG_ERROR_PATH_EMPTY",new
- // Object[] {absolutePath.toString()}),null));
- // }
- // if (absolutePath.segmentCount() < 2)
- // {
- // throw new CoreException(new
- // Status(IStatus.ERROR,WebServicePlugin.ID,0,WebServicePlugin.getMessage("%MSG_ERROR_PATH_NOT_FOLDER",new
- // Object[] {absolutePath.toString()}),null));
- // }
- // IContainer parent = makeFolderPath(resourceContext,
- // absolutePath.removeLastSegments(1), progressMonitor, statusMonitor);
- // String fileName = absolutePath.lastSegment();
- // return makeFile(resourceContext, parent, fileName, inputStream,
- // progressMonitor, statusMonitor);
- // }
- /**
- * Creates under the given <code>project</code> a file of the given
- * <code>relativePath</code> and returns its handle as an
- * <code>IFile</code>. If the file cannot be created, a
- * <code>CoreException</code> containing an <code>IStatus</code> object
- * is thrown.
- *
- * @param absolutePath
- * The absolute path of the file to create. The project at the
- * beginning of the path must already exist, that is, this method
- * cannot be used to create projects.
- * @param createFolders
- * The intermediate folder creation policy, one of
- * {@link #CREATE CREATE}or {@link #DONT_CREATE DONT_CREATE}.
- * <ul>
- * <li><code>CREATE</code>- If any intermediate folders in
- * the given <code>absolutePath</code> do not exist, they will
- * be created.
- * <li><code>DONT_CREATE</code>- If any intermediate folders
- * in the given <code>absolutePath</code> do not exist, the
- * method will throw a <code>CoreException</code>.
- * </ul>
- * @param overwriteFile
- * The policy for existing files, one of
- * {@link #OVERWRITE OVERWRITE}or
- * {@link #DONT_OVERWRITE DONT_OVERWRITE}.
- * <ul>
- * <li><code>OVERWRITE</code>- If a resource of the same name
- * as the given <code>absolutePath</code> already exists and is
- * a file, it will be replaced. If the resource already exists
- * and it is not a file, then no file will be created and a
- * <code>CoreException</code> will be thrown.
- * <li><code>DONT_OVERWRITE</code>- If any resource of the
- * same name as the given <code>absolutePath</code> already
- * exists, then no file will be created and a
- * <code>CoreException</code> will be thrown.
- * </ul>
- * @param progressMonitor
- * The progress monitor for the operation, or null.
- * @return The {@link org.eclipse.core.resources.IFile IFile}handle of the
- * file.
- * @throws CoreException
- * An exception containing an
- * {@link org.eclipse.core.runtime.IStatus IStatus}with a
- * severity of <code>IStatus.ERROR</code> and a
- * locale-specific description of the cause.
- */
- // public static IFile createFile (
- // ResourceContext resourceContext,
- // IProject project,
- // IPath relativePath,
- // InputStream inputStream,
- // IProgressMonitor progressMonitor,
- // StatusMonitor statusMonitor
- // )
- // throws CoreException
- // {
- // IPath absolutePath = project.getFullPath().append(relativePath);
- // return createFile(resourceContext, absolutePath, inputStream,
- // progressMonitor, statusMonitor);
- // }
- /**
- * Creates an output stream that can be used to write to the given
- * <code>file</code>. Actual changes to the workspace may occur during
- * creation of the stream, while writing to the stream, or when the stream
- * is closed. A <code>CoreException</code> containing an
- * <code>IStatus</code> will be thrown at some point in the lifecycle of
- * the stream if the file resource cannot be created.
- *
- * @param file
- * The {@link org.eclipse.core.resources.IFile IFile}handle of
- * the file resource to create. The project implied by the
- * pathname of the file must already exist, that is, this method
- * cannot be used to create projects.
- * @param progressMonitor
- * The progress monitor for the operation, or null.
- * @return An <code>OutputStream</code> tied to the file resource. Actual
- * checks of or changes to the workspace may occur as early during
- * stream creation, closure, or any time in between.
- * @throws CoreException
- * An exception containing an
- * {@link org.eclipse.core.runtime.IStatus IStatus}with a
- * severity of <code>IStatus.ERROR</code> and a
- * locale-specific description of the cause. Reasons include:
- * <ol>
- * <li>The project of the given file's path does not exist.
- * <li>A non-file resource of the same name of the given file
- * already exists.
- * <li>A file resource of the same name of the given file
- * already exists, and <code>overwriteFile</code> is false.
- * <li>One or more intermediate folders to the given file do
- * not exist, and <code>createFolders</code> is false.
- * </ol>
- */
-
- // public static OutputStream newFileOutputStream (
- // ResourceContext context,
- // IFile file,
- // IProgressMonitor progressMonitor,
- // StatusMonitor statusMonitor
- // )
- // throws CoreException
- // {
- // return new FileResourceOutputStream(context, file, progressMonitor,
- // statusMonitor);
- // }
- /**
- * Copies a set of files from a plugin's installation location to an Eclipse
- * folder. The files are named in an index file located relative to the
- * plugin's installation location.
- *
- * @param plugin
- * The plugin containing the files to copy. Must not be null.
- * @param sourcePath
- * The path, relative to the <code>plugin</code> install
- * location, containing the files to copy. If null, then the
- * plugin install location is the source path (ie. null is
- * equivalent to ".").
- * @param indexPathname
- * A file containing a whitespace-delimitted list of pathnames of
- * the files to copy. The pathnames are relative to the
- * <code>plugin sourcePath</code>. Must not be null.
- * @param targetPath
- * The absolute Eclipse path of the folder to which the files
- * will be copied. The relative pathnames of the files named in
- * the <code>indexPathname</code> file are preserved. Must not
- * be null.
- * @param createFolders
- * The intermediate folder creation policy, one of
- * {@link #CREATE CREATE}or {@link #DONT_CREATE DONT_CREATE}.
- * <ul>
- * <li><code>CREATE</code>- If any intermediate folders in
- * the given <code>absolutePath</code> do not exist, they will
- * be created.
- * <li><code>DONT_CREATE</code>- If any intermediate folders
- * in the given <code>absolutePath</code> do not exist, the
- * method will throw a <code>CoreException</code>.
- * </ul>
- * @param overwriteFiles
- * The policy for existing files, one of
- * {@link #OVERWRITE OVERWRITE}or
- * {@link #DONT_OVERWRITE DONT_OVERWRITE}.
- * <ul>
- * <li><code>OVERWRITE</code>- If a resource of the same name
- * as the given <code>absolutePath</code> already exists and is
- * a file, it will be replaced. If the resource already exists
- * and it is not a file, then no file will be created and a
- * <code>CoreException</code> will be thrown.
- * <li><code>DONT_OVERWRITE</code>- If any resource of the
- * same name as the given <code>absolutePath</code> already
- * exists, then no file will be created and a
- * <code>CoreException</code> will be thrown.
- * </ul>
- * @param progressMonitor
- * The progress monitor for the operation, or null.
- * @throws CoreException
- * An exception containing an
- * {@link org.eclipse.core.runtime.IStatus IStatus}with a
- * severity of <code>IStatus.ERROR</code> and a
- * locale-specific description of the cause.
- */
- // static public void copyIndexedFiles (
- // ResourceContext resourceContext,
- // Plugin plugin,
- // IPath sourcePath,
- // IPath indexPathname,
- // IPath targetPath,
- // IProgressMonitor progressMonitor,
- // StatusMonitor statusMonitor
- // )
- // throws CoreException
- // {
- // try
- // {
- // InputStream input = plugin.openStream(indexPathname);
- // Enumeration filenames = StringUtils.parseFilenamesFromStream(input);
- // copyEnumeratedFiles(resourceContext, plugin, sourcePath, filenames,
- // targetPath, progressMonitor, statusMonitor);
- // }
- // catch (IOException e)
- // {
- // throw new CoreException(new
- // Status(IStatus.ERROR,plugin.getDescriptor().getUniqueIdentifier(),0,WebServicePlugin.getMessage("%MSG_ERROR_IO"),e));
- // }
- // }
- /**
- * Copies a set of files from a plugin's installation location to an Eclipse
- * folder. The files are named in an enumeration.
- *
- * @param plugin
- * The plugin containing the files to copy. Must not be null.
- * @param sourcePath
- * The path, relative to the <code>plugin</code> install
- * location, containing the files to copy. If null, then the
- * plugin install location is the source path (ie. null is
- * equivalent to ".").
- * @param pathnames
- * An enumeration of pathnames of the files to copy. The
- * pathnames are relative to the <code>plugin sourcePath</code>.
- * Must not be null.
- * @param targetPath
- * The absolute Eclipse path of the folder to which the files
- * will be copied. The relative pathnames of the files named in
- * the <code>pathnames</code> enumeration are preserved. Must
- * not be null.
- * @param createFolders
- * The intermediate folder creation policy, one of
- * {@link #CREATE CREATE}or {@link #DONT_CREATE DONT_CREATE}.
- * <ul>
- * <li><code>CREATE</code>- If any intermediate folders in
- * the given <code>absolutePath</code> do not exist, they will
- * be created.
- * <li><code>DONT_CREATE</code>- If any intermediate folders
- * in the given <code>absolutePath</code> do not exist, the
- * method will throw a <code>CoreException</code>.
- * </ul>
- * @param overwriteFiles
- * The policy for existing files, one of
- * {@link #OVERWRITE OVERWRITE}or
- * {@link #DONT_OVERWRITE DONT_OVERWRITE}.
- * <ul>
- * <li><code>OVERWRITE</code>- If a resource of the same name
- * as the given <code>absolutePath</code> already exists and is
- * a file, it will be replaced. If the resource already exists
- * and it is not a file, then no file will be created and a
- * <code>CoreException</code> will be thrown.
- * <li><code>DONT_OVERWRITE</code>- If any resource of the
- * same name as the given <code>absolutePath</code> already
- * exists, then no file will be created and a
- * <code>CoreException</code> will be thrown.
- * </ul>
- * @param progressMonitor
- * The progress monitor for the operation, or null.
- * @throws CoreException
- * An exception containing an
- * {@link org.eclipse.core.runtime.IStatus IStatus}with a
- * severity of <code>IStatus.ERROR</code> and a
- * locale-specific description of the cause.
- */
- // static public void copyEnumeratedFiles (
- // ResourceContext resourceContext,
- // Plugin plugin,
- // IPath sourcePath,
- // Enumeration pathnames,
- // IPath targetPath,
- // IProgressMonitor progressMonitor,
- // StatusMonitor statusMonitor
- // )
- // throws CoreException
- // {
- // while (pathnames.hasMoreElements())
- // {
- // String filename = (String)pathnames.nextElement();
- // copyFile(resourceContext, plugin, sourcePath, new Path(filename),
- // targetPath, progressMonitor, statusMonitor);
- // }
- // }
- /**
- * Copies a file from a plugin's installation location to an Eclipse folder.
- *
- * @param plugin
- * The plugin containing the files to copy. Must not be null.
- * @param sourcePath
- * The path, relative to the <code>plugin</code> install
- * location, containing the files to copy. If null, then the
- * plugin install location is the source path (ie. null is
- * equivalent to ".").
- * @param pathname
- * The pathname of the file to copy. The pathname is relative to
- * the <code>plugin sourcePath</code>. Must not be null.
- * @param targetPath
- * The absolute Eclipse path of the folder to which the file will
- * be copied. The relative pathname of the file is preserved.
- * Must not be null.
- * @param createFolders
- * The intermediate folder creation policy, one of
- * {@link #CREATE CREATE}or {@link #DONT_CREATE DONT_CREATE}.
- * <ul>
- * <li><code>CREATE</code>- If any intermediate folders in
- * the given <code>absolutePath</code> do not exist, they will
- * be created.
- * <li><code>DONT_CREATE</code>- If any intermediate folders
- * in the given <code>absolutePath</code> do not exist, the
- * method will throw a <code>CoreException</code>.
- * </ul>
- * @param overwriteFile
- * The policy for existing files, one of
- * {@link #OVERWRITE OVERWRITE}or
- * {@link #DONT_OVERWRITE DONT_OVERWRITE}.
- * <ul>
- * <li><code>OVERWRITE</code>- If a resource of the same name
- * as the given <code>absolutePath</code> already exists and is
- * a file, it will be replaced. If the resource already exists
- * and it is not a file, then no file will be created and a
- * <code>CoreException</code> will be thrown.
- * <li><code>DONT_OVERWRITE</code>- If any resource of the
- * same name as the given <code>absolutePath</code> already
- * exists, then no file will be created and a
- * <code>CoreException</code> will be thrown.
- * </ul>
- * @param progressMonitor
- * The progress monitor for the operation, or null.
- * @throws CoreException
- * An exception containing an
- * {@link org.eclipse.core.runtime.IStatus IStatus}with a
- * severity of <code>IStatus.ERROR</code> and a
- * locale-specific description of the cause.
- */
- // static public void copyFile (
- // ResourceContext resourceContext,
- // Plugin plugin,
- // IPath sourcePath,
- // IPath pathname,
- // IPath targetPath,
- // IProgressMonitor progressMonitor,
- // StatusMonitor statusMonitor
- // )
- // throws CoreException
- // {
- // try
- // {
- // IPath target = targetPath.append(pathname);
- // IPath source = sourcePath == null ? pathname :
- // sourcePath.append(pathname);
- // InputStream input = plugin.openStream(source);
- // createFile(resourceContext, target, input, progressMonitor,
- // statusMonitor);
- // }
- // catch (IOException e)
- // {
- // throw new CoreException(new
- // Status(IStatus.ERROR,plugin.getDescriptor().getUniqueIdentifier(),0,WebServicePlugin.getMessage("%MSG_ERROR_IO"),e));
- // }
- // }
- /**
- * Copies a set of files from a plugin's installation location to a native
- * directory. The files are named in an index file located relative to the
- * plugin's installation location.
- *
- * @param plugin
- * The plugin containing the files to copy. Must not be null.
- * @param sourcePath
- * The path, relative to the <code>plugin</code> install
- * location, containing the files to copy. If null, then the
- * plugin install location is the source path (ie. null is
- * equivalent to ".").
- * @param indexPathname
- * A file containing a whitespace-delimitted list of pathnames of
- * the files to copy. The pathnames are relative to the
- * <code>plugin sourcePath</code>. Must not be null.
- * @param targetPath
- * The absolute path of the native directory to which the files
- * will be copied. The relative pathnames of the files named in
- * the <code>indexPathname</code> file are preserved. Must not
- * be null.
- * @param progressMonitor
- * The progress monitor for the operation, or null.
- * @throws IOException
- * An exception indicating an IO error has occured.
- */
- static public void copyIndexedFilesToOS(Plugin plugin, IPath sourcePath,
- IPath indexPathname, IPath targetPath,
- IProgressMonitor progressMonitor) throws IOException {
- InputStream input = plugin.openStream(indexPathname);
- Enumeration filenames = StringUtils.parseFilenamesFromStream(input);
- copyEnumeratedFilesToOS(plugin, sourcePath, filenames, targetPath,
- progressMonitor);
- }
-
- /**
- * Copies a set of files from a plugin's installation location to a native
- * directory. The files are named in an enumeration.
- *
- * @param plugin
- * The plugin containing the files to copy. Must not be null.
- * @param sourcePath
- * The path, relative to the <code>plugin</code> install
- * location, containing the files to copy. If null, then the
- * plugin install location is the source path (ie. null is
- * equivalent to ".").
- * @param pathnames
- * An enumeration of pathnames of the files to copy. The
- * pathnames are relative to the <code>plugin sourcePath</code>.
- * Must not be null.
- * @param targetPath
- * The absolute path of the native directory to which the files
- * will be copied. The relative pathnames of the files named in
- * the <code>pathnames</code> enumeration are preserved. Must
- * not be null.
- * @param progressMonitor
- * The progress monitor for the operation, or null.
- * @throws IOException
- * An exception indicating an IO error has occured.
- */
- static public void copyEnumeratedFilesToOS(Plugin plugin, IPath sourcePath,
- Enumeration pathnames, IPath targetPath,
- IProgressMonitor progressMonitor) throws IOException {
- while (pathnames.hasMoreElements()) {
- String filename = (String) pathnames.nextElement();
- copyFileToOS(plugin, sourcePath, new Path(filename), targetPath,
- progressMonitor);
- }
- }
-
- /**
- * Copies a file from a plugin's installation location to a native
- * directory.
- *
- * @param plugin
- * The plugin containing the files to copy. Must not be null.
- * @param sourcePath
- * The path, relative to the <code>plugin</code> install
- * location, containing the files to copy. If null, then the
- * plugin install location is the source path (ie. null is
- * equivalent to ".").
- * @param pathname
- * The pathname of the file to copy. The pathname is relative to
- * the <code>plugin sourcePath</code>. Must not be null.
- * @param targetPath
- * The absolute path of the native directory to which the file
- * will be copied. The relative pathname of the file is
- * preserved. Must not be null.
- * @param progressMonitor
- * The progress monitor for the operation, or null.
- * @throws IOException
- * An exception indicating an IO error has occured.
- */
- static public void copyFileToOS(Plugin plugin, IPath sourcePath,
- IPath pathname, IPath targetPath, IProgressMonitor progressMonitor)
- throws IOException {
- IPath target = targetPath.append(pathname);
- IPath source = sourcePath == null ? pathname : sourcePath
- .append(pathname);
- InputStream input = plugin.openStream(source);
- OutputStream output = new FileOutputStream(target.toOSString());
- copyStream(input, output);
- input.close();
- output.close();
- }
-
- /**
- * Copies data from one stream to another.
- *
- * @param input
- * The input stream.
- * @param output
- * The output stream.
- * @return The number of bytes copied.
- * @throws IOException
- * An exception if an error occurs while processing either of
- * the streams.
- */
- static public int copyStream(InputStream input, OutputStream output)
- throws IOException {
- int t = 0;
- byte[] buffer = new byte[1024];
- int n = input.read(buffer);
- while (n >= 0) {
- output.write(buffer, 0, n);
- t += n;
- n = input.read(buffer);
- }
- return t;
- }
-
- /**
- * Creates a native directory path equal to the parent portion of the given
- * <code>pathname</code>. If the directory already exists, then no action
- * is taken.
- *
- * @param pathname
- * The pathname to the file whose parent directory should be
- * created.
- * @throws IOException
- * An exception if an IO error occurs.
- */
- static public void createParentDirectoryFor(String pathname)
- throws IOException {
- File file = new File(pathname);
- File parent = file.getParentFile();
- if (parent != null) {
- parent.mkdirs();
- }
- }
-
- /**
- * Returns the IResource represented by the given selection.
- *
- * @param object
- * The selection
- * @return IResource if the selection represents an IResource. Returns null
- * otherwise.
- * @throws CoreException
- */
- static public IResource getResourceFromSelection(Object obj)
- throws CoreException {
- IResource res = null;
- if (obj != null) {
- if (obj instanceof IResource) {
- res = (IResource) obj;
- } else if (obj instanceof ICompilationUnit) {
- ICompilationUnit compUnit = (ICompilationUnit) obj;
- res = compUnit.getCorrespondingResource();
- } else if (obj instanceof EnterpriseBean) {
- EnterpriseBean ejbBean = (EnterpriseBean) obj;
- IProject ejbProject = ProjectUtilities.getProject(ejbBean);
- if (ejbProject != null)
- res = ejbProject;
- }
-
- }
-
- return res;
- }
-
- //----------------------------------------------------------------------
- // Naughty bits...
- //----------------------------------------------------------------------
-
- //
- // Creates a path of folders.
- // Do not call with an absolutePath of less than one segment.
- //
- // private static IContainer makeFolderPath (
- // ResourceContext resourceContext,
- // IPath absolutePath,
- // IProgressMonitor progressMonitor,
- // StatusMonitor statusMonitor
- // )
- // throws CoreException
- // {
- // if (absolutePath.segmentCount() <= 1)
- // {
- // return getWorkspaceRoot().getProject(absolutePath.segment(0));
- // }
- // else
- // {
- // IContainer parent = makeFolderPath(resourceContext,
- // absolutePath.removeLastSegments(1), progressMonitor, statusMonitor);
- // String folderName = absolutePath.lastSegment();
- // return makeFolder(resourceContext, parent,folderName, progressMonitor ,
- // statusMonitor);
- // }
- // }
- //
- // Creates a folder under a container.
- // The container must already exist.
- //
- // private static IFolder makeFolder (
- // ResourceContext resourceContext,
- // IContainer parent,
- // String folderName,
- // IProgressMonitor progressMonitor,
- // StatusMonitor statusMonitor
- // )
- // throws CoreException
- // {
- // IResource child = parent.findMember(folderName);
- // if (child == null)
- // {
- // if (!resourceContext.isCreateFoldersEnabled()) {
- // int result = statusMonitor.reportStatus(new
- // Status(IStatus.WARNING,WebServicePlugin.ID,0,
- // WebServicePlugin.getMessage("%MSG_ERROR_FOLDER_CREATION_DISABLED",
- // new Object[] {parent.getFullPath().toString(),folderName}),null),
- // getThreeStateFileOptions());
- // if (result == IStatusDialogConstants.CANCEL_ID)
- // return null;
- //
- // if ( result == IStatusDialogConstants.YES_TO_ALL_ID)
- // resourceContext.setCreateFoldersEnabled(true);
- //
- // }
- // IFolder folder = parent.getFolder(new Path(folderName));
- // folder.create(true,true,progressMonitor);
- // return folder;
- // }
- // else if (child.getType() == IResource.FOLDER)
- // {
- // return (IFolder)child;
- // }
- // else
- // {
- // throw new CoreException(new
- // Status(IStatus.ERROR,WebServicePlugin.ID,0,WebServicePlugin.getMessage("%MSG_ERROR_RESOURCE_NOT_FOLDER",new
- // Object[] {parent.getFullPath().append(folderName).toString()}),null));
- // }
- // }
-
- //
- // Creates a file under a container.
- // The container must already exist.
- //
- // private static IFile makeFile (
- // ResourceContext resourceContext,
- // IContainer parent,
- // String fileName,
- // InputStream inputStream,
- // IProgressMonitor progressMonitor,
- // StatusMonitor statusMonitor
- // )
- // throws CoreException
- // {
- // IResource child = parent.findMember(fileName);
- // if (child != null)
- // {
- // if (child.getType() == IResource.FILE)
- // {
- // if (!resourceContext.isOverwriteFilesEnabled()) {
- // int result = statusMonitor.reportStatus( new
- // Status(IStatus.WARNING,WebServicePlugin.ID,0,
- // WebServicePlugin.getMessage("%MSG_ERROR_FILE_OVERWRITE_DISABLED",
- // new Object[] {parent.getFullPath().toString(),fileName}),null),
- // getThreeStateFileOptions());
- //
- // if (result == IStatusDialogConstants.CANCEL_ID)
- // return null;
- //
- // if ( result == IStatusDialogConstants.YES_TO_ALL_ID)
- // resourceContext.setOverwriteFilesEnabled(true);
- // }
- // //We have permission to overwrite so check if file is read-only
- // if (child.isReadOnly())
- // {
- // if (!resourceContext.isCheckoutFilesEnabled()) {
- //
- // int result = statusMonitor.reportStatus( new
- // Status(IStatus.WARNING,WebServicePlugin.ID,0,
- // WebServicePlugin.getMessage("%MSG_ERROR_FILE_CHECKOUT_DISABLED",
- // new Object[] {parent.getFullPath().toString(),fileName}),null),
- // getThreeStateFileOptions());
- //
- // if (result == IStatusDialogConstants.CANCEL_ID)
- // return null;
- //
- // if ( result == IStatusDialogConstants.YES_TO_ALL_ID)
- // resourceContext.setCheckoutFilesEnabled(true);
- // }
- //
- // IFile[] files = new IFile[1];
- // files[0] = (IFile)child;
- //
- // if (
- // !statusMonitor.reportStatus(getWorkspace().validateEdit(files,null)))
- // return null;
- // }
- //
- // //Change the contents of the existing file.
- // IFile file = parent.getFile(new Path(fileName));
- // file.setContents(inputStream,true,true,progressMonitor);
- // return file;
- //
- // }
- // else
- // {
- // throw new CoreException(new
- // Status(IStatus.ERROR,WebServicePlugin.ID,0,WebServicePlugin.getMessage("%MSG_ERROR_RESOURCE_NOT_FILE",new
- // Object[] {parent.getFullPath().append(fileName)}),null));
- // }
- // }
- // else
- // {
- // //Create a new file.
- // IFile file = parent.getFile(new Path(fileName));
- // file.create(inputStream,true,progressMonitor);
- // return file;
- // }
- // }
-
- /**
- * Deletes a file under a container. The container must already exist.
- *
- * @param file -
- * the IFile to be deleted
- * @param progressMonitor
- * @param statusMonitor
- * @return True if the file does not exist or if it exists and is
- * successfully deleted. False otherwise.
- */
- // public static boolean deleteFile (
- // ResourceContext resourceContext,
- // IFile file,
- // IProgressMonitor progressMonitor,
- // StatusMonitor statusMonitor )
- // throws CoreException
- // {
- // if (file.exists())
- // {
- // if (!resourceContext.isOverwriteFilesEnabled()) {
- // int result = statusMonitor.reportStatus( new
- // Status(IStatus.WARNING,WebServicePlugin.ID,0,
- // WebServicePlugin.getMessage("%MSG_ERROR_FILE_OVERWRITE_DISABLED",
- // new Object[]
- // {file.getParent().getFullPath().toString(),file.getName()}),null),
- // getThreeStateFileOptions());
- //
- // if (result == IStatusDialogConstants.CANCEL_ID)
- // return false;
- //
- // if ( result == IStatusDialogConstants.YES_TO_ALL_ID)
- // resourceContext.setOverwriteFilesEnabled(true);
- // }
- // //We have permission to overwrite so check if file is read-only
- // if (file.isReadOnly())
- // {
- // if (!resourceContext.isCheckoutFilesEnabled()) {
- // int result = statusMonitor.reportStatus( new
- // Status(IStatus.WARNING,WebServicePlugin.ID,0,
- // WebServicePlugin.getMessage("%MSG_ERROR_FILE_CHECKOUT_DISABLED",
- // new Object[]
- // {file.getParent().getFullPath().toString(),file.getName()}),null),
- // getThreeStateFileOptions());
- // if (result == IStatusDialogConstants.CANCEL_ID)
- // return false;
- //
- // if ( result == IStatusDialogConstants.YES_TO_ALL_ID)
- // resourceContext.setCheckoutFilesEnabled(true);
- //
- // }
- // IFile[] files = new IFile[1];
- // files[0] = file;
- //
- // if (
- // !statusMonitor.reportStatus(getWorkspace().validateEdit(files,null)))
- // return false;
- // }
- // file.delete(true,progressMonitor);
- // }
- // //At this point, either the file did not exist or we successfully deleted
- // it. Return success.
- // return true;
- // }
- /**
- * Deletes a folder under a container.
- *
- * @param folder -
- * the IFolder to be deleted
- * @param progressMonitor
- * @param statusMonitor
- * @return True if the folder does not exist or if it exists and is
- * successfully deleted along with its members. False otherwise.
- */
- // public static boolean deleteFolder (
- // ResourceContext resourceContext,
- // IFolder folder,
- // IProgressMonitor progressMonitor,
- // StatusMonitor statusMonitor
- // )
- // throws CoreException
- // {
- // if (!folder.exists()) return true;
- //
- // boolean deleted = true;
- // IResource[] resources = folder.members();
- // for (int i=0; i<resources.length; i++)
- // {
- // IResource resource = resources[i];
- // if (resource instanceof IFile)
- // {
- // deleted = deleteFile(resourceContext, (IFile)resource, progressMonitor,
- // statusMonitor);
- // }
- // if (resource instanceof IFolder)
- // {
- // deleted = deleteFolder( resourceContext, (IFolder)resource,
- // progressMonitor, statusMonitor);
- // }
- //
- // if (!deleted) break;
- // }
- // if (deleted) {
- // folder.delete(true, true, progressMonitor);
- // return true;
- // }
- // else
- // return false;
- //
- // }
- /**
- * Deletes a set of files that are named in an index file located relative
- * to the plugin's installation location.
- *
- * @param plugin
- * The plugin containing the indexed file Must not be null.
- * @param sourcePath -
- * relative path of the indexed file passing a null in has the
- * same effect as passing a "." in
- * @param indexFilePath -
- * the indexed filename Must not be null
- * @param targetPath -
- * path containing the files named in the indexed file Must not
- * be null, this path must end with a trailing separator
- * @param progressMonitor
- */
- // public static void deleteIndexFilesFromOS (
- // Plugin plugin,
- // IPath indexFilePath,
- // IPath targetPath
- // )
- // throws IOException {
- // InputStream input = plugin.openStream(indexFilePath);
- // Enumeration filenames = StringUtils.parseFilenamesFromStream(input);
- // while (filenames.hasMoreElements()) {
- // File targetFile =
- // targetPath.append((String)filenames.nextElement()).toFile();
- // if (targetFile.exists())
- // targetFile.delete();
- // }
- // }
- /**
- * Returns a URI reference to the given Eclipse resource, or null if no such
- * reference can be determined (for example, if the resource does not exist
- * in the underlying filesystem).
- *
- * @param resource
- * The resource.
- * @return The URI as a string, or null if there is no URI to the resource.
- */
- public static String getResourceURI(IResource resource) {
- String uri = null;
- IPath location = resource.getLocation();
- if (location != null) {
- uri = "file:" + location.toString();
- }
- return uri;
- }
-
- /**
- * Returns a URI reference to the given Eclipse resource using the
- * "platform:" protocol, or null if no such reference can be determined (for
- * example, if the resource does not exist in the underlying filesystem).
- *
- * @param resource
- * The resource.
- * @return The URI as a string, or null if there is no URI to the resource.
- */
- public static String getPlatformResourceURI(IResource resource) {
- String uri = null;
- IPath location = resource.getFullPath();
- if (location != null) {
- uri = "platform:/resource" + location.toString();
- }
- return uri;
- }
-
- /**
- * Returns the default binding namespace string given a Java bean name
- * (using the convention used by CTC in GM). e.g. Java bean MyClass result
- * in binding namespace of
- * "http://www.myclass.com/definitions/MyClassRemoteInterface"
- *
- * @param beanName
- * The java bean.
- * @return The binding namespace as a string.
- */
- public static String getBindingNamespace(String beanName) {
- return "http://www." + beanName.toLowerCase() + ".com/definitions/"
- + beanName + "RemoteInterface";
- }
-
- /**
- * Returns the default schema namespace string given a Java bean name (using
- * the convention used by CTC in GM). e.g. Java bean MyClass result in
- * schema namespace of
- * "http://www.myclass.com/schemas/MyClassRemoteInterface"
- *
- * @param beanName
- * The java bean.
- * @return The schemas namespace as a string.
- */
- public static String getSchemaNamespace(String beanName) {
- return "http://www." + beanName.toLowerCase() + ".com/schemas/"
- + beanName + "RemoteInterface";
- }
-
- // public static Vector getThreeStateFileOptions() {
- // Vector options = new Vector();
- // options.add(new
- // StatusOption(IStatusDialogConstants.YES_ID,IStatusDialogConstants.YES_LABEL,"",""));
- // options.add(new
- // StatusOption(IStatusDialogConstants.YES_TO_ALL_ID,IStatusDialogConstants.YES_TO_ALL_LABEL,"",""));
- // options.add(new
- // StatusOption(IStatusDialogConstants.CANCEL_ID,IStatusDialogConstants.CANCEL_LABEL,"",""));
- // return options;
- // }
-
- //----------------------------------------------------------------------
-
- /**
- * Gets the SOAP rpcrouter servlet URL for the service project
- *
- * @param project
- * The project.
- * @param serverFactoryId
- * The server factory id
- * @param server
- * The server
- * @return The URL, possibly null.
- */
-
- public static String getServletURL(IProject project,
- String serverFactoryId, IServer server) {
- return getServletURL(getWebProjectURL(project, serverFactoryId, server));
- }
-
- public static String getServletURL(String webProjectURL) {
- if (webProjectURL == null)
- return null;
- else
- return webProjectURL + SERVLET_EXT;
- }
-
- /**
- * Gets the client Web project name
- *
- * @param projectName
- * The project name to base on.
- * @param typeId the webservice type id.
- * @return The client Web project name.
- */
- public static String getClientWebProjectName(String projectName, String typeId)
- {
- String baseClientWebProjectName = projectName + DEFAULT_CLIENT_WEB_PROJECT_EXT;
- IPath projectPath;
- IProject project;
- boolean foundWebProject = false;
- int i = 1;
-
- if( isSkeletonEJBType( typeId ) )
- {
- // For the skeleton EJB scenario we need to create a slightly different
- // base name. When the EJB project is created another project
- // is created with "Client" tacked onto the end. We will
- // add "WS" to our client so we don't collide with the other
- // client project.
- baseClientWebProjectName = projectName + "WS" + DEFAULT_CLIENT_WEB_PROJECT_EXT;
- }
-
- String clientWebProjectName = baseClientWebProjectName;
-
- while (!foundWebProject)
- {
- projectPath = new Path(clientWebProjectName).makeAbsolute();
- project = ResourceUtils.getProjectOf(projectPath);
-
- if (project.exists() && !ResourceUtils.isWebProject(project))
- {
- clientWebProjectName = baseClientWebProjectName + i;
- i++;
- }
- else
- {
- foundWebProject = true;
- }
- }
-
- return clientWebProjectName;
- }
-
- public static boolean isSkeletonEJBType( String typeID )
- {
- return typeID.equals( "org.eclipse.jst.ws.type.wsdl.ejb" );
- }
-
- public static String getDefaultEJBProjectName() {
- return DEFAULT_EJB_PROJECT_NAME;
- }
-
- public static String getDefaultWebProjectName() {
- return DEFAULT_WEB_PROJECT_NAME;
- }
-
- public static String getRouterProjectName(String projectName) {
- return projectName + DEFAULT_ROUTER_PROJECT_EXT;
- }
-
- public static String getDefaultServiceEARProjectName() {
- return DEFAULT_SERVICE_EAR_PROJECT_NAME;
- }
-
- public static String getDefaultClientEARProjectName() {
- return DEFAULT_CLIENT_EAR_PROJECT_NAME;
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/SelectionToResource.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/SelectionToResource.java
deleted file mode 100644
index 2dd3f48..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/SelectionToResource.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.wst.command.env.core.data.Transformer;
-
-import com.ibm.wtp.emf.workbench.ProjectUtilities;
-
-public class SelectionToResource implements Transformer
-{
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.data.Transformer#transform(java.lang.Object)
- */
- public Object transform(Object value)
- {
- IStructuredSelection selection = (IStructuredSelection)value;
- IResource resource = null;
-
- if( selection != null )
- {
- Object object = selection.getFirstElement();
-
- if( object != null )
- {
- if( object instanceof IResource)
- {
- resource = (IResource)object;
- }
- else if( object instanceof ICompilationUnit )
- {
- ICompilationUnit compUnit = (ICompilationUnit)object;
-
- try
- {
- resource = compUnit.getCorrespondingResource();
- }
- catch( JavaModelException exc)
- {
- }
- }
- else if( object instanceof EnterpriseBean )
- {
- EnterpriseBean ejbBean = (EnterpriseBean)object;
- IProject ejbProject = ProjectUtilities.getProject( ejbBean );
-
- if( ejbProject != null )
- {
- resource = ejbProject;
- }
- }
- }
- }
-
- return resource;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java
deleted file mode 100644
index 4025834..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java
+++ /dev/null
@@ -1,500 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.common;
-
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jst.j2ee.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.internal.servertarget.IServerTargetConstants;
-import org.eclipse.jst.j2ee.internal.servertarget.ServerTargetHelper;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IProjectProperties;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.model.IRunningActionServer;
-
-/**
- * This class contains useful methods for working with Server plugin functions
- */
-public final class ServerUtils {
-
- private MessageUtils msgUtils_;
- private Hashtable serverIdToLabel_;
- private Hashtable serverLabelToId_;
- private static ServerUtils instance_;
-
- public static ServerUtils getInstance() {
- if (instance_ == null) {
- instance_ = new ServerUtils();
- }
- return instance_;
-
- }
-
- public ServerUtils(){
- String pluginId = "org.eclipse.jst.ws";
- msgUtils_ = new MessageUtils(pluginId + ".plugin", this);
- }
-
- // Gets the Server labels given the server factory id
- public void getServerLabelsAndIds() {
- serverIdToLabel_ = new Hashtable();
- serverLabelToId_ = new Hashtable();
- IServerType[] serverTypes = ServerCore.getServerTypes();
- for (int idx = 0; idx < serverTypes.length; idx++) {
-
- IServerType serverType = (IServerType) serverTypes[idx];
-
- String id = serverType.getId();
- String serverLabel = serverType.getName();
- if (!(id == null) && !(serverLabel == null)) {
- serverIdToLabel_.put(id, serverLabel);
- serverLabelToId_.put(serverLabel, id);
- }
- }
- }
-
- public String getServerLabelForId(String factoryId) {
- if (serverIdToLabel_ == null)
- this.getServerLabelsAndIds();
- return (String) serverIdToLabel_.get(factoryId);
- }
-
- public String getServerIdForLabel(String factoryLabel) {
- if (serverLabelToId_ == null)
- this.getServerLabelsAndIds();
- return (String) serverLabelToId_.get(factoryLabel);
- }
-
- public Status modifyModules(Environment env, IServer server, IModule module, boolean add, IProgressMonitor monitor) {
-
- IServerWorkingCopy wc = null;
- Status status = new SimpleStatus("");
- try {
-
- if (module==null || !module.getProject().exists()) {
- return status;
- }
-
-
- // check if module is a true Java project
- if (module instanceof IModule){
- IModule pm = (IModule)module;
- if (pm!=null){
- IProject project = pm.getProject();
- if (project==null || ResourceUtils.isTrueJavaProject(project)) {
- return status;
- }
- }
- }
-
- wc = server.createWorkingCopy();
- if (wc!=null){
- Object x = server.getAdapter(IRunningActionServer.class);
- if (x!=null && x instanceof IRunningActionServer) {
- int state = server.getServerState();
- if (state == IServer.STATE_STOPPED || state == IServer.STATE_UNKNOWN) {
- String mode = ILaunchManager.RUN_MODE;
- server.synchronousStart(mode, monitor);
- }
- }
-
- List list = Arrays.asList(server.getModules());
- if (add) {
- if (!list.contains(module)) {
- ServerUtil.modifyModules(wc, new IModule[] { module}, new IModule[0], monitor);
- }
- }
- else { // removes module
- if (list.contains(module)) {
- ServerUtil.modifyModules(wc, new IModule[0], new IModule[] { module}, monitor);
- }
- }
- }
- else {
- // handle case of Null WC; non-issue for now
- }
- }
- catch (CoreException ce) {
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SERVER"), Status.ERROR, ce);
- env.getStatusHandler().reportError(status);
- return status;
- }
- finally {
- if (wc != null) {
- // Always saveAll and release the serverWorkingCopy
- try {
- wc.saveAll(true, monitor);
- }
- catch(CoreException cex){
- status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SERVER"), Status.ERROR, cex);
- env.getStatusHandler().reportError(status);
- return status;
- }
- }
- }
- return status;
- }
-
-
- public static void modifyModules(IServer server, IModule module, boolean add, IProgressMonitor monitor) {
-
- IServerWorkingCopy wc = null;
- try {
- wc = server.createWorkingCopy();
- if (wc!=null){
- Object x = server.getAdapter(IRunningActionServer.class);
- if (x!=null && x instanceof IRunningActionServer) {
- int state = server.getServerState();
- if (state == IServer.STATE_STOPPED || state == IServer.STATE_UNKNOWN) {
- String mode = ILaunchManager.RUN_MODE;
- server.synchronousStart(mode, monitor);
- }
- }
-
- List list = Arrays.asList(server.getModules());
- if (add) {
- if (!list.contains(module)) {
- ServerUtil.modifyModules(wc, new IModule[] { module}, new IModule[0], monitor);
- }
- }
- else { // removes module
- if (list.contains(module)) {
- ServerUtil.modifyModules(wc, new IModule[0], new IModule[] { module}, monitor);
- }
- }
- }
- }
- catch (CoreException ce) {
- // handle error
- }
- finally{
- try{
- if (wc!=null){
- wc.saveAll(true, monitor);
- }
- }
- catch(CoreException ce){
- //handle error
- }
- }
-
- }
-
- public static IServer getServerForModule(IModule module, String serverTypeId, IServer server, boolean create, IProgressMonitor monitor) {
- if (server != null)
- return server;
- else
- return getServerForModule(module, serverTypeId, create, monitor);
- }
-
- public static IServer getServerForModule(IModule module, String serverTypeId, boolean create, IProgressMonitor monitor) {
- try {
-
- IServer[] servers = ServerUtil.getServersByModule(module, monitor);
-
- if (servers != null && servers.length > 0) {
- if (serverTypeId == null || serverTypeId.length() == 0)
- return servers[0]; // WSAD v4 behavior
-
- for (int i = 0; i < servers.length; i++) {
- if (servers[i].getServerType().getId().equalsIgnoreCase(serverTypeId))
- return servers[i];
- }
- }
-
- return createServer(module, serverTypeId, create, monitor);
-
- }
- catch (Exception e) {
- return null;
- }
- }
-
- public static IServer getServerForModule(IModule module) {
- try {
- IServer[] servers = ServerUtil.getServersByModule(module, null);
- return ((servers != null && servers.length > 0) ? servers[0] : null);
- }
- catch (Exception e) {
- return null;
- }
- }
-
- public IServer createServer(Environment env, IModule module, String serverTypeId, boolean create, IProgressMonitor monitor){
- IServerWorkingCopy serverWC = null;
- IServer server = null;
- try {
- IServerType serverType = ServerCore.findServerType(serverTypeId);
- serverWC = serverType.createServer(serverTypeId, null, monitor);
- server = serverWC.getOriginal();
- if (server != null) {
- Object x = server.getAdapter(IRunningActionServer.class);
- if (x!=null && x instanceof IRunningActionServer) {
- int state = server.getServerState();
- if (state == IServer.STATE_STOPPED || state == IServer.STATE_UNKNOWN) {
- String mode = ILaunchManager.RUN_MODE;
- server.synchronousStart(mode, monitor);
- }
- }
-
- if (module != null && module.getProject().exists()) {
- IModule[] parentModules = server.getRootModules(module, monitor);
- if (parentModules!=null && parentModules.length!=0) {
- module = (IModule)parentModules[0];
- }
- serverWC.modifyModules(new IModule[] { module}, new IModule[0], monitor);
- }
- }
-
- return server;
- }
- catch (Exception e) {
- Status status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SERVER"), Status.ERROR, e);
- env.getStatusHandler().reportError(status);
- return null;
- }
- finally{
- try{
- if (serverWC!=null){
- serverWC.saveAll(true, monitor);
- }
- }
- catch(CoreException ce){
- Status status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_SERVER"), Status.ERROR, ce);
- env.getStatusHandler().reportError(status);
- return null;
- //handler core exception
- }
- }
- }
-
- public static IServer createServer(IModule module, String serverTypeId, boolean create, IProgressMonitor monitor) {
- IServerWorkingCopy serverWC = null;
- IServer server= null;
- try {
- IServerType serverType = ServerCore.findServerType(serverTypeId);
- serverWC = serverType.createServer(serverTypeId, null, monitor);
- server = serverWC.getOriginal();
- if (server != null) {
- Object x = server.getAdapter(IRunningActionServer.class);
- if (x!=null && x instanceof IRunningActionServer) {
- int state = server.getServerState();
- if (state == IServer.STATE_STOPPED || state == IServer.STATE_UNKNOWN) {
- String mode = ILaunchManager.RUN_MODE;
- server.synchronousStart(mode, monitor);
- }
- }
-
- if (module != null) {
- IModule[] parentModules = server.getRootModules(module, monitor);
- if (parentModules!=null && parentModules.length!=0) {
- module = (IModule)parentModules[0];
- }
- serverWC.modifyModules(new IModule[] { module}, new IModule[0], monitor);
- }
- }
-
- return server;
- }
- catch (Exception e) {
- return null;
- }
- finally{
- try{
- if (serverWC!=null){
- serverWC.saveAll(true, monitor);
- }
- }
- catch(CoreException ce){
- return null;
- //handler core exception
- }
- }
- }
-
- public static String[] getServerTypeIdsByModule(IProject project) {
- Vector serverIds = new Vector();
- if (project != null) {
- IServer[] servers = ServerUtil.getServersByModule(ResourceUtils.getModule(project), null);
- if (servers != null && servers.length > 0) {
- for (int i = 0; i < servers.length; i++) {
- serverIds.add(servers[i].getId());
- }
- }
- }
- return (String[]) serverIds.toArray(new String[serverIds.size()]);
- }
-
- public static IServer getDefaultExistingServer(IProject project) {
- String defaultServerName;
-
- //IServerPreferences serverPreferences = ServerCore.getServerPreferences();
- IProjectProperties props = ServerCore.getProjectProperties(project);
- IServer preferredServer = props.getDefaultServer();
- //IServer preferredServer = serverPreferences.getDeployableServerPreference(ResourceUtils.getModule(project));
- if (preferredServer != null)
- return preferredServer;
-
- IServer[] configuredServers = ServerUtil.getServersByModule(ResourceUtils.getModule(project), null);
- if (configuredServers != null && configuredServers.length > 0) { return configuredServers[0]; }
-
- IServer[] nonConfiguredServers = ServerUtil.getAvailableServersForModule(ResourceUtils.getModule(project), false, null);
- if (nonConfiguredServers != null && nonConfiguredServers.length > 0) { return nonConfiguredServers[0]; }
- return null;
- }
-
-
- /*
- * @param moduleType - ad defined in IServerTargetConstants (i.e. EAR_TYPE, WEB_TYPE, etc.)
- * @param j2eeVersion String representation of the int values in J2EEVersionConstants
- * i.e. "12" or "13" or "14"
- * @return String the id of the server target - to be used in project creation operations.
- */
- public static String getServerTargetIdFromFactoryId(String serverFactoryId, String moduleType, String j2eeVersion)
- {
- IServerType serverType = ServerCore.findServerType(serverFactoryId);
- if (serverType == null)
- return null;
-
- String serverRuntimeTypeId = serverType.getRuntimeType().getId();
-
- String stJ2EEVersion = ServerUtils.getServerTargetJ2EEVersion(j2eeVersion);
- List runtimes = ServerTargetHelper.getServerTargets(moduleType, stJ2EEVersion);
- for (int i=0; i<runtimes.size(); i++)
- {
- IRuntime runtime = (IRuntime)runtimes.get(i);
- String thisRuntimeTypeId = runtime.getRuntimeType().getId();
- if (thisRuntimeTypeId.equals(serverRuntimeTypeId))
- {
- return runtime.getId();
- }
- }
-
- return null;
- }
-
- /*
- * @param serverFactoryId the server's factory id
- * @returns the runtime type id given the server's factory id. Returns a blank String if the no ServerType exists for the given factory id.
- */
- public static String getRuntimeTargetIdFromFactoryId(String serverFactoryId)
- {
- IServerType serverType = ServerCore.findServerType(serverFactoryId);
- if (serverType!=null)
- {
- String serverRuntimeId = serverType.getRuntimeType().getId();
- return serverRuntimeId;
- }
- else
- return "";
- }
-
- /*
- * @param serverFactoryId the server's factory id
- * @returns the server type id given the server's factory id. Returns a blank String if the no ServerType exists for the given factory id.
- */
- public static String getServerTypeIdFromFactoryId(String serverFactoryId)
- {
- IServerType serverType = ServerCore.findServerType(serverFactoryId);
- if (serverType!=null)
- {
- String serverTypeId = serverType.getId();
- return serverTypeId;
- }
- else
- return "";
- }
-
- /*
- * @param j2eeVersion String representation of the int values in J2EEVersionConstants
- * i.e. "12" or "13" or "14"
- */
- public static boolean isTargetValidForEAR(String runtimeTargetId, String j2eeVersion)
- {
- if (runtimeTargetId == null)
- return false;
-
- String earModuleType = IServerTargetConstants.EAR_TYPE;
- String stJ2EEVersion = ServerUtils.getServerTargetJ2EEVersion(j2eeVersion);
- List runtimes = ServerTargetHelper.getServerTargets(earModuleType, stJ2EEVersion);
- for (int i=0; i<runtimes.size(); i++ )
- {
- IRuntime runtime = (IRuntime)runtimes.get(i);
- String thisId = runtime.getRuntimeType().getId();
- if (thisId.equals(runtimeTargetId))
- return true;
- }
-
- return false;
- }
- /*
- * @param j2eeVersion String representation of the int values in J2EEVersionConstants
- * i.e. "12" or "13" or "14"
- * @param the project type from IServerTargetConstants
- */
- public static boolean isTargetValidForProjectType(String runtimeTargetId, String j2eeVersion, String projectType)
- {
- if (runtimeTargetId == null)
- return false;
-
- if (projectType==null || projectType.length()==0)
- return false;
-
- String stJ2EEVersion = ServerUtils.getServerTargetJ2EEVersion(j2eeVersion);
- List runtimes = ServerTargetHelper.getServerTargets(projectType, stJ2EEVersion);
- for (int i=0; i<runtimes.size(); i++ )
- {
- IRuntime runtime = (IRuntime)runtimes.get(i);
- String thisId = runtime.getRuntimeType().getId();
- if (thisId.equals(runtimeTargetId))
- return true;
- }
-
- return false;
- }
-
- public static String getServerTargetJ2EEVersion(String j2eeVersion)
- {
- String stJ2EEVersion = null;
- if (j2eeVersion==null || j2eeVersion.length()==0)
- return null;
-
- int j2eeVersionInt = Integer.parseInt(j2eeVersion);
- switch (j2eeVersionInt)
- {
- case (J2EEVersionConstants.J2EE_1_2_ID):
- return IServerTargetConstants.J2EE_12;
- case (J2EEVersionConstants.J2EE_1_3_ID):
- return IServerTargetConstants.J2EE_13;
- case (J2EEVersionConstants.J2EE_1_4_ID):
- return IServerTargetConstants.J2EE_14;
- default:
- return null;
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/StatusObjectHandler.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/StatusObjectHandler.java
deleted file mode 100644
index 52f0fe9..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/StatusObjectHandler.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.common;
-
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.util.WrappedException;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-
-
-public class StatusObjectHandler
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- private static final int MAX_DETAILS = 16;
-
- public static IStatus generateTreeStatus (IStatus status)
- {
- //
- // There could be lots of Throwables, CoreExceptions,
- // WrappedExceptions and IStatus objects beneath the
- // given status. Find them.
- //
- LinkedList statusList = new LinkedList();
- appendStatus(MAX_DETAILS, statusList, status, status.getSeverity());
- if (statusList.size() > 0)
- {
- IStatus newStatus = (IStatus)statusList.removeFirst();
- if (statusList.size() > 0)
- {
- IStatus[] secondaryStatusArray = new IStatus[statusList.size()];
- int n = 0;
- Iterator i = statusList.iterator();
- while (i.hasNext())
- {
- secondaryStatusArray[n++] = (IStatus)i.next();
- }
- newStatus = new MultiStatus(status.getPlugin(),status.getCode(),secondaryStatusArray,status.getMessage(),status.getException());
- }
- return newStatus;
- }
- else
- return null;
- }
-
- //
- // Appends zero or more IStatus objects to the list of IStatus objects
- // based upon an IStatus.
- //
- private static int appendStatus ( int max, List statusList, IStatus status, int severity )
- {
- if (max > 0 && status != null)
- {
- //
- // Append an IStatus object for the given status' message.
- //
- if (status.getMessage() != null)
- {
- max = append(statusList,max,severity,status.getPlugin(),status.getCode(),status.getMessage(),status.getException());
- }
- //
- // Append the IStatus' Throwable, if any.
- //
- max = appendThrowable(max,statusList,status.getException(),severity);
- //
- // If the IStatus is a multi status, append the children.
- //
- IStatus[] children = status.getChildren();
- for (int i=0; i<children.length && max>0; i++)
- {
- max = appendStatus(max,statusList,children[i],severity);
- }
- }
- return max;
- }
-
- //
- // Appends zero or more IStatus objects to the list of IStatus objects
- // based upon a Throwable. WrappedExceptions and CoreExceptions are
- // given special treatment.
- //
- private static int appendThrowable ( int max, List statusList, Throwable throwable, int severity )
- {
- if (max > 0 && throwable != null)
- {
- //
- // Append an IStatus object for the exception's message.
- //
- if (throwable.getLocalizedMessage() != null)
- {
- max = append(statusList,max,severity,WebServicePlugin.ID,0,throwable.getLocalizedMessage(),throwable);
- }
- //
- // If the exception is a WrappedException, append the wrapped Exception.
- //
- if (throwable instanceof WrappedException)
- {
- WrappedException wexc = (WrappedException)throwable;
- max = appendThrowable(max,statusList,wexc.exception(),severity);
- }
- //
- // If the exception is a CoreException, append the enclosed IStatus.
- //
- if (throwable instanceof CoreException)
- {
- CoreException cexc = (CoreException)throwable;
- max = appendStatus(max,statusList,cexc.getStatus(),severity);
- }
- }
- return max;
- }
-
- //
- // Creates and appends an IStatus to the list of IStatus objects.
- //
- private static int append ( List statusList, int max, int severity, String id, int code, String message, Throwable throwable )
- {
- if (max > 0)
- {
- IStatus status = new Status(severity,id,code,message,throwable);
- statusList.add(status);
- max--;
- }
- return max;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/StringToIProjectTransformer.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/StringToIProjectTransformer.java
deleted file mode 100644
index d833e13..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/StringToIProjectTransformer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.common;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.command.env.common.FileResourceUtils;
-import org.eclipse.wst.command.env.core.data.Transformer;
-
-
-/**
- * Transfroms a java.lang.String to an org.eclipse.core.runtime.IProject
- */
-public class StringToIProjectTransformer implements Transformer
-{
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.data.Transformer#transform(java.lang.Object)
- * @param Object This must be a java.lang.String
- * @return Object Returns an IProject
- */
- public Object transform(Object value)
- {
- IProject project = null;
- String valueString = (String)value;
- if (valueString.length() > 0)
- project = FileResourceUtils.getWorkspaceRoot().getProject((String)value);
-
- return project;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/StringUtils.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/StringUtils.java
deleted file mode 100644
index 5d9fd9b..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/StringUtils.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.common;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.JavaConventions;
-
-/**
- * This class contains some useful string utilities that are not provided by
- * either String or StringBuffer.
- *
- * @author Peter Moogk
- * @date July 13, 2000
-**/
-public final class StringUtils
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * The platform-specific line separator.
- */
- public static final String NEWLINE = System.getProperty("line.separator");
-
- private StringUtils(){};
-
- /**
- * This method splits a single line of text into multiple lines
- * based on a maximum line length. The method will try to fit as
- * many words as possible onto a line without exceeding the maximum
- * line length. Note: the only case where a line might exceed the
- * maximum is if a single word is longer than the maximum.
- **/
- public static String[] splitter( String text, int max_length )
- {
- Vector return_text = new Vector(20);
- String[] return_str;
- int index = 0;
-
- while( index < text.length() )
- {
- String str = text.substring( index, Math.min( max_length + index,
- text.length() ) );
- int space_index = str.lastIndexOf( " " );
-
- if( index + str.length() < text.length() &&
- text.charAt( index + str.length() - 1 ) != ' ' &&
- text.charAt( index + str.length() ) != ' ' &&
- space_index != -1 )
- {
- return_text.addElement( str.substring( 0, space_index ) );
- index += space_index + 1;
- }
- else
- {
- return_text.addElement( str.trim() );
- index += str.length();
- }
- }
-
- return_str = new String[return_text.size()];
-
- for( index = 0; index < return_text.size(); index++ )
- {
- return_str[index] = (String)(return_text.elementAt(index));
- }
-
- return return_str;
- }
-
- /**
- * This method returns a string with a repeated number of characters.
- **/
- static public String repeat( char the_char, int count )
- {
- StringBuffer buf = new StringBuffer( count );
-
- for( int index = 0; index < count; index++ )
- {
- buf.append( the_char );
- }
-
- return buf.toString();
- }
-
- /**
- * This method flattens an array of arguments to a string.
- * The method respects embedded whitespace and quotes.
- * <ul>
- * <li>Any argument with embedded whitespace will be flattened out
- * with enclosing quotes. For example, the single argument
- * <u>Hello World</u>
- * will be returned as
- * <u>"Hello World"</u>.
- * <li>Any argument with quotes will be flattened out with the
- * quotes escaped. For example, the single argument
- * <u>"Happy days"</u>
- * will be returned as
- * <u>\"Happy days\"</u>.
- * </ul>
- * @param arguments The array of strings to flatten.
- * @return the flattened string.
- */
- static public String flattenArguments ( String[] arguments )
- {
- StringBuffer buf = new StringBuffer();
-
- for (int i=0; i<arguments.length; i++)
- {
- //
- // Append a separator (except the first time).
- //
- if (i > 0) buf.append(' ');
-
- //
- // Look for whitespace.
- //
- boolean whitespace = false;
- char[] chars = arguments[i].toCharArray();
- for (int j=0; !whitespace && j<chars.length; j++)
- {
- if (Character.isWhitespace(chars[j]))
- {
- whitespace = true;
- }
- }
-
- //
- // Append the argument, quoted as necessary.
- //
- if (whitespace) buf.append('"');
- for (int j=0; j<chars.length; j++)
- {
- if (chars[j] == '"') buf.append('\\');
- buf.append(chars[j]);
- }
- if (whitespace) buf.append('"');
- }
-
- return buf.toString();
- }
-
- /**
- * This method parses whitespace-delimitted filenames from
- * the given <code>input</code> stream. <b>Limitation:</b>
- * Quoted filenames or filenames with embedded whitespace
- * are not currently supported.
- * @param input The input stream.
- * @return An enumeration of filenames from the stream.
- */
- static public Enumeration parseFilenamesFromStream ( InputStream input )
- throws IOException
- {
- Vector filenames = new Vector(64,64);
- StringBuffer buffer = null;
- byte state = STATE_WS;
- int ic = input.read();
- while (ic >= 0)
- {
- char c = (char)ic;
- switch (state)
- {
- case STATE_WS:
- if (!Character.isWhitespace(c))
- {
- buffer = new StringBuffer();
- buffer.append(c);
- state = STATE_NWS;
- }
- break;
- case STATE_NWS:
- if (!Character.isWhitespace(c))
- {
- buffer.append(c);
- }
- else
- {
- String filename = buffer.toString();
- filenames.add(filename);
- buffer = null;
- state = STATE_WS;
- }
- break;
- default:
- break;
- }
- ic = input.read();
- }
- return filenames.elements();
- }
-
- private static final byte STATE_WS = 0;
- private static final byte STATE_NWS = 1;
-
-
- /**
- * Returns true is the type passed in is a primtive java type
- * @param class name String
- * @return true is primitive type
- */
- public static boolean isPrimitiveType(String typeName)
- {
-
- if (typeName.equalsIgnoreCase("boolean") ||
- typeName.equalsIgnoreCase("byte") ||
- typeName.equalsIgnoreCase("double") ||
- typeName.equalsIgnoreCase("float") ||
- typeName.equalsIgnoreCase("int") ||
- typeName.equalsIgnoreCase("long") ||
- typeName.equalsIgnoreCase("short") ||
- typeName.equalsIgnoreCase("char"))
- return true;
- return false;
-
- }
-
- /**
- * The method replace the characters that are allowed in URIs
- * and not allowed in Java class names to an underscore ('_')
- * @param URI String
- * @return valid Java class name String
- */
- public static String URI2ClassName( String uri ) {
- String className = uri;
- for ( int i = 0; i < URI_SYMBOLS.length; i++ ) {
- className = className.replace ( URI_SYMBOLS[i], UNDERSCORE );
- }
- return className;
- }
-
- private static final char[] URI_SYMBOLS = {'-', '~', '#', '/', '.'};
- private static final char UNDERSCORE = '_';
-
-
- /**
- * This returns a valid Java identifier based on the given name.
- * (follows JAX-RPC 1.0 Public Review Draft 2 recommendations)
- */
- public static String javaIdentifierFor(String localName)
- {
- StringBuffer result = new StringBuffer();
- boolean skipped = false;
- for (int i = 0, length = localName.length(); i < length; ++i)
- {
- char character = localName.charAt(i);
- if (Character.isJavaIdentifierPart(character) && !isDelimiter(character))
- {
- if (skipped && result.length() != 0)
- {
- character = Character.toUpperCase(character);
- }
- result.append(character);
- skipped = false;
- }
- else
- {
- skipped =true;
- }
- }
-
- if (!JavaConventions.validateIdentifier(result.toString()).isOK())
- {
- result.insert(0, "_");
- }
-
- return result.toString();
- }
-
- private static boolean isDelimiter(char character)
- {
- return "\u002D\u002E\u003A\u005F\u00B7\u0387\u06DD\u06DE".indexOf(character) != -1;
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/PersistentProjectTopologyContext.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/PersistentProjectTopologyContext.java
deleted file mode 100644
index a0a666d..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/PersistentProjectTopologyContext.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.context;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.context.PersistentContext;
-
-
-public class PersistentProjectTopologyContext extends PersistentContext implements ProjectTopologyContext
-{
-
-public PersistentProjectTopologyContext ()
-{
- super( WebServicePlugin.getInstance());
-}
- public void load() {
- String[] ids = ProjectTopologyDefaults.getClientTypes();
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < ids.length; i++)
- {
- if (i != 0)
- sb.append(" ");
- sb.append(ids[i]);
- }
- setDefault(PREFERENCE_CLIENT_TYPES, sb.toString());
- setDefault(PREFERENCE_USE_TWO_EARS, ProjectTopologyDefaults.isUseTwoEARs());
- }
-
- public void setClientTypes(String[] ids)
- {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < ids.length; i++)
- {
- if (i != 0)
- sb.append(" ");
- sb.append(ids[i]);
- }
- setValue(PREFERENCE_CLIENT_TYPES, sb.toString());
- }
-
- public String[] getClientTypes()
- {
- StringTokenizer st = new StringTokenizer(getValueAsString(PREFERENCE_CLIENT_TYPES));
- String[] s = new String[st.countTokens()];
- for (int i = 0; i < s.length; i++)
- s[i] = st.nextToken();
- return s;
- }
-
- public void setUseTwoEARs(boolean use)
- {
- setValue(PREFERENCE_USE_TWO_EARS, use);
- }
- public boolean isUseTwoEARs()
- {
- return getValueAsBoolean(PREFERENCE_USE_TWO_EARS);
- }
-
- public ProjectTopologyContext copy() {
- TransientProjectTopologyContext context = new TransientProjectTopologyContext();
- context.setClientTypes(getClientTypes());
- context.setUseTwoEARs(isUseTwoEARs());
- return context;
-}
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/PersistentScenarioContext.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/PersistentScenarioContext.java
deleted file mode 100644
index 9eaf046..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/PersistentScenarioContext.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.context;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestExtension;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.context.PersistentContext;
-
-
-public class PersistentScenarioContext extends PersistentContext implements ScenarioContext
-{
- public PersistentScenarioContext()
- {
- super(WebServicePlugin.getInstance());
- }
-
- public void load()
- {
- ScenarioDefaults defaults = new ScenarioDefaults();
- String[] ids = defaults.getWebServiceTestTypes();
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < ids.length; i++)
- {
- if (i != 0) sb.append(",");
- sb.append(ids[i]);
- }
- String nonJavaTestService = defaults.getNonJavaTestServiceDefault();
- setDefaultStringIfNoDefault(PREFERENCE_WEBSERVICE_TEST_TYPES, sb.toString());
- setDefaultStringIfNoDefault(PREFERENCE_NON_JAVA_TEST_SERVICE, nonJavaTestService);
-
- setDefaultStringIfNoDefault(PREFERENCE_CLIENT_WEBSERVICE_TYPE, defaults.webserviceClientTypeDefault() );
- setDefaultStringIfNoDefault(PREFERENCE_WEBSERVICE_TYPE, defaults.webserviceTypeIdDefault() );
- setDefaultBooleanIfNoDefault(PREFERENCE_GENERATE_PROXY, defaults.generateProxyDefault() );
- setDefaultBooleanIfNoDefault(PREFERENCE_LAUNCH_WEBSERVICE_EXPLORER, defaults.launchWebserviceExplorerDefault() );
- setDefaultBooleanIfNoDefault(PREFERENCE_START_WEBSERVICE, defaults.startWebserviceDefault() );
- setDefaultBooleanIfNoDefault(PREFERENCE_TEST_WEBSERVICE, defaults.testWebserviceDefault() );
- setDefaultBooleanIfNoDefault(PREFERENCE_MONITOR_WEBSERVICE, defaults.getMonitorWebServiceDefault());
- setDefaultBooleanIfNoDefault(PREFERENCE_LAUNCH_SAMPLE, defaults.launchSample() );
- }
-
- public String getNonJavaTestService()
- {
- WebServiceTestRegistry registry = WebServiceTestRegistry.getInstance();
- String[] testTypes = getWebServiceTestTypes();
- for (int i = 0; i < testTypes.length; i++)
- {
- WebServiceTestExtension wse = (WebServiceTestExtension) registry
- .getWebServiceExtensionsByName(testTypes[i]);
- if (!wse.isJava()) return testTypes[i];
- }
- return "";
- }
-
- public void setWebServiceTestTypes(String[] ids)
- {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < ids.length; i++)
- {
- if (i != 0) sb.append(",");
- sb.append(ids[i]);
- }
- setValue(PREFERENCE_WEBSERVICE_TEST_TYPES, sb.toString());
- }
-
- public String[] getWebServiceTestTypes()
- {
- StringTokenizer st = new StringTokenizer(
- getValueAsString(PREFERENCE_WEBSERVICE_TEST_TYPES), ",");
- String[] s = new String[st.countTokens()];
- for (int i = 0; i < s.length; i++)
- s[i] = st.nextToken();
- return s;
- }
-
- public ScenarioContext copy()
- {
- TransientScenarioContext context = new TransientScenarioContext();
- context.setWebServiceTestTypes(getWebServiceTestTypes());
- context.setNonJavaTestService(getNonJavaTestService());
-
- context.setClientWebServiceType( getClientWebServiceType() );
- context.setWebServiceType( getWebServiceType() );
- context.setLaunchWebServiceExplorer( getLaunchWebServiceExplorer() );
- context.setStartWebService( getStartWebService() );
- context.setGenerateProxy( getGenerateProxy() );
- context.setTestWebService( getTestWebService() );
- context.setMonitorWebService(getMonitorWebService());
- context.setLaunchSampleEnabled( isLaunchSampleEnabled() );
-
- return context;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getClientWebServiceType()
- */
- public String getClientWebServiceType()
- {
- return getValueAsString(PREFERENCE_CLIENT_WEBSERVICE_TYPE);
- }
-
- public String getClientWebServiceTypeDefault()
- {
- return getDefaultString(PREFERENCE_CLIENT_WEBSERVICE_TYPE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getGenerateProxy()
- */
- public boolean getGenerateProxy()
- {
- return getValueAsBoolean(PREFERENCE_GENERATE_PROXY);
- }
-
- public boolean getGenerateProxyDefault()
- {
- return getDefaultBoolean(PREFERENCE_GENERATE_PROXY);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getLaunchWebServiceExplorer()
- */
- public boolean getLaunchWebServiceExplorer()
- {
- return getValueAsBoolean(PREFERENCE_LAUNCH_WEBSERVICE_EXPLORER);
- }
-
- public boolean getLaunchWebServiceExplorerDefault()
- {
- return getDefaultBoolean(PREFERENCE_LAUNCH_WEBSERVICE_EXPLORER);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getStartWebService()
- */
- public boolean getStartWebService()
- {
- return getValueAsBoolean(PREFERENCE_START_WEBSERVICE);
- }
-
- public boolean getStartWebServiceDefault()
- {
- return getDefaultBoolean(PREFERENCE_START_WEBSERVICE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getTestWebService()
- */
- public boolean getTestWebService()
- {
- return getValueAsBoolean(PREFERENCE_TEST_WEBSERVICE);
- }
-
- public boolean getTestWebServiceDefault()
- {
- return getDefaultBoolean(PREFERENCE_TEST_WEBSERVICE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getWebServiceType()
- */
- public String getWebServiceType()
- {
- return getValueAsString(PREFERENCE_WEBSERVICE_TYPE);
- }
-
- public String getWebServiceTypeDefault()
- {
- return getDefaultString(PREFERENCE_WEBSERVICE_TYPE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setClientWebServiceType(java.lang.String)
- */
- public void setClientWebServiceType(String value)
- {
- setValue( PREFERENCE_CLIENT_WEBSERVICE_TYPE, value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setGenerateProxy(boolean)
- */
- public void setGenerateProxy(boolean value)
- {
- setValue( PREFERENCE_GENERATE_PROXY, value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setLaunchWebServiceExplorer(boolean)
- */
- public void setLaunchWebServiceExplorer(boolean value)
- {
- setValue( PREFERENCE_LAUNCH_WEBSERVICE_EXPLORER, value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setStartWebService(boolean)
- */
- public void setStartWebService(boolean value)
- {
- setValue( PREFERENCE_START_WEBSERVICE, value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setTestWebService(boolean)
- */
- public void setTestWebService(boolean value)
- {
- setValue( PREFERENCE_TEST_WEBSERVICE, value);
- }
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setWebServiceType(java.lang.String)
- */
- public void setWebServiceType(String value)
- {
- setValue( PREFERENCE_WEBSERVICE_TYPE, value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getMonitorWebService()
- */
- public boolean getMonitorWebService()
- {
- return getValueAsBoolean(PREFERENCE_MONITOR_WEBSERVICE);
- }
-
- public boolean getMonitorWebServiceDefault()
- {
- return getDefaultBoolean(PREFERENCE_MONITOR_WEBSERVICE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setMonitorWebService(boolean)
- */
- public void setMonitorWebService(boolean value)
- {
- setValue(PREFERENCE_MONITOR_WEBSERVICE, value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getLaunchSampleEnabledDefault()
- */
- public boolean getLaunchSampleEnabledDefault()
- {
- return getDefaultBoolean(PREFERENCE_LAUNCH_SAMPLE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#isLaunchSampleEnabled()
- */
- public boolean isLaunchSampleEnabled()
- {
- return getValueAsBoolean(PREFERENCE_LAUNCH_SAMPLE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setLaunchSampleEnabled(boolean)
- */
- public void setLaunchSampleEnabled(boolean value)
- {
- setValue( PREFERENCE_LAUNCH_SAMPLE, value);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/PersistentUDDIPreferenceContext.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/PersistentUDDIPreferenceContext.java
deleted file mode 100644
index f4db2de..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/PersistentUDDIPreferenceContext.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.context;
-
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.wst.command.env.context.PersistentContext;
-
-
-public class PersistentUDDIPreferenceContext extends PersistentContext implements UDDIPreferenceContext
-{
- public PersistentUDDIPreferenceContext()
- {
- super(WebServicePlugin.getInstance());
- }
-
- public void load()
- {
- setDefault(PREFERENCE_UDDI_CAT_DATA_COLUMN_DELIMITER, UDDIPreferenceDefaults.getUddiCatDataColumnDelimiter());
- setDefault(PREFERENCE_UDDI_CAT_DATA_STRING_DELIMITER, UDDIPreferenceDefaults.getUddiCatDataStringDelimiter());
- }
-
- public void setUddiCatDataColumnDelimiter(String delimiter)
- {
- setValue(PREFERENCE_UDDI_CAT_DATA_COLUMN_DELIMITER, delimiter);
- }
-
- public String getUddiCatDataColumnDelimiter()
- {
- return getValueAsString(PREFERENCE_UDDI_CAT_DATA_COLUMN_DELIMITER);
- }
-
- public void setUddiCatDataStringDelimiter(String delimiter)
- {
- setValue(PREFERENCE_UDDI_CAT_DATA_STRING_DELIMITER, delimiter);
- }
-
- public String getUddiCatDataStringDelimiter()
- {
- return getValueAsString(PREFERENCE_UDDI_CAT_DATA_STRING_DELIMITER);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ProjectTopologyContext.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ProjectTopologyContext.java
deleted file mode 100644
index 616d335..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ProjectTopologyContext.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.context;
-
-public interface ProjectTopologyContext
-{
- /**
- * This constant String is used to lookup the preferred order of the different client types
- **/
- public static final String PREFERENCE_CLIENT_TYPES = "clientTypes";
-
- /**
- * This constant String is used to lookup the two EAR option
- **/
- public static final String PREFERENCE_USE_TWO_EARS = "useTwoEARs";
-
- public void setClientTypes(String[] ids);
- public String[] getClientTypes();
-
- public void setUseTwoEARs(boolean use);
- public boolean isUseTwoEARs();
-
- public ProjectTopologyContext copy();
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ProjectTopologyDefaults.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ProjectTopologyDefaults.java
deleted file mode 100644
index 0ca6943..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ProjectTopologyDefaults.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.context;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-
-public class ProjectTopologyDefaults
-{
- public static final String[] getClientTypes()
- {
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] elements = reg.getConfigurationElementsFor("org.eclipse.jst.ws.consumption.ui", "clientProjectType");
- String[] types = new String[elements.length];
- for (int i = 0; i < types.length; i++)
- types[i] = elements[i].getAttribute("id");
- return types;
- }
-
- public static final boolean isUseTwoEARs()
- {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ScenarioContext.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ScenarioContext.java
deleted file mode 100644
index 9bcbd24..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ScenarioContext.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.context;
-
-public interface ScenarioContext
-{
- public final String PREFERENCE_WEBSERVICE_TEST_TYPES = "webServiceTestTypes";
-
- public final String PREFERENCE_NON_JAVA_TEST_SERVICE= "nonJavaTestService";
-
- public final String PREFERENCE_WEBSERVICE_TYPE = "webServiceType";
-
- public final String PREFERENCE_START_WEBSERVICE = "startWebService";
-
- public final String PREFERENCE_LAUNCH_WEBSERVICE_EXPLORER = "launchWebServiceExplorer";
-
- public final String PREFERENCE_GENERATE_PROXY = "generateProxy";
-
- public final String PREFERENCE_CLIENT_WEBSERVICE_TYPE = "clientWebServiceType";
-
- public final String PREFERENCE_TEST_WEBSERVICE = "testWebService";
-
- public final String PREFERENCE_MONITOR_WEBSERVICE = "monitorWebService";
-
- public final String PREFERENCE_LAUNCH_SAMPLE = "launchSample";
-
- public String[] getWebServiceTestTypes();
- public void setWebServiceTestTypes(String[] testTypes);
-
- public String getNonJavaTestService();
-
- public String getWebServiceType();
- public String getWebServiceTypeDefault();
- public void setWebServiceType( String value );
-
- public boolean getStartWebService();
- public boolean getStartWebServiceDefault();
- public void setStartWebService( boolean value );
-
- public boolean getLaunchWebServiceExplorer();
- public boolean getLaunchWebServiceExplorerDefault();
- public void setLaunchWebServiceExplorer( boolean value );
-
- public boolean getGenerateProxy();
- public boolean getGenerateProxyDefault();
- public void setGenerateProxy( boolean value );
-
- public String getClientWebServiceType();
- public String getClientWebServiceTypeDefault();
- public void setClientWebServiceType( String value );
-
- public boolean getTestWebService();
- public boolean getTestWebServiceDefault();
- public void setTestWebService( boolean value );
-
- public boolean getMonitorWebService();
- public boolean getMonitorWebServiceDefault();
- public void setMonitorWebService(boolean value);
-
- public boolean isLaunchSampleEnabled();
- public boolean getLaunchSampleEnabledDefault();
- public void setLaunchSampleEnabled( boolean value );
-
- public ScenarioContext copy();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ScenarioDefaults.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ScenarioDefaults.java
deleted file mode 100644
index 85ea814..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/ScenarioDefaults.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.context;
-
-
-import org.eclipse.jst.ws.internal.data.LabelsAndIds;
-import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry;
-
-
-
-public class ScenarioDefaults
-{
-
-
- public String[] getWebServiceTestTypes()
- {
- //we will set the home grown sample as the first choice
- WebServiceTestRegistry testRegistry = WebServiceTestRegistry.getInstance();
-
- LabelsAndIds labelsandids = testRegistry.getLabelsAndIDs();
- String[] labels = labelsandids.getLabels_();
- String[] ids = labelsandids.getIds_();
-
- String[] newNames = new String[labels.length];
- int index = -1;
- for(int i = 0;i<ids.length;i++){
- if(ids[i].equals("org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WebServiceSampleTest"))
- index = i;
- }
- if(index != -1){
- newNames[0] = labels[index];
- int j = 1;
- for(int i = 0;i<labels.length;i++){
- if(i != index){
- newNames[j] = labels[i];
- j++;
- }
- }
- }
- else return labels;
-
- return newNames;
- }
-
- public String getNonJavaTestServiceDefault()
- {
- return "Web Services Explorer";
- }
-
- public String webserviceTypeIdDefault()
- {
- return "org.eclipse.jst.ws.type.java";
- }
-
- public boolean startWebserviceDefault()
- {
- return true;
- }
-
- public boolean launchWebserviceExplorerDefault()
- {
- return false;
- }
-
- public boolean generateProxyDefault()
- {
- return false;
- }
-
- public String webserviceClientTypeDefault()
- {
- return "org.eclipse.jst.ws.client.type.java";
- }
-
- public boolean testWebserviceDefault()
- {
- return false;
- }
-
- public boolean getMonitorWebServiceDefault()
- {
- return false;
- }
-
- public boolean launchSample()
- {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/TransientProjectTopologyContext.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/TransientProjectTopologyContext.java
deleted file mode 100644
index e4a289b..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/TransientProjectTopologyContext.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.context;
-
-
-public class TransientProjectTopologyContext implements ProjectTopologyContext
-{
- private String[] clientTypes;
- private boolean twoEARs;
-
- public TransientProjectTopologyContext () {}
-
- public void setClientTypes(String[] clientTypes)
- {
- this.clientTypes = clientTypes;
- }
- public String[] getClientTypes()
- {
- return clientTypes;
- }
-
- public void setUseTwoEARs(boolean use)
- {
- this.twoEARs = use;
- }
- public boolean isUseTwoEARs()
- {
- return twoEARs;
- }
-
- public ProjectTopologyContext copy() {
- TransientProjectTopologyContext context = new TransientProjectTopologyContext();
- context.setClientTypes(getClientTypes());
- context.setUseTwoEARs(isUseTwoEARs());
- return context;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/TransientScenarioContext.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/TransientScenarioContext.java
deleted file mode 100644
index 8730619..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/TransientScenarioContext.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.context;
-
-public class TransientScenarioContext implements ScenarioContext
-{
- private String[] webServiceTestTypes;
- private String nonJavaTestService;
- private String webServiceType_;
- private boolean startWebService_;
- private boolean launchWebServiceExplorer_;
- private boolean generateProxy_;
- private String clientWebServiceType_;
- private boolean testWebService_;
- private boolean monitorWebService;
- private boolean launchSample_;
-
- private ScenarioDefaults defaults = new ScenarioDefaults();
-
- public TransientScenarioContext () {}
-
- public String getNonJavaTestService()
- {
- return nonJavaTestService;
- }
-
- public void setNonJavaTestService(String nonJavaTestService)
- {
- this.nonJavaTestService = nonJavaTestService;
- }
-
- public void setWebServiceTestTypes(String[] webServiceTestTypes)
- {
- this.webServiceTestTypes = webServiceTestTypes;
- }
-
- public String[] getWebServiceTestTypes()
- {
- return webServiceTestTypes;
- }
-
- public ScenarioContext copy() {
- TransientScenarioContext context = new TransientScenarioContext();
- context.setWebServiceTestTypes(getWebServiceTestTypes());
- context.setNonJavaTestService(getNonJavaTestService());
-
- context.setWebServiceType( getWebServiceType() );
- context.setClientWebServiceType( getClientWebServiceType() );
- context.setGenerateProxy( getGenerateProxy() );
- context.setLaunchWebServiceExplorer( getLaunchWebServiceExplorer() );
- context.setStartWebService( getStartWebService() );
- context.setTestWebService( getTestWebService() );
- context.setMonitorWebService(getMonitorWebService());
- context.setLaunchSampleEnabled( isLaunchSampleEnabled() );
- return context;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getClientWebServiceType()
- */
- public String getClientWebServiceType()
- {
- return clientWebServiceType_;
- }
-
- public String getClientWebServiceTypeDefault(){ return defaults.webserviceClientTypeDefault(); }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getGenerateProxy()
- */
- public boolean getGenerateProxy()
- {
- return generateProxy_;
- }
-
- public boolean getGenerateProxyDefault(){ return defaults.generateProxyDefault(); }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getLaunchWebServiceExplorer()
- */
- public boolean getLaunchWebServiceExplorer()
- {
- return launchWebServiceExplorer_;
- }
-
- public boolean getLaunchWebServiceExplorerDefault(){ return defaults.launchWebserviceExplorerDefault(); }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getStartWebService()
- */
- public boolean getStartWebService()
- {
- return startWebService_;
- }
-
- public boolean getStartWebServiceDefault(){ return defaults.startWebserviceDefault(); }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getTestWebService()
- */
- public boolean getTestWebService()
- {
- return testWebService_;
- }
-
- public boolean getTestWebServiceDefault(){ return defaults.testWebserviceDefault(); }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getWebServiceType()
- */
- public String getWebServiceType()
- {
- return webServiceType_;
- }
-
- public String getWebServiceTypeDefault(){ return defaults.webserviceTypeIdDefault(); }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setClientWebServiceType(java.lang.String)
- */
- public void setClientWebServiceType(String value)
- {
- clientWebServiceType_ = value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setGenerateProxy(boolean)
- */
- public void setGenerateProxy(boolean value)
- {
- generateProxy_ = value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setLaunchWebServiceExplorer(boolean)
- */
- public void setLaunchWebServiceExplorer(boolean value)
- {
- launchWebServiceExplorer_ = value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setStartWebService(boolean)
- */
- public void setStartWebService(boolean value)
- {
- startWebService_ = value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setTestWebService(boolean)
- */
- public void setTestWebService(boolean value)
- {
- testWebService_ = value;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setWebServiceType(java.lang.String)
- */
- public void setWebServiceType(String value)
- {
- webServiceType_ = value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getMonitorWebService()
- */
- public boolean getMonitorWebService()
- {
- return monitorWebService;
- }
-
- public boolean getMonitorWebServiceDefault()
- {
- return defaults.getMonitorWebServiceDefault();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setMonitorWebService(boolean)
- */
- public void setMonitorWebService(boolean value)
- {
- monitorWebService = value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#getLaunchSampleEnabledDefault()
- */
- public boolean getLaunchSampleEnabledDefault()
- {
- return defaults.launchSample();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#isLaunchSampleEnabled()
- */
- public boolean isLaunchSampleEnabled()
- {
- return launchSample_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.ws.internal.context.ScenarioContext#setLaunchSampleEnabled(boolean)
- */
- public void setLaunchSampleEnabled(boolean value)
- {
- launchSample_ = value;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/UDDIPreferenceContext.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/UDDIPreferenceContext.java
deleted file mode 100644
index a24addb..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/UDDIPreferenceContext.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.context;
-
-public interface UDDIPreferenceContext
-{
- /*
- * This constant String is used to lookup the column delimiter for user-defined UDDI
- * Category data.
- */
- public static final String PREFERENCE_UDDI_CAT_DATA_COLUMN_DELIMITER = "uddiCatDataColumnDelimiter";
-
- /*
- * This constant String is used to lookup the string delimiter for user-defined UDDI
- * Category data.
- */
- public static final String PREFERENCE_UDDI_CAT_DATA_STRING_DELIMITER = "uddiCatDataStringDelimiter";
-
- public void setUddiCatDataColumnDelimiter(String delimiter);
- public String getUddiCatDataColumnDelimiter();
- public void setUddiCatDataStringDelimiter(String delimiter);
- public String getUddiCatDataStringDelimiter();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/UDDIPreferenceDefaults.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/UDDIPreferenceDefaults.java
deleted file mode 100644
index 39eba91..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/context/UDDIPreferenceDefaults.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.context;
-
-public class UDDIPreferenceDefaults
-{
- public static final String getUddiCatDataColumnDelimiter()
- {
- return "#";
- }
-
- public static final String getUddiCatDataStringDelimiter()
- {
- return "\"";
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/data/LabelsAndIds.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/data/LabelsAndIds.java
deleted file mode 100644
index 4bd0f64..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/data/LabelsAndIds.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/**
- */
-package org.eclipse.jst.ws.internal.data;
-
-public class LabelsAndIds
-{
- private String[] labels_;
- private String[] ids_;
-
- /**
- * @return Returns the ids_.
- */
- public String[] getIds_()
- {
- return ids_;
- }
- /**
- * @param ids_ The ids_ to set.
- */
- public void setIds_(String[] ids_)
- {
- this.ids_ = ids_;
- }
- /**
- * @return Returns the labels_.
- */
- public String[] getLabels_()
- {
- return labels_;
- }
- /**
- * @param labels_ The labels_ to set.
- */
- public void setLabels_(String[] labels_)
- {
- this.labels_ = labels_;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/data/TypeRuntimeServer.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/data/TypeRuntimeServer.java
deleted file mode 100644
index 4dc349d..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/data/TypeRuntimeServer.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/**
- */
-package org.eclipse.jst.ws.internal.data;
-
-public class TypeRuntimeServer
-{
- private String typeId_ = "";
- private String runtimeId_ = "";
- private String serverId_ = "";
- private String serverInstanceId_;
-
- /**
- * @return Returns the runtimeId_.
- */
- public String getRuntimeId()
- {
- return runtimeId_;
- }
- /**
- * @param runtimeId_ The runtimeId_ to set.
- */
- public void setRuntimeId(String runtimeId_)
- {
- this.runtimeId_ = runtimeId_;
- }
- /**
- * @return Returns the serverId_.
- */
- public String getServerId()
- {
- return serverId_;
- }
- /**
- * @param serverId_ The serverId_ to set.
- */
- public void setServerId(String serverId_)
- {
- this.serverId_ = serverId_;
- }
- /**
- * @return Returns the serverInstanceId_.
- */
- public String getServerInstanceId()
- {
- return serverInstanceId_;
- }
- /**
- * @param serverInstanceId_ The serverInstanceId_ to set.
- */
- public void setServerInstanceId(String serverInstanceId_)
- {
- this.serverInstanceId_ = serverInstanceId_;
- }
- /**
- * @return Returns the typeId_.
- */
- public String getTypeId()
- {
- return typeId_;
- }
- /**
- * @param typeId_ The typeId_ to set.
- */
- public void setTypeId(String typeId_)
- {
- this.typeId_ = typeId_;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "type(" + typeId_ + ") runtime(" + runtimeId_ + ") factory(" + serverId_ + ") servInstId(" + serverInstanceId_ + ")";
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicConnection.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicConnection.java
deleted file mode 100644
index 26b1d5f..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicConnection.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-public class BasicConnection implements Connection
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private Rel fRel;
- private Element fElement;
- private Connection fOpposingConnection;
-
- public static final int OUTBOUND = 0;
- public static final int INBOUND = 1;
-
- public static Connection[] createPair ( Rel outboundRel, Element targetElement, Rel inboundRel, Element sourceElement )
- {
- BasicConnection outboundConnection = new BasicConnection(outboundRel,targetElement);
- BasicConnection inboundConnection = new BasicConnection(inboundRel,sourceElement);
- outboundConnection.fOpposingConnection = inboundConnection;
- inboundConnection.fOpposingConnection = outboundConnection;
- return new Connection[] {outboundConnection,inboundConnection};
- }
-
- public BasicConnection ( Rel rel, Element element )
- {
- fRel = rel;
- fElement = element;
- fOpposingConnection = null;
- }
-
- public Rel getRel ()
- {
- return fRel;
- }
-
- public Element getElement ()
- {
- return fElement;
- }
-
- public Connection getOpposingConnection ()
- {
- return fOpposingConnection;
- }
-
- public String toString ()
- {
- return fElement.getName();
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicElement.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicElement.java
deleted file mode 100644
index c892a02..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicElement.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-public class BasicElement implements Element
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private String fName;
- private String fMUID;
- private Model fModel;
- private Hashtable fRels;
- private Hashtable fProperties;
- private Vector fListeners;
-
- public BasicElement ( String name, Model model )
- {
- fName = name;
- setMUID(model.makeMUID(name));
- model.addElement(this);
- fModel = model;
- fRels = new Hashtable();
- fListeners = new Vector();
- fProperties = new Hashtable();
- fProperties.put(Property.NAME,new BasicProperty(Property.NAME,fName));
- }
-
- public BasicElement ( String name, Element element, String outboundRelName, String inboundRelName )
- {
- this(name,element.getModel());
- connect(element,outboundRelName,inboundRelName);
- }
-
- /**
- * Returns a clone of this <code>Element</code>
- * of the same class and with the same name and model,
- * but with no Properties, Rels or Listeners except for
- * the {@link Property#NAME NAME} property.
- * @return Object A new Element.
- */
- public Element shallowClone ()
- {
- return new BasicElement(fName,fModel);
- }
-
- /**
- * Returns a clone of this <code>Element</code>
- * of the same class and with the same name and model
- * and with a copy of the original Element's Properties.
- * The Rels and Listeners are not cloned.
- * @return Element A new Element.
- */
- public final Element deepClone ()
- {
- Element newElement = shallowClone();
- Enumeration e = getProperties();
- while (e.hasMoreElements())
- {
- Property property = (Property)e.nextElement();
- Property newProperty = (Property)property.shallowClone();
- newElement.setProperty(newProperty);
- }
- return newElement;
- }
-
- /**
- * Model-View-Controller: All property changes to the model
- * (such as those made by a wizard in the role of a Controller)
- * should yield events to which an interested party can listen
- * (such as a wizard in the role of a Viewer).
- * @param tml The listener to add.
- */
- public void addListener ( ElementListener listener )
- {
- fListeners.add(listener);
- }
-
- public Model getModel ()
- {
- return fModel;
- }
-
- public boolean isValid ()
- {
- return (fModel != null && fModel.containsElement(this));
- }
-
- public boolean remove ()
- {
- return fModel.removeElement(this);
- }
-
- public void setName ( String name )
- {
- fName = name;
- fProperties.put(Property.NAME,new BasicProperty(Property.NAME,fName));
- }
-
- public String getName ()
- {
- return fName;
- }
-
- /*
- * The getter for the MUID
- * The MUID is the Model Unique Identifier, made from the name and an
- * appended unique number
- * @return String a unique id for this element within the context of the model
- */
- public String getMUID()
- {
- return fMUID;
- }
-
- /*
- *
- *
- */
- public int getNumberID()
- {
- String number = getMUID().substring(getName().length());
- return Integer.parseInt(number);
- }
-
- /*
- * Set the MUID which was made by the model
- * Should only be settable within this element
- * Set once upon creation, you can change the name
- * but the id will remain constant.
- */
- private void setMUID(String MUID)
- {
- fMUID = MUID;
- }
-
- public void setProperty ( Property property )
- {
- String propertyName = property.getName();
- Property oldProperty = getProperty(propertyName);
- fProperties.put(propertyName,property);
- if (oldProperty == null)
- {
- PropertyAddEvent event = new PropertyAddEvent(this,property);
- Enumeration e = fListeners.elements();
- while (e.hasMoreElements())
- {
- ((ElementListener)e.nextElement()).propertyAdded(event);
- }
- }
- else
- {
- Object oldValue = oldProperty.getValue();
- Object newValue = property.getValue();
- if (oldValue != newValue)
- {
- if (oldValue == null || newValue == null || (!oldValue.equals(newValue)))
- {
- PropertyChangeEvent event = new PropertyChangeEvent(this,property,oldProperty);
- Enumeration e = fListeners.elements();
- while (e.hasMoreElements())
- {
- ((ElementListener)e.nextElement()).propertyChanged(event);
- }
- }
- }
- }
- if (propertyName.equals(Property.NAME)) fName = property.getValue().toString();
- }
-
- public void setPropertyAsObject ( String name, Object value )
- {
- setProperty(new BasicProperty(name,value));
- }
-
- public void setPropertyAsString ( String name, String value )
- {
- setProperty(new BasicProperty(name,value));
- }
-
- public Property getProperty ( String name )
- {
- return (Property)fProperties.get(name);
- }
-
- public Object getPropertyAsObject ( String name )
- {
- Property property = getProperty(name);
- return (property == null ? null : property.getValue());
- }
-
- public String getPropertyAsString ( String name )
- {
- Property property = getProperty(name);
- return (property == null ? null : property.getValueAsString());
- }
-
- public Enumeration getProperties ()
- {
- return fProperties.elements();
- }
-
- public boolean connect ( Element targetElement, String outboundRelName, String inboundRelName )
- {
- if (fModel == null || fModel != targetElement.getModel()) return false;
-
- Element sourceElement = this;
- Rel outboundRel = sourceElement.getRel(outboundRelName);
- Rel inboundRel = targetElement.getRel(inboundRelName);
- Connection[] pair = BasicConnection.createPair(outboundRel,targetElement,inboundRel,sourceElement);
- outboundRel.addConnection(pair[BasicConnection.OUTBOUND]);
- inboundRel.addConnection(pair[BasicConnection.INBOUND]);
- RelAddEvent event = new RelAddEvent(pair);
- Enumeration eSource = getListeners();
- Enumeration eTarget = targetElement.getListeners();
- while (eSource.hasMoreElements())
- {
- ((ElementListener)eSource.nextElement()).relAdded(event);
- }
-
- while (eTarget.hasMoreElements())
- {
- ((ElementListener)eTarget.nextElement()).relAdded(event);
- }
-
-
- return true;
- }
-
- public boolean disconnect ( Element targetElement, String outboundRelName )
- {
- return disconnect(targetElement,getRel(outboundRelName));
- }
-
- public boolean disconnectRel ( String outboundRelName )
- {
- return disconnectRel(getRel(outboundRelName));
- }
-
- public boolean disconnectAll ()
- {
- if (fModel == null) return false;
- Enumeration e = fRels.elements();
- while (e.hasMoreElements())
- {
- Rel rel = (Rel)e.nextElement();
- disconnectRel(rel);
- }
- return true;
- }
-
- public Enumeration getElements ( String relName )
- {
- return getRel(relName).getTargetElements();
- }
-
- public int getNumberOfElements ( String relName )
- {
- return getRel(relName).getNumberOfTargetElements();
- }
-
- public Rel getRel ( String relName )
- {
- Rel rel = (Rel)fRels.get(relName);
- if (rel == null)
- {
- rel = new BasicRel(relName,this);
- fRels.put(relName,rel);
- }
- return rel;
- }
-
- public Enumeration getRels ()
- {
- return fRels.elements();
- }
-
- public Enumeration getListeners()
- {
- return fListeners.elements();
- }
-
- protected boolean disconnect ( Element targetElement, Rel outboundRel )
- {
- if (fModel == null || fModel != targetElement.getModel() || outboundRel == null) return false;
- Connection outboundConnection = outboundRel.getConnectionTo(targetElement);
- if (outboundConnection == null) return false;
- Connection inboundConnection = outboundConnection.getOpposingConnection();
- RelRemoveEvent event = new RelRemoveEvent(new Connection [] {outboundConnection,inboundConnection});
- Enumeration e = fListeners.elements();
- while (e.hasMoreElements())
- {
- ((ElementListener)e.nextElement()).relRemoved(event);
- }
-
- Enumeration eTarget = targetElement.getListeners();
- while (eTarget.hasMoreElements())
- {
- ((ElementListener)eTarget.nextElement()).relRemoved(event);
- }
-
- Rel inboundRel = inboundConnection.getRel();
- boolean done = outboundRel.removeConnection(outboundConnection);
- inboundRel.removeConnection(inboundConnection);
- return done;
- }
-
- protected boolean disconnectRel ( Rel outboundRel )
- {
- if (fModel == null || outboundRel == null) return false;
- Element[] elements = new Element[outboundRel.getNumberOfTargetElements()];
- int i = 0;
- Enumeration e = outboundRel.getTargetElements();
- while (e.hasMoreElements())
- {
- elements[i++] = (Element)e.nextElement();
- }
- while (i-- > 0)
- {
- disconnect(elements[i],outboundRel);
- }
- return true;
- }
-
- public String toString ()
- {
- return getName();
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicModel.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicModel.java
deleted file mode 100644
index 7e2a27b..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicModel.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-public class BasicModel implements Model
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private String fName;
- private Hashtable fElements;
- private Element fRoot;
- //This is used by the MUID
- private int fUniqueNumberCounter;
-
- public BasicModel ( String name )
- {
- fName = name;
- fElements = new Hashtable();
- fRoot = null;
- fUniqueNumberCounter = 0;
- }
-
- public void setName ( String name )
- {
- fName = name;
- }
-
- public String getName ()
- {
- return fName;
- }
-
-
- /*
- * simple counter that increments each call
- */
- public int getUniqueNumber()
- {
- fUniqueNumberCounter++;
- return fUniqueNumberCounter;
- }
-
- /*
- * This will use a unique number and append it to the end of the name
- * @param String name of the element
- * @return String MUID
- */
- public String makeMUID(String name)
- {
- String num = String.valueOf(getUniqueNumber());
- String muid = name + num;
- return muid;
- }
-
-
- public boolean setRootElement ( Element root )
- {
- if (root.getModel() == null)
- addElement(root);
- else if (root.getModel() != this)
- return false;
- fRoot = root;
- return true;
- }
-
- public Element getRootElement ()
- {
- if (fRoot == null) fRoot = getFirstElement();
- return fRoot;
- }
-
-
- /**
- * Get the elements that have this name
- * @param String name the name of the element
- * @return Vector a vector of elements that have this name
- * These elements may be of different types
- **/
-
- public Vector getElementsByName(String name)
- {
- Vector vector = new Vector();
- Enumeration e = fElements.keys();
- while (e.hasMoreElements()){
- Element element = (Element)e.nextElement();
- if (element.getName().equals(name)) vector.addElement(element);
- }
- return vector;
- }
-
-
-
- public boolean addElement ( Element element )
- {
- if (element.getModel() != null) return false;
- fElements.put(element,element);
- return true;
- }
-
- public boolean removeElement ( Element element )
- {
- if (element.getModel() != this) return false;
- element.disconnectAll();
- if (fRoot == element) fRoot = null;
- return (fElements.remove(element) == element);
- }
-
- public Enumeration getElements ()
- {
- return fElements.elements();
- }
-
- public int getNumberOfElements ()
- {
- return fElements.size();
- }
-
- public boolean containsElement ( Element element )
- {
- return fElements.contains(element);
- }
-
- private Element getFirstElement ()
- {
- Enumeration e = getElements();
- return (e.hasMoreElements() ? (Element)e.nextElement() : null);
- }
-
- public String toString ()
- {
- return getName();
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicProperty.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicProperty.java
deleted file mode 100644
index 9930a11..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicProperty.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-public class BasicProperty implements Property
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private String fName;
- private Object fValue;
-
- public BasicProperty ( String name )
- {
- fName = name;
- }
-
- public BasicProperty ( String name, Object value )
- {
- fName = name;
- fValue = value;
- }
-
- /**
- * Returns a shallow clone of this <code>Property</code>.
- * Property key and value references are cloned,
- * but the value objects themselves are not cloned.
- * @return Property A new Property.
- */
- public Property shallowClone ()
- {
- return new BasicProperty(fName,fValue);
- }
-
- public String getName ()
- {
- return fName;
- }
-
- public void setValue ( Object value )
- {
- fValue = value;
- }
-
- public Object getValue ()
- {
- return fValue;
- }
-
- public void setValueAsString ( String value )
- {
- fValue = value;
- }
-
- public String getValueAsString ()
- {
- return (fValue != null ? fValue.toString() : null);
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicRel.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicRel.java
deleted file mode 100644
index 84bfd21..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/BasicRel.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-public class BasicRel implements Rel
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private String fName;
- private Element fSourceElement;
- private Vector fConnections;
-
- public BasicRel ( String name, Element sourceElement )
- {
- fName = name;
- fSourceElement = sourceElement;
- fConnections = new Vector();
- }
-
- public String getName ()
- {
- return fName;
- }
-
- public Element getSourceElement ()
- {
- return fSourceElement;
- }
-
- public Enumeration getTargetElements ()
- {
- return new ElementEnumeration(fConnections.elements());
- }
-
- public int getNumberOfTargetElements ()
- {
- return fConnections.size();
- }
-
- public void addConnection ( Connection connection )
- {
- fConnections.addElement(connection);
- }
-
- public boolean removeConnection ( Connection connection )
- {
- return fConnections.removeElement(connection);
- }
-
- public Connection getConnectionTo ( Element targetElement )
- {
- Enumeration e = fConnections.elements();
- while (e.hasMoreElements())
- {
- Connection c = (Connection)e.nextElement();
- if (c.getElement() == targetElement) return c;
- }
- return null;
- }
-
- public String toString ()
- {
- return getName();
- }
-
- private class ElementEnumeration implements Enumeration
- {
- private Enumeration fConnectionEnumeration;
-
- public ElementEnumeration ( Enumeration connectionEnumeration )
- {
- fConnectionEnumeration = connectionEnumeration;
- }
-
- public boolean hasMoreElements ()
- {
- return fConnectionEnumeration.hasMoreElements();
- }
-
- public Object nextElement ()
- {
- return ((Connection)fConnectionEnumeration.nextElement()).getElement();
- }
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Connection.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Connection.java
deleted file mode 100644
index 5788678..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Connection.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-/**
-* This is the abstract class for a connection that ties a Rel to a Node.
-* Normally Connection objects are manufactured and managed within the
-* derived classes of the Model framework, and are not manipulated by
-* the caller directly.
-*/
-public interface Connection
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Returns the Rel that owns this connection.
- * @return Rel The Rel that owns this connection.
- * This method never returns null, that is, a Connection
- * cannot exist without a Rel to own it.
- */
- public Rel getRel ();
-
- /**
- * Returns the Node that this connection points to.
- * @return Node The Node this connection points to.
- * This method never returns null, that is, a Connection
- * cannot exist without a Node to point to.
- */
- public Element getElement ();
-
- /**
- * Returns the opposing connection to this connection.
- * Connection objects always exist in pairs, that is,
- * if node "Parent" has a relationship named "Children"
- * containing a connection to node "Child", then there
- * must exist an opposing connection from "Child" to
- * "Parent" in some relationship of "Child" (for example,
- * in a relationship called "Parents").
- * @return Connection The opposing connection.
- * As a general rule, this method should never return null.
- * It may only return null during construction of the pair
- * of connections.
- */
- public Connection getOpposingConnection ();
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Element.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Element.java
deleted file mode 100644
index 7281bce..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Element.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-import java.util.Enumeration;
-
-/**
-* This is the abstract class for elements that can be managed by a Model.
-* Every element has a name, a set of properties, and a set of relationships
-* to other elements.
-*/
-public interface Element
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Returns a clone of this <code>Element</code>
- * of the same class and with the same name and model,
- * but with no Properties, Rels or Listeners except for
- * the {@link Property#NAME NAME} property.
- * @return Object A new Element.
- */
- public Element shallowClone ();
-
- /**
- * Returns a clone of this <code>Element</code>
- * of the same class and with the same name and model
- * and with a copy of the original Element's Properties.
- * The Rels and Listeners are not cloned.
- * @return Element A new Element.
- */
- public Element deepClone ();
-
- /**
- * Returns the model this element belongs to, or null if the element
- * has not been added to a model. See also {@link #isValid isValid()}.
- * @return Model The model this element belongs to, or null if none.
- */
- public Model getModel ();
-
- /**
- * Returns true if and only if this element belongs to a model.
- * See also {@link #getModel getModel()}.
- * @return boolean True if and only if this element belongs to a model.
- */
- public boolean isValid ();
-
- /**
- * Removes this element from the model to which it currently belongs.
- * After calling this method, {@link #getModel getModel()} will return
- * null and {@link #isValid isValid()} will return false.
- * @return boolean True if the element was successfully removed from
- * its model. This method returns false if the element does not belong
- * to any model.
- */
- public boolean remove ();
-
- /**
- * Sets the name of this element and updates the "name" property.
- * Every element includes a property called "name" (see Property.NAME)
- * whose value is the same string as passed into setName().
- * @param name The name of this element.
- */
- public void setName ( String name );
-
- /**
- *
- */
- public void addListener ( ElementListener listener );
-
- /**
- * Returns the name of this element.
- * @return String The name of this element.
- */
- public String getName ();
-
- /**
- * Adds or sets a property of this element.
- * Properties set using this method can be retrieved using either
- * {@link #getProperty getProperty()} or
- * {@link #getPropertyAsObject getPropertyAsObject()}.
- * Every element includes a property called "name" (see Property.NAME)
- * whose value is the same string as passed into {@link #setName setName()}.
- * Any previous property with the same name is replaced.
- * @param property The property to set.
- */
- public void setProperty ( Property property );
-
- /**
- * Adds or sets a property of this element.
- * Properties set using this method can be retrieved using either
- * {@link #getProperty getProperty()} or
- * {@link #getPropertyAsObject getPropertyAsObject()}.
- * Every element includes a property called "name" (see Property.NAME)
- * whose value is the same string as passed into {@link #setName setName()}.
- * Any previous property with the same name is replaced.
- * @param name The name of the property to set.
- * @param value The Object value of the property to set.
- */
- public void setPropertyAsObject ( String name, Object value );
-
- /**
- * Adds or sets a String property of this element.
- * Properties set using this method can be retrieved using either
- * {@link #getProperty getProperty()},
- * {@link #getPropertyAsObject getPropertyAsObject()} or
- * {@link #getPropertyAsString getPropertyAsString()}.
- * Every element includes a property called "name" (see Property.NAME)
- * whose value is the same string as passed into {@link #setName setName()}.
- * Any previous property with the same name is replaced.
- * @param name The name of the property to set.
- * @param value The String value of the property to set.
- */
- public void setPropertyAsString ( String name, String value );
-
- /**
- * Returns a property of the given name or null if there is none.
- * Every element includes a property called "name" (see Property.NAME)
- * whose value is the same string as passed into {@link #setName setName()}.
- * @param name The name of the property to return.
- * @return Property The property, or null if none.
- */
- public Property getProperty ( String name );
-
- /**
- * Returns the Object value of a property of the given name or null
- * if there is none.
- * Every element includes a property called "name" (see Property.NAME)
- * whose value is the same string as passed into {@link #setName setName()}.
- * @param name The name of the property to return.
- * @return Object The property value as an Object, or null if none.
- */
- public Object getPropertyAsObject ( String name );
-
- /**
- * Returns the String value of a property of the given name or null
- * if there is none.
- * Every element includes a property called "name" (see Property.NAME)
- * whose value is the same string as passed into {@link #setName setName()}.
- * @param name The name of the property to return.
- * @return String The property value as a String, or null if none.
- */
- public String getPropertyAsString ( String name );
-
- /**
- * Returns an enumeration of all properties of this element.
- * There is always at least one property that carries the
- * name of this element (see {@link #setName setName()}).
- * @return Enumeration An enumeration of all properties of this element.
- */
- public Enumeration getProperties ();
-
- /**
- * Creates a bidirectional relationship between this element and another.
- * Both relationships are identified by names. The names of all the
- * outbound relationships of a element must be mutually unique.
- * @param element The element to connect to.
- * @param outboundRelName The name of the relationship to contain the
- * connection to the element.
- * @param inboundRelName The name of the relationship to contain the
- * inverse connection back to this element.
- * @return boolean True if the connection is created successfully.
- * Both elements must belong to the same model, other false is returned.
- */
- public boolean connect ( Element element, String outboundRelName, String inboundRelName );
-
- /**
- * Dismantles the connection to another element in a given relationship.
- * The inverse connection is also automatically dismantled.
- * @param element The element to disconnect from.
- * @param outboundRelName The name of the relationship containing
- * the connection to the element.
- * @return boolean True if the connection is removed successfully.
- * Both elements must belong to the same model, other false is returned.
- * If the elements are not connected through the given relationship, then
- * false is returned.
- */
- public boolean disconnect ( Element element, String outboundRelName );
-
- /**
- * Dismantles the connection to all elements in the given relationship.
- * The inverse connections are also automatically dismantled.
- * @param outboundRelName The name of the relationship.
- * @return boolean True if all connections are removed successfully.
- * This method returns false if the element does not belong to a model.
- */
- public boolean disconnectRel ( String outboundRelName );
-
- /**
- * Dismantles all connections from this element.
- * @return boolean True if all connections are removed successfully.
- * This method returns false if the element does not belong to a model.
- */
- public boolean disconnectAll ();
-
- /**
- * Returns an enumeration of all elements
- * connected thru the given relationship.
- * @param relName The name of the relationship.
- * @return Enumeration The elements in the relationship.
- * This method never returns null.
- */
- public Enumeration getElements ( String relName );
-
- /**
- * Returns the number of elements in the given relationship.
- * @param relName The name of the relationship.
- * @return int The number of elements in the relationship.
- * This method never returns a negative value.
- */
-
- public Enumeration getListeners();
-
- public int getNumberOfElements ( String relName );
-
- /**
- * Returns the relationship object of the given name.
- * @param relName The name of the relationship.
- * @return int The relationship. This method never returns null.
- * In other words, any reference to a relationship name automatically
- * brings a corresponding Rel object into existence. Careless naming
- * may result in the {@link #getRels getRels()} method returning an enumeration of
- * more relationships than would be meaningful, efficient or useful.
- */
- public Rel getRel ( String relName );
-
- /**
- * Returns an enumeration of all known relationships.
- * @return Enumeration The outbound relationships of the element.
- * This method never returns null.
- */
- public Enumeration getRels ();
-
-
- /*
- * There is a need sometimes for each element in a model to have a unique identifier.
- * Normally this would be left to a name, but since the element maker gives it its name
- * there is a chance that a model could have two elements with the same name. If they
- * are the same element type then there would be no way to differenciate between the two.
- * The following getter and setter will provide a unique identifier. This identifier will be known
- * as the muid or Model Unique Identifier. Unlike a uuid it will only be assured uniqueness
- * within its own model. The intention is to use a unique number appended to the end
- * of the name.
- * The following is the getter
- * @return String the unique identifier
- */
-
- public String getMUID();
-
-
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/ElementAdapter.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/ElementAdapter.java
deleted file mode 100644
index 7b33b1f..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/ElementAdapter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-/**
-* This is where we store all the state data that various UIs
-* (such as the NewWSDLCreationWizard) capture from the user
-* and then need to process.
-*/
-public class ElementAdapter implements ElementListener
-{
- /**
- * Called when a property is added to the model.
- * @param event The event containing the model, property and value.
- */
- public void propertyAdded ( PropertyAddEvent event )
- {
- }
-
- /**
- * Called when a property in the model changes.
- * @param event The event containing the model, property, old value
- * and new value.
- */
- public void propertyChanged ( PropertyChangeEvent event )
- {
- }
-
- /**
- * Called when a property in the model is removed.
- * @param event The event containing the model, property and old value.
- */
- public void propertyRemoved ( PropertyRemoveEvent event )
- {
- }
-
- /**
- * Called when a property is added to the model.
- * @param event The event containing the model, property and value.
- */
- public void relAdded ( RelAddEvent event )
- {
- }
-
- /**
- * Called when a property is added to the model.
- * @param event The event containing the model, property and value.
- */
- public void relRemoved ( RelRemoveEvent event )
- {
- }
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/ElementListener.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/ElementListener.java
deleted file mode 100644
index 8e6c9f6..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/ElementListener.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-/**
-* This is where we store all the state data that various UIs
-* (such as the NewWSDLCreationWizard) capture from the user
-* and then need to process.
-*/
-public interface ElementListener
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Called when a property is added to the model.
- * @param event The event containing the model, property and value.
- */
- public void propertyAdded ( PropertyAddEvent event );
-
- /**
- * Called when a property in the model changes.
- * @param event The event containing the model, property, old value
- * and new value.
- */
- public void propertyChanged ( PropertyChangeEvent event );
-
- /**
- * Called when a property in the model is removed.
- * @param event The event containing the model, property and old value.
- */
- public void propertyRemoved ( PropertyRemoveEvent event );
-
- /**
- * Called when a property is added to the model.
- * @param event The event containing the model, property and value.
- */
- public void relAdded ( RelAddEvent event );
-
- /**
- * Called when a property is added to the model.
- * @param event The event containing the model, property and value.
- */
- public void relRemoved ( RelRemoveEvent event );
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Model.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Model.java
deleted file mode 100644
index 0277ece..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Model.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-/**
-* This is the abstract class for a simple data model consisting of
-* a network of named nodes (class Node). Every node carries a set
-* of named properties (class Property). Nodes are interrelated by
-* relationships (class Rel) and connections (class Connection).
-* Each Model keeps a registry of all of its nodes, and keeps a
-* reference to one "root" node that can be used as a starting
-* point for navigation.
-*/
-public interface Model
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Sets the name of the model.
- * @param name The name of the model.
- */
- public void setName ( String name );
-
- /**
- * Gets the name of the model.
- * @return String The name of the model. This must not be null.
- */
- public String getName ();
-
- /**
- * Sets a node as the root of the model. If the node does not
- * belong to a model, then it is added automatically. If the
- * node already belongs to another model, then the root node
- * is not set and method returns false.
- * @param root The node to set as the root. The node must
- * belong either to this model or to no model. This must
- * not be null.
- * @return boolean True if the node was set as the root.
- * This method returns false if the given node already belongs
- * to another model.
- */
- public boolean setRootElement ( Element root );
-
- /**
- * Returns the root node. This method always returns a node
- * except on an empty Model. If setRootNode() has not been
- * called, or if the last root node was removed from the model,
- * then the method will select and return an arbitrary node as
- * the root. This method will consistently return the same node
- * until either
- * (a) setRootNode() is called with a different node or
- * (b) removeNode() is called to remove the node from the model.
- * @return Node The current root node, or null if the model is empty.
- */
-
- public Element getRootElement ();
-
- /**
- * Get the elements that have this name
- * @param String name the name of the element
- * @return Vector a vector of elements that have this name
- * These elements may be of different types
- **/
-
- public Vector getElementsByName(String name);
-
- /**
- * Adds a node to the model. If the node already belongs to another
- * model then it will not be added.
- * @param node The node to add. This must not be null.
- * @return boolean True if the node was added successfully.
- * This method returns false if the given node already belongs to
- * the current model or to another model.
- */
- public boolean addElement ( Element element );
-
- /**
- * Removes a node from the model.
- * @param node The node to remove. This must not be null.
- * @return boolean True if the node was removed successfully.
- * This method returns false if the given node does not belong
- * to this model.
- */
- public boolean removeElement ( Element element );
-
- /**
- * Returns an enumeration of all nodes in the model and in no
- * particular order,
- * @return Enumeration An enumeration of all nodes in the model.
- * This method never returns null.
- */
- public Enumeration getElements ();
-
- /**
- * Returns the number of nodes in the model.
- * @return int The number of nodes in the model.
- * This method never returns a negative value.
- */
- public int getNumberOfElements ();
-
- /**
- * Determines if this model contains the given node.
- * @param node The node to check for. This must not be null.
- * @return boolean True if and only if the model contains the node.
- */
- public boolean containsElement ( Element element );
-
- /*
- * This function will provide the next number in the queue for the MUID
- *
- */
- public int getUniqueNumber();
-
- /*
- * heres what we call from the element
- */
- public String makeMUID(String name);
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Property.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Property.java
deleted file mode 100644
index 00f5bc1..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Property.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-/**
-* This is the abstract class for properties of a Node.
-* Every property has an immutable name and a value of type Object.
-*/
-public interface Property
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Every Node has a property called "name" that is equivalent
- * to and kept synchronized with Node.getName() and Node.setName().
- */
- public static final String NAME = "name";
-
- /**
- * Returns a shallow clone of this <code>Property</code>.
- * Property key and value references are cloned,
- * but the value objects themselves are not cloned.
- * @return Property A new Property.
- */
- public Property shallowClone ();
-
- /**
- * Returns the name of this node.
- * @return String The name of this node.
- */
- public String getName ();
-
- /**
- * Sets the value of this property.
- * @param value The value to set. Any previous value is replaced.
- */
- public void setValue ( Object value );
-
- /**
- * Returns the value of this property.
- * @return Object The value of this property, possibly null.
- */
- public Object getValue ();
-
- /**
- * Sets the value of this property as a string.
- * @param value The string to set. Any previous value is replaced.
- * The type of the previous value, if any, is of no consequence.
- */
- public void setValueAsString ( String value );
-
- /**
- * Returns the value of this property as a string.
- * @return String the value of this property as a string, possibly null.
- * If the set value is an arbitrary Object, then Object.toString() is
- * returned.
- */
- public String getValueAsString ();
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/PropertyAddEvent.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/PropertyAddEvent.java
deleted file mode 100644
index 78337db..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/PropertyAddEvent.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-/**
-* Carries data relevant to when a property is added to the model.
-*/
-public class PropertyAddEvent
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * The model the changed.
- */
- protected BasicElement fElement;
-
- /**
- * The property that was added.
- */
- protected Property fProperty;
-
-
- /**
- * Constructor.
- * @param model The model that changed.
- * @param property The property that was added.
- * @param value The property's value.
- */
- public PropertyAddEvent ( BasicElement element, Property property)
- {
- fElement = element;
- fProperty = property;
- }
-
- /**
- * Returns the model that changed (that produced this event).
- * @return TinyModel The model that changed.
- */
- public BasicElement getElement ()
- {
- return fElement;
- }
-
- /**
- * Returns the model property that was added.
- * @return TinyModel The property that was added.
- */
- public Property getProperty ()
- {
- return fProperty;
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/PropertyChangeEvent.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/PropertyChangeEvent.java
deleted file mode 100644
index 96099b8..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/PropertyChangeEvent.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-/**
-* Carries data relevant to when a property is changed in the model.
-*/
-public class PropertyChangeEvent
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * The model the changed.
- */
- protected BasicElement fElement;
-
- /**
- * The property that changed.
- */
- protected Property fProperty;
-
- /**
- * The property's old value.
- */
- protected Property fOldProperty;
-
- /**
- * Constructor.
- * @param model The model that changed.
- * @param property The property that changed.
- * @param oldValue The property's old value.
- * @param newValue The property's new value.
- */
- public PropertyChangeEvent ( BasicElement element , Property property, Property oldProperty )
- {
- fElement = element;
- fProperty = property;
- fOldProperty = oldProperty;
- }
-
- /**
- * Returns the model that changed (that produced this event).
- * @return TinyModel The model that changed.
- */
- public BasicElement getElement ()
- {
- return fElement;
- }
-
- /**
- * Returns the model property that changed.
- * @return TinyModel The property that changed.
- */
- public Property getProperty ()
- {
- return fProperty;
- }
-
- /**
- * Returns the model property's old value.
- * @return TinyModel The property's old value.
- */
- public Property getOldProperty ()
- {
- return fOldProperty;
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/PropertyRemoveEvent.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/PropertyRemoveEvent.java
deleted file mode 100644
index fa38c5d..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/PropertyRemoveEvent.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-/**
-* Carries data relevant to when a property is removed from the model.
-*/
-public class PropertyRemoveEvent
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * The model the changed.
- */
- protected BasicElement fElement;
-
- /**
- * The property that was removed.
- */
- protected Property fProperty;
-
- /**
- * Constructor.
- * @param model The model that changed.
- * @param property The property that was removed.
- * @param value The property's value.
- */
- public PropertyRemoveEvent ( BasicElement element, Property property)
- {
- fElement = element;
- fProperty = property;
- }
-
- /**
- * Returns the model that changed (that produced this event).
- * @return TinyModel The model that changed.
- */
- public BasicElement getElement ()
- {
- return fElement;
- }
-
- /**
- * Returns the model property that was removed.
- * @return TinyModel The property that was removed.
- */
- public Property getProperty ()
- {
- return fProperty;
- }
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Rel.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Rel.java
deleted file mode 100644
index 1a398af..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/Rel.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-import java.util.Enumeration;
-
-/**
-* This is the abstract class for relationships in a Model.
-*/
-public interface Rel
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * Returns the name of this relationship. Relationship names
- * cannot be changed.
- * @return String The name of the relationship.
- */
- public String getName ();
-
- /**
- * Returns the node that owns this relationship.
- * @return Node The node that owns this relationship.
- * This method never returns null, that is, relationships
- * cannot exist in the absence of a node.
- */
- public Element getSourceElement();
-
- /**
- * Returns an enumeration of all nodes in this relationship.
- * @return Enumeration The nodes in this relationship.
- * This method never returns null.
- */
- public Enumeration getTargetElements ();
-
- /**
- * Returns the number of nodes in this relationship.
- * @return int The number of nodes in this relationship.
- * This method never returns a negative value.
- */
- public int getNumberOfTargetElements ();
-
- /**
- * Adds a connection to this relationship. This method is
- * intended for use by derivations of the Model framework,
- * not by users of the framework. Connection objects should
- * only be constructed, added, removed and retrieved by
- * implementations of the Node and Rel interfaces.
- * @param connection The connection to add.
- */
- public void addConnection ( Connection connection );
-
- /**
- * Removes a connection from this relationship. This method is
- * intended for use by derivations of the Model framework,
- * not by users of the framework. Connection objects should
- * only be constructed, added, removed and retrieved by
- * implementations of the Node and Rel interfaces.
- * @param connection The connection to remove.
- * @return boolean True if the connection was found and removed.
- */
- public boolean removeConnection ( Connection connection );
-
- /**
- * Returns the Connection object for the given target node.
- * This method is intended for use by derivations of the Model
- * framework, not by users of the framework. Connection objects
- * should only be constructed, added, removed and retrieved by
- * implementations of the Node and Rel interfaces.
- * @param targetNode The node to find the Connection to.
- * @return Connection The connection, or null if none.
- */
- public Connection getConnectionTo ( Element targetElement );
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/RelAddEvent.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/RelAddEvent.java
deleted file mode 100644
index cbc8b39..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/RelAddEvent.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.datamodel;
-
-/**
-* Carries data relevant to when a property is added to the model.
-*/
-public class RelAddEvent
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * The model the changed.
- */
- protected Connection fOutBound;
-
- /**
- * The model the changed.
- */
- protected Connection fInBound;
-
- /**
- * The property that was added.
- */
- protected Property fProperty;
-
-
- /**
- * Constructor.
- * @param model The model that changed.
- * @param property The property that was added.
- * @param value The property's value.
- */
- public RelAddEvent (Connection[] pair)
- {
- fOutBound = pair[BasicConnection.OUTBOUND];
- fInBound = pair[BasicConnection.INBOUND];
- }
-
- /**
- * Returns the outbound connection that changed
- **/
- public Connection getOutBoundConnection ()
- {
- return fOutBound;
- }
-
- /**
- * Returns the changed rel name
- **/
- public String getOutBoundRelName()
- {
- return fOutBound.getRel().getName();
- }
-
- /**
- * Returns the changed rel
- **/
- public Rel getOutBoundRel()
- {
- return fOutBound.getRel();
- }
-
- /**
- * Returns the changed rel name
- **/
- public String getInBoundRelName()
- {
- return fInBound.getRel().getName();
- }
-
- /**
- * Returns the changed rel
- **/
- public Rel getInBoundRel()
- {
- return fInBound.getRel();
- }
-
- /**
- * Returns the outbound element that changed
- **/
- public Element getParentElement ()
- {
- return fOutBound.getElement();
- }
-
-
- /**
- * Returns the inbound connection that changed
- **/
- public Element getChildElement ()
- {
- return fInBound.getElement();
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/RelRemoveEvent.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/RelRemoveEvent.java
deleted file mode 100644
index 94a319a..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/datamodel/RelRemoveEvent.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.datamodel;
-
-/**
-* Carries data relevant to when a property is added to the model.
-*/
-public class RelRemoveEvent
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * The model the changed.
- */
- protected Connection fOutBound;
-
- /**
- * The model the changed.
- */
- protected Connection fInBound;
-
- /**
- * The property that was added.
- */
- protected Property fProperty;
-
-
- /**
- * Constructor.
- * @param model The model that changed.
- * @param property The property that was added.
- * @param value The property's value.
- */
- public RelRemoveEvent (Connection[] pair)
- {
- fOutBound = pair[BasicConnection.OUTBOUND];
- fInBound = pair[BasicConnection.INBOUND];
- }
-
- /**
- * Returns the model that changed (that produced this event).
- * @return TinyModel The model that changed.
- */
- public Connection getOutBound ()
- {
- return fOutBound;
- }
-
- /**
- * Returns the model property that was added.
- * @return TinyModel The property that was added.
- */
- public Connection getInBound ()
- {
- return fInBound;
- }
-
- /**
- * Returns the changed rel name
- **/
- public String getOutBoundRelName()
- {
- return fOutBound.getRel().getName();
- }
-
- /**
- * Returns the changed rel
- **/
- public Rel getOutBoundRel()
- {
- return fOutBound.getRel();
- }
-
- /**
- * Returns the changed rel name
- **/
- public String getInBoundRelName()
- {
- return fInBound.getRel().getName();
- }
-
- /**
- * Returns the changed rel
- **/
- public Rel getInBoundRel()
- {
- return fInBound.getRel();
- }
-
-
- /**
- * Returns the outbound element that changed
- **/
- public Element getOutBoundElement ()
- {
- return fOutBound.getElement();
- }
-
-
- /**
- * Returns the inbound connection that changed
- **/
- public Element getInboundElement ()
- {
- return fInBound.getElement();
- }
-
-
-
-}
-
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/dialog/IStatusDialogConstants.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/dialog/IStatusDialogConstants.java
deleted file mode 100644
index 687bfeb..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/dialog/IStatusDialogConstants.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.dialog;
-
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-
-/**
-* Constants for status dialogs
-*/
-public interface IStatusDialogConstants {
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
-
- /*
- * Button ID for the "Yes" button
- */
- public static final int YES_ID = 2;
- /*
- * Button ID for the "Yes to all" button
- */
- public static final int YES_TO_ALL_ID = 4;
- /*
- * Button ID for the "Cancel" button
- */
- public static final int CANCEL_ID = 1;
- /*
- * Button ID for the "OK" button
- */
- public static final int OK_ID = 0;
- /*
- * Button ID for the "Details" button
- */
- public static final int DETAILS_ID = 13;
-
- /*
- * Button label for the "Yes" button
- */
- public static final String YES_LABEL = WebServicePlugin.getMessage("%STATUS_DIALOG_YES_LABEL");
- /*
- * Button label for the "Yes to all" button
- */
- public static final String YES_TO_ALL_LABEL = WebServicePlugin.getMessage("%STATUS_DIALOG_YES_TO_ALL_LABEL");
- /*
- * Button label for the "Cancel" button
- */
- public static final String CANCEL_LABEL = WebServicePlugin.getMessage("%STATUS_DIALOG_CANCEL_LABEL");
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExecutable.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExecutable.java
deleted file mode 100644
index 37326bf..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExecutable.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ext;
-
-/**
-* All Extensions with exectutable extensions should implement this
-* to fit our framework
-*/
-public interface WebServiceExecutable
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- /**
- *Returns a wizard fragment for this exention type
- *
- */
- public WebServiceFinishCommand getFinishCommand();
-}
-
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtension.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtension.java
deleted file mode 100644
index 6bbc476..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtension.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ext;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-
-
-/**
-* This represents an extension in the plugin registry
-* It job is to act as a proxy to the iconfigelement
-*/
-public interface WebServiceExtension
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * If the extension has code that needs to be executed or a fragment added
- * @return WebServiceExecutable this interface holds executable code and a
- * fragment
- */
- public WebServiceExecutable getWebServiceExecutableExtension();
-
- /**
- * This is the config element that holds the extension info
- * @param IConfigurationElement Extension element
- */
- public void setConfigElement(IConfigurationElement configElement);
-
- /**
- * If the extension has code that
- * @return IConfigurationElement Extension element
- */
- public IConfigurationElement getConfigElement();
-}
-
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtensionImpl.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtensionImpl.java
deleted file mode 100644
index 779e905..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtensionImpl.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ext;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-
-
-
-
-
-/**
-* This represents an extension in the plugin registry
-* It job is to act as a proxy to the iconfigelement
-*/
-public class WebServiceExtensionImpl implements WebServiceExtension
-{
-
- private Log log_;
-
- /*
- * The ConfigElement that holds extension info
- */
- protected IConfigurationElement configElement_;
-
- /*
- * The extension executable
- */
- protected WebServiceExecutable webServiceExecutable_;
-
-
- public WebServiceExtensionImpl(IConfigurationElement configElement)
- {
- configElement_ = configElement;
- log_ = new EclipseLog();
- }
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- /**
- * If the extension has code that needs to be executed or a fragment added
- * @return WebServiceExecutable this interface holds executable code and a
- * fragment
- */
- public WebServiceExecutable getWebServiceExecutableExtension()
- {
- if(webServiceExecutable_ != null) return webServiceExecutable_;
-
- try{
- Object webServiceExecutable = configElement_.createExecutableExtension("class");
-
- if( webServiceExecutable instanceof WebServiceExecutable)
- return (WebServiceExecutable)webServiceExecutable;
- else
- log_.log(Log.ERROR, 5028, this, "getWebServiceExecutableExtension", "Incorrect WebServiceTest:" + webServiceExecutable.getClass().getName());
- }catch (CoreException e){
- log_.log(Log.ERROR, 5029, this, "getWebServiceExecutableExtension",e);
- }
-
- return null;
- }
-
- /**
- * This is the config element that holds the extension info
- * @param IConfigurationElement Extension element
- */
- public void setConfigElement(IConfigurationElement configElement)
- {
- configElement_ = configElement;
- }
-
- /**
- * This is the config element that holds the extension info
- * @return IConfigurationElement Extension element
- */
- public IConfigurationElement getConfigElement()
- {
- return configElement_;
- }
-
- /**
- * The name of the extension being used
- * @return String name of this extension
- */
- public String getName()
- {
- return getConfigElement().getAttribute( "name" );
- }
-
-
-}
-
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtensionRegistry.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtensionRegistry.java
deleted file mode 100644
index afc1d07..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtensionRegistry.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ext;
-
-
-/**
-* Returns the names of the extensions for a given extension-point
-* also returns the extension objects
-*
-*/
-public interface WebServiceExtensionRegistry
-{
-
- /**
- * Returns the names of all registered extensions
- * @return The names of all registered extensions.
- */
- public String[] getWebServiceExtensionNames ();
-
- /**
- * Returns the extension object of the given name
- *@return WebServiceExtension object
- */
- public WebServiceExtension getWebServiceExtensionsByName( String name);
-
- /**
- * Returns All extention objects in this registry
- *@return WebServiceExtension objects
- */
- public WebServiceExtension[] getWebServiceExtensions();
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtensionRegistryImpl.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtensionRegistryImpl.java
deleted file mode 100644
index 7f5cefb..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceExtensionRegistryImpl.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ext;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jst.ws.internal.data.LabelsAndIds;
-
-
-/**
-* This is a generic registry which sets up general code in handling
-* IConfigElements for an extension
-*/
-public abstract class WebServiceExtensionRegistryImpl implements WebServiceExtensionRegistry
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- private Hashtable nameExtensionTable_;
- private Vector id_;
- private Vector label_;
- private LabelsAndIds labelsandids_;
-
- public WebServiceExtensionRegistryImpl()
- {
- nameExtensionTable_ = new Hashtable();
- label_ = new Vector();
- id_ = new Vector();
- loadExtensions();
- }
-
- /**
- * Children registries will have different extension types
- * @return WebserviceExtension holds a config elem
- * for that extension capable of creating an executable file
- */
- public abstract WebServiceExtension createWebServiceExtension(IConfigurationElement configElement);
-
- /**
- * Children must implement how they get the IConfigurationElement[]
- * @return IConfigurationElement[] an array of elements particular to that
- * extension
- */
- public abstract IConfigurationElement[] getConfigElements();
-
- /*
- * Loads WebServiceExtensions for WebServiceClientTest into this registry.
- * This is done by querying the plugin registry for all extensions
- * that extend webServiceClientTest
- */
- private void loadExtensions ()
- {
- IConfigurationElement[] config = getConfigElements();
-
- for(int idx=0; idx<config.length; idx++)
- {
- IConfigurationElement elem = config[idx];
- String name = elem.getAttribute( "name" );
- String id = elem.getAttribute( "id" );
- WebServiceExtension webServiceExtension = createWebServiceExtension(elem);
- nameExtensionTable_.put(name,webServiceExtension);
- label_.add(name);
- id_.add(id);
- }
- }
-
- /**
- * Returns the names of all registered extensions
- * @return The names of all registered extensions.
- */
- public String[] getWebServiceExtensionNames ()
- {
- return (String[])nameExtensionTable_.keySet().toArray( new String[0] );
- }
-
- /**
- * Return the names and Ids
- */
- public LabelsAndIds getLabelsAndIDs()
- {
- labelsandids_ = new LabelsAndIds();
- labelsandids_.setLabels_((String[])label_.toArray( new String[0] ));
- labelsandids_.setIds_((String[])id_.toArray( new String[0] ));
- return labelsandids_;
- }
-
- /**
- * Returns the extension object of the given name
- * @return WebServiceExtension object
- */
- public WebServiceExtension getWebServiceExtensionsByName( String name)
- {
- return (WebServiceExtension)nameExtensionTable_.get(name);
- }
-
- /**
- * Returns All extention objects in this registry
- *@return WebServiceExtension objects
- */
- public WebServiceExtension[] getWebServiceExtensions()
- {
- return (WebServiceExtension[])nameExtensionTable_.values().toArray( new WebServiceExtension[0] );
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceFinishCommand.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceFinishCommand.java
deleted file mode 100644
index 96a29bb..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/WebServiceFinishCommand.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
-* <copyright>
-*
-* Licensed Material - Property of IBM
-* (C) Copyright IBM Corp. 2000, 2002 - All Rights Reserved.
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*
-* </copyright>
-*/
-
-package org.eclipse.jst.ws.internal.ext;
-
-import org.eclipse.wst.command.env.core.Command;
-
-public interface WebServiceFinishCommand extends Command
-{
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/JavaProxyTestCommand.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/JavaProxyTestCommand.java
deleted file mode 100644
index c503972..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/JavaProxyTestCommand.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
-* <copyright>
-*
-* Licensed Material - Property of IBM
-* (C) Copyright IBM Corp. 2000, 2002 - All Rights Reserved.
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*
-* </copyright>
-*/
-
-package org.eclipse.jst.ws.internal.ext.test;
-
-import org.eclipse.wst.command.env.core.selection.BooleanSelection;
-
-public interface JavaProxyTestCommand extends WebServiceTestFinishCommand
-{
-
- /**
- * This holds an info class that comes from user input or some calcilations that needs to be
- * used for the finish
- */
-
- public void setJspFolder(String jspFolder);
-
- public void setRunClientTest(boolean runClientTest);
-
- public void setSampleProject(String sampleProject);
-
- public void setProxyBean(String proxyBean);
-
- public void setSetEndpointMethod(String setEndpointMethod);
-
- public void setClientProject(String clientProject);
-
- public void setMethods(BooleanSelection[] methods);
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WSDLTestFinishCommand.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WSDLTestFinishCommand.java
deleted file mode 100644
index 2523dcf..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WSDLTestFinishCommand.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
-* <copyright>
-*
-* Licensed Material - Property of IBM
-* (C) Copyright IBM Corp. 2000, 2002 - All Rights Reserved.
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*
-* </copyright>
-*/
-
-package org.eclipse.jst.ws.internal.ext.test;
-
-public interface WSDLTestFinishCommand extends WebServiceTestFinishCommand
-{
- public void setServiceProject(String serverProject);
- public void setWsdlServiceURL(String wsdlURI);
- public void setExternalBrowser(boolean external);
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WebServiceTestExtension.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WebServiceTestExtension.java
deleted file mode 100644
index 811ab23..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WebServiceTestExtension.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ext.test;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jst.ws.internal.ext.WebServiceExtensionImpl;
-
-
-
-/**
-* This represents an extension in the plugin registry
-* It job is to act as a proxy to the iconfigelement
-* In particular it holds a client test extension element
-*/
-public class WebServiceTestExtension extends WebServiceExtensionImpl
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- public WebServiceTestExtension(IConfigurationElement configElement)
- {
- super(configElement);
- }
-
- /**
- * Will this testClient generate code
- * @return boolean true if codegen needed
- */
- public boolean isCodeGenNeeded()
- {
- return Boolean.valueOf(getConfigElement().getAttribute( "codegen" )).booleanValue();
- }
-
- /**
- * Use the default Folder Provided by us
- * @return boolean true if no special folder requires
- */
- public boolean useDefaultCodeGenFolder()
- {
- return Boolean.valueOf(getConfigElement().getAttribute( "defaultcodegenfolder" )).booleanValue();
- }
-
- /**
- * Use Special Folder for generated code
- * @return String special folder name
- */
- public String getCodeGenFolder()
- {
- return getConfigElement().getAttribute( "codegenfolder" );
- }
-
- /**
- * Do we need to launch something
- * @return Boolean if true launch codegen
- */
- public boolean isLaunchRequired()
- {
- return Boolean.valueOf(getConfigElement().getAttribute( "launchRequired" )).booleanValue();
- }
-
- /**
- * Do we need the methods for the proxy
- * @return boolean true if proxy methods needed
- */
- public boolean areMethodsNeeded()
- {
- return Boolean.valueOf(getConfigElement().getAttribute( "methodsneeded" )).booleanValue();
- }
-
- /**
- * Does this test machine need a server
- * @return boolean true if a server is required
- */
- public boolean isServerNeeded()
- {
- return Boolean.valueOf(getConfigElement().getAttribute( "serverneeded" )).booleanValue();
- }
-
- /**
- * Use the Default Server chosen by the wizard
- * @return boolean true if the default server is wanted
- */
- public boolean useDefaultServer()
- {
- return Boolean.valueOf(getConfigElement().getAttribute( "defaultserver" )).booleanValue();
- }
-
- /**
- * Use the Default Server chosen by the wizard
- * @return boolean true if the default server is wanted
- */
- public String useServer()
- {
- return getConfigElement().getAttribute( "useserver" );
- }
-
- public boolean isJava()
- {
- return Boolean.valueOf(getConfigElement().getAttribute( "java" )).booleanValue();
- }
-
-
-}
-
-
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WebServiceTestFinishCommand.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WebServiceTestFinishCommand.java
deleted file mode 100644
index 0e87ff5..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WebServiceTestFinishCommand.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
-* <copyright>
-*
-* Licensed Material - Property of IBM
-* (C) Copyright IBM Corp. 2000, 2002 - All Rights Reserved.
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*
-* </copyright>
-*/
-
-package org.eclipse.jst.ws.internal.ext.test;
-
-import java.util.List;
-
-import org.eclipse.jst.ws.internal.ext.WebServiceFinishCommand;
-import org.eclipse.wst.server.core.IServer;
-
-public interface WebServiceTestFinishCommand extends WebServiceFinishCommand
-{
-
- /**
- * If the command needs a server this is the chosen
- * client serverID
- * @param sampleServerTypeID
- */
- public void setServerTypeID(String serviceServerTypeID);
-
- /**
- * This is the IServer if required
- * @param sampleExistingServer
- */
- public void setExistingServer(IServer serviceExistingServer);
-
- /**
- * This is the endpoints if monitor service is enabled
- * @param endpoints
- */
- public void setEndpoint(List endpoints);
-
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WebServiceTestRegistry.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WebServiceTestRegistry.java
deleted file mode 100644
index fbc9bd1..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/ext/test/WebServiceTestRegistry.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.ext.test;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.ws.internal.ext.WebServiceExtension;
-import org.eclipse.jst.ws.internal.ext.WebServiceExtensionRegistryImpl;
-
-public class WebServiceTestRegistry extends WebServiceExtensionRegistryImpl
-{
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- /*
- * This is a singleton becasue it was decided that the memory foot print
- * is not as expensive as the time taken retrieving the data
- *
- */
-
-
- private static WebServiceTestRegistry wstr;
-
- public static WebServiceTestRegistry getInstance()
- {
- if(wstr == null) wstr = new WebServiceTestRegistry();
- return wstr;
- }
-
- private WebServiceTestRegistry()
- {
- super();
- }
-
- /**
- * Children registries will have different extension types
- * @return WebserviceExtension holds a config elem
- * for that extension capable of creating an executable file
- */
- public WebServiceExtension createWebServiceExtension(IConfigurationElement configElement)
- {
- return new WebServiceTestExtension(configElement);
- }
-
- /**
- * Children must implement how they get the IConfigurationElement[]
- * @return IConfigurationElement[] an array of elements particular to that
- * extension
- */
- public IConfigurationElement[] getConfigElements()
- {
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] config = reg.getConfigurationElementsFor(
- "org.eclipse.jst.ws.consumption.ui",
- "webServiceTest");
- return config;
- }
-
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/plugin/WebServicePlugin.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/plugin/WebServicePlugin.java
deleted file mode 100644
index 8296410..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/plugin/WebServicePlugin.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.plugin;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jst.ws.internal.context.PersistentProjectTopologyContext;
-import org.eclipse.jst.ws.internal.context.PersistentScenarioContext;
-import org.eclipse.jst.ws.internal.context.PersistentUDDIPreferenceContext;
-import org.eclipse.jst.ws.internal.context.ProjectTopologyContext;
-import org.eclipse.jst.ws.internal.context.ScenarioContext;
-import org.eclipse.jst.ws.internal.context.UDDIPreferenceContext;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-import org.eclipse.wst.command.internal.env.context.PersistentResourceContext;
-
-
-/**
-* This is the plugin class for the Web Services plugin.
-* <p>
-* This plugin contains the bulk of the Web Services runtime.
-* Only the graphical user interface portion of the runtime is
-* found elsewhere - in the org.eclipse.jst.ws.ui plugin.
-*/
-public class WebServicePlugin extends Plugin
-{
- /**
- * The identifier of the descriptor of this plugin in plugin.xml.
- */
- public static final String ID = "org.eclipse.jst.ws";
-
- /**
- * The reference to the singleton instance of this plugin.
- */
- private static WebServicePlugin instance_;
-
- private PersistentResourceContext resourceContext_;
- private PersistentScenarioContext scenarioContext_;
- private PersistentProjectTopologyContext projectTopologyContext_;
- private PersistentUDDIPreferenceContext uddiPreferenceContext;
- private Log log_;
-
- /**
- * Constructs a runtime plugin object for this plugin.
- * The "plugin" element in plugin.xml should include the attribute
- * class = "org.eclipse.jst.ws.internal.plugin.WebServicePlugin".
- * @param descriptor The descriptor of this plugin.
- */
- public WebServicePlugin ( IPluginDescriptor descriptor )
- {
- super(descriptor);
- if (instance_ == null)
- {
- instance_ = this;
- }
- log_ = new EclipseLog();
- }
-
- // New M7 code will create plugins with the default constructor.
- public WebServicePlugin()
- {
- instance_ = this;
- }
-
- /**
- * Returns the singleton instance of this plugin. Equivalent to calling
- * (WebServicePlugin)Platform.getPlugin("org.eclipse.jst.ws");
- * @return The WebServicePlugin singleton.
- */
- public static WebServicePlugin getInstance ()
- {
- return instance_;
- }
-
- /**
- * Called once by the platform when this plugin is first loaded.
- * @throws CoreException If this plugin fails to start.
- */
- public void startup () throws CoreException
- {
- log_.log(Log.INFO, 5027, this, "startup", "Starting plugin org.eclipse.jst.ws");
- super.startup();
- }
-
- /**
- * Called once by the platform when this plugin is unloaded.
- * @throws CoreException If this plugin fails to shutdown.
- */
- public void shutdown () throws CoreException
- {
- log_.log(Log.INFO, 5028, this, "shutdown", "Shutting plugin org.eclipse.jst.ws");
-
- super.shutdown();
- }
-
- protected void initializeDefaultPluginPreferences()
- {
- ((PersistentProjectTopologyContext) getProjectTopologyContext()).load();
- ((PersistentUDDIPreferenceContext) getUDDIPreferenceContext()).load();
- }
-
- public ResourceContext getResourceContext()
- {
- if (resourceContext_ == null)
- resourceContext_ = PersistentResourceContext.getInstance();
- return resourceContext_;
- }
-
- public ScenarioContext getScenarioContext()
- {
- if (scenarioContext_ == null)
- {
- scenarioContext_ = new PersistentScenarioContext();
- scenarioContext_.load();
- }
-
- return scenarioContext_;
- }
-
- public ProjectTopologyContext getProjectTopologyContext()
- {
- if (projectTopologyContext_ == null)
- projectTopologyContext_ = new PersistentProjectTopologyContext();
- return projectTopologyContext_;
- }
-
-
- public UDDIPreferenceContext getUDDIPreferenceContext()
- {
- if (uddiPreferenceContext == null)
- uddiPreferenceContext = new PersistentUDDIPreferenceContext();
- return uddiPreferenceContext;
- }
-
- /**
- * Returns the message string identified by the given key from
- * plugin.properties.
- * @return The String message.
- */
- public static String getMessage ( String key )
- {
- return instance_.getDescriptor().getResourceString(key);
- }
-
- /**
- * Returns the message string identified by the given key from
- * plugin.properties. Substitution sequences in the message string
- * are replaced by the given array of substitution objects (which
- * are most frequently strings). See the JDK's
- * {@link java.text.MessageFormat java.text.MessageFormat}
- * class for further details on substitution.
- * @return The String message.
- */
- public static String getMessage ( String key, Object[] args )
- {
- return MessageFormat.format(getMessage(key),args);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/variable/initializers/WebServiceClasspathVariableInitializer.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/variable/initializers/WebServiceClasspathVariableInitializer.java
deleted file mode 100644
index 576cfd8..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/variable/initializers/WebServiceClasspathVariableInitializer.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 10, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.ws.internal.variable.initializers;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.ClasspathVariableInitializer;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-
-/**
- * @author kathy
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-public abstract class WebServiceClasspathVariableInitializer
- extends
- ClasspathVariableInitializer {
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathVariableInitializer#initialize(java.lang.String)
- */
- public static final String WEBSERVICE_PLUGIN_ID = "org.eclipse.jst.ws"; //$NON-NLS-1$
- public static final String XERCES_PLUGIN_ID = "org.apache.xerces"; //$NON-NLS-1$
-
- /**
- *
- */
- public WebServiceClasspathVariableInitializer() {
- super();
- }
- protected IPluginDescriptor getWebservicesPluginDescriptor() {
- return Platform.getPluginRegistry().getPluginDescriptor(WEBSERVICE_PLUGIN_ID);
- }
- protected IPluginDescriptor getXercesPluginDescriptor() {
- return Platform.getPluginRegistry().getPluginDescriptor(XERCES_PLUGIN_ID);
- }
- protected IPath createPath(URL aURL) {
- try {
- return new Path(Platform.asLocalURL(aURL).getFile());
- } catch (IOException e) {
- return null;
- }
- }
- protected URL appendURL(URL aURL, String jarName) {
- try {
- return new URL(aURL, jarName);
- } catch (MalformedURLException e) {
- return null;
- }
- }
- protected void setClasspathVariable(String variable, IPath varPath) {
- if (varPath != null) {
- try {
- JavaCore.setClasspathVariable(variable, varPath, null);
- } catch (JavaModelException e) {
- //Logger.getLogger().logError(e);
- }
- }
- }
-
- protected boolean jarExists(IPath jarPath) {
- if (jarPath != null) {
- File file = jarPath.toFile();
- return file != null && file.exists();
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/variable/initializers/XercesAPIVariableInitializer.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/variable/initializers/XercesAPIVariableInitializer.java
deleted file mode 100644
index a486a8c..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/variable/initializers/XercesAPIVariableInitializer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.variable.initializers;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-
-
-public class XercesAPIVariableInitializer extends WebServiceClasspathVariableInitializer {
- public static final String XERCES_API_VARIABLE = "XERCES_API_JAR"; //$NON-NLS-1$
- public static final String XERCES_API_JAR = "xmlParserAPIs.jar"; //$NON-NLS-1$
- /**
- *
- */
- public XercesAPIVariableInitializer() {
- super();
- }
-
- public void initialize(String variable) {
- IPluginDescriptor descr = getXercesPluginDescriptor();
- if (descr == null)
- return;
- URL installURL = descr.getInstallURL();
- //setup the xercesAPI.jar variable
- URL varURL = appendURL(installURL, XERCES_API_JAR);
- if (varURL != null)
- setClasspathVariable(XERCES_API_VARIABLE, createPath(varURL));
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/variable/initializers/XercesImplVariableInitializer.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/variable/initializers/XercesImplVariableInitializer.java
deleted file mode 100644
index e45be5a..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/variable/initializers/XercesImplVariableInitializer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.variable.initializers;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-
-
-public class XercesImplVariableInitializer extends WebServiceClasspathVariableInitializer {
- public static final String XERCES_IMPL_VARIABLE = "XERCES_IMPL_JAR"; //$NON-NLS-1$
- public static final String XERCES_IMPL_JAR = "xercesImpl.jar"; //$NON-NLS-1$
- /**
- *
- */
- public XercesImplVariableInitializer() {
- super();
- }
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathVariableInitializer#initialize(java.lang.String)
- */
- public void initialize(String variable) {
- IPluginDescriptor descr = getXercesPluginDescriptor();
- if (descr == null)
- return;
- URL installURL = descr.getInstallURL();
- //setup the xercesImpl.jar variable
- URL varURL = appendURL(installURL, XERCES_IMPL_JAR);
- if (varURL != null)
- setClasspathVariable(XERCES_IMPL_VARIABLE, createPath(varURL));
- }
-}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/plugin.properties b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/plugin.properties
deleted file mode 100644
index 29bdaaf..0000000
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-
-MSG_ERROR_SERVER=IWAB0213E Error in starting server.
diff --git a/bundles/org.eclipse.wst.command.env.core/.classpath b/bundles/org.eclipse.wst.command.env.core/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/bundles/org.eclipse.wst.command.env.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.command.env.core/.cvsignore b/bundles/org.eclipse.wst.command.env.core/.cvsignore
deleted file mode 100644
index 512f021..0000000
--- a/bundles/org.eclipse.wst.command.env.core/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-build.xml
-runtime
-temp.folder
diff --git a/bundles/org.eclipse.wst.command.env.core/.project b/bundles/org.eclipse.wst.command.env.core/.project
deleted file mode 100644
index 6327dea..0000000
--- a/bundles/org.eclipse.wst.command.env.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.command.env.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.command.env.core/build.properties b/bundles/org.eclipse.wst.command.env.core/build.properties
deleted file mode 100644
index 6883bc7..0000000
--- a/bundles/org.eclipse.wst.command.env.core/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-bin.includes = plugin.xml,\
- *.jar,\
- envcore.jar
-src.includes = .classpath,\
- .project,\
- build.properties,\
- plugin.xml,\
- src/
-source.envcore.jar = src/
-output.envcore.jar = bin/
-jars.compile.order = envcore.jar
diff --git a/bundles/org.eclipse.wst.command.env.core/plugin.properties b/bundles/org.eclipse.wst.command.env.core/plugin.properties
deleted file mode 100644
index c71709d..0000000
--- a/bundles/org.eclipse.wst.command.env.core/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Environment Command Framework (core)
-PLUGIN_PROVIDER=Eclipse.org
diff --git a/bundles/org.eclipse.wst.command.env.core/plugin.xml b/bundles/org.eclipse.wst.command.env.core/plugin.xml
deleted file mode 100644
index 0b07fb0..0000000
--- a/bundles/org.eclipse.wst.command.env.core/plugin.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id = "org.eclipse.wst.command.env.core"
- version = "1.0.0"
- name = "%PLUGIN_NAME"
- provider-name = "%PLUGIN_PROVIDER">
-
- <runtime>
- <library name="envcore.jar">
- <export name="*"/>
- </library>
- </runtime>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/Command.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/Command.java
deleted file mode 100644
index 6fbda35..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/Command.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core;
-
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Status;
-
-/**
- * Commands are executable, undoable, redoable objects.
- * Every Command has a name and a description.
- */
-public interface Command
-{
- /**
- * Returns the name of the Command, a short translatable string
- * indicating what the Command does. Can be null.
- * @return The name of the Command. Can be null.
- */
- public String getName ();
-
- /**
- * Returns the description of the Command. Can be null.
- * @return The description of the Command. Can be null.
- */
- public String getDescription ();
-
- /**
- * Executes the Command.
- * @param environment The environment.
- * Must not be null.
- * @return A <code>Status</code> object indicating the degree
- * to which the <code>execute</code> method was successful.
- * A valud of <code>null</code>, or a Status with a severity
- * of less than <code>Status.ERROR</code> signifies success.
- */
- public Status execute ( Environment environment );
-
- /**
- * Returns <code>true</code> if, and only if, the Command's
- * <code>undo</code> method is supported.
- * @return True if the Command supports being undone.
- */
- public boolean isUndoable ();
-
- /**
- * Undoes the Command.
- * @param environment The environment.
- * Must not be null.
- * @return A <code>Status</code> object indicating the degree
- * to which the <code>undo</code> method was successful.
- * A valud of <code>null</code>, or a Status with a severity
- * of less than <code>Status.ERROR</code> signifies success.
- */
- public Status undo ( Environment environment );
-
- /**
- * Returns <code>true</code> if, and only if, the Command's
- * <code>redo</code> method is supported.
- * @return True if the Command supports being redone.
- */
- public boolean isRedoable ();
-
- /**
- * Re-executes the Command.
- * @param environment The environment.
- * Must not be null.
- * @return A <code>Status</code> object indicating the degree
- * to which the <code>redo</code> method was successful.
- * A value of <code>null</code>, or a Status with a severity
- * of less then <code>Status.ERROR</code> signifies success.
- */
- public Status redo ( Environment environment );
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/CommandFactory.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/CommandFactory.java
deleted file mode 100644
index 9f8df61..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/CommandFactory.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core;
-
-/**
- * This interface is used to create Command objects.
- *
- */
-public interface CommandFactory
-{
- /**
- *
- * @return returns a created Command object.
- */
- public Command create();
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/CommandManager.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/CommandManager.java
deleted file mode 100644
index 9ee6540..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/CommandManager.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core;
-
-/**
- * CommandManagers help manage the lifecycle of Commands.
- */
-public interface CommandManager
-{
- /**
- * Returns true if this CommandManager is capable of undoing
- * Commands. Some CommandManagers and Environments may be of
- * a sort that will never undo() Commands. Command.execute()
- * methods should take advantage of this method to optimize
- * out any caching logic whenever this method returns false.
- */
- public boolean isUndoEnabled ();
-
- // There's probably more, like factory methods for creating
- // Undo/Redo stacks and stuff like that.
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/MultiCommand.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/MultiCommand.java
deleted file mode 100644
index 5dab5fe..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/MultiCommand.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core;
-
-import java.util.Arrays;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
- * This command can be used to group multiple Commands together
- * into a single sequence list of commands to execute.
- *
- *
- */
-public class MultiCommand extends SimpleCommand
-{
-
- protected String name = null;
- protected String description = null;
-
- private List commands_ = new LinkedList();
- private Command[] commandsArray_ = null;
-
- /**
- * Creates a MultiCommand with no name, description, or list of commands.
- *
- */
- public MultiCommand ()
- {
- }
-
- /**
- * Creates a MutilCommands with an empty list of commands.
- * @param name The name of the command.
- * @param description A description of the command.
- */
- public MultiCommand ( String name, String description )
- {
- this.name = name;
- this.description = description;
- }
-
- /**
- * Creates a MultiCommand
- * @param name the name of the command.
- * @param description a description of the command.
- * @param commands an initial list of the commands to execute.
- */
- public MultiCommand ( String name, String description, Command[] commands )
- {
- this.name = name;
- this.description = description;
- commands_.addAll(Arrays.asList(commands));
- }
-
- /**
- * Adds a command to the list of commands to execute.
- * @param command the command to add.
- */
- public void add ( Command command )
- {
- commandsArray_ = null;
- commands_.add(command);
- }
-
- /**
- *
- * @see org.eclipse.wst.command.env.core.Command#getName()
- */
- public String getName ()
- {
- return name != null ? name : (commands_.size() > 0 ? ((Command)commands_.get(0)).getName() : null);
- }
-
- /**
- *
- * @see org.eclipse.wst.command.env.core.Command#getDescription()
- */
- public String getDescription ()
- {
- return description != null ? description : (commands_.size() > 0 ? ((Command)commands_.get(0)).getDescription() : null);
- }
-
- /**
- * Executes the list of commands in the MultiCommand.
- */
- public Status execute ( Environment environment )
- {
- Status status = null;
- Command[] commands = commandsArray();
- for (int i=0; i<commands.length; i++)
- {
- status = commands[i].execute(environment);
-
- if (status != null && status.matches(Status.ERROR))
- {
- for (i--; i>=0; i--)
- {
- commands[i].undo(environment);
- }
- return status;
- }
- }
- return status;
- }
-
- /**
- * Indicates if this command is undoable. If one of the commands
- * in the list is undoable the entire list is considered to be
- * undoable.
- */
- public boolean isUndoable ()
- {
- ListIterator i = commands_.listIterator();
- while (i.hasPrevious())
- {
- if (!((Command)i.previous()).isUndoable())
- {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Undos this command if it can.
- */
- public Status undo ( Environment environment )
- {
- Status status = null;
- ListIterator i = commands_.listIterator();
- while (i.hasPrevious())
- {
- status = ((Command)i.previous()).undo(environment);
- }
- return status;
- }
-
- /**
- * Returns whether this command is redoable or not.
- */
- public boolean isRedoable ()
- {
- ListIterator i = commands_.listIterator();
- while (i.hasNext())
- {
- if (!((Command)i.next()).isRedoable())
- {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Reexecutes this command.
- */
- public Status redo ( Environment environment )
- {
- Status status = null;
- Command[] commands = commandsArray();
- for (int i=0; i<commands.length; i++)
- {
- status = commands[i].redo(environment);
- if (status != null && status.matches(Status.ERROR))
- {
- for (i--; i>=0; i--)
- {
- commands[i].undo(environment);
- }
- return status;
- }
- }
- return status;
- }
-
- private Command[] commandsArray ()
- {
- if (commandsArray_ == null)
- {
- commandsArray_ = (Command[])commands_.toArray(new Command[0]);
- }
- return commandsArray_;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/SimpleCommand.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/SimpleCommand.java
deleted file mode 100644
index 5f30ca7..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/SimpleCommand.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core;
-
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-/**
- * This is a simple implementation of the Command interface that subclass
- * can extend.
- *
- */
-public class SimpleCommand implements Command
-{
- private String name_;
- private String description_;
-
- public SimpleCommand( String name, String description )
- {
- name_ = name;
- description_ = description;
- }
-
- public SimpleCommand()
- {
- name_ = "";
- description_ = "";
- }
-
- /**
- * Sets the name of the command.
- * @param name the name.
- */
- public void setName( String name )
- {
- name_ = name;
- }
-
- /**
- * Sets the description of the command.
- * @param description the description.
- */
- public void setDescription( String description )
- {
- description_ = description;
- }
-
- /**
- * @see org.eclipse.env.command.Command#execute(org.eclipse.env.common.Environment)
- */
- public Status execute(Environment environment)
- {
- return new SimpleStatus( "" );
- }
-
- /**
- * @see org.eclipse.env.command.Command#getDescription()
- */
- public String getDescription()
- {
- return description_;
- }
-
- /**)
- * @see org.eclipse.env.command.Command#getName()
- */
- public String getName()
- {
- return name_;
- }
-
- /**)
- * @see org.eclipse.env.command.Command#isRedoable()
- */
- public boolean isRedoable()
- {
- return false;
- }
-
- /**
- * @see org.eclipse.env.command.Command#isUndoable()
- */
- public boolean isUndoable()
- {
- return false;
- }
-
- /**
- * @see org.eclipse.env.command.Command#redo(org.eclipse.env.common.Environment)
- */
- public Status redo(Environment environment)
- {
- return new SimpleStatus( "" );
- }
-
- /**
- * @see org.eclipse.env.command.Command#undo(org.eclipse.env.common.Environment)
- */
- public Status undo(Environment environment)
- {
- return new SimpleStatus( "" );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Choice.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Choice.java
deleted file mode 100644
index 23cc9b9..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Choice.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-public class Choice {
-
- protected char shortcut = ' ';
- protected String label = null;
- protected String description = null;
-
- /**
- * Constructor for Choice.
- */
- public Choice() {
- }
-
- /**
- * Constructor for Choice.
- * @param shortcut
- * @param label
- */
- public Choice(char shortcut, String label) {
- this.shortcut = shortcut;
- this.label = label;
- }
-
- /**
- * Constructor for Choice.
- * @param shortcut
- * @param label
- * @param description
- */
- public Choice(char shortcut, String label, String description) {
- this.shortcut = shortcut;
- this.label = label;
- this.description = description;
- }
-
- /**
- * Gets the label.
- * @return Returns a String
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * Sets the label.
- * @param label The label to set
- */
- public void setLabel(String label) {
- this.label = label;
- }
-
- /**
- * Gets the description.
- * @return Returns a String
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Sets the description.
- * @param description The description to set
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Gets the shortcut.
- * @return Returns a char
- */
- public char getShortcut() {
- return shortcut;
- }
-
- /**
- * Sets the shortcut.
- * @param shortcut The shortcut to set
- */
- public void setShortcut(char shortcut) {
- this.shortcut = shortcut;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Condition.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Condition.java
deleted file mode 100644
index 9a2fea1..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Condition.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-/**
- * This interface defines a boolean condition that can be evaluated for any object.
- */
-public interface Condition
-{
- /**
- * This returns whether the given object passes this condition.
- */
- public boolean evaluate();
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Environment.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Environment.java
deleted file mode 100644
index 9bd4233..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Environment.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-import org.eclipse.wst.command.env.core.CommandManager;
-import org.eclipse.wst.command.env.core.uri.URIFactory;
-
-
-/**
- * An Environment provides the means for a
- * <ol>
- * <li>A log for writing messages to a logging facility,</li>
- * <li>A progress monitor for receiving progress information,</li>
- * <li>A status handler for receiving and processing status reports,</li>
- * <li>A factory for the handling of URIs (resources).</li>
- * </ol>
- */
-public interface Environment
-{
- /**
- * Returns a logging facility.
- */
- public Log getLog ();
-
- /**
- * Returns a progress monitor.
- */
- public ProgressMonitor getProgressMonitor ();
-
- /**
- * Returns a status handler.
- */
- public StatusHandler getStatusHandler ();
-
- /**
- * Returns a URI factory.
- * Hint: Implementers should insure that the Factory they return
- * has a reference to this Environment so that URI objects can
- * report progress and announce status.
- */
- public URIFactory getURIFactory ();
-
- /**
- * Returns a compiler appropriate to the environment.
- */
- public JavaCompiler getJavaCompiler ();
-
- /**
- * Returns an object that helps manage execution/undoing of Commands.
- */
- public CommandManager getCommandManager ();
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/EnvironmentException.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/EnvironmentException.java
deleted file mode 100644
index b315b61..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/EnvironmentException.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-/**
- * This is the exception class for conditions raised by the Environment.
- */
-public class EnvironmentException extends Exception
-{
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 3978983275899402036L;
-
- protected Status status = null;
-
- /**
- * Creates a new EnvironmentException.
- */
- public EnvironmentException ()
- {
- super();
- }
-
- /**
- * Creates a new EnvironmentException.
- */
- public EnvironmentException ( Status status )
- {
- super(status == null ? null : status.getMessage());
- this.status = status;
- }
-
- /**
- * Returns the Status object.
- */
- public Status getStatus()
- {
- return status;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Evaluate.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Evaluate.java
deleted file mode 100644
index a78591f..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Evaluate.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-/**
- * This interface can be used when a conditional object needs to be returned.
-**/
-public interface Evaluate
-{
- /**
- * @return returns an object based on some evaluated condition.
- **/
- public Object evaluate();
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/JavaCompiler.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/JavaCompiler.java
deleted file mode 100644
index 7710d60..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/JavaCompiler.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-import org.eclipse.wst.command.env.core.uri.URI;
-
-/**
- * This is the interface for an object that does Java compilation
- * of a resource.
- */
-public interface JavaCompiler
-{
- /**
- * Compiles the given Java file to the given class file,
- * using context information on classpaths, options, etc.
- */
- public void compile ( URI javaUri, URI classUri, JavaCompilerContext context );
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/JavaCompilerContext.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/JavaCompilerContext.java
deleted file mode 100644
index cbc9758..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/JavaCompilerContext.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-/**
- * This is the interface for an object that contains data
- * required by JavaCompiler.compile().
- */
-public interface JavaCompilerContext
-{
- // TBD...
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Log.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Log.java
deleted file mode 100644
index a018c80..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Log.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-/**
- * Log objects provide a means for logging information for FFDC etc.
- */
-public interface Log
-{
- public static final int OK = 0;
- public static final int INFO = 1;
- public static final int WARNING = 2;
- public static final int ERROR = 4;
-
- /**
- * Returns true if logging is enabled.
- * There is no requirement to call this method before attempting
- * a call to one of the <code>log</code> methods, as they will
- * quietly do nothing if logging is disabled. This method can be
- * useful, however, anywhere the cost of building up the parameters
- * to a log method might be high and best avoided except when logging
- * is enabled.
- * @return True if logging is enabled, and false otherwise.
- */
- public boolean isEnabled ();
-
- /**
- * Returns true if the the debug option is set to true.
- */
- public boolean isEnabled (String option);
-
- /**
- * Logs a <code>Throwable</code>.
- * @param severity The severity of the logging entry.
- * @param messageNum The message number.
- * @param caller The object (for non-static methods) or class (for
- * static methods) doing the logging.
- * @param method The simple name of the method doing the loging.
- * @param throwable The Throwable to log.
- */
- public void log ( int severity, int messageNum, Object caller, String method, Throwable throwable );
-
- /**
- * Logs a <code>Throwable</code>.
- * @param severity The severity of the logging entry.
- * @param debug option
- * @param messageNum The message number.
- * @param caller The object (for non-static methods) or class (for
- * static methods) doing the logging.
- * @param method The simple name of the method doing the loging.
- * @param throwable The Throwable to log.
- */
- public void log ( int severity, String option, int messageNum, Object caller, String method, Throwable throwable );
-
- /**
- * Logs a <code>Status</code>.
- * @param severity The severity of the logging entry.
- * @param messageNum The message number.
- * @param caller The object (for non-static methods) or class (for
- * static methods) doing the logging.
- * @param method The simple name of the method doing the loging.
- * @param status The Status to log.
- */
- public void log ( int severity, int messageNum, Object caller, String method, Status status );
-
- /**
- * Logs a <code>Status</code>.
- * @param severity The severity of the logging entry.
- * @param debug option
- * @param messageNum The message number.
- * @param caller The object (for non-static methods) or class (for
- * static methods) doing the logging.
- * @param method The simple name of the method doing the loging.
- * @param status The Status to log.
- */
- public void log ( int severity, String option, int messageNum, Object caller, String method, Status status );
-
- /**
- * Logs an <code>Object</code>.
- * @param severity The severity of the logging entry.
- * @param messageNum The message number.
- * @param caller The object (for non-static methods) or class (for
- * static methods) doing the logging.
- * @param method The simple name of the method doing the loging.
- * @param object The Object to log.
- */
- public void log ( int severity, int messageNum, Object caller, String method, Object object );
-
- /**
- * Logs an <code>Object</code>.
- * @param severity The severity of the logging entry.
- * @param debug option
- * @param messageNum The message number.
- * @param caller The object (for non-static methods) or class (for
- * static methods) doing the logging.
- * @param method The simple name of the method doing the loging.
- * @param object The Object to log.
- */
- public void log ( int severity, String option, int messageNum, Object caller, String method, Object object );
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/MessageUtils.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/MessageUtils.java
deleted file mode 100644
index 916e609..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/MessageUtils.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-import java.text.MessageFormat;
-import java.util.Hashtable;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-/**
- * This class provides a convienent way to access resource bundles and
- * retieve translated strings.
- *
- *
- */
-public class MessageUtils
-{
- private ResourceBundle resource_;
-
- private static Hashtable bundles_ = new Hashtable();
-
- /**
- *
- * @param bundleId the resource bundle ID.
- * @param object the class loader for this object will be used to retrieve
- * the resource bundle.
- */
- public MessageUtils( String bundleId, Object object )
- {
- this( bundleId, object.getClass().getClassLoader() );
- }
-
- /**
- *
- * @param bundleId the resource bundle ID.
- * @param loader the class loader that will be used to retrieve
- * the resource bundle.
- */
- public MessageUtils( String bundleId, ClassLoader loader )
- {
- resource_ = (ResourceBundle)bundles_.get( bundleId );
-
- if( resource_ == null )
- {
- resource_ = ResourceBundle.getBundle( bundleId, Locale.getDefault(), loader );
- bundles_.put( bundleId, resource_ );
- }
- }
-
- /**
- *
- * @param key the key for the string to retrieve.
- * @return returns the translated string.
- */
- public String getMessage ( String key )
- {
- String value = key;
-
- try
- {
- value = resource_.getString( key );
- }
- catch( Throwable exc )
- {
- }
-
- return value;
- }
-
- /**
- *
- * @param key the key for the string to retrieve.
- * @param args These arguments will be substituted into the translated string.
- * @return returns the translated string with any substitutions.
- */
- public String getMessage ( String key, Object[] args )
- {
- return MessageFormat.format( getMessage(key),args );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/NullProgressMonitor.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/NullProgressMonitor.java
deleted file mode 100644
index c9ed3a9..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/NullProgressMonitor.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-/**
- * A ProgressMonitor that does nothing.
- */
-public class NullProgressMonitor implements ProgressMonitor
-{
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.ProgressMonitor#getChildProgressMonitor()
- */
- public ProgressMonitor getChildProgressMonitor()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.ProgressMonitor#isCancelRequested()
- */
- public boolean isCancelRequested()
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.ProgressMonitor#report(java.lang.String)
- */
- public void report(String progress)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/NullStatusHandler.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/NullStatusHandler.java
deleted file mode 100644
index 0c24c43..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/NullStatusHandler.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-public class NullStatusHandler implements StatusHandler
-{
-
- /**
- * @see org.eclipse.env.common.StatusHandler#report(org.eclipse.env.common.Status, org.eclipse.env.common.Choice[])
- */
- public Choice report(Status status, Choice[] choices)
- {
- Choice result = null;
-
- // Always take the first choice if available.
- if( choices != null && choices.length > 0 )
- {
- result = choices[0];
- }
-
- return result;
- }
-
- /**
- * @see org.eclipse.env.common.StatusHandler#report(org.eclipse.env.common.Status)
- */
- public void report(Status status) throws StatusException
- {
- }
-
- /*
- * Report a warning.
- */
- private boolean reportWarning(Status status)
- {
- return true;
- }
-
- /*
- * Report and error.
- */
- private boolean reportErrorStatus(Status status)
- {
- return false;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.StatusHandler#reportError(org.eclipse.wst.command.env.core.common.Status)
- */
- public void reportError(Status status)
- {
- reportErrorStatus( status );
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.StatusHandler#reportInfo(org.eclipse.wst.command.env.core.common.Status)
- */
- public void reportInfo(Status status)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/ProgressMonitor.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/ProgressMonitor.java
deleted file mode 100644
index c63153e..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/ProgressMonitor.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-public interface ProgressMonitor
-{
- /**
- * Reports progress.
- */
- public void report ( String progress );
-
- /**
- * Returns a new progress monitor that will record progress
- * messages as "children" of the message most recently reported
- * thru the parent monitor.
- */
- public ProgressMonitor getChildProgressMonitor ();
-
- /**
- * Returns true if the environment has requested cancellation
- * of the operation in progress. It is entirely up to a Command
- * to decide if, and when, to consult this method.
- */
- public boolean isCancelRequested ();
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Range.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Range.java
deleted file mode 100644
index b30b4ae..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Range.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-import org.eclipse.wst.command.env.core.uri.URI;
-
-/**
- * Carries position information within a resource.
- */
-public interface Range
-{
- public static final int UNKNOWN = -1;
-
- /**
- * Returns the identifier of the resource the range applies to.
- */
- public URI getURI ();
-
- /**
- * Returns the index, zero-indexed, of the first line
- * of the range.
- */
- public int getStartingLineNumber ();
-
- /**
- * Returns the index, zero-indexed, of the first character
- * of the range relative to the beginning of the line.
- */
- public int getStartingCharNumberInLine ();
-
- /**
- * Returns the index, zero-indexed, of the first character
- * of the range relative to the beginning of the file.
- */
- public int getStartingCharNumberInURI ();
-
- /**
- * Returns the index, zero-indexed, of the last line
- * of the range.
- */
- public int getEndingLineNumber ();
-
- /**
- * Returns the offset, zero-indexed, of the last character
- * of the range relative to the beginning of the line.
- */
- public int getEndingCharNumberInLine ();
-
- /**
- * Returns the index, zero-indexed, of the last character
- * of the range relative to the beginning of the file.
- */
- public int getEndingCharNumberInURI ();
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/RangeVector.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/RangeVector.java
deleted file mode 100644
index c208685..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/RangeVector.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-import java.util.Vector;
-
-/**
- * This Vector makes the protected method removeRange public.
- *
- */
-public class RangeVector extends Vector
-{
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 4048793476659230773L;
-
- public void removeRange( int start, int end )
- {
- super.removeRange( start, end );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/SimpleStatus.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/SimpleStatus.java
deleted file mode 100644
index 51b3689..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/SimpleStatus.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Iterator;
-
-/**
- * A usually sufficient implementation of Status.
- */
-public class SimpleStatus implements Status
-{
-
- private List children_ = new LinkedList();
- private String id_;
- private String message_;
- private int severity_;
- private Throwable throwable_;
-
- /**
- * Method SimpleStatus.
- * @param id
- */
- public SimpleStatus ( String id )
- {
- this(id,"",OK,null);
- }
-
- /**
- * Method SimpleStatus.
- * @param id
- * @param message
- * @param severity
- */
- public SimpleStatus ( String id, String message, int severity )
- {
- this(id,message,severity,null);
- }
-
- /**
- * Method SimpleStatus.
- * @param id
- * @param message
- * @param children
- */
- public SimpleStatus ( String id, String message, Status[] children )
- {
- this(id,message,OK,null);
- for (int i=0; i<children.length; i++)
- {
- children_.add(children[i]);
- }
- }
-
- /**
- * Method SimpleStatus.
- * @param id
- * @param message
- * @param severity
- * @param throwable
- */
- public SimpleStatus ( String id, String message, int severity, Throwable throwable )
- {
- id_ = id;
- message_ = message;
- severity_ = severity;
- throwable_ = throwable;
- }
-
- /**
- * @see Status#getId()
- */
- public String getId ()
- {
- return id_;
- }
-
- /**
- * @see Status#getMessage()
- */
- public String getMessage ()
- {
- return message_;
- }
-
- /**
- * @see Status#getSeverity()
- */
- public int getSeverity ()
- {
- int severity = severity_;
- if (children_.size() > 0)
- {
- Iterator i = children_.iterator();
- while (i.hasNext())
- {
- Status status = (Status)i.next();
- int childSeverity = status.getSeverity();
- if (childSeverity > severity)
- {
- severity = childSeverity;
- }
- }
- }
- return severity;
- }
-
- /**
- * @see Status#getThrowable()
- */
- public Throwable getThrowable ()
- {
- return throwable_;
- }
-
- /**
- * @see Status#hasChildren()
- */
- public boolean hasChildren ()
- {
- return children_.size() > 0;
- }
-
- /**
- * @see Status#getChildren()
- */
- public Status[] getChildren ()
- {
- return (Status[])children_.toArray(new Status[0]);
- }
-
- /**
- * @see Status#matches(int)
- */
- public boolean matches ( int mask )
- {
- return (getSeverity() | mask) != 0;
- }
-
- /**
- * Method addChild.
- * @param status
- */
- public void addChild ( Status status )
- {
- children_.add(status);
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Status.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Status.java
deleted file mode 100644
index 38e8ae3..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/Status.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-/**
- * Carries status information.
- */
-public interface Status
-{
- /**
- * Status: Everything is fine, and there are no messages or details.
- */
- public static final int OK = 0;
-
- /**
- * Status: Everything is fine, but there is information to report.
- */
- public static final int INFO = 1;
-
- /**
- * Status: Things are working, but possibly not as expected.
- */
- public static final int WARNING = 2;
-
- /**
- * Status: Blammo.
- */
- public static final int ERROR = 4;
-
- /**
- * Returns a non-translated application specific identifier.
- * May return null.
- */
- public String getId ();
-
- /**
- * Returns a translated (locale-sensitive) message.
- * May return null.
- */
- public String getMessage ();
-
- /**
- * Returns the severity.
- */
- public int getSeverity ();
-
- /**
- * Returns an exception (throwable) behind the status, if any.
- * May return null.
- */
- public Throwable getThrowable ();
-
- /**
- * Returns true if this status object has child status objects.
- */
- public boolean hasChildren ();
-
- /**
- * Returns the immediate child Status objects of this object.
- * Never returns null, but may return a zero-length array.
- */
- public Status[] getChildren ();
-
- /**
- * Returns true if this status' severity matches the severity
- * mask passed in. Strictly speaking:
- * this.matches(that) == (this.getSeverity() | that != 0)
- */
- public boolean matches ( int mask );
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/StatusException.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/StatusException.java
deleted file mode 100644
index 825bc66..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/StatusException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-/**
- * This is the exception class used by StatusHandlers to tell their
- * callers that processing should stop.
- */
-public class StatusException extends EnvironmentException
-{
- /**
- * Comment for <code>serialVersionUID</code>
- * */
- private static final long serialVersionUID = 3618141160322119992L;
-
- /**
- * The Choice that lead to the exception being thrown,
- * if any (ie. may be null).
- */
- protected Choice choice;
-
- /**
- * Creates a new StatusException with the given Status.
- */
- public StatusException( Status status )
- {
- super( status );
- }
-
- /**
- * Creates a new StatusException with the given Choice.
- * The Choice may be null.
- */
- public StatusException ( Choice choice )
- {
- super();
- this.choice = choice;
- }
-
- /**
- * Creates a new StatusException with the given Choice
- * and status object. The Choice may be null.
- */
- public StatusException ( Status status, Choice choice )
- {
- super(status);
- this.choice = choice;
- }
-
- /**
- * Returns the Choice object inside this exception.
- */
- public Choice getChoice ()
- {
- return choice;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/StatusHandler.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/StatusHandler.java
deleted file mode 100644
index be4b312..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/common/StatusHandler.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.common;
-
-/**
- * Processes status events raised by the caller and returns an
- * indication of choices made by the recipient of the status and
- * may raise an exception against the caller to have them abort
- * procesing.
- */
-public interface StatusHandler
-{
- /**
- * Reports the given Status and set of possible responses.
- * Returns the choice made by the handler.
- */
- public Choice report ( Status status, Choice[] choices );
-
- /**
- * Reports the given Status with implied options to either
- * continue or abort.
- * Throws an exception if the handler decides the caller
- * should stop processing.
- */
- public void report ( Status status ) throws StatusException;
-
- /**
- * Report the given Error Status. No user feedback is provided.
- * @param status
- */
- public void reportError( Status status );
-
- /**
- * Report the given Info Status. No user feedback is provided.
- * @param status
- */
- public void reportInfo( Status status );
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/Context.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/Context.java
deleted file mode 100644
index 9f1c9ad..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/Context.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.context;
-
-/**
- * This interface provides a way to get and set preference information.
- *
- */
-public interface Context
-{
- /**
- * Loads the preference data into this Context object.
- *
- */
- public void load();
-
- /**
- * Sets the default for a boolean preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setDefault (String name, boolean value);
-
- /**
- * Sets the default for a string preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setDefault (String name, String value);
-
- /**
- * Sets the default for a int preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setDefault (String name, int value);
-
- /**
- * Sets the value for a string preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setValue (String name, String value);
-
- /**
- * Sets the value for a boolean preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setValue (String name, boolean value);
-
- /**
- * Sets the value for a int preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setValue (String name, int value);
-
- /**
- * Gets the value for a string preference.
- * @param name the preference name.
- * @return the preference value.
- */
- public String getValueAsString ( String name);
-
- /**
- * Gets the value for a boolean preference.
- * @param name the preference name.
- * @return the preference value.
- */
- public boolean getValueAsBoolean ( String name);
-
- /**
- * Gets the value for a int preference.
- * @param name the preference name.
- * @return the preference value.
- */
- public int getValueAsInt ( String name);
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/ResourceContext.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/ResourceContext.java
deleted file mode 100644
index a20d7b5..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/ResourceContext.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.context;
-
-public interface ResourceContext
-{
- /**
- * This constant string is used to lookup the overwrite files general preference from
- * the plugins local preferences store.
- **/
- public static final String PREFERENCE_OVERWRITE = "filesOverwrite";
-
- /**
- * This constant string is used to lookup the create folders general preference from
- * the plugins local preferences store.
- **/
- public static final String PREFERENCE_CREATE_FOLDERS = "createFolders";
-
- /**
- * This constant string is used to lookup the checkout files general preference from
- * the plugins local preferences store.
- **/
- public static final String PREFERENCE_CHECKOUT = "filesCheckout";
-
- /**
- *
- * @param enable set whether overwriting of files is enabled.
- */
- public void setOverwriteFilesEnabled ( boolean enable);
-
- /**
- *
- * @return returns whether overwriting of files is enabled.
- */
- public boolean isOverwriteFilesEnabled();
-
- /**
- *
- * @param enable set whether creation of folders is enabled.
- */
- public void setCreateFoldersEnabled( boolean enable);
-
- /**
- *
- * @return returns whether creation of folders is enabled.
- */
- public boolean isCreateFoldersEnabled();
-
- /**
- *
- * @param enable sets whether automatic checkout of files is enabled.
- */
- public void setCheckoutFilesEnabled( boolean enable);
-
- /**
- *
- * @return returns whether automatic checkout of files is enabled.
- */
- public boolean isCheckoutFilesEnabled();
-
- /**
- *
- * @return returns a copy of this ResourceContext.
- */
- public ResourceContext copy();
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/ResourceDefaults.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/ResourceDefaults.java
deleted file mode 100644
index 92c84b3..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/ResourceDefaults.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.context;
-
-public class ResourceDefaults
-{
- private static final boolean PREFERENCE_OVERWRITE_DEFAULT = false;
- private static final boolean PREFERENCE_CREATE_FOLDERS_DEFAULT = true;
- private static final boolean PREFERENCE_CHECKOUT_DEFAULT = false;
-
- /**
- *
- * @return returns the default setting for overwriting files.
- */
- public static boolean getOverwriteFilesDefault ()
- {
- return PREFERENCE_OVERWRITE_DEFAULT;
- }
-
- /**
- *
- * @return returns the default setting ofr creating folders.
- */
- public static boolean getCreateFoldersDefault ()
- {
- return PREFERENCE_CREATE_FOLDERS_DEFAULT;
- }
-
- /**
- *
- * @return returns the default setting for checking out files.
- */
- public static boolean getCheckoutFilesDefault()
- {
- return PREFERENCE_CHECKOUT_DEFAULT;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/TransientResourceContext.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/TransientResourceContext.java
deleted file mode 100644
index a845b41..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/context/TransientResourceContext.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.context;
-
-/**
- * This class implements a ResourceContext interface where the state
- * of the context data is transient.
- *
- */
-public class TransientResourceContext implements ResourceContext
-{
- private boolean overWriteFiles;
- private boolean createFolders;
- private boolean checkOutFiles;
-
- public TransientResourceContext() {
- setOverwriteFilesEnabled(ResourceDefaults.getOverwriteFilesDefault());
- setCreateFoldersEnabled(ResourceDefaults.getCreateFoldersDefault());
- setCheckoutFilesEnabled(ResourceDefaults.getCheckoutFilesDefault());
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.context.ResourceContext#setOverwriteFilesEnabled(boolean)
- */
- public void setOverwriteFilesEnabled(boolean enable) {
- overWriteFiles = enable;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.context.ResourceContext#isOverwriteFilesEnabled()
- */
- public boolean isOverwriteFilesEnabled() {
- return overWriteFiles;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.context.ResourceContext#setCreateFoldersEnabled(boolean)
- */
- public void setCreateFoldersEnabled(boolean enable) {
- createFolders = enable;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.context.ResourceContext#isCreateFoldersEnabled()
- */
- public boolean isCreateFoldersEnabled() {
- return createFolders;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.context.ResourceContext#setCheckoutFilesEnabled(boolean)
- */
- public void setCheckoutFilesEnabled(boolean enable) {
- checkOutFiles = enable;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.context.ResourceContext#isCheckoutFilesEnabled()
- */
- public boolean isCheckoutFilesEnabled() {
- return checkOutFiles;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.context.ResourceContext#copy()
- */
- public ResourceContext copy() {
- ResourceContext cc = new TransientResourceContext();
- cc.setOverwriteFilesEnabled(isOverwriteFilesEnabled());
- cc.setCreateFoldersEnabled(isCreateFoldersEnabled());
- cc.setCheckoutFilesEnabled(isCheckoutFilesEnabled());
- return cc;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/data/DataMappingRegistry.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/data/DataMappingRegistry.java
deleted file mode 100644
index ecf42ca..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/data/DataMappingRegistry.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.data;
-
-public interface DataMappingRegistry
-{
- /**
- * This method adds a data mapping from a source object to a target
- * object. When the sourceObject is encountered by the framework the
- * sourceProperty will be called and the data will be passed to the
- * targetProperty in the targetObject. If a transformer object is
- * specified the sourceObject is transformed before being passed to
- * the target object.
- *
- * @param sourceType The source object.
- * @param sourceProperty The source property.
- * @param targetType The target object.
- * @param targetProperty The target property.
- * @param transformer The transformer object that transforms the
- * the source object.
- */
- public void addMapping( Class sourceType,
- String sourceProperty,
- Class targetType,
- String targetProperty,
- Transformer transformer );
-
- /**
- * This method is equivalent to the above with targetProperty the same
- * as the sourceProperty and with the transformer set to null.
- *
- * @param sourceType The source object.
- * @param sourceProperty The source property.
- * @param targetType The target object.
- */
- public void addMapping( Class sourceType,
- String sourceProperty,
- Class targetType );
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/data/Transformer.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/data/Transformer.java
deleted file mode 100644
index 0a80f0c..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/data/Transformer.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.data;
-
-/**
- * This interface is used to transform an object from one class to another.
- *
- */
-public interface Transformer
-{
- /*
- * @return returns a transformed object based on the input value.
- */
- public Object transform( Object value );
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/environment.properties b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/environment.properties
deleted file mode 100644
index b1d7769..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/environment.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages for SimpleURIFactory
-#
-MSG_NULL_ARG_SPECIFIED=Null specified as argument to {0}.
-MSG_SCHEME_NOT_FOUND=Scheme not found for URI {0}.
-MSG_ABSOLUTE_PATH_WITHOUT_SCHEME=Absolute path specified without a scheme for URI {0}.
-
-#
-# Common Messages
-#
-MSG_URI_NOT_RELATIVE=URL: {0} is not relative.
-MSG_ERROR_UNEXPECTED_ERROR=IWAB0014E Unexpected exception occured.
-
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/AbstractCommandFragment.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/AbstractCommandFragment.java
deleted file mode 100644
index 7a3e42c..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/AbstractCommandFragment.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-import org.eclipse.wst.command.env.core.CommandFactory;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-
-
-/**
- * This class is used as the base class for other standard fragment classes.
- *
-**/
-public abstract class AbstractCommandFragment implements CommandFragment
-{
- private CommandFactory commandFactory_;
- private String id_;
- private boolean doNotRunInTransaction_ = false;
-
- /**
- * Copy constructor.
- * @param fragment
- */
- protected AbstractCommandFragment( AbstractCommandFragment fragment )
- {
- commandFactory_ = fragment.commandFactory_;
- id_ = fragment.id_;
- }
-
- /**
- * Creates a new AbstractCommandFragment.
- *
- * @param command the executable command for this fragment.
- **/
- public AbstractCommandFragment( CommandFactory commandFactory, String id )
- {
- commandFactory_ = commandFactory;
- id_ = id;
- }
-
- public String getId()
- {
- return id_;
- }
-
- public void setId( String id )
- {
- id_ = id;
- }
-
- /**
- * Gets executable command associated with this fragment.
- *
- * @return returns the first child fragment for this fragment. Returns
- * null when there is no first child.
- **/
- public CommandFactory getCommandFactory()
- {
- return commandFactory_;
- }
-
- /**
- * This method is called retrieve the data mappings for this command fragment.
- */
- public void registerDataMappings( DataMappingRegistry registry )
- {
- // The default behaviour is not to add any entries to the registry.
- }
-
- /**
- *
- * @return If the commands for this fragment should not be run within a transaction then
- * this method should return true. If the fragment does not care if it is run in a transaction
- * or not it should return false.
- */
- public boolean doNotRunInTransaction()
- {
- return doNotRunInTransaction_;
- }
-
- /**
- * Sets the run in transaction property.
- * @param doNotRunInTransaction
- */
- public void setDoNotRunInTransaction( boolean doNotRunInTransaction )
- {
- doNotRunInTransaction_ = doNotRunInTransaction;
- }
-
- /**
- * All fragments need to be cloneable.
- **/
- abstract public Object clone();
-
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/BooleanFragment.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/BooleanFragment.java
deleted file mode 100644
index ebbda80..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/BooleanFragment.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-import org.eclipse.wst.command.env.core.CommandFactory;
-import org.eclipse.wst.command.env.core.common.Condition;
-
-
-/**
- * This class returns either the true fragment or the false fragment
- * based on the response from the condition object.
-**/
-public class BooleanFragment extends AbstractCommandFragment
-{
- private CommandFragment trueFragment_;
- private CommandFragment falseFragment_;
- private Condition condition_;
-
- /**
- * Create a BooleanFragment with default values.
- *
- */
- public BooleanFragment()
- {
- this( null, null, new Condition()
- {
- public boolean evaluate()
- {
- return true;
- }
- },
- null, "" );
- }
-
- /**
- *
- * @param trueFragment The fragment chosen if the condition is true.
- * @param falseFragment The fragment chosen if the condition is false.
- * @param condition The condition.
- */
- public BooleanFragment( CommandFragment trueFragment,
- CommandFragment falseFragment,
- Condition condition )
- {
- this( trueFragment, falseFragment, condition, null, "" );
- }
-
- /**
- * Creates a new BooleanFragment.
- *
- * @param trueFragment returned if condition is true.
- * @param falseFragment returned if condition is false.
- * @param condition the condition for this fragment.
- * @param state the state passed to the condition.
- * @param command the exectable command for this fragment.
- **/
- public BooleanFragment( CommandFragment trueFragment,
- CommandFragment falseFragment,
- Condition condition,
- CommandFactory commandFactory,
- String id )
- {
- super( commandFactory, id );
-
- trueFragment_ = trueFragment;
- falseFragment_ = falseFragment;
- condition_ = condition;
- }
-
- /**
- * Copy constructor.
- * @param frag
- */
- protected BooleanFragment( BooleanFragment frag )
- {
- this( null,
- null,
- frag.condition_,
- frag.getCommandFactory(),
- frag.getId() );
-
- // Now we have to clone in the true and false
- // fragments.
- trueFragment_ = (CommandFragment)trueFragment_.clone();
- falseFragment_ = (CommandFragment)falseFragment_.clone();
- }
-
- /**
- * Makes a copy of the CommandFragment.
- *
- * @return returns a copy of this fragment.
- **/
- public Object clone()
- {
- return new BooleanFragment( this );
- }
-
- /**
- * Gets the first child fragment for this fragment.
- *
- * @return returns the first child fragment for this fragment. Returns
- * null when there is no first child.
- **/
- public CommandFragment getFirstSubFragment()
- {
- return condition_.evaluate() ? trueFragment_ : falseFragment_;
- }
-
- /**
- * Gets the next child fragment for this fragment.
- *
- * @return returns the next child fragment for this fragment. Returns null
- * when there is no next child.
- **/
- public CommandFragment getNextSubFragment( CommandFragment fragment )
- {
- return null;
- }
-
- /**
- * Sets the condition.
- * @param condition
- */
- public void setCondition( Condition condition )
- {
- condition_ = condition;
- }
-
- /**
- * Sets the true fragment.
- * @param fragment
- */
- public void setTrueFragment( CommandFragment fragment )
- {
- trueFragment_ = fragment;
- }
-
- /**
- * Sets the false fragment.
- * @param fragment
- */
- public void setFalseFragment( CommandFragment fragment )
- {
- falseFragment_ = fragment;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/ChoiceFragment.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/ChoiceFragment.java
deleted file mode 100644
index 35f80f8..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/ChoiceFragment.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.wst.command.env.core.CommandFactory;
-import org.eclipse.wst.command.env.core.common.Evaluate;
-
-
-/**
- * This class returns a fragment from a list of fragments based
- * on the object returned from the Evaluate object.
-**/
-public class ChoiceFragment extends AbstractCommandFragment
-{
- private Hashtable fragmentTable_;
- private Evaluate evaluate_;
-
- /**
- * Create a clone with new a new hashtable.
- **/
- protected ChoiceFragment( ChoiceFragment frag )
- {
- super( frag.getCommandFactory(), frag.getId() );
-
- evaluate_ = frag.evaluate_;
- fragmentTable_ = new Hashtable();
-
- Enumeration keys = frag.fragmentTable_.keys();
-
- // Clone the fragments in the table.
- while( keys.hasMoreElements() )
- {
- Object key = keys.nextElement();
- fragmentTable_.put( key, ((CommandFragment)frag.fragmentTable_.get(key)).clone() );
- }
- }
-
- public ChoiceFragment( Object[] keys,
- CommandFragment[] fragments )
- {
- this( keys, fragments, null, null, "" );
- }
-
- public ChoiceFragment( Object[] keys,
- CommandFragment[] fragments,
- Evaluate evaluate )
- {
- this( keys, fragments, evaluate, null, "" );
- }
-
- public void setEvaluate( Evaluate evaluate )
- {
- evaluate_ = evaluate;
- }
-
- /**
- * Constructs a choice fragment. The key at index X is mapped to
- * to the fragment at index X.
- *
- * @param keys these keys must be unique as determined by the equals method.
- * They are used to identify which fragment to return.
- * @param fragments these are the fragments to be returned. Null is not allowed
- * as an entry in the array.
- * @param evaluate the object returned by this evaluate object is used
- * as the key to locate a fragment.
- * @param state the state passed to evaluate.
- **/
- public ChoiceFragment( Object[] keys,
- CommandFragment[] fragments,
- Evaluate evaluate,
- CommandFactory commandFactory,
- String id )
- {
- super( commandFactory, id );
-
- evaluate_ = evaluate;
- fragmentTable_ = new Hashtable();
-
- if( keys == null || fragments == null || keys.length != fragments.length )
- {
- throw new IllegalArgumentException( "Bad keys or fragments." );
- }
- else
- {
- // Create the fragment table.
- for( int index = 0; index < keys.length; index++ )
- {
- fragmentTable_.put( keys[index], fragments[index] );
- }
- }
- }
-
- /**
- * Makes a copy of the CommandFragment.
- *
- * @return returns a copy of this fragment.
- **/
- public Object clone()
- {
- return new ChoiceFragment( this );
- }
-
- /**
- * Gets the first child fragment for this fragment.
- *
- * @return returns the first child fragment for this fragment. Returns
- * null when there is no first child.
- **/
- public CommandFragment getFirstSubFragment()
- {
- Object key = evaluate_.evaluate();
- CommandFragment fragment = (CommandFragment)fragmentTable_.get(key);
-
- if( fragment == null )
- {
- throw new IllegalArgumentException( "Key not found in table. Key=" + key );
- }
-
- return fragment;
- }
-
- /**
- * Gets the next child fragment for this fragment.
- *
- * @return returns the next child fragment for this fragment. Returns null
- * when there is no next child.
- **/
- public CommandFragment getNextSubFragment( CommandFragment fragment )
- {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragment.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragment.java
deleted file mode 100644
index e4fe06f..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragment.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-import org.eclipse.wst.command.env.core.CommandFactory;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-
-
-/**
- * This interface describes a list of interruptable commands. The
- * order of this list of commands is defined by the getFirstSubFragment and
- * getNextSubFragment methods.
-**/
-public interface CommandFragment extends Cloneable
-{
- /**
- *
- * @return Returns a unique identifier for this fragment.
- */
- public String getId();
-
- /**
- * Gets executable command associated with this fragment.
- *
- * @return returns the first child fragment for this fragment. Returns
- * null when there is no first child.
- **/
- public CommandFactory getCommandFactory();
-
- /**
- * Gets the first child fragment for this fragment.
- *
- * @return returns the first child fragment for this fragment. Returns
- * null when there is no first child.
- **/
- public CommandFragment getFirstSubFragment();
-
- /**
- * Gets the next child fragment for this fragment.
- *
- * @return returns the next child fragment for this fragment. Returns null
- * when there is no next child.
- **/
- public CommandFragment getNextSubFragment( CommandFragment fragment );
-
- /*
- * This method is called to retrieve the data mappings for this command fragment.
- */
- public void registerDataMappings( DataMappingRegistry registry );
-
- /**
- *
- * @return If the commands for this fragment should not be run within a transaction then
- * this method should return true. If the fragment does not care if it is run in a transaction
- * or not it should return false.
- */
- public boolean doNotRunInTransaction();
-
- /**
- * All wizard fragments need to be cloneable.
- **/
- public Object clone();
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragmentEngine.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragmentEngine.java
deleted file mode 100644
index ad8be05..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragmentEngine.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-import java.util.Stack;
-
-import org.eclipse.wst.command.env.core.Command;
-import org.eclipse.wst.command.env.core.CommandFactory;
-import org.eclipse.wst.command.env.core.CommandManager;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.internal.env.core.data.DataFlowManager;
-
-
-
-/**
- * The CommandFragmentEngine provides a convienent way to traverse CommandFragments
- * and possiblity execute its associate Command.
- */
-public class CommandFragmentEngine implements CommandManager
-{
- private Stack commandStack_;
- private FragmentListener undoFragmentListener_;
- private FragmentListener nextFragmentListener_;
- private FragmentListener peekFragmentListener_;
- private DataFlowManager dataManager_;
- private Environment environment_;
- private Status lastStatus_;
-
- /**
- * Creates a CommandFragmentEngine.
- *
- * @param startFragment the root fragment where traversal will begin.
- * @param dataManager the data manager containing all of the data mappings.
- * @param environment the environment.
- */
- public CommandFragmentEngine( CommandFragment startFragment, DataFlowManager dataManager, Environment environment )
- {
- SequenceFragment root = new SequenceFragment();
- root.add( startFragment );
-
- commandStack_ = new Stack();
-
- addToStack( root, -1 );
- addToStack( startFragment, 0 );
-
- dataManager_ = dataManager;
- environment_ = environment;
- }
-
- /**
- *
- * @return the Status from the last Command executed.
- */
- public Status getLastStatus()
- {
- return lastStatus_;
- }
-
- /**
- */
- public boolean isUndoEnabled()
- {
- return true;
- }
-
- /**
- * Sets the next fragment listener for this engine. This listener will be
- * called for each fragment that is traversed in moveForwardToNextStop operation.
- *
- * @param listener the fragment listener.
- */
- public void setNextFragmentListener( FragmentListener listener )
- {
- nextFragmentListener_ = listener;
- }
-
- /**
- * Sets the next fragment listener for this engine. This listener will be
- * called for each fragment that is traversed in peekForwardToNextStop operation.
- *
- * @param listener the fragment listener.
- */
- public void setPeekFragmentListener( FragmentListener listener )
- {
- peekFragmentListener_ = listener;
- }
-
- /**
- * Sets the peek fragment listener for this engine. This listener will be
- * called for each fragment that is traversed in undoToLastStop operation.
- *
- * @param listener the fragment listener.
- */
- public void setUndoFragmentListener( FragmentListener listener )
- {
- undoFragmentListener_ = listener;
- }
-
- /**
- * Traverse the CommandFragments starting with the CommandFragment on the
- * top of the command fragment stack. The operation does NOT change the
- * command fragment stack and does not execute any command associated with
- * a CommandFragment.
- */
- public void peekForwardToNextStop()
- {
- CommandListEntry topEntry = (CommandListEntry)commandStack_.lastElement();
- int parentIndex = topEntry.parentIndex_;
- CommandFragment childFragment = topEntry.fragment_;
- boolean continueLoop = navigateChildFragments( childFragment, false );
-
- while( parentIndex != -1 && continueLoop )
- {
- CommandListEntry parentEntry = (CommandListEntry)commandStack_.elementAt( parentIndex );
- CommandFragment parentFragment = parentEntry.fragment_;
- CommandFragment nextFragment = parentFragment.getNextSubFragment( childFragment );
-
- if( nextFragment == null )
- {
- // There are no more sibling fragments to navigate so we will pop up to the parent
- // an continue navigation there.
- parentIndex = parentEntry.parentIndex_;
- childFragment = parentFragment;
- }
- else
- {
- if( navigateChildFragments( nextFragment, true ) )
- {
- // We are continuing to navigate. This time we want to traverse the sibling
- // of nextFragment.
- childFragment = nextFragment;
- }
- else
- {
- // We are stopping our navigation.
- continueLoop = false;
- }
- }
- }
- }
-
-
- /**
- * Traverse the CommandFragments starting with the CommandFragment on the
- * top of the command fragment stack. This operation does change the
- * command fragment stack and does execute any command associated with
- * a CommandFragment.
- */
- public void moveForwardToNextStop()
- {
- CommandListEntry topEntry = (CommandListEntry)commandStack_.lastElement();
- int parentIndex = topEntry.parentIndex_;
- CommandFragment currentFragment = topEntry.fragment_;
- boolean continueExecute = visitTop();
- CommandFragment childFragment = currentFragment.getFirstSubFragment();
-
- // If the current fragment has child fragments we need to traverse these children.
- while( childFragment != null && continueExecute )
- {
- parentIndex = commandStack_.size() - 1;
- addToStack( childFragment, parentIndex );
- continueExecute = visitTop();
- currentFragment = childFragment;
- childFragment = currentFragment.getFirstSubFragment();
- }
-
- // The previous while loop has guaranteed that currentFragment has no
- // child fragments. This while loop assumes this to be the case.
- while( parentIndex != -1 && continueExecute )
- {
- CommandListEntry parentEntry = (CommandListEntry)commandStack_.elementAt( parentIndex );
- CommandFragment parentFragment = parentEntry.fragment_;
- CommandFragment nextFragment = null;
-
- if( currentFragment == null )
- {
- nextFragment = parentFragment.getFirstSubFragment();
- }
- else
- {
- nextFragment = parentFragment.getNextSubFragment( currentFragment );
- }
-
- if( nextFragment == null )
- {
- // There are no more sibling fragments to navigate so we will pop up to the parent
- // and continue navigation there.
- parentIndex = parentEntry.parentIndex_;
- currentFragment = parentFragment;
- }
- else
- {
- // We have a new fragment that we need to add to the top of the stack.
- addToStack( nextFragment, parentIndex );
- parentIndex = commandStack_.size() - 1;
- continueExecute = visitTop();
- currentFragment = null;
- }
- }
- }
-
- /**
- *
- * @return returns true if the there is not longer any elements on the stack. Note:
- * that last two entries are always left on the stack.
- */
- public boolean undoToLastStop()
- {
- CommandListEntry topEntry = (CommandListEntry)commandStack_.lastElement();
-
- // Always undo the top element.
- performUndo( topEntry );
-
- while( topEntry.parentIndex_ != 0 )
- {
- commandStack_.pop();
- topEntry = (CommandListEntry)commandStack_.lastElement();
-
- performUndo( topEntry );
-
- if( topEntry.fragmentStopped_ )
- {
- break;
- }
- }
-
- return topEntry.parentIndex_ == 0;
- }
-
- private void performUndo( CommandListEntry entry )
- {
- if( entry.parentIndex_ == 0 ) return;
-
- Command cmd = entry.command_;
-
- if( cmd != null && cmd.isUndoable() ) cmd.undo( environment_ );
-
- undoFragmentListener_.notify( entry.fragment_ );
- }
-
- private boolean navigateChildFragments( CommandFragment fragment, boolean visitCurrent )
- {
- boolean continueNavigate = true;
- CommandFragment childFrag = null;
-
- if( visitCurrent )
- {
- continueNavigate = peekFragmentListener_.notify( fragment );
- dataManager_.process( fragment );
- }
-
- childFrag = fragment.getFirstSubFragment();
-
- while( childFrag != null && continueNavigate )
- {
- continueNavigate = navigateChildFragments( childFrag, true );
- childFrag = fragment.getNextSubFragment( childFrag );
- }
-
- return continueNavigate;
- }
-
- private boolean visitTop()
- {
- CommandListEntry entry = (CommandListEntry)commandStack_.lastElement();
- boolean continueNavigate = nextFragmentListener_.notify( entry.fragment_ );
-
- if( continueNavigate )
- {
- // Call the setters for this fragment.
- dataManager_.process( entry.fragment_ );
-
- // Add any rules to the mapping registry before we execute the command.
- entry.fragment_.registerDataMappings( dataManager_.getMappingRegistry() );
-
- lastStatus_ = runCommand( entry );
-
- if( lastStatus_.getSeverity() == Status.ERROR ) continueNavigate = false;
- }
-
- if( !continueNavigate ) entry.fragmentStopped_ = true;
-
- return continueNavigate;
- }
-
- private void addToStack( CommandFragment fragment, int parentIndex )
- {
- CommandListEntry entry = new CommandListEntry( fragment, parentIndex );
- commandStack_.push( entry );
- }
-
- private Status runCommand( CommandListEntry entry )
- {
- CommandFactory factory = entry.fragment_.getCommandFactory();
- Status status = new SimpleStatus( "" );
-
- if( factory != null )
- {
- Command cmd = factory.create();
- entry.command_ = cmd;
-
- if( cmd != null )
- {
- dataManager_.process( cmd );
-
- try
- {
- environment_.getLog().log(Log.INFO, "command", 5001, this, "runCommand", "Executing: " + cmd.getClass().getName());
-
- status = cmd.execute( environment_ );
- }
- catch( Throwable exc )
- {
- MessageUtils utils = new MessageUtils( "org.eclipse.wst.command.env.core.environment", this );
- SimpleStatus unexpectedError = new SimpleStatus("id", exc.getMessage(), Status.ERROR, exc );
- status = new SimpleStatus( "", utils.getMessage( "MSG_ERROR_UNEXPECTED_ERROR" ), new Status[]{unexpectedError} );
- environment_.getStatusHandler().reportError( status );
- }
- finally
- {
- String message = "Ok";
-
- if( status.getSeverity() == Status.ERROR )
- {
- message = "Error: " + status.getMessage();
- }
-
- environment_.getLog().log(Log.INFO, "command", 5001, this, "runCommand", "Execution status: " + message );
- }
- }
- }
-
- return status;
- }
-
- private class CommandListEntry
- {
- public CommandListEntry( CommandFragment fragment, int parentIndex )
- {
- fragment_ = fragment;
- parentIndex_ = parentIndex;
- fragmentStopped_ = false;
- }
-
- public Command command_;
- public CommandFragment fragment_;
- public int parentIndex_;
- public boolean fragmentStopped_;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragmentFactory.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragmentFactory.java
deleted file mode 100644
index 6ccc47f..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragmentFactory.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-/**
- * This interface provides a way to create CommandFragments.
- *
- */
-public interface CommandFragmentFactory
-{
- /**
- *
- * @return returns a created CommandFragment object.
- */
- public CommandFragment create();
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragmentFactoryFactory.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragmentFactoryFactory.java
deleted file mode 100644
index 48076ae..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/CommandFragmentFactoryFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-public interface CommandFragmentFactoryFactory
-{
- /**
- * The framework calls this method to get the CommandFragmentFactory
- * for a particular extension.
- *
- * @return Creates a CommandFragmentFactory.
- */
- public CommandFragmentFactory create();
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/ExtensionFragment.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/ExtensionFragment.java
deleted file mode 100644
index 6840489..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/ExtensionFragment.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.command.env.core.registry.CommandRegistry;
-
-
-public class ExtensionFragment extends AbstractCommandFragment
-{
- private String[] ids_;;
- private CommandRegistry extensionRegistry_;
- private Hashtable fragments_;
-
- /**
- * The default constructor
- *
- */
- public ExtensionFragment()
- {
- super( null, "" );
- fragments_ = new Hashtable();
- }
-
- /**
- * Copy constructor.
- * @param Fragment the fragment to copy
- */
- protected ExtensionFragment( ExtensionFragment fragment )
- {
- super( fragment );
-
- ids_ = fragment.ids_;
- extensionRegistry_ = fragment.extensionRegistry_;
- fragments_ = fragment.fragments_;
- }
-
- public void setExtensionIds( String[] ids )
- {
- ids_ = ids;
- }
-
- public void setExtensionRegistry( CommandRegistry registry )
- {
- extensionRegistry_ = registry;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragment#getFirstSubFragment()
- */
- public CommandFragment getFirstSubFragment()
- {
- CommandFragmentFactoryFactory factory = extensionRegistry_.getFactoryFactory( ids_ );
-
- if( factory == null ) return null;
-
- CommandFragment fragment = (CommandFragment)fragments_.get( factory );
-
- if( fragment == null )
- {
- fragment = factory.create().create();
- fragments_.put( factory, fragment );
- }
-
- return fragment;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragment#getNextSubFragment(org.eclipse.wst.command.env.core.fragment.CommandFragment)
- */
- public CommandFragment getNextSubFragment(CommandFragment fragment)
- {
- return null;
- }
-
- /**
- * @see java.lang.Object#clone()
- */
- public Object clone()
- {
- return new ExtensionFragment( this );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/FragmentListener.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/FragmentListener.java
deleted file mode 100644
index a762c6f..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/FragmentListener.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-/**
- * This interface should be implement for code that needs to listen to fragments
- * that are being traverse by the CommandFragmentEngine.
- *
- */
-public interface FragmentListener
-{
- /*
- * Notifies this listener that a commandFragment is being visited during
- * a traversal.
- */
- public boolean notify( CommandFragment commandFragment );
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/LoopCondition.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/LoopCondition.java
deleted file mode 100644
index aa780bb..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/LoopCondition.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-/**
- * This interface can be used when a conditional object needs to be returned.
-**/
-public interface LoopCondition
-{
- /**
- * Evaluates a loop condition.
- *
- * @param loop the loop fragment that is being evaluated.
- * @param fragment the child fragment of the loop
- * under evaluation. Note: fragment can be null.
- * @return returns an object based on some evaluated condition.
- **/
- public boolean evaluate( LoopFragment loop, CommandFragment fragment );
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/LoopFragment.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/LoopFragment.java
deleted file mode 100644
index d218354..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/LoopFragment.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-import org.eclipse.wst.command.env.core.CommandFactory;
-import org.eclipse.wst.command.env.core.common.RangeVector;
-
-
-/**
- * This class returns a dynamically determined number of
- * fragments. This loop will return the fragment parameter
- * as long as the stopCondition evaluates to false. Otherwise,
- * null is returned.
-**/
-public class LoopFragment extends AbstractCommandFragment
-{
- private LoopCondition stopCondition_;
- private CommandFragment fragment_;
- private RangeVector fragmentHistory_;
-
- /**
- * Copy contructor for this fragment.
- **/
- protected LoopFragment( LoopFragment fragment )
- {
- this( fragment.fragment_,
- fragment.stopCondition_,
- fragment.getCommandFactory(),
- fragment.getId() );
- }
-
- public LoopFragment( CommandFragment fragment,
- LoopCondition stopCondition )
- {
- this( fragment, stopCondition, null, "" );
- }
-
- /**
- * @param fragment the fragment that will be returned by the loop.
- * @param stopCondition when false the fragment will be returned,
- * otherwise null is returned.
- * @param state the state passed to the condition.
- * @param command the executable command for this fragment.
- **/
- public LoopFragment( CommandFragment fragment,
- LoopCondition stopCondition,
- CommandFactory commandFactory,
- String id )
- {
- super( commandFactory, id );
-
- fragment_ = fragment;
- stopCondition_ = stopCondition;
- fragmentHistory_ = new RangeVector();
- }
-
- /**
- * Makes a copy of the CommandFragment.
- *
- * @return returns a copy of this fragment.
- **/
- public Object clone()
- {
- return new LoopFragment( this );
- }
-
- /**
- * Returns the index of the fragment
- *
- * @param fragment the fragment to search.
- * @return the index of this fragment.
- **/
- public int indexOf( CommandFragment fragment )
- {
- return fragmentHistory_.indexOf( fragment );
- }
-
-
- /**
- * Gets the first child fragment for this fragment.
- *
- * @return returns the first child fragment for this fragment. Returns
- * null when there is no first child.
- **/
- public CommandFragment getFirstSubFragment()
- {
- return getNextSubFragment( null );
- }
-
- /**
- * Gets the next child fragment for this fragment.
- *
- * @return returns the next child fragment for this fragment. Returns null
- * when there is no next child.
- **/
- public CommandFragment getNextSubFragment( CommandFragment frag )
- {
- CommandFragment nextFrag = null;
-
- if( stopCondition_.evaluate( this, frag ) )
- {
- // The stop condition has been met.
- // Do nothing.
- }
- else
- {
- int fragIndex = indexOf( frag );
-
- // Note: when fragment == null the fragIndex
- // should be -1. Therefore, if there
- // is already a first fragment in
- // fragmentHistory that will be returned.
- if( fragIndex + 1 < fragmentHistory_.size() )
- {
- // We have a copy of the fragment already.
- nextFrag = (CommandFragment)(fragmentHistory_.elementAt( fragIndex + 1 ));
- }
- else
- {
- nextFrag = (CommandFragment)(fragment_.clone());
- fragmentHistory_.add( nextFrag );
- }
- }
-
- return nextFrag;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/SequenceFragment.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/SequenceFragment.java
deleted file mode 100644
index a2dcfed..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/SequenceFragment.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.command.env.core.CommandFactory;
-
-
-/**
- * This class implements a sequence of CommandFragments.
-**/
-public class SequenceFragment extends AbstractCommandFragment
-{
- private List fragmentList_;
-
- protected SequenceFragment( SequenceFragment frag )
- {
- super( frag.getCommandFactory(), frag.getId() );
-
- fragmentList_ = new Vector();
-
- for( int index = 0; index < frag.fragmentList_.size(); index++ )
- {
- Object newFrag = ((CommandFragment)frag.fragmentList_.get(index)).clone();
- fragmentList_.add( newFrag );
- }
- }
-
- public SequenceFragment( CommandFragment[] fragments,
- CommandFactory commandFactory,
- String id )
- {
- super( commandFactory, id );
-
- if( fragments != null )
- {
- fragmentList_ = Arrays.asList( fragments );
- }
- else
- {
- fragmentList_ = new Vector();
- }
- }
-
- public SequenceFragment()
- {
- super( null, "" );
-
- fragmentList_ = new Vector();
- }
-
- /**
- * Appends a fragment to the sequence.
- **/
- public void add( CommandFragment fragment )
- {
- fragmentList_.add( fragment );
- }
-
- /**
- * Makes a copy of the CommandFragment.
- *
- * @return returns a copy of this fragment.
- **/
- public Object clone()
- {
- return new SequenceFragment( this );
- }
-
- /**
- * Gets the first child fragment for this fragment.
- *
- * @return returns the first child fragment for this fragment. Returns
- * null when there is no first child.
- **/
- public CommandFragment getFirstSubFragment()
- {
- CommandFragment fragment = null;
-
- if( fragmentList_ == null || fragmentList_.size() == 0 )
- {
- fragment = null;
- }
- else
- {
- fragment = (CommandFragment)( fragmentList_.get(0) );
- }
-
- return fragment;
- }
-
- /**
- * Gets the next child fragment for this fragment.
- *
- * @return returns the next child fragment for this fragment. Returns null
- * when there is no next child.
- **/
- public CommandFragment getNextSubFragment( CommandFragment fragment )
- {
- int index = fragmentList_.indexOf( fragment );
-
- if( index == -1 )
- {
- throw new IllegalArgumentException( "Fragment not found in sequence.");
- }
- else
- {
- index++;
-
- if( index >= fragmentList_.size() )
- {
- // There is nothing following this fragment so return null;
- return null;
- }
- else
- {
- // Return the next fragment.
- return (CommandFragment)(fragmentList_.get( index ));
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/SimpleFragment.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/SimpleFragment.java
deleted file mode 100644
index 41cfbb4..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/fragment/SimpleFragment.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.fragment;
-
-import org.eclipse.wst.command.env.core.*;
-
-/**
- * This class implements an empty of WizardFragment.
-**/
-public class SimpleFragment extends AbstractCommandFragment
-{
- public SimpleFragment()
- {
- this( (CommandFactory)null, "" );
- }
-
- public SimpleFragment( String id )
- {
- this( (CommandFactory)null, id );
- }
-
- public SimpleFragment( final Command command, String id )
- {
- super( new CommandFactory()
- {
- public Command create()
- {
- return command;
- }
- }, id );
- }
-
- public SimpleFragment( CommandFactory commandFactory, String id )
- {
- super( commandFactory, id );
- }
-
- /**
- * Copy constructor for fragment.
- **/
- protected SimpleFragment( SimpleFragment fragment )
- {
- super( fragment.getCommandFactory(), fragment.getId() );
- }
-
- /**
- * All wizard fragments need to be cloneable.
- **/
- public Object clone()
- {
- return new SimpleFragment( this );
- }
-
-
- /**
- * Gets the first child fragment for this fragment.
- *
- * @return returns the first child fragment for this fragment. Returns
- * null when there is no first child.
- **/
- public CommandFragment getFirstSubFragment(){ return null; }
-
- /**
- * Gets the next child fragment for this fragment.
- *
- * @return returns the next child fragment for this fragment. Returns null
- * when there is no next child.
- **/
-
- public CommandFragment getNextSubFragment( CommandFragment fragment ){ return null; }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/registry/CommandRegistry.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/registry/CommandRegistry.java
deleted file mode 100644
index cb4a9ae..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/registry/CommandRegistry.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.registry;
-
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactoryFactory;
-
-/**
- * This interface provides a way to create a CommandFragmentFactoryFactory
- * from an array of ids.
- *
- */
-public interface CommandRegistry
-{
- /**
- * Creates a CommandFragmentFactoryFactory from an array of ids.
- *
- * @param ids the ids.
- * @return the CommandFragmentFactoryFactory object.
- */
- public CommandFragmentFactoryFactory getFactoryFactory( String[] ids );
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/BooleanSelection.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/BooleanSelection.java
deleted file mode 100644
index 11bb441..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/BooleanSelection.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/**
- */
-package org.eclipse.wst.command.env.core.selection;
-
-public class BooleanSelection
-{
- private String value_;
- private boolean selected_;
-
- public BooleanSelection( String value, boolean selected )
- {
- value_ = value;
- selected_ = selected;
- }
-
- public String getValue()
- {
- return value_;
- }
-
- public boolean isSelected()
- {
- return selected_;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/ChoicesToString.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/ChoicesToString.java
deleted file mode 100644
index b91f536..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/ChoicesToString.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.selection;
-
-import org.eclipse.wst.command.env.core.data.Transformer;
-
-public class ChoicesToString implements Transformer
-{
- private int level_;
-
- public ChoicesToString( int level )
- {
- level_ = level;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.data.Transformer#transform(java.lang.Object)
- */
- public Object transform( Object value )
- {
- SelectionListChoices choices = (SelectionListChoices)value;
-
- for( int index = 0; index < level_; index++ )
- {
- choices = choices.getChoice();
- }
-
- return choices.getList().getSelection();
- }
-
- public SelectionList transform( SelectionListChoices choices )
- {
- return (SelectionList)transform( (Object)choices );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/DynamicList.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/DynamicList.java
deleted file mode 100644
index 94cb516..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/DynamicList.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.selection;
-
-import java.util.Vector;
-
-public class DynamicList
-{
- private Vector stringList_ = new Vector();
- private Vector dynamicListVectorList_ = new Vector();
-
- public void add( String[] values, Object target )
- {
- DynamicList currentList = this;
-
- for( int index = 0; index < values.length; index++ )
- {
- String value = values[index];
- int length = currentList.stringList_.size();
- int foundIndex = -1;
-
- // Find the string in the current list.
- for( int searchIndex = 0; searchIndex < length; searchIndex++ )
- {
- String string = (String)currentList.stringList_.elementAt( searchIndex );
-
- if( string.equals( value ) )
- {
- foundIndex = searchIndex;
- break;
- }
- }
-
- if( foundIndex == -1 )
- {
- // We have a new string so add it to the list.
- currentList.stringList_.add( value );
- currentList.dynamicListVectorList_.add( new DynamicList() );
- foundIndex = length;
- }
-
- currentList = (DynamicList)currentList.dynamicListVectorList_.elementAt( foundIndex );
- }
-
- currentList.dynamicListVectorList_.add( target );
- }
-
- public SelectionListChoices toListChoices()
- {
- SelectionList list = new SelectionList( (String[])stringList_.toArray( new String[0] ), 0);
- int length = dynamicListVectorList_.size();
- Vector vector = new Vector();
-
- for( int index = 0; index < length; index++ )
- {
- Object obj = dynamicListVectorList_.elementAt(index);
-
- if( obj instanceof DynamicList )
- {
- vector.add( ((DynamicList)obj).toListChoices() );
- }
- else
- {
- vector.add( obj );
- }
- }
-
- return new SelectionListChoices( list, vector );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/SelectionList.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/SelectionList.java
deleted file mode 100644
index 2ef475e..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/SelectionList.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.selection;
-
-public class SelectionList
-{
- private int selectionIndex_;
- private String[] list_;
- private String selectionValue_;
-
- public SelectionList( String[] list, int selectionIndex )
- {
- list_ = list;
- selectionIndex_ = selectionIndex;
- }
-
- public void setSelectionValue( String value )
- {
- selectionValue_ = value;
- selectionIndex_ = -1;
-
- for( int index = 0; index < list_.length; index++ )
- {
- if( value.equals( list_[index] ) )
- {
- selectionIndex_ = index;
- break;
- }
- }
- }
-
- public String[] getList()
- {
- return list_;
- }
-
- public void setIndex( int index )
- {
- selectionIndex_ = index;
- selectionValue_ = null;
- }
-
- public int getIndex()
- {
- return selectionIndex_;
- }
-
- public String getSelection()
- {
- if( selectionValue_ != null ) return selectionValue_;
-
- if( selectionIndex_ == -1 || selectionIndex_ > list_.length-1 )
- {
- return "";
- }
- else
- {
- return list_[ selectionIndex_ ];
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/SelectionListChoices.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/SelectionListChoices.java
deleted file mode 100644
index 8be65e2..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/selection/SelectionListChoices.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.selection;
-
-import java.util.Vector;
-
-public class SelectionListChoices
-{
- private SelectionList selectionList_;
- private Vector choices_;
- private SelectionList newValueSelectionList_;
-
- /**
- *
- * @param list The selection list.
- * @param choices This is a vector of SelectionListChoies and can be
- * null if there are no choices. This index of list
- * is used to index into choices. If index is -1 then
- * the newValueSelectionList is used.
- */
- public SelectionListChoices( SelectionList list, Vector choices )
- {
- selectionList_ = list;
- choices_ = choices;
-
- newValueSelectionList_ = new SelectionList( new String[0], -1 );
- }
-
- public SelectionListChoices( SelectionList list, Vector choices, SelectionList newList )
- {
- this( list, choices );
- newValueSelectionList_ = newList;
- }
-
- public SelectionList getList()
- {
- return selectionList_;
- }
-
- public Vector getChoices()
- {
- return choices_;
- }
-
- public Vector getChoicesAtLevel( int level )
- {
- SelectionListChoices choices = this;
-
- for( int index = 0; index < level; index++ )
- {
- choices = choices.getChoice();
- }
-
- return choices.getChoices();
- }
-
- public SelectionListChoices getChoice()
- {
- int selectionIndex = selectionList_.getIndex();
- SelectionListChoices result = null;
-
- if( selectionIndex == -1 )
- {
- result = new SelectionListChoices( newValueSelectionList_, null );
- }
- else if( choices_ != null && choices_.size() != 0 )
- {
- result = (SelectionListChoices)choices_.elementAt( selectionIndex );
- }
-
- return result;
- }
-
- public SelectionListChoices getChoice(int index)
- {
- SelectionListChoices result = null;
- if (index < 0 || index >= getList().getList().length)
- {
- result = new SelectionListChoices( newValueSelectionList_, null );
- }
- else
- {
- result = (SelectionListChoices)choices_.elementAt( index );
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/NativeFileCommand.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/NativeFileCommand.java
deleted file mode 100644
index d3a8b70..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/NativeFileCommand.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri;
-
-import java.io.File;
-import java.util.List;
-import java.util.LinkedList;
-
-import org.eclipse.wst.command.env.core.Command;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.uri.URI;
-import org.eclipse.wst.command.env.core.uri.URIException;
-
-public abstract class NativeFileCommand implements Command
-{
- protected String name;
-
- protected String description;
-
- protected URI[] urisToRead;
-
- protected URI[] urisToWrite;
-
- protected NativeFileCommand ()
- {
- this(null,null);
- }
-
- protected NativeFileCommand ( String name, String description )
- {
- this.name = name;
- this.description = description;
- }
-
- public String getName ()
- {
- return name;
- }
-
- public String getDescription ()
- {
- return description;
- }
-
- public void setURIsToRead ( URI[] urisToRead )
- {
- this.urisToRead = urisToRead;
- }
-
- public URI[] getURIsToRead ()
- {
- return urisToRead;
- }
-
- public void setURIsToWrite ( URI[] urisToWrite )
- {
- this.urisToWrite = urisToWrite;
- }
-
- public URI[] getURIsToWrite ()
- {
- return urisToWrite;
- }
-
- public Status execute ( Environment environment )
- {
- File[] filesToRead = getFiles(urisToRead);
- File[] filesToWrite = getFiles(urisToWrite);
- preProcess(filesToRead,filesToWrite);
- Status status = execute(environment,filesToRead,filesToWrite);
- postProcess(filesToRead,filesToWrite);
- return status;
- }
-
- public abstract Status execute ( Environment environment, File[] filesToRead, File[] filesToWrite );
-
- public boolean isUndoable ()
- {
- return false;
- }
-
- public Status undo ( Environment environment )
- {
- return null;
- }
-
- public boolean isRedoable ()
- {
- return false;
- }
-
- public Status redo ( Environment environment )
- {
- return null;
- }
-
- private void preProcess ( File[] filesToRead, File[] filesToWrite )
- {
- // TBD.
- }
-
- private void postProcess ( File[] filesToRead, File[] filesToWrite )
- {
- // TBD.
- }
-
- private File[] getFiles ( URI[] uris )
- {
- List list = new LinkedList();
- if (uris != null)
- {
- for (int i=0; i<uris.length; i++)
- {
- if (uris[i].isAvailableAsFile())
- {
- try
- {
- list.add(uris[i].asFile());
- }
- catch (URIException e)
- {
- }
- }
- }
- }
- return (File[])list.toArray(new File[0]);
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/RelativeScheme.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/RelativeScheme.java
deleted file mode 100644
index 207f959..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/RelativeScheme.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri;
-
-import java.net.URL;
-
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class RelativeScheme implements URIScheme
-{
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URIScheme#isHierarchical()
- */
- public boolean isHierarchical()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URIScheme#isValid(org.eclipse.env.uri.URI)
- */
- public boolean isValid(URI uri)
- {
- return !uri.toString().startsWith( "/" );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URIScheme#newURI(java.lang.String)
- */
- public URI newURI(String uri)
- {
- return new RelativeURI( uri );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URIScheme#newURI(org.eclipse.env.uri.URI)
- */
- public URI newURI(URI uri)
- {
- return new RelativeURI( uri.toString() );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URIScheme#newURI(java.net.URL)
- */
- public URI newURI(URL url)
- {
- return new RelativeURI( url.toString() );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URIScheme#validate(org.eclipse.env.uri.URI)
- */
- public Status validate(URI uri)
- {
- Status result = null;
-
- if( isValid( uri ) )
- {
- result = new SimpleStatus( "", "", Status.OK );
- }
- else
- {
- result = new SimpleStatus( "", "", Status.ERROR );
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/RelativeURI.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/RelativeURI.java
deleted file mode 100644
index 2d177fc..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/RelativeURI.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class RelativeURI implements URI
-{
- protected String uri_;
-
- public RelativeURI( String uri )
- {
- uri_ = uri;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#append(org.eclipse.env.uri.URI)
- */
- public URI append(URI relativeURI) throws URIException
- {
- if( !relativeURI.isRelative())
- {
- MessageUtils msg = new MessageUtils( "org.eclipse.wst.command.env.core.environment", new Dummy() );
-
- throw new URIException(
- new SimpleStatus( "RelativeURI",
- msg.getMessage( "MSG_URI_NOT_RELATIVE", new Object[]{ relativeURI.toString() }),
- Status.ERROR ));
- }
-
- String newURI = uri_ + "/" + relativeURI.toString();
-
- return getURIScheme().newURI( newURI );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#asFile()
- */
- public File asFile()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#asString()
- */
- public String asString()
- {
- return uri_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#toString()
- */
- public String toString()
- {
- return uri_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#asURL()
- */
- public URL asURL() throws URIException
- {
- URL url = null;
-
- try
- {
- url = new URL( uri_ );
- }
- catch( MalformedURLException exc )
- {
- throw new URIException(
- new SimpleStatus( "RelativeURI", exc.getMessage(), Status.ERROR ),
- this );
- }
-
- return url;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#erase()
- */
- public void erase() throws URIException
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#getInputStream()
- */
- public InputStream getInputStream() throws URIException
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#getOutputStream()
- */
- public OutputStream getOutputStream() throws URIException
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#getURIScheme()
- */
- public URIScheme getURIScheme()
- {
- return new RelativeScheme();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isAvailableAsFile()
- */
- public boolean isAvailableAsFile()
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isAvailableAsURL()
- */
- public boolean isAvailableAsURL()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isHierarchical()
- */
- public boolean isHierarchical()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isLeaf()
- */
- public boolean isLeaf()
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isPresent()
- */
- public boolean isPresent()
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isReadable()
- */
- public boolean isReadable()
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isRelative()
- */
- public boolean isRelative()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isWritable()
- */
- public boolean isWritable()
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#list()
- */
- public URI[] list() throws URIException
- {
- return new URI[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#list(org.eclipse.env.uri.URIFilter)
- */
- public URI[] list(URIFilter uriFilter) throws URIException
- {
- return new URI[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#parent()
- */
- public URI parent() throws URIException
- {
- int lastSlash = uri_.lastIndexOf( '/' );
- int firstSlash = uri_.indexOf( '/' );
-
- // If there is a parent, then it must start with a slash
- // and end with a slash.
- if( lastSlash == -1 || firstSlash == -1 ) return null;
-
- return getURIScheme().newURI( uri_.substring(0, lastSlash ) );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#rename(org.eclipse.env.uri.URI)
- */
- public void rename(URI newURI) throws URIException
- {
- uri_ = newURI.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#touchFolder()
- */
- public void touchFolder() throws URIException
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#touchLeaf()
- */
- public void touchLeaf() throws URIException
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#visit(org.eclipse.env.uri.URIVisitor, org.eclipse.env.uri.URIFilter)
- */
- public void visit(URIVisitor uriVisitor, URIFilter uriFilter)
- throws URIException
- {
- boolean continueVisit = true;
-
- // If the filter accepts this we will visit it.
- if( uriFilter.accepts( this ) )
- {
- continueVisit = uriVisitor.visit( this );
- }
-
- URI[] children = list();
-
- for( int index = 0; index < children.length && continueVisit; index++ )
- {
- children[index].visit( uriVisitor, uriFilter );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#visit(org.eclipse.env.uri.URIVisitor)
- */
- public void visit(URIVisitor uriVisitor) throws URIException
- {
- boolean continueVisit = uriVisitor.visit( this );
-
- URI[] children = list();
-
- for( int index = 0; index < children.length && continueVisit; index++ )
- {
- children[index].visit( uriVisitor );
- }
- }
-
- private class Dummy
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/SimpleURIFactory.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/SimpleURIFactory.java
deleted file mode 100644
index dcaaf11..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/SimpleURIFactory.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri;
-
-import java.net.URL;
-import java.util.Hashtable;
-
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class SimpleURIFactory implements URIFactory
-{
- private Hashtable schemes_ = new Hashtable();
- private MessageUtils msg_ = new MessageUtils( "org.eclipse.wst.command.env.core.environment", this );
-
-
- /* (non-Javadoc)
- */
- public URI newURI(String uri) throws URIException
- {
- URIScheme scheme = newURIScheme( uri );
-
- return scheme.newURI( uri );
- }
-
- /* (non-Javadoc)
- */
- public URI newURI(URL url) throws URIException
- {
- URIScheme scheme = newURIScheme( url.toString() );
-
- return scheme.newURI( url );
- }
-
- /* (non-Javadoc)
- */
- public URIScheme newURIScheme(String schemeOrURI) throws URIException
- {
- URIScheme newScheme = null;
-
- if( schemeOrURI == null )
- {
- throw new URIException(
- new SimpleStatus( "SimpleURIFactory",
- msg_.getMessage( "MSG_NULL_ARG_SPECIFIED", new Object[]{"newURIScheme"}),
- Status.ERROR ) );
- }
-
- int colon = schemeOrURI.indexOf(':');
- int slash = schemeOrURI.indexOf('/');
-
- // A protocol was specified. Note: a colon appearing after a path is not
- // considered part of the protocol for this URI.
- if( (colon != -1 && slash == -1) || ( colon != -1 && colon < slash ) )
- {
- String protocol = schemeOrURI.substring(0, colon );
- newScheme = (URIScheme)schemes_.get( protocol );
-
- if( newScheme == null )
- {
- throw new URIException(
- new SimpleStatus( "SimpleURIFactory",
- msg_.getMessage( "MSG_SCHEME_NOT_FOUND", new Object[]{ schemeOrURI }),
- Status.ERROR ) );
- }
- }
- else if( schemeOrURI.startsWith( "/") )
- {
- throw new URIException(
- new SimpleStatus( "SimpleURIFactory",
- msg_.getMessage( "MSG_ABSOLUTE_PATH_WITHOUT_SCHEME", new Object[]{ schemeOrURI }),
- Status.ERROR ) );
-
- }
- else
- {
- newScheme = new RelativeScheme();
- }
-
- return newScheme;
- }
-
- public void registerScheme( String protocol, URIScheme scheme )
- {
- schemes_.put( protocol, scheme );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URI.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URI.java
deleted file mode 100644
index 93f1277..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URI.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-
-/**
- * A URI represents a Univeral Resource Identifer.
- */
-public interface URI
-{
- /**
- * Returns the string form of the URI.
- * The resource need not exist.
- */
- public String toString ();
-
- /**
- * Returns the URIScheme for the scheme of this URI.
- * The resource need not exist.
- */
- public URIScheme getURIScheme ();
-
- /**
- * Returns true iff the resource identified by this URI exists.
- */
- public boolean isPresent ();
-
- /**
- * Returns true iff the resource identified by this URI exists
- * and is a leaf. Returns true always for non-hierarchical schemes.
- */
- public boolean isLeaf ();
-
- /**
- * Returns true iff the resource identified by this URI exists
- * and is readable. A readable leaf resource indicates that an
- * input stream can be opened on the resource. A readable folder
- * resource indicates that the children of the folder, if any,
- * can be determined via the list() or visit() methods.
- */
- public boolean isReadable ();
-
- /**
- * Returns true iff the resource identified by this URI exists
- * and is writable. A writable leaf resource indicates that an
- * output stream can be opened on the resource. A writable folder
- * resource indicates that new resources can be created in the folder.
- */
- public boolean isWritable ();
-
- /**
- * Returns true iff this URI belongs to a hierarchical scheme.
- * The resource need not exist.
- * this.isHierarchical() == this.getURIScheme().isHierarchical().
- */
- public boolean isHierarchical ();
-
- /**
- * Returns true iff this URI is a relative URI.
- * The resource need not exist.
- */
- public boolean isRelative ();
-
- /**
- * Returns the URI of the folder containing this URI.
- * The resource need not exist.
- */
- public URI parent () throws URIException;
-
- /**
- * Returns a new, normalized URI formed by appending the given
- * relative URI to this URI. Both URIs must be hierarchical.
- * The resulting URI will always be hierarchical. The given
- * URI must be relative. This URI can be relative or absolute.
- * the resulting URI will be equivalently relative or absolute.
- */
- public URI append ( URI relativeURI ) throws URIException;
-
- /**
- * Gets an InputStream for reading from the resource
- * identified by this leaf or non-hierarchical URI.
- */
- public InputStream getInputStream () throws URIException;
-
- /**
- * Gets an OutputStream for writing to the resource
- * identified by this leaf or non-hierarchical URI.
- */
- public OutputStream getOutputStream () throws URIException;
-
- /**
- * Creates a new, empty resource at the location identified by
- * the URI. On completion, this.isLeaf() == true. If a leaf
- * resource already exists, this method does nothing. If a
- * non-leaf resource already exists under this URI, creation
- * will fail and an exception will be thrown.
- */
- public void touchLeaf () throws URIException;
-
- /**
- * Creates a new folder resource at the location identified by
- * the URI. The scheme of the URI must be hierarchical.
- * On completion, this.isLeaf() == false. If a folder resource
- * already exists, this method does nothing. If a leaf resource
- * already exists under this URI, creation will fail and an
- * exception will be thrown.
- */
- public void touchFolder () throws URIException;
-
- /**
- * Erases the resource identified by this URI.
- */
- public void erase () throws URIException;
-
- /**
- * Renames or moves the resource identified by this URI
- * to the new URI.
- */
- public void rename ( URI newURI ) throws URIException;
-
- /**
- * Visits this resource and its decendants in pre-order fashion.
- * For each resource, whether a folder or a leaf, the given
- * URIVisitor's visit() method is called with the URI of the
- * resource. If URIVisitor.visit() returns false, the visiting
- * algorithm will "prune" the decendants of the resource and
- * carry on visiting the rest of the tree. If URIVisitor.visit()
- * returns true, the visiting algorithm will continue its walk
- * down the resource's descendants.
- */
- public void visit ( URIVisitor uriVisitor ) throws URIException;
-
- /**
- * As for visit(URIVisitor), except only resource URIs that are
- * accepted by the given filter are visited. If a folder resource
- * fails to be accepted by the filter, this will not prevent the
- * visiting algorithm from walking the resource's descendants.
- * It remains the job of the visitor to choose whether or not to
- * prune a branch by returning false or true.
- */
- public void visit ( URIVisitor uriVisitor, URIFilter uriFilter ) throws URIException;
-
- /**
- * Returns a list of URIs for the immediate children of the given
- * hierarchical, non-leaf URI. This method never returns null,
- * though it may return a zero length array.
- */
- public URI[] list () throws URIException;
-
- /**
- * As for list(), except only URIs that are accepted by the given
- * filter are returned in the array. This method never returns null,
- * though it may return a zero length array.
- */
- public URI[] list ( URIFilter uriFilter ) throws URIException;
-
- /**
- * Returns true if the asURL() method is fair game,
- * in other words, if this URI can be converted into a URL.
- */
- public boolean isAvailableAsURL ();
-
- /**
- * Returns a URL object for the resource under this URI.
- * There are many URIs and URISchemes for which this method
- * will fail and throw an exception. It should be used only
- * in cases where URIs are known to be representable as URLs.
- */
- public URL asURL () throws URIException;
-
- /**
- * Returns true if the asFile() method is fair game,
- * in other words, if this URI can be converted into a File.
- */
- public boolean isAvailableAsFile ();
-
- /**
- * Returns a File object for the resource under this URI.
- * There are many URIs and URISchemes for which this method
- * will fail and throw an exception. It should be used only
- * in cases where URIs are known to be backed by physical files.
- */
- public File asFile () throws URIException;
-
- /**
- * Returns the URI as a string.
- * Equivalent to toString().
- */
- public String asString ();
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIException.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIException.java
deleted file mode 100644
index 1226212..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri;
-
-import org.eclipse.wst.command.env.core.common.Status;
-
-/**
- * This is the base class for most exceptions thrown by URI classes.
- * Every URIException carries a URI and a Status, each of which may
- * be null. The getMessage() method as inherited from Exception will
- * return the message from the URIExceptin's Status object, if any.
- */
-public class URIException extends Exception
-{
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 3258130271424756018L;
-
- /**
- * A Status object containing details about the exception,
- * if applicable.
- */
- protected Status status;
-
- /**
- * The URI for which the exception occured,
- * if applicable.
- */
- protected URI uri;
-
- /**
- * Creates a new URIException with the given Status.
- * The status may be null.
- */
- public URIException ( Status status )
- {
- super();
- this.status = status;
- }
-
- /**
- * Creates a new URIException for the given Status and URI,
- * each of which may be null.
- */
- public URIException ( Status status, URI uri )
- {
- super(status != null ? status.getMessage() : null);
- this.status = status;
- this.uri = uri;
- }
-
- /**
- * Returns the Status object inside this exception.
- */
- public Status getStatus ()
- {
- return status;
- }
-
- /**
- * Returns the URI inside this exception.
- */
- public URI getURI ()
- {
- return uri;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIFactory.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIFactory.java
deleted file mode 100644
index 6d7b8f0..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIFactory.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri;
-
-import java.net.URL;
-
-/**
- * This is a factory for creating new URI and URIScheme objects.
- */
-public interface URIFactory
-{
- /**
- * Creates and returns a new URI for the given string.
- */
- public URI newURI ( String uri ) throws URIException;
-
- /**
- * Creates and returns a new URI for the given URL.
- */
- public URI newURI ( URL url ) throws URIException;
-
- /**
- * Creates and returns a new URIScheme for the given scheme string.
- * If the string contains no colons, the entire string is interpretted
- * as the name of the scheme. If the string contains a colon, then the
- * substring up to but excluding the first colon is interpretted as the
- * name of the scheme, meaning the caller can pass in any URI string in
- * order to get a URIScheme object.
- */
- public URIScheme newURIScheme ( String schemeOrURI ) throws URIException;
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIFilter.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIFilter.java
deleted file mode 100644
index bfeab9d..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIFilter.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri;
-
-/**
- * This interface is implemented by classes that visit or list URIs.
- * Refer to {@link URI#getChildren}.
- */
-public interface URIFilter
-{
- /**
- * Filters the given URI.
- * @param uri The resource to filter.
- * @return True if the resource matches the filter,
- * false if it does not.
- * @throws URIException If the filter fails to analyze the resource.
- */
- public boolean accepts ( URI uri ) throws URIException;
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIScheme.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIScheme.java
deleted file mode 100644
index df77e09..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIScheme.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri;
-
-import java.net.URL;
-
-import org.eclipse.wst.command.env.core.common.Status;
-
-/**
- * A URIScheme represents a single scheme for some a family of
- * Univeral Resource Identifiers. Examples include "file", "http"
- * and "platform" (Eclipse).
- */
-public interface URIScheme
-{
- /**
- * Returns a new URI.
- */
- public URI newURI ( String uri ) throws URIException;
-
- /**
- * Returns a new URI.
- */
- public URI newURI ( URL url ) throws URIException;
-
- /**
- * Returns a new URI.
- */
- public URI newURI ( URI uri ) throws URIException;
-
- /**
- * Returns the proper name of the scheme.
- */
- public String toString ();
-
- /**
- * Returns true if and only if this is a hierarchical scheme.
- */
- public boolean isHierarchical ();
-
- /**
- * Returns true if and only if the given URI satisfies the
- * grammatical requirements of the scheme. Absolute URIs must
- * begin with "<scheme>:". Relative URIs must either not contain
- * a colon, ":", or it must begin with "./".
- */
- public boolean isValid ( URI uri );
-
- /**
- * Returns a Status object indicating whether or not the given
- * URI is valid. The severity and message of the Status object
- * will describe this.
- */
- public Status validate ( URI uri );
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIUtils.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIUtils.java
deleted file mode 100644
index bb9b316..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIUtils.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri;
-
-/**
- * This class contains several static utility methods for
- * working with URIs.
- */
-public class URIUtils
-{
- /**
- * Copies all bytes from the old URI to the new URI.
- */
- public static void copy ( URI oldUri, URI newUri ) throws URIException
- {
- }
-
- /**
- * Moves one URI to another.
- */
- public static void move ( URI oldUri, URI newUri ) throws URIException
- {
- }
-
- /**
- * Constructs a new, temporary leaf URI.
- * The scheme of the URI may be, but is not guaranteed to be, "file:".
- */
- public static URI getTemporaryLeafURI () throws URIException
- {
- return null;
- }
-
- /**
- * Constructs a new, temporary folder URI.
- * The scheme of the URI may be, but is not guaranteed to be, "file:".
- */
- public static URI getTemporaryFolderURI () throws URIException
- {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIVisitor.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIVisitor.java
deleted file mode 100644
index 1a15bf7..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/URIVisitor.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri;
-
-/**
- * This interface is implemented by classes that visit URIs.
- * Refer to {@link URI#visit}.
- */
-public interface URIVisitor
-{
- /**
- * Visits the given URI.
- * @param uri The resource to visit.
- * @return True if the resource's descendants should be visited,
- * or false if they should not be visited.
- * @throws URIException If the visit method fails.
- */
- public boolean visit ( URI uri ) throws URIException;
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/file/FileScheme.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/file/FileScheme.java
deleted file mode 100644
index 28572f6..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/file/FileScheme.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri.file;
-
-import java.net.URL;
-
-import org.eclipse.wst.command.env.core.uri.RelativeScheme;
-import org.eclipse.wst.command.env.core.uri.RelativeURI;
-import org.eclipse.wst.command.env.core.uri.URI;
-
-
-public class FileScheme extends RelativeScheme
-{
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URIScheme#isValid(org.eclipse.env.uri.URI)
- */
- public boolean isValid(URI uri)
- {
- return uri.toString().startsWith( "file:" );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URIScheme#newURI(java.lang.String)
- */
- public URI newURI(String uri)
- {
- String newURI = null;
-
- if( uri.startsWith( "file:") )
- {
- // The file protocol has been specified so keep it as is.
- newURI = uri;
- }
- else if( uri.startsWith( "/") )
- {
- // The file scheme has not been specified so we will add it.
- newURI = "file:" + uri;
- }
-
- if( newURI == null )
- {
- return new RelativeURI( uri );
- }
- else
- {
- return new FileURI( newURI );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URIScheme#newURI(org.eclipse.env.uri.URI)
- */
- public URI newURI(URI uri)
- {
- return new FileURI( uri.toString() );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URIScheme#newURI(java.net.URL)
- */
- public URI newURI(URL url)
- {
- return new FileURI( url.toString() );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/file/FileURI.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/file/FileURI.java
deleted file mode 100644
index e691670..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/env/core/uri/file/FileURI.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.core.uri.file;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Vector;
-
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.uri.RelativeURI;
-import org.eclipse.wst.command.env.core.uri.URI;
-import org.eclipse.wst.command.env.core.uri.URIException;
-import org.eclipse.wst.command.env.core.uri.URIFilter;
-import org.eclipse.wst.command.env.core.uri.URIScheme;
-
-
-public class FileURI extends RelativeURI
-{
- private File file_ = null;
-
- public FileURI( String uri )
- {
- super( uri );
-
- if( getURIScheme().isValid( this ) )
- {
- file_ = new File( uri.substring( 5, uri.length() ) );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#asFile()
- */
- public File asFile()
- {
- return file_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#erase()
- */
- public void erase() throws URIException
- {
- deleteFile( file_ );
- }
-
- private void deleteFile( File file )
- {
- if( file.isDirectory() )
- {
- File[] children = file.listFiles();
-
- for( int index = 0; index < children.length; index++ )
- {
- File child = children[index];
-
- if( child.isDirectory() )
- {
- deleteFile( child );
- }
- else
- {
- child.delete();
- }
- }
- }
-
- file.delete();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#getInputStream()
- */
- public InputStream getInputStream() throws URIException
- {
- FileInputStream stream = null;
-
- try
- {
- File parent = file_.getParentFile();
- parent.mkdirs();
-
- stream = new FileInputStream( file_ );
- }
- catch( IOException exc )
- {
- Status status = new SimpleStatus( "", exc.getMessage(), Status.ERROR, exc );
- throw new URIException( status, this );
- }
-
- return stream;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#getOutputStream()
- */
- public OutputStream getOutputStream() throws URIException
- {
- FileOutputStream stream = null;
-
- try
- {
- File parent = file_.getParentFile();
- parent.mkdirs();
-
- stream = new FileOutputStream( file_ );
- }
- catch( IOException exc )
- {
- Status status = new SimpleStatus( "", exc.getMessage(), Status.ERROR, exc );
- throw new URIException( status, this );
- }
-
- return stream;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#getURIScheme()
- */
- public URIScheme getURIScheme()
- {
- return new FileScheme();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isAvailableAsFile()
- */
- public boolean isAvailableAsFile()
- {
- return file_ != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isAvailableAsURL()
- */
- public boolean isAvailableAsURL()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isLeaf()
- */
- public boolean isLeaf()
- {
- return file_.isFile();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isPresent()
- */
- public boolean isPresent()
- {
- return file_.exists();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isReadable()
- */
- public boolean isReadable()
- {
- return file_.canRead();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#isWritable()
- */
- public boolean isWritable()
- {
- return file_.canWrite();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#list()
- */
- public URI[] list() throws URIException
- {
- File[] children = file_.listFiles();
- URI[] URIs = new URI[0];
-
- if( children != null )
- {
- int length = children.length;
-
- URIs = new URI[length];
-
- for( int index = 0; index < length; index++ )
- {
- URIs[index] = new FileURI( "file:" + children[index].getAbsolutePath() );
- }
- }
-
- return URIs;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#list(org.eclipse.env.uri.URIFilter)
- */
- public URI[] list(URIFilter uriFilter) throws URIException
- {
- File[] children = file_.listFiles();
- int length = children == null ? 0 : children.length;
- Vector URIs = new Vector();
-
- for( int index = 0; index < length; index++ )
- {
- URI newURI = new FileURI( "file:" + children[index].getAbsolutePath() );
-
- if( uriFilter.accepts( newURI) )
- {
- URIs.add( newURI );
- }
- }
-
- return (URI[])URIs.toArray( new URI[0] );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#rename(org.eclipse.env.uri.URI)
- */
- public void rename(URI newURI) throws URIException
- {
- uri_ = newURI.toString();
- file_.renameTo( new File( uri_ ) );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#touchFolder()
- */
- public void touchFolder() throws URIException
- {
- file_.mkdirs();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.env.uri.URI#touchLeaf()
- */
- public void touchLeaf() throws URIException
- {
- try
- {
- // Ensure that the parent folders are created.
- File parent = file_.getParentFile();
- parent.mkdirs();
-
- file_.createNewFile();
- }
- catch( IOException exc )
- {
- Status status = new SimpleStatus( "", exc.getMessage(), Status.ERROR, exc );
- throw new URIException( status, this );
- }
- }
-
- private class Dummy
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/ClassEntry.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/ClassEntry.java
deleted file mode 100644
index 0d08d10..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/ClassEntry.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.command.internal.env.core.data;
-
-import java.util.Vector;
-
-public class ClassEntry
-{
- public Object lastObject_;
- public Vector getterList_;
- public Vector setterList_;
- public int order_;
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/DataFlowManager.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/DataFlowManager.java
deleted file mode 100644
index 62ac916..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/DataFlowManager.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.core.data;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.data.Transformer;
-
-
-public class DataFlowManager
-{
- private DataMappingRegistryImpl registry_;
- private Hashtable classTable_;
- private int order_;
- private Environment environment_;
-
- public DataFlowManager( DataMappingRegistryImpl registry, Environment environment )
- {
- registry_ = registry;
- classTable_ = new Hashtable();
- order_ = 0;
- environment_ = environment;
- }
-
- public DataMappingRegistry getMappingRegistry()
- {
- return registry_;
- }
-
- public void process( Object object )
- {
- // Add this object to the classTable_ if required.
- String objectType = object.getClass().getName();
- ClassEntry classEntry = (ClassEntry)classTable_.get( objectType );
-
- environment_.getLog().log(Log.INFO, "data", 5004, this, "process", "Processing: " + objectType );
-
- if( classEntry == null )
- {
- classEntry = new ClassEntry();
- classTable_.put( objectType, classEntry );
- }
-
- classEntry.lastObject_ = object;
- classEntry.order_ = order_++;
-
- // Now process the setters for this object
- Vector ruleEntries = registry_.getRuleEntries( objectType );
-
- if( ruleEntries != null )
- {
- if( classEntry.setterList_ == null )
- {
- classEntry.setterList_ = getSetterList( object );
- }
-
- // For each setter in this object try to find a rule.
- for( int setterIndex = 0; setterIndex < classEntry.setterList_.size(); setterIndex++ )
- {
- ObjectMethod currentObjectMethod = new ObjectMethod();
- Method setterMethod = (Method)classEntry.setterList_.elementAt( setterIndex );
- RuleEntry currentRuleEntry = null;
-
- currentObjectMethod.order = -1;
-
- // Find rules that match this setter. Note: there can be more than one rule
- // that matches this setter. In this case we use the most recent, which is
- // defined by the order field.
- for( int index = 0; index < ruleEntries.size(); index++ )
- {
- RuleEntry ruleEntry = (RuleEntry)ruleEntries.elementAt( index );
-
- if( setterMethod.getName().equals( "set" + ruleEntry.targetProperty_ ) )
- {
- // We found a setter for this rule. Now find the getter method.
- // Note: getGetterMethod always returns a value, but if there is no
- // getters available it will set the order to -1.
- ObjectMethod getter = getGetterMethod( ruleEntry.sourceType_, ruleEntry.sourceProperty_ );
-
- if( getter.order == -1 )
- {
- environment_.getLog().log(Log.INFO , "data", 5005, this, "process", " >>No getter found for property: " + setterMethod.getName());
- }
-
- if( currentObjectMethod.order < getter.order )
- {
- // We found a more recent getter.
- currentObjectMethod = getter;
- currentRuleEntry = ruleEntry;
- }
- }
- }
-
- if( currentObjectMethod.order != -1 )
- {
- invokeMethod( currentObjectMethod.object,
- currentObjectMethod.method,
- object,
- setterMethod,
- currentRuleEntry.transformer_ );
- }
- else
- {
- environment_.getLog().log(Log.INFO, "data", 5006, this, "process", " >>No rule found for setter: " + setterMethod.getName() );
- }
- }
- }
- }
-
- /**
- * Find all the setters for this object and return a vector of them.
- *
- * @param object
- * @return
- */
- private Vector getSetterList( Object object )
- {
- Vector result = new Vector();
-
- Method[] methods = object.getClass().getMethods();
-
- for( int index = 0; index < methods.length; index++ )
- {
- Method method = methods[index];
- boolean isPublic = Modifier.isPublic( method.getModifiers() );
- Class returnType = method.getReturnType();
-
- if( isPublic &&
- returnType == Void.TYPE &&
- method.getParameterTypes().length == 1 &&
- method.getName().startsWith( "set" ))
- {
- method.setAccessible( true );
- result.add( method );
- }
- }
-
- return result;
- }
-
- private ObjectMethod getGetterMethod( String sourceType, String sourceProperty )
- {
- ClassEntry classEntry = (ClassEntry)classTable_.get( sourceType );
- ObjectMethod getterFound = new ObjectMethod();
-
- // Indicate that there is no getter yet.
- getterFound.order = -1;
-
- if( classEntry != null )
- {
- if( classEntry.getterList_ == null )
- {
- // Build the getter list.
- classEntry.getterList_ = getGetterList( classEntry.lastObject_ );
- }
-
- for( int index = 0; index < classEntry.getterList_.size(); index++ )
- {
- Method getter = (Method)classEntry.getterList_.elementAt( index );
-
- if( getter.getName().equals( "get" + sourceProperty ))
- {
- getterFound.order = classEntry.order_;
- getterFound.method = getter;
- getterFound.object = classEntry.lastObject_;
- break;
- }
- }
- }
-
- return getterFound;
- }
-
- private Vector getGetterList( Object object )
- {
- Vector result = new Vector();
-
- Method[] methods = object.getClass().getMethods();
-
- for( int index = 0; index < methods.length; index++ )
- {
- Method method = methods[index];
- boolean isPublic = Modifier.isPublic( method.getModifiers() );
- Class returnType = method.getReturnType();
-
- if( isPublic &&
- returnType != Void.TYPE &&
- method.getParameterTypes().length == 0 &&
- method.getName().startsWith( "get" ))
- {
- method.setAccessible( true );
- result.add( method );
- }
- }
-
- return result;
- }
-
- private void invokeMethod( Object sourceObject,
- Method sourceMethod ,
- Object clientObject,
- Method clientMethod,
- Transformer transformer)
- {
- Object data = null;
-
- try
- {
- data = sourceMethod.invoke( sourceObject, new Object[0] );
- }
- catch( InvocationTargetException exc )
- {
- exc.printStackTrace();
- // pgm Need to externalize this string.
- throw new IllegalArgumentException( "Provider \"" + sourceObject.getClass().getName() +
- "\" threw an exception." );
- }
- catch( IllegalAccessException exc )
- {
- exc.printStackTrace();
- // pgm Need to externalize this string.
- throw new IllegalArgumentException( "Provider \"" + sourceObject.getClass().getName() +
- "\" threw an exception." );
- }
-
- environment_.getLog().log(Log.INFO, "data", 5007, this, "invokeMethod "," Setting prop: " + clientMethod.getName() + " data=" + data + " from: " + sourceObject.getClass().getName() );
-
-
- if( transformer != null )
- {
- data = transformer.transform( data );
- }
-
- try
- {
- clientMethod.invoke( clientObject, new Object[]{ data } );
- }
- catch( InvocationTargetException exc )
- {
- exc.printStackTrace();
- // pgm Need to externalize this string.
- throw new IllegalArgumentException( "Client \"" + clientObject.getClass().getName() +
- "\" threw an exception." );
- }
- catch( IllegalAccessException exc )
- {
- exc.printStackTrace();
- // pgm Need to externalize this string.
- throw new IllegalArgumentException( "Client \"" + clientObject.getClass().getName() +
- "\" threw an exception." );
- }
- }
-
- private class ObjectMethod
- {
- public Object object;
- public Method method;
- public int order;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/DataMappingRegistryImpl.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/DataMappingRegistryImpl.java
deleted file mode 100644
index 132a09d..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/DataMappingRegistryImpl.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.core.data;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.data.Transformer;
-
-
-public class DataMappingRegistryImpl implements DataMappingRegistry
-{
- private Hashtable rulesTable_ = new Hashtable();
-
- public Vector getRuleEntries( String targetType )
- {
- return (Vector)rulesTable_.get( targetType );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.data.DataMappingRegistry#addMapping(java.lang.Class, java.lang.String, java.lang.Class, java.lang.String, org.eclipse.wst.command.env.core.data.Transformer)
- */
- public void addMapping( Class sourceType, String sourceProperty,
- Class targetType, String targetProperty,
- Transformer transformer)
- {
- Vector ruleEntries = (Vector)rulesTable_.get( targetType.getName() );
- RuleEntry ruleEntry = null;
-
- if( ruleEntries == null )
- {
- ruleEntries = new Vector();
- rulesTable_.put( targetType.getName(), ruleEntries );
- }
-
- // Find the rule entry
- for( int index = 0; index < ruleEntries.size(); index++ )
- {
- RuleEntry newEntry = (RuleEntry)ruleEntries.elementAt( index );
-
- if( sourceProperty.equals( newEntry.sourceProperty_ ) &&
- sourceType.equals( newEntry.sourceType_ ) &&
- targetProperty.equals( newEntry.targetProperty_ ) )
- {
- // The entry already exists
- ruleEntry = newEntry;
- break;
- }
- }
-
- if( ruleEntry == null )
- {
- // The rule didn't exist already so we will create a new one.
- ruleEntry = new RuleEntry(sourceType.getName(), sourceProperty, targetProperty, transformer );
- ruleEntries.add( ruleEntry );
- }
- else
- {
- // Just update the transformer.
- ruleEntry.transformer_ = transformer;
- }
- }
-
- //ruleEntries_.
-// String sourceClass = sourceType.getName();
-// String targetClass = targetType.getName();
-// Vector entries = (Vector)ruleEntries_.get( sourceClass );
-// RuleEntry ruleEntry = null;
-//
-// if( entries != null )
-// {
-// // Check to see if this mapping already exists.
-// for( int index = 0; index < entries.size(); index++ )
-// {
-// RuleEntry foundEntry = (RuleEntry)entries.elementAt( index );
-//
-// if( sourceProperty.equals( foundEntry.sourceProperty_ ) &&
-// targetType.equals( foundEntry.targetType_ ) &&
-// targetProperty.equals( foundEntry.targetProperty_ ) )
-// {
-// ruleEntry = foundEntry;
-// ruleEntry.transformer_ = transformer;
-// }
-// }
-//
-// // There is an existing vector for this sourceClass, but it didn't
-// // contain this new rule so we will add it in.
-// if( ruleEntry == null )
-// {
-// ruleEntry = new RuleEntry( sourceProperty, targetClass, targetProperty, transformer );
-// entries.add( ruleEntry );
-// }
-// }
-// else
-// {
-// // We need to create a new vector for this sourceClass.
-// entries = new Vector();
-// ruleEntry = new RuleEntry( sourceProperty, targetClass, targetProperty, transformer );
-// entries.add( ruleEntry );
-// ruleEntries_.put( sourceClass, entries );
-// }
-// }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.data.DataMappingRegistry#addMapping(java.lang.Class, java.lang.String, java.lang.Class)
- */
- public void addMapping(Class sourceType, String sourceProperty, Class targetType)
- {
- addMapping( sourceType, sourceProperty, targetType, sourceProperty, null );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/RuleEntry.java b/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/RuleEntry.java
deleted file mode 100644
index c039735..0000000
--- a/bundles/org.eclipse.wst.command.env.core/src/org/eclipse/wst/command/internal/env/core/data/RuleEntry.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.core.data;
-
-import org.eclipse.wst.command.env.core.data.Transformer;
-
-public class RuleEntry
-{
- public String sourceType_;
- public String sourceProperty_;
- public String targetProperty_;
- public Transformer transformer_;
-
-
- public RuleEntry( String sourceType,
- String sourceProperty,
- String targetProperty,
- Transformer transformer )
- {
- sourceType_ = sourceType;
- sourceProperty_ = sourceProperty;
- targetProperty_ = targetProperty;
- transformer_ = transformer;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/.classpath b/bundles/org.eclipse.wst.command.env.ui/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.command.env.ui/.cvsignore b/bundles/org.eclipse.wst.command.env.ui/.cvsignore
deleted file mode 100644
index 512f021..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-build.xml
-runtime
-temp.folder
diff --git a/bundles/org.eclipse.wst.command.env.ui/.project b/bundles/org.eclipse.wst.command.env.ui/.project
deleted file mode 100644
index ceb0b37..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.command.env.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.command.env.ui/build.properties b/bundles/org.eclipse.wst.command.env.ui/build.properties
deleted file mode 100644
index 8156427..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-bin.includes = plugin.xml,\
- *.jar,\
- envui.jar
-src.includes = .classpath,\
- .project,\
- build.properties,\
- plugin.xml,\
- src/
-jars.compile.order = envui.jar
-source.envui.jar = src/
-output.envui.jar = bin/
diff --git a/bundles/org.eclipse.wst.command.env.ui/plugin.properties b/bundles/org.eclipse.wst.command.env.ui/plugin.properties
deleted file mode 100644
index 84a6ee2..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Environment Command Framework (GUI)
-PLUGIN_PROVIDER=Eclipse.org
diff --git a/bundles/org.eclipse.wst.command.env.ui/plugin.xml b/bundles/org.eclipse.wst.command.env.ui/plugin.xml
deleted file mode 100644
index a0dd625..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/plugin.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id = "org.eclipse.wst.command.env.ui"
- version = "1.0.0"
- name = "%PLUGIN_NAME"
- provider-name = "%PLUGIN_PROVIDER">
-
- <runtime>
- <library name="envui.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <import plugin="org.eclipse.wst.command.env"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.osgi"/>
- </requires>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/eclipse/EclipseEnvironment.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/eclipse/EclipseEnvironment.java
deleted file mode 100644
index baf14eb..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/eclipse/EclipseEnvironment.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.eclipse;
-
-import org.eclipse.wst.command.env.core.CommandManager;
-import org.eclipse.wst.command.env.core.common.JavaCompiler;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.ProgressMonitor;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.core.uri.SimpleURIFactory;
-import org.eclipse.wst.command.env.core.uri.URIFactory;
-import org.eclipse.wst.command.env.core.uri.file.FileScheme;
-import org.eclipse.wst.command.env.eclipse.BaseEclipseEnvironment;
-import org.eclipse.wst.command.env.eclipse.EclipseLog;
-import org.eclipse.wst.command.env.eclipse.EclipseScheme;
-
-
-/**
- * This class implements an Environment class for the Eclipse Environment.
- * This Environment currently supports the "platform" protocol and the "file"
- * protocol.
- *
- */
-public class EclipseEnvironment implements BaseEclipseEnvironment
-{
- private CommandManager commandManager_ = null;
- private SimpleURIFactory uriFactory_ = null;
- private ResourceContext resourceContext_ = null;
- private ProgressMonitor monitor_ = null;
- private StatusHandler statusHandler_ = null;
-
- public EclipseEnvironment( CommandManager commandManager,
- ResourceContext resourceContext,
- ProgressMonitor monitor,
- StatusHandler statusHandler )
- {
- commandManager_ = commandManager;
- resourceContext_ = resourceContext;
- uriFactory_ = new SimpleURIFactory();
- monitor_ = monitor;
- statusHandler_ = statusHandler;
-
- uriFactory_.registerScheme( "platform", new EclipseScheme( this ) );
- uriFactory_.registerScheme( "file", new FileScheme() );
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Environment#getCommandManager()
- */
- public CommandManager getCommandManager()
- {
- return commandManager_;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Environment#getJavaCompiler()
- */
- public JavaCompiler getJavaCompiler()
- {
- return null;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Environment#getLog()
- */
- public Log getLog()
- {
- return new EclipseLog();
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Environment#getProgressMonitor()
- */
- public ProgressMonitor getProgressMonitor()
- {
- return monitor_;
- }
-
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Environment#getStatusHandler()
- */
- public StatusHandler getStatusHandler()
- {
- return statusHandler_;
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getURIFactory()
- */
- public URIFactory getURIFactory()
- {
- return uriFactory_;
- }
-
- /**
- * @return returns a ResourceContext for this Environment.
- */
- public ResourceContext getResourceContext()
- {
- return resourceContext_;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/eclipse/EclipseProgressMonitor.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/eclipse/EclipseProgressMonitor.java
deleted file mode 100644
index 0eab6b8..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/eclipse/EclipseProgressMonitor.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.eclipse;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.command.env.core.common.ProgressMonitor;
-
-
-public class EclipseProgressMonitor implements ProgressMonitor
-{
- IProgressMonitor monitor_;
-
- public EclipseProgressMonitor()
- {
- }
-
- /**
- * Sets an eclipse IProgressMonitor to this monitor.
- * @param monitor
- */
- public void setMonitor( IProgressMonitor monitor )
- {
- monitor_ = monitor;
- }
-
- /**
- *
- * @return returns the Eclipse IProgressMonitor for this monitor.
- */
- public IProgressMonitor getMonitor()
- {
- return monitor_;
- }
-
- /**
- * @see org.eclipse.env.common.ProgressMonitor#getChildProgressMonitor()
- */
- public ProgressMonitor getChildProgressMonitor()
- {
- return null;
- }
-
- /**
- * @see org.eclipse.env.common.ProgressMonitor#isCancelRequested()
- */
- public boolean isCancelRequested()
- {
- return monitor_ == null ? false : monitor_.isCanceled();
- }
-
- /**
- * @see org.eclipse.env.common.ProgressMonitor#report(java.lang.String)
- */
- public void report(String progress)
- {
- if( monitor_ != null )
- {
- Display currentThreadDisplay = Display.findDisplay( Thread.currentThread() );
-
- if( currentThreadDisplay != null )
- {
- monitor_.beginTask( progress, IProgressMonitor.UNKNOWN );
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/eclipse/EclipseStatusHandler.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/eclipse/EclipseStatusHandler.java
deleted file mode 100644
index f4c91fe..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/eclipse/EclipseStatusHandler.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.eclipse;
-
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.command.env.core.common.Choice;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.common.StatusException;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-import org.eclipse.wst.command.internal.env.ui.dialog.MessageDialog;
-import org.eclipse.wst.command.internal.env.ui.dialog.StatusDialogConstants;
-
-
-public class EclipseStatusHandler implements StatusHandler
-{
- private Shell shell_;
- private MessageUtils msg_;
-
- public EclipseStatusHandler()
- {
- this( new Shell() );
- }
-
- public EclipseStatusHandler(Shell shell)
- {
- msg_ = new MessageUtils( "org.eclipse.wst.command.env.common.environment", this );
- shell_ = shell;
- }
-
- /**
- * @see org.eclipse.env.common.StatusHandler#report(org.eclipse.env.common.Status, org.eclipse.env.common.Choice[])
- */
- public Choice report(Status status, Choice[] choices)
- {
- int result =
- MessageDialog.openMessage(
- shell_,
- msg_.getMessage("TITLE_WARNING"),
- null,
- status,
- choices);
- for (int i = 0; i < choices.length; i++)
- {
- if (choices[i].getShortcut() == result)
- return choices[i];
- }
-
- return null;
- }
-
- /**
- * @see org.eclipse.env.common.StatusHandler#report(org.eclipse.env.common.Status)
- */
- public void report(Status status) throws StatusException
- {
- boolean userOk = false;
-
- switch (status.getSeverity())
- {
- // an error has been reported and we need to stop executing the comming
- // commands
- case Status.ERROR :
- {
- userOk = reportErrorStatus(status);
- break;
- }
- case Status.WARNING :
- {
- userOk = reportWarning(status);
- break;
- }
- case Status.INFO :
- {
- userOk = true;
- reportInfo(status);
- break;
- }
- }
-
- if( !userOk ) throw new StatusException( status );
- }
-
- private boolean reportWarning(Status status)
- {
- int userResponse =
- MessageDialog.openMessage(
- shell_,
- msg_.getMessage("TITLE_WARNING"),
- null,
- status);
- return (userResponse == StatusDialogConstants.OK_ID);
- }
-
- private boolean reportErrorStatus(Status status)
- {
- MessageDialog.openMessage(
- shell_,
- msg_.getMessage("TITLE_ERROR"),
- null,
- status);
- return false;
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.StatusHandler#reportError(org.eclipse.wst.command.env.core.common.Status)
- */
- public void reportError(Status status)
- {
- reportErrorStatus( status );
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.StatusHandler#reportInfo(org.eclipse.wst.command.env.core.common.Status)
- */
- public void reportInfo(Status status)
- {
- MessageDialog.openMessage(
- shell_,
- msg_.getMessage("TITLE_INFO"),
- null,
- status);
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/environmentui.properties b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/environmentui.properties
deleted file mode 100644
index bc1f403..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/environmentui.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-BUTTON_SHOW_ALL_DIALOGS=Show All
-BUTTON_HIDE_ALL_DIALOGS=Hide All
-CHECKBOX_DO_NOT_SHOW_DIALOG_AGAIN=Do not show me this dialog box again.
-
-TOOLTIP_PPAD_PAGE=Control to show/hide the dialogs that appear when a pop-up action is executed.
-TOOLTIP_DO_NOT_SHOW_DIALOG_AGAIN=To allow this dialog to show again, enable from preference - dialogs.
-TOOLTIP_PPAD_BUTTON_SHOW_ALL=Show all dialogs.
-TOOLTIP_PPAD_BUTTON_HIDE_ALL=Hide all dialogs and execute pop-up actions.
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/CanFinishRegistry.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/CanFinishRegistry.java
deleted file mode 100644
index 2b3f6f2..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/CanFinishRegistry.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.widgets;
-
-import org.eclipse.wst.command.env.core.common.Condition;
-
-/**
- * This is an interface for an abstract can finish registry.
- * This registry is usually associate with an Eclipse wizard. This
- * registry allow condition object to be added to it in order to
- * determine if the wizard can finish or not.
- *
- */
-public interface CanFinishRegistry
-{
- /**
- * Add a condition object to the registry.
- * @param condition the condition.
- */
- public void addCondition( Condition condition );
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/CommandWidgetBinding.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/CommandWidgetBinding.java
deleted file mode 100644
index c705cf4..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/CommandWidgetBinding.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.widgets;
-
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactoryFactory;
-
-
-public interface CommandWidgetBinding extends CommandFragmentFactoryFactory
-{
- /**
- * This method is used by extensions to register their widgets with
- * CommandFragments
- *
- * @param widgetRegistry
- */
- public void registerWidgetMappings( WidgetRegistry widgetRegistry );
-
- /**
- * This method is used by extenions to register the data mappings
- * that their widgets use.
- *
- * @param dataRegistry
- */
- public void registerDataMappings( DataMappingRegistry dataRegistry );
-
- /**
- * This method is used by extensions to register condition objects
- * that control if the wizard can finish or not.
- *
- * @param canFinishRegistry
- */
- public void registerCanFinish( CanFinishRegistry canFinishRegistry );
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/CurrentPageCommand.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/CurrentPageCommand.java
deleted file mode 100644
index 764d217..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/CurrentPageCommand.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.command.env.ui.widgets;
-
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager;
-
-
-/**
- * This Command can be used to get the current page.
- * Use of this class is not recommended.
- *
- */
-public class CurrentPageCommand extends SimpleCommand
-{
- private WizardPageManager pageManager_;
-
- public CurrentPageCommand( WizardPageManager pageManager )
- {
- pageManager_ = pageManager;
- }
-
- public IWizardPage getCurrentPage()
- {
- return pageManager_.getCurrentPage();
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/DynamicWizard.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/DynamicWizard.java
deleted file mode 100644
index afd107a..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/DynamicWizard.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.widgets;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-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;
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.core.fragment.SimpleFragment;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseEnvironment;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseProgressMonitor;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseStatusHandler;
-import org.eclipse.wst.command.internal.env.context.PersistentResourceContext;
-import org.eclipse.wst.command.internal.env.core.data.DataFlowManager;
-import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistryImpl;
-import org.eclipse.wst.command.internal.env.ui.widgets.SimpleCanFinishRegistry;
-import org.eclipse.wst.command.internal.env.ui.widgets.SimplePageFactory;
-import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetRegistry;
-import org.eclipse.wst.command.internal.env.ui.widgets.WizardPageFactory;
-import org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager;
-
-
-/**
- * This class is used to add dynamic wizards into Eclipse. When adding
- * a dynamic wizard into eclipse two entries need to be made in the plugin.xml
- * file. This first entry tells Eclipse that a new wizard should be added
- * and it references this class. The second entry specifies detailed information
- * that is specific to the wizard to be added. These two plugin.xml entries
- * are linked together via their id attributes. For example here is an
- * entry that registers a new wizard with eclipse. Note the class attribute
- * references this class.
- * <pre>
- * <extension
- * point="org.eclipse.ui.newWizards">
- * <wizard
- * name="%PLUGIN_NEW_WIZARD_NAME_WS_CLIENT"
- * icon="icons/full/ctool16/newclient_webserv_wiz.gif"
- * category="org.eclipse.jst.ws.ui.new"
- * class="org.eclipse.wst.command.env.ui.widgets.DynamicWizard"
- * id="org.eclipse.jst.ws.consumption.ui.wizard.client.clientwizard">
- * <description>
- * %PLUGIN_NEW_WIZARD_DESC_WS_CLIENT
- * </description>
- * <selection
- * class="org.eclipse.core.resources.IResource">
- * </selection>
- * </wizard>
- * </extension>
- *
- * </pre>
- * Here is the dynamicWizard entry for this particular wizard. This id attributes
- * link these two entries together. The class attribute must specify a class that
- * implements the org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding interface. This
- * interface specifies what the UI should look like and the commands the should
- * be executed in the wizard.
- *
- * <pre>
- * <extension
- * point="org.eclipse.wst.command.env.dynamicWizard">
- * <dynamicWizard
- * iconbanner="icons/full/wizban/webservicesclient_wiz.gif"
- * class="org.eclipse.jst.ws.consumption.ui.widgets.binding.ClientWidgetBinding"
- * title="%WIZARD_TITLE_WSC"
- * id="org.eclipse.jst.ws.consumption.ui.wizard.client.clientwizard">
- * </dynamicWizard>
- * </extension>
- * </pre>
- *
- */
-public class DynamicWizard extends Wizard implements INewWizard, IExecutableExtension
-{
- private String iconBannerName_;
- private IPluginDescriptor pluginDescriptor_;
- private SimpleCanFinishRegistry canFinishRegistry_;
- private WizardPageManager pageManager_;
- private String wizardTitle_;
- private IWizardPage startPage_ = null;
-
- protected IConfigurationElement wizardElement_;
- protected IConfigurationElement originalElement_;
- protected CommandWidgetBinding commandWidgetBinding_;
-
- public DynamicWizard()
- {
- setNeedsProgressMonitor(true);
- }
-
- /**
- * This method is called when the Dynamic wizard is created by eclipse.
- * We need to find a dynamicWizard extension point that matches the id
- * for this wizard. Once the extension point is found it will contain
- * a reference to a CommandWidgetBinding class which defines the widgets
- * and commands for this wizard.
- *
- * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
- */
- public void setInitializationData( IConfigurationElement config,
- String propertyName,
- Object data )
- throws CoreException
- {
- String wizardId = config.getAttribute( "id" );
-
- setInitialData( wizardId );
- originalElement_ = config;
- }
-
- /**
- * This method should only be called if the Dynamic Wizard is being
- * launched through some other mechanise other than the Eclipse New Wizard
- * mechanism.
- *
- * @param binding the command widget binding for this wizard.
- * @param descriptor the plugin descriptor where the icon banner is
- * located.
- * @param iconBannerPath the icon banner path for this wizard. The path
- * is relative to the plugin specified by the
- * descriptor parameter.
- * @param wizardTitle the wizard title
- */
- public void setInitialData( CommandWidgetBinding binding,
- IPluginDescriptor descriptor,
- String iconBannerPath,
- String wizardTitle )
- {
- commandWidgetBinding_ = binding;
- pluginDescriptor_ = descriptor;
- iconBannerName_ = iconBannerPath;
- wizardTitle_ = wizardTitle;
- }
-
- /**
- * Sets the initial data based on the dynamic wizard id.
- *
- * @param wizardId
- */
- public void setInitialData( String wizardId ) throws CoreException
- {
- IPluginRegistry registry = Platform.getPluginRegistry();
- IExtensionPoint point = registry.getExtensionPoint("org.eclipse.wst.command.env.dynamicWizard");
- IExtension[] extensions = point.getExtensions();
- int wizardIndex = -1;
-
- for( int index = 0; index < extensions.length; index++)
- {
- IConfigurationElement[] elements = extensions[index].getConfigurationElements();
-
- if( elements.length == 1 && elements[0].getName().equals( "dynamicWizard") )
- {
- String id = elements[0].getAttribute( "id" );
-
- if( id != null && id.equals( wizardId ) )
- {
- wizardElement_ = elements[0];
- wizardIndex = index;
- break;
- }
- }
- }
-
- if( wizardElement_ != null )
- {
- commandWidgetBinding_ = (CommandWidgetBinding)wizardElement_.createExecutableExtension( "class" );
- pluginDescriptor_ = extensions[wizardIndex].getDeclaringPluginDescriptor();
- iconBannerName_ = wizardElement_.getAttribute( "iconbanner" );
- wizardTitle_ = wizardElement_.getAttribute( "title" );
- }
-
- if( commandWidgetBinding_ == null )
- {
- MessageUtils msg = new MessageUtils( "org.eclipse.wst.command.env.ui.widgets.environment", this );
- Status status = new Status( Status.ERROR, "id", 0, msg.getMessage( "MSG_ERROR_WIZARD_ID_NOT_FOUND", new String[]{ wizardId}) , null );
- throw new CoreException( status );
- }
- }
-
- /**
- * This method is called by the eclipse framework to initialize the
- * wizard.
- *
- * @param workbench the eclipse workbench
- * @param selection the initial selection that the user has made within
- * eclipse.
- */
- public void init ( IWorkbench workbench, IStructuredSelection selection )
- {
- PersistentResourceContext context = PersistentResourceContext.getInstance();
- EclipseStatusHandler handler = new EclipseStatusHandler();
- EclipseProgressMonitor monitor = new EclipseProgressMonitor();
- EclipseEnvironment environment = new EclipseEnvironment( null, context, monitor, handler );
-
- DataMappingRegistryImpl dataRegistry_ = new DataMappingRegistryImpl();
- SimpleWidgetRegistry widgetRegistry_ = new SimpleWidgetRegistry();
-
- DataFlowManager dataManager = new DataFlowManager( dataRegistry_, environment );
-
- startPage_ = null;
- canFinishRegistry_ = new SimpleCanFinishRegistry();
- pageManager_ = new WizardPageManager( widgetRegistry_,
- getWizardPageFactory(),
- this,
- dataManager,
- environment );
-
- pageManager_.setRootFragment( getRootFragment( selection, pageManager_ ) );
-
- commandWidgetBinding_.registerWidgetMappings( widgetRegistry_ );
- commandWidgetBinding_.registerDataMappings( dataRegistry_ );
- commandWidgetBinding_.registerCanFinish( canFinishRegistry_ );
-
- // If a page is not complete ensure that canFinish is false.
- Condition canFinish = new Condition()
- {
- public boolean evaluate()
- {
- IWizardPage currentPage = pageManager_.getCurrentPage();
-
- return currentPage != null ? currentPage.isPageComplete() : true;
- }
- };
-
- canFinishRegistry_.add( canFinish );
-
- // Set that we need a progress monitor.
- setNeedsProgressMonitor( true );
-
- // Ensure that the next/back buttons are enabled.
- setForcePreviousAndNextButtons( true );
-
- // Set the icon banner if specified.
- if( iconBannerName_ != null && iconBannerName_.length() > 0 )
- {
- try
- {
- URL installURL = pluginDescriptor_.getInstallURL();
- URL imageURL = new URL(installURL, iconBannerName_ );
- ImageDescriptor image = ImageDescriptor.createFromURL(imageURL);
-
- if( image != null )
- {
- setDefaultPageImageDescriptor( image );
- }
- }
- catch (MalformedURLException e)
- {
- }
- }
-
- if( wizardTitle_ != null && wizardTitle_.length() > 0 )
- {
- setWindowTitle( wizardTitle_ );
- }
- }
-
- // Subclasses can override this.
- protected WizardPageFactory getWizardPageFactory()
- {
- return new SimplePageFactory();
- }
-
- /**
- * Returns true if all pages are complete.
- * @return True if all pages are complete.
- */
- public boolean canFinish ()
- {
- int length = canFinishRegistry_.size();
- boolean result = true;
-
- for( int index = 0; index < length; index++ )
- {
- Condition condition = (Condition)canFinishRegistry_.elementAt( index );
-
- result = condition.evaluate();
-
- if( !result ) break;
- }
-
- return result;
- }
-
- /**
- * Returns the first page for this wizard.
- *
- * @return the first page for this wizard.
- **/
- public IWizardPage getStartingPage()
- {
- if( startPage_ == null )
- {
- startPage_ = pageManager_.getNextPage();
- }
-
- return startPage_;
- }
-
- /**
- * Returns the next page after page and
- * runs the appropriate tasks.
- *
- * @return the next page after page.
- **/
- public IWizardPage getNextPage( IWizardPage page )
- {
- return pageManager_.getNextPage();
- }
-
- /**
- */
- public boolean performFinish ()
- {
- return pageManager_.performFinish();
- }
-
- /**
- * Undo fragments
- */
- public boolean performCancel ()
- {
- return pageManager_.performCancel();
- }
-
- protected CommandFragment getRootFragment( IStructuredSelection selection, WizardPageManager pageManager )
- {
- SequenceFragment root = new SequenceFragment();
-
- root.add( new SimpleFragment( new SelectionCommand( selection ), "" ) );
- root.add( new SimpleFragment( new CurrentPageCommand( pageManager ), "" ) );
- root.add( commandWidgetBinding_.create().create() );
-
- return root;
- }
-
- protected IConfigurationElement getConfigElement()
- {
- return wizardElement_;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/PageWizardDataEvents.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/PageWizardDataEvents.java
deleted file mode 100644
index 941eb37..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/PageWizardDataEvents.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.widgets;
-
-import org.eclipse.jface.wizard.IWizardPage;
-
-/**
- * Dynamic wizard implementations that want to create different
- * kinds of wizard pages need to implement this interface.
- * The WizardPageFactory returns a class of this type.
- *
- */
-public interface PageWizardDataEvents extends IWizardPage
-{
- /**
- *
- * @return returns the WidgetDataEvents object created by the addControls
- * method of a WidgetContributor.
- */
- public WidgetDataEvents getDataEvents();
-
- /**
- * Validates that this wizard page is complete.
- *
- */
- public void validatePageToStatus();
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/SelectionCommand.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/SelectionCommand.java
deleted file mode 100644
index ee6f2e8..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/SelectionCommand.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.command.env.ui.widgets;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-
-
-/**
- * This SelectionCommand is execute at the very beginning of the
- * dynamic wizard. Commands executed in the wizard that need
- * the initial selection can get it through a data mapping from
- * this command to the command that needs it.
- *
- */
-public class SelectionCommand extends SimpleCommand
-{
- private IStructuredSelection selection_;
-
- public SelectionCommand( IStructuredSelection selection )
- {
- selection_ = selection;
- }
-
- public IStructuredSelection getInitialSelection()
- {
- return selection_;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/SimpleCommandEngineManager.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/SimpleCommandEngineManager.java
deleted file mode 100644
index 4aad225..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/SimpleCommandEngineManager.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.widgets;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentEngine;
-import org.eclipse.wst.command.env.core.fragment.FragmentListener;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseProgressMonitor;
-import org.eclipse.wst.command.internal.env.core.data.DataFlowManager;
-
-
-/**
- * This class manages the execution of Commands in a flow of CommandFragments.
- * The bulk of this work is done by the CommandFragmentEngine. The main job of
- * this class is run the fragments in a particular transactional environment.
- * A fragment has a method called doNotRunInTransaction which is used to determine
- * if its commands should be run in a transaction or not. If this method returns
- * true(ie. not in a transaction) the Commands are wrapped in a IRunnableWithProgress.
- * If false( ie. in a transaction ) the Commands are wrapped in a WorkspaceModifyOperation.
- *
- */
-public class SimpleCommandEngineManager
-{
- protected CommandFragmentEngine engine_;
- protected DataFlowManager dataManager_;
- private Environment environment_;
-
- private boolean foundStop_;
- private boolean doNotRunInTransaction_;
-
- public SimpleCommandEngineManager( Environment environment, DataFlowManager dataManager )
- {
- environment_ = environment;
- dataManager_ = dataManager;
- }
-
- /**
- * Sets the root fragment. The execution engine will start executing commands
- * at the beginning of this root fragment.
- *
- * @param root the root fragment.
- */
- public void setRootFragment( CommandFragment root )
- {
- engine_ = new CommandFragmentEngine( root, dataManager_, environment_ );
-
- engine_.setPeekFragmentListener(
- new FragmentListener()
- {
- public boolean notify( CommandFragment fragment )
- {
- return peekFragment( fragment );
- }
- } );
-
- engine_.setNextFragmentListener(
- new FragmentListener()
- {
- public boolean notify( CommandFragment fragment )
- {
- return nextFragment( fragment );
- }
- } );
-
- engine_.setUndoFragmentListener(
- new FragmentListener()
- {
- public boolean notify( CommandFragment fragment )
- {
- return undoFragment( fragment );
- }
- } );
- }
-
- /**
- * The CommandFragmentEngine calls this method when it is peeking forward
- * in the fragments. When peeking forward the command stack state in the
- * engine is not changes.
- *
- *
- * @param fragment the fragment that it is peeking at.
- * @return Indicates whether peeking should stop or not.
- */
- protected boolean peekFragment( CommandFragment fragment )
- {
- return true;
- }
-
- /**
- * The CommandFragmentEngine calls this method when it is moving forward
- * in the fragments. When moving forward the command stack state is saved
- * at each fragment is traversed.
- *
- * @param fragment the fragment that is being traversed.
- * @return indicates if the forward traversal should continue.
- */
- protected boolean nextFragment( CommandFragment fragment )
- {
- if( fragment.doNotRunInTransaction() != doNotRunInTransaction_ )
- {
- // The fragment is requesting a different transaction environment than
- // the one that we are in so we must stop and change environments.
- doNotRunInTransaction_ = fragment.doNotRunInTransaction();
- foundStop_ = false;
- }
-
- return foundStop_;
- }
-
- /**
- * This method is called for each fragment when the command engine is unwinding
- * its stack during an undo operation.
- *
- * @param fragment the fragment being undone.
- * @return returns true if the undo process should continue.
- */
- protected boolean undoFragment( CommandFragment fragment )
- {
- return true;
- }
-
- /**
- * The method executes the CommandFragment commands in the context provided.
- *
- * @param context the context
- * @return returns the status of executing the commands.
- */
- public Status runForwardToNextStop( IRunnableContext context )
- {
- IRunnableWithProgress operation = null;
-
- doNotRunInTransaction_ = false;
-
- do
- {
- // We will stop unless we are changing transaction modes.
- foundStop_ = true;
-
- if( doNotRunInTransaction_ )
- {
- operation = getNoTransactionOperation();
- }
- else
- {
- operation = getTransactionOperation();
- }
-
- try
- {
- if( context == null )
- {
- // We don't have a container yet so just run the operation.
- operation.run( null );
- }
- else
- {
- // We have a container where this operation can run and have
- // its progress displayed.
- context.run( false, false, operation );
- }
- }
- catch( InterruptedException exc )
- {
- //TODO should log these exceptions.
- exc.printStackTrace();
- }
- catch( InvocationTargetException exc )
- {
- //TODO should log these exceptions.
- exc.printStackTrace();
- }
- }
- while( !foundStop_ );
-
- return engine_.getLastStatus();
- }
-
- private IRunnableWithProgress getTransactionOperation()
- {
- IRunnableWithProgress operation = new IRunnableWithProgress()
- {
- public void run( IProgressMonitor monitor )
- //WorkspaceModifyOperation operation = new WorkspaceModifyOperation()
- //{
- // public void execute( IProgressMonitor monitor )
- {
- EclipseProgressMonitor eclipseMonitor = (EclipseProgressMonitor)environment_.getProgressMonitor();
- eclipseMonitor.setMonitor( monitor );
- environment_.getLog().log(Log.INFO, "command", 5002, this, "getTransactionOperation", "Start of transaction");
- engine_.moveForwardToNextStop();
- environment_.getLog().log(Log.INFO, "command", 5003, this, "getTransactionOperation", "End of transaction");
- }
- };
-
- return operation;
- }
-
- private IRunnableWithProgress getNoTransactionOperation()
- {
- IRunnableWithProgress operation = new IRunnableWithProgress()
- {
- public void run( IProgressMonitor monitor )
- {
- EclipseProgressMonitor eclipseMonitor = (EclipseProgressMonitor)environment_.getProgressMonitor();
- eclipseMonitor.setMonitor( monitor );
- environment_.getLog().log(Log.INFO, "command", 5085, this, "getNoTransactionOperation", "Start of NON transaction");
- engine_.moveForwardToNextStop();
- environment_.getLog().log(Log.INFO, "command", 5086, this, "getNoTransactionOperation", "End of NON transaction");
- }
- };
-
- return operation;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/SimpleWidgetDataContributor.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/SimpleWidgetDataContributor.java
deleted file mode 100644
index 21c7ded..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/SimpleWidgetDataContributor.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.widgets;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
- * This class provides a simple WidgetDataContributor class that concrete
- * WidgetDataContributors can subclass.
- *
- */
-public class SimpleWidgetDataContributor implements WidgetDataContributor
-{
- /**
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#addControls(org.eclipse.swt.widgets.Composite, org.eclipse.swt.widgets.Listener)
- */
- public WidgetDataEvents addControls( Composite parent, Listener statusListener)
- {
- return this;
- }
-
- /**
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus()
- */
- public Status getStatus()
- {
- return null;
- }
-
- /**
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents#externalize()
- */
- public void externalize()
- {
- }
-
- /**
- * @see org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents#internalize()
- */
- public void internalize()
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetContributor.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetContributor.java
deleted file mode 100644
index abd330f..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetContributor.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.widgets;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
- * This interface provides a way for developers to create validatable widgets
- * that can be used in many different Eclipse UI contexts. (ie. in a Windows, Diaglogs,
- * wizard pages, etc)
- *
- * The main functionality this interface has over just a regular Eclipse Composite
- * is that it provides a mechanism for validating the Widget. When validating
- * there are two aspects to keep in mind. The first aspect deals with WHEN validation
- * occurs and the second aspect deals with WHAT to do for a validation event.
- *
- * The first aspect of triggering validation events is handled by the statusListener
- * parameter of the addControls method. If a particular control that is contributed can
- * affect the validity of this WidgetContributor then the statusListener object
- * should be added to the listener list of that control. For example, if the text in
- * a Text widget can affect the validity of this WidgetContributor then you would
- * add the statusListener to the Text widgets Modify listener list:
- *
- *
- * Text someText = new Text( parent, SWT.NONE );
- * someText.addListener( SWT.Modify, statusListener );
- *
- * Note: if you want to force validation of this widget you can call
- * the statusListener.handleEvent(null) method directly. This
- * is not the prefered may to trigger validation, however.
- *
- * The second aspect of valiation is what to do when the validation event occurs.
- * This is handled by getStatus method. Any code that ensures that this widget is
- * valid should be put in the getStatus implementation.
- *
- *
-*/
-public interface WidgetContributor
-{
- /**
- * This method should be used to implement the UI contributions for this widget.
- *
- * @param parent The composite parent that sub widgets should use.
- * @param statusListener This listener should be added to any widget that can
- * affect the validity of this WidgetContributor.
- * @return returns a WidgetDataEvents object. This object is used by the
- * framework to internalize and externalize data for this widget.
- */
- public WidgetDataEvents addControls( Composite parent, Listener statusListener );
-
- /**
- * This method should implement validation code for this WidgetContributor.
- *
- * @return returns a status object indicating the validity of this widget.
- * If the status severity is ERROR then this widget is considered to
- * be invalid. For any other status severity or if the status returned
- * is null this widget is considered to be valid.
- */
- public Status getStatus();
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetContributorFactory.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetContributorFactory.java
deleted file mode 100644
index 3f6b1b1..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetContributorFactory.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.widgets;
-
-/**
- * This interface provide a way for creating WidgetContributors
- *
- *
- */
-public interface WidgetContributorFactory
-{
- public WidgetContributor create();
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetDataContributor.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetDataContributor.java
deleted file mode 100644
index 3147634..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetDataContributor.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.widgets;
-
-/**
- * This interface is a combination of the WidgetContributor interface and
- * the WidgetDataEvents interface.
- *
- */
-public interface WidgetDataContributor extends WidgetContributor, WidgetDataEvents
-{
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetDataEvents.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetDataEvents.java
deleted file mode 100644
index e246ae6..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetDataEvents.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.widgets;
-
-/**
- * This interface provides a way for internalizing and externalizing state
- * data in a WidgetContributor. The internalize method will be called
- * before the widget is displayed so that it can set the default data
- * for that widget. The externalize method provides a way of getting data
- * from the widget after it is displayed.
- *
- */
-public interface WidgetDataEvents
-{
- /**
- * Implementations should set widget state data here.
- *
- */
- public void internalize();
-
- /**
- * Implemenations should get widget state data here.
- *
- */
- public void externalize();
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetRegistry.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetRegistry.java
deleted file mode 100644
index 5d1494a..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/WidgetRegistry.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.ui.widgets;
-
-/**
- * This interface defines how WidgetContributors are made known to the
- * dynamic wizard framework. This widget will be displayed as a wizard page
- * with the name and title specified in the add method. The fragmentId is
- * used to associate this widget with a particular CommandFragment. When
- * a CommandFragment with this fragmentId is traversed the corresponding
- * WidgetContributor will be displayed.
- *
- */
-public interface WidgetRegistry
-{
- /**
- * Adds a WidgetContributorFactory to the framework. This factory
- * is used to get the WidgetContributor. This WidgetContributor
- * will be used to render the wizard page.
- *
- * @param fragmentId the CommandFragment id that this WidgetContributor is associated with.
- * @param pageName the name of this wizard page.
- * @param pageTitle the title of this wizard page.
- * @param widgetFactory the factory which will create the WidgetContributor.
- */
- public void add( String fragmentId,
- String pageName,
- String pageTitle,
- WidgetContributorFactory widgetFactory );
-
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/environment.properties b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/environment.properties
deleted file mode 100644
index 7a98e36..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/env/ui/widgets/environment.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-MSG_ERROR_WIZARD_ID_NOT_FOUND=IWAB0013E Could not find wizard id: {0}
-
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/ErrorDialog.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/ErrorDialog.java
deleted file mode 100644
index 3e2ae05..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/ErrorDialog.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.dialog;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
- * A dialog to display one or more errors to the user, as contained in an
- * <code>Status</code> object. If an error contains additional detailed
- * information then a Details button is automatically supplied, which shows or
- * hides an error details viewer when pressed by the user.
- *
- */
-public class ErrorDialog extends MessageDialog
-{
-
- /**
- * Creates an error dialog. Note that the dialog will have no visual
- * representation (no widgets) until it is told to open.
- * <p>
- * Normally one should use <code>openError</code> to create and open one of
- * these. This constructor is useful only if the error object being displayed
- * contains child items <it>and</it> you need to specify a mask which will
- * be used to filter the displaying of these children.
- * </p>
- *
- * @param parentShell
- * the shell under which to create this dialog
- * @param dialogTitle
- * the title to use for this dialog, or <code>null</code> to
- * indicate that the default title should be used
- * @param message
- * the message to show in this dialog, or <code>null</code> to
- * indicate that the error's message should be shown as the
- * primary message
- * @param status
- * the error to show to the user
- * @param displayMask
- * the mask to use to filter the displaying of child items, as per
- * <code>Status.matches</code>
- */
- public ErrorDialog(
- Shell parentShell,
- String dialogTitle,
- String message,
- Status status,
- int displayMask)
- {
- super(parentShell, dialogTitle, message, status, displayMask);
- }
-
- /*
- * (non-Javadoc) This should also be overwritten Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent)
- {
- // create OK and Details buttons
- createButton(
- parent,
- StatusDialogConstants.OK_ID,
- IDialogConstants.OK_LABEL,
- true);
- if (status.hasChildren() || status.getThrowable() != null )
- {
- detailsButton =
- createButton(
- parent,
- StatusDialogConstants.DETAILS_ID,
- IDialogConstants.SHOW_DETAILS_LABEL,
- false);
- }
- }
-
- /*
- * This is one of the few methods that needs to be overwritten by the
- * subclasses. The image names can be found in the Dialog class
- */
- protected Image getDialogImage()
- {
- // create image
- return JFaceResources.getImageRegistry().get(DLG_IMG_ERROR);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/InfoDialog.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/InfoDialog.java
deleted file mode 100644
index 35afb19..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/InfoDialog.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.dialog;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
- * A dialog to display one or more errors to the user, as contained in an
- * <code>Status</code> object. If an error contains additional detailed
- * information then a Details button is automatically supplied, which shows or
- * hides an error details viewer when pressed by the user.
- *
- */
-public class InfoDialog extends MessageDialog
-{
- /**
- * Creates an error dialog. Note that the dialog will have no visual
- * representation (no widgets) until it is told to open.
- * <p>
- * Normally one should use <code>openError</code> to create and open one of
- * these. This constructor is useful only if the error object being displayed
- * contains child items <it>and</it> you need to specify a mask which will
- * be used to filter the displaying of these children.
- * </p>
- *
- * @param parentShell
- * the shell under which to create this dialog
- * @param dialogTitle
- * the title to use for this dialog, or <code>null</code> to
- * indicate that the default title should be used
- * @param message
- * the message to show in this dialog, or <code>null</code> to
- * indicate that the error's message should be shown as the
- * primary message
- * @param status
- * the error to show to the user
- * @param displayMask
- * the mask to use to filter the displaying of child items, as per
- * <code>Status.matches</code>
- */
- public InfoDialog(
- Shell parentShell,
- String dialogTitle,
- String message,
- Status status,
- int displayMask)
- {
- super(parentShell, dialogTitle, message, status, displayMask);
- }
-
- /*
- * (non-Javadoc) This should also be overwritten Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent)
- {
- // create OK and Details buttons
- createButton(
- parent,
- StatusDialogConstants.OK_ID,
- IDialogConstants.OK_LABEL,
- true);
- if (status.hasChildren())
- {
- detailsButton =
- createButton(
- parent,
- StatusDialogConstants.DETAILS_ID,
- IDialogConstants.SHOW_DETAILS_LABEL,
- false);
- }
- }
-
- /*
- * This is one of the few methods that needs to be overwritten by the
- * subclasses. The image names can be found in the Dialog class
- */
- protected Image getDialogImage()
- {
- // create image
- return JFaceResources.getImageRegistry().get(DLG_IMG_INFO);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/MessageDialog.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/MessageDialog.java
deleted file mode 100644
index 4972a35..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/MessageDialog.java
+++ /dev/null
@@ -1,579 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.dialog;
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.command.env.common.StringUtils;
-import org.eclipse.wst.command.env.core.common.Choice;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
- * A dialog to display one or more errors to the user, as contained in an
- * <code>Status</code> object. If an error contains additional detailed
- * information then a Details button is automatically supplied, which shows or
- * hides an error details viewer when pressed by the user.
- *
- */
-public class MessageDialog extends Dialog
-{
- protected Composite parent;
-
- /**
- * Reserve room for this many list items.
- */
- protected static final int LIST_ITEM_COUNT = 7;
-
- /**
- * The Details button.
- */
- protected Button detailsButton;
-
- /**
- * The title of the dialog.
- */
- protected String title;
-
- /**
- * The message to display.
- */
- protected String message;
-
- /**
- * The SWT list control that displays the error details.
- */
- protected List list;
- protected Text details;
-
- /**
- * Indicates whether the error details viewer is currently created.
- */
- protected boolean listCreated = false;
- protected boolean detailsCreated = false;
-
- /**
- * Filter mask for determining which status items to display.
- */
- protected int displayMask = 0xFFFF;
-
- /**
- * The main status object.
- */
- protected Status status;
-
- private Point savedSize = null;
-
- /**
- * List of the main error object's detailed errors (element type: <code>Status</code>).
- */
- protected java.util.List statusList;
- /**
- * Creates an error dialog. Note that the dialog will have no visual
- * representation (no widgets) until it is told to open.
- * <p>
- * Normally one should use <code>openError</code> to create and open one of
- * these. This constructor is useful only if the error object being displayed
- * contains child items <it>and</it> you need to specify a mask which will
- * be used to filter the displaying of these children.
- * </p>
- *
- * @param parentShell
- * the shell under which to create this dialog
- * @param dialogTitle
- * the title to use for this dialog, or <code>null</code> to
- * indicate that the default title should be used
- * @param message
- * the message to show in this dialog, or <code>null</code> to
- * indicate that the error's message should be shown as the
- * primary message
- * @param status
- * the error to show to the user
- * @param displayMask
- * the mask to use to filter the displaying of child items, as per
- * <code>Status.matches</code>
- */
- public MessageDialog(
- Shell parentShell,
- String dialogTitle,
- String message,
- Status status,
- int displayMask)
- {
- super(parentShell);
- this.title = dialogTitle == null ? JFaceResources.getString("Problem_Occurred") : //$NON-NLS-1$
- dialogTitle;
- this.message = message == null ? status.getMessage() : JFaceResources.format("Reason", new Object[] { message, status.getMessage()}); //$NON-NLS-1$
- this.status = status;
- statusList = Arrays.asList(status.getChildren());
- this.displayMask = displayMask;
- setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);
- }
- /*
- * (non-Javadoc) Method declared on Dialog. Handles the pressing of the Ok or
- * Details button in this dialog. If the Ok button was pressed then close
- * this dialog. If the Details button was pressed then toggle the displaying
- * of the error details area. Note that the Details button will only be
- * visible if the error being displayed specifies child details.
- */
- protected void buttonPressed(int id)
- {
- if (id == StatusDialogConstants.DETAILS_ID)
- { // was the details button pressed?
- toggleDetailsArea();
- }
- else
- {
- super.buttonPressed(id);
- }
- }
- /*
- * (non-Javadoc) Method declared in Window.
- */
- protected void configureShell(Shell shell)
- {
- super.configureShell(shell);
- shell.setText(title);
- }
- /*
- * (non-Javadoc) This should also be overwritten Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent)
- {
- // create OK and Details buttons
- createButton(
- parent,
- StatusDialogConstants.OK_ID,
- IDialogConstants.OK_LABEL,
- true);
- if (status.hasChildren() || status.getThrowable() != null )
- {
- detailsButton =
- createButton(
- parent,
- StatusDialogConstants.DETAILS_ID,
- IDialogConstants.SHOW_DETAILS_LABEL,
- false);
- }
-
- parent.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ));
- }
-
- /*
- * This is one of the few methods that needs to be overwritten by the
- * subclasses. The image names can be found in the Dialog class
- */
- protected Image getDialogImage()
- {
- // create image
- return JFaceResources.getImageRegistry().get(DLG_IMG_INFO);
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog. Creates and returns the contents
- * of the upper part of the dialog (above the button bar).
- */
- protected Control createDialogArea(Composite parent)
- {
- this.parent = parent;
-
- // create composite
- Composite composite = (Composite) super.createDialogArea(parent);
- Composite imageAndLabel = new Composite(composite, SWT.NONE);
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- imageAndLabel.setLayout(gl);
- composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ));
-
- // create image
- Image image = getDialogImage();
- if (image != null)
- {
- Label label = new Label(imageAndLabel, 0);
- image.setBackground(label.getBackground());
- label.setImage(image);
- label.setLayoutData(
- new GridData(
- GridData.HORIZONTAL_ALIGN_CENTER
- | GridData.VERTICAL_ALIGN_BEGINNING));
- }
-
- // create message
- if (message != null)
- {
- Text text = new Text(imageAndLabel, SWT.READ_ONLY|SWT.WRAP);
- text.setText(message);
- GridData data =
- new GridData(
- GridData.GRAB_HORIZONTAL
- | GridData.GRAB_VERTICAL
- | GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint =
- convertHorizontalDLUsToPixels(
- IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
-
- text.setLayoutData(data);
- text.setFont(parent.getFont());
- }
-
- return composite;
- }
-
- protected List createDropDownList(Composite parent)
- {
- // create the list
- list = new List(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
-
- // fill the list
- populateList(list);
-
- GridData data =
- new GridData(
- GridData.HORIZONTAL_ALIGN_FILL
- | GridData.GRAB_HORIZONTAL
- | GridData.VERTICAL_ALIGN_FILL
- | GridData.GRAB_VERTICAL);
- data.heightHint = list.getItemHeight() * LIST_ITEM_COUNT;
- list.setLayoutData(data);
- listCreated = true;
- return list;
- }
- protected Text createDropDownDetails(Composite parent)
- {
- details = new Text(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY);
- //details.setEditable(false);
- Color color = new Color(parent.getShell().getDisplay(), 255, 255, 255);
- details.setBackground(color);
- populateDetails(details, status, 0);
- GridData data =
- new GridData(
- GridData.HORIZONTAL_ALIGN_FILL
- | GridData.GRAB_HORIZONTAL
- | GridData.VERTICAL_ALIGN_FILL
- | GridData.GRAB_VERTICAL);
- details.setLayoutData(data);
- details.setSelection(0);
- detailsCreated = true;
- return details;
- }
- /*
- * (non-Javadoc) Method declared on Window.
- */
- /**
- * Extends <code>Window.open()</code>. Opens an error dialog to display
- * the error. If you specified a mask to filter the displaying of these
- * children, the error dialog will only be displayed if there is at least one
- * child status matching the mask.
- */
- public int open()
- {
- if (shouldDisplay(status, displayMask))
- {
- return super.open();
- }
- return 0;
- }
- /**
- * This essentially does the work of a factory Opens an error dialog to
- * display the given error. Use this method if the error object being
- * displayed does not contain child items, or if you wish to display all such
- * items without filtering.
- *
- * @param parent
- * the parent shell of the dialog, or <code>null</code> if none
- * @param dialogTitle
- * the title to use for this dialog, or <code>null</code> to
- * indicate that the default title should be used
- * @param message
- * the message to show in this dialog, or <code>null</code> to
- * indicate that the error's message should be shown as the
- * primary message
- * @param status
- * the error to show to the user
- * @return the code of the button that was pressed that resulted in this
- * dialog closing. This will be <code>Dialog.OK</code> if the OK
- * button was pressed, or <code>Dialog.CANCEL</code> if this
- * dialog's close window decoration or the ESC key was used.
- */
- public static int openMessage(
- Shell parent,
- String dialogTitle,
- String message,
- Status status)
- {
-
- switch (status.getSeverity())
- {
- case Status.INFO :
- return openInfo(
- parent,
- dialogTitle,
- message,
- status,
- Status.OK | Status.INFO | Status.WARNING | Status.ERROR);
- case Status.WARNING :
- return openWarning(
- parent,
- dialogTitle,
- message,
- status,
- Status.OK | Status.INFO | Status.WARNING | Status.ERROR);
- default :
- return openError(
- parent,
- dialogTitle,
- message,
- status,
- Status.OK | Status.INFO | Status.WARNING | Status.ERROR);
- }
-
- }
-
- public static int openMessage(
- Shell parent,
- String dialogTitle,
- String message,
- Status status,
- Choice[] options)
- {
-
- return openOptions(
- parent,
- dialogTitle,
- message,
- status,
- Status.OK | Status.INFO | Status.WARNING | Status.ERROR,
- options);
- }
-
- /**
- * Opens an error dialog to display the given error. Use this method if the
- * error object being displayed contains child items <it>and</it> you wish
- * to specify a mask which will be used to filter the displaying of these
- * children. The error dialog will only be displayed if there is at least one
- * child status matching the mask.
- *
- * @param parentShell
- * the parent shell of the dialog, or <code>null</code> if none
- * @param dialogTitle
- * the title to use for this dialog, or <code>null</code> to
- * indicate that the default title should be used
- * @param message
- * the message to show in this dialog, or <code>null</code> to
- * indicate that the error's message should be shown as the
- * primary message
- * @param status
- * the error to show to the user
- * @param displayMask
- * the mask to use to filter the displaying of child items, as per
- * <code>Status.matches</code>
- * @return the code of the button that was pressed that resulted in this
- * dialog closing. This will be <code>Dialog.OK</code> if the OK
- * button was pressed, or <code>Dialog.CANCEL</code> if this
- * dialog's close window decoration or the ESC key was used.
- */
- public static int openError(
- Shell parentShell,
- String title,
- String message,
- Status status,
- int displayMask)
- {
- ErrorDialog dialog =
- new ErrorDialog(parentShell, title, message, status, displayMask);
- return dialog.open();
- }
-
- public static int openInfo(
- Shell parentShell,
- String title,
- String message,
- Status status,
- int displayMask)
- {
- InfoDialog dialog =
- new InfoDialog(parentShell, title, message, status, displayMask);
- return dialog.open();
- }
-
- public static int openWarning(
- Shell parentShell,
- String title,
- String message,
- Status status,
- int displayMask)
- {
- WarningDialog dialog =
- new WarningDialog(parentShell, title, message, status, displayMask);
- return dialog.open();
- }
-
- public static int openOptions(
- Shell parentShell,
- String title,
- String message,
- Status status,
- int displayMask,
- Choice[] options)
- {
- OptionsDialog dialog =
- new OptionsDialog(
- parentShell,
- title,
- message,
- status,
- displayMask,
- options);
- dialog.open();
- return dialog.getReturnCode();
- }
-
- /**
- * Populates the list using this error dialog's status object. This walks the
- * child stati of the status object and displays them in a list. The format
- * for each entry is status_path : status_message If the status's path was
- * null then it (and the colon) are omitted.
- */
- private void populateList(List list)
- {
- Iterator enumeration = statusList.iterator();
- while (enumeration.hasNext())
- {
- Status childStatus = (Status) enumeration.next();
- populateList(list, childStatus, 0);
- }
- }
- private void populateList(List list, Status status, int nesting)
- {
- if (!status.matches(displayMask))
- {
- return;
- }
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < nesting; i++)
- {
- sb.append(" ");
- }
- sb.append(status.getMessage());
- list.add(sb.toString());
- Status[] children = status.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- populateList(list, children[i], nesting + 1);
- }
- }
- private void populateDetails(Text text, Status status, int nesting)
- {
- if (!status.matches(displayMask))
- {
- return;
- }
-
- String tabChars = StringUtils.repeat( ' ', nesting * 2 );
- String messageLine = tabChars + status.getMessage() + System.getProperty("line.separator");
- Throwable except = status.getThrowable();
-
- text.append( messageLine );
-
- if( except != null )
- {
- String[] trace = StringUtils.getStackTrace( except );
-
- for( int index = 0; index < trace.length; index++ )
- {
- text.append( tabChars + " " + trace[index] + System.getProperty("line.separator") );
- }
- }
-
- Status[] children = status.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- populateDetails(text, children[i], nesting + 1);
- }
- }
- /**
- * Returns whether the given status object should be displayed.
- *
- * @param status
- * a status object
- * @param mask
- * a mask as per <code>Status.matches</code>
- * @return <code>true</code> if the given status should be displayed, and
- * <code>false</code> otherwise
- */
- protected static boolean shouldDisplay(Status status, int mask)
- {
- Status[] children = status.getChildren();
- if (children == null || children.length == 0)
- {
- return status.matches(mask);
- }
- for (int i = 0; i < children.length; i++)
- {
- if (children[i].matches(mask))
- return true;
- }
- return false;
- }
- /**
- * Toggles the unfolding of the details area. This is triggered by the user
- * pressing the details button.
- */
- private void toggleDetailsArea()
- {
- Point windowSize = getShell().getSize();
- int newHeight = -1;
-
- if (detailsCreated)
- {
- details.dispose();
- detailsCreated = false;
- detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
-
- // Without the following computeSize call the setSize call below throws an array out of bounds exception.
- // Very weird.
- getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- newHeight = savedSize.y;
- }
- else
- {
- if( savedSize == null ) savedSize = windowSize;
-
- details = createDropDownDetails((Composite) getContents());
- detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
- newHeight = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
- }
-
-
- newHeight = newHeight > 400 ? 400 : newHeight;
-
- getShell().setSize( new Point(windowSize.x, newHeight) );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/OptionsDialog.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/OptionsDialog.java
deleted file mode 100644
index 150d6e4..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/OptionsDialog.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.dialog;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.command.env.core.common.Choice;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
- * A dialog to display one or more errors to the user, as contained in an
- * <code>Status</code> object. If an error contains additional detailed
- * information then a Details button is automatically supplied, which shows or
- * hides an error details viewer when pressed by the user.
- *
- */
-public class OptionsDialog extends MessageDialog
-{
- private Choice[] choices;
- private int returnCode_;
-
- public OptionsDialog(
- Shell parentShell,
- String dialogTitle,
- String message,
- Status status,
- int displayMask,
- Choice[] choices)
- {
- super(parentShell, dialogTitle, message, status, displayMask);
- this.choices = choices;
- }
-
- /*
- * (non-Javadoc) This should also be overwritten Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent)
- {
- // create a button for each options
- for (int i = 0; i < choices.length; i++)
- {
- createButton(parent, choices[i].getShortcut(), choices[i].getLabel(), true);
- }
- if (status.hasChildren())
- {
- detailsButton =
- createButton(
- parent,
- StatusDialogConstants.DETAILS_ID,
- IDialogConstants.SHOW_DETAILS_LABEL,
- false);
- }
- }
-
- protected void buttonPressed(int id)
- {
- if (id == StatusDialogConstants.DETAILS_ID)
- // was the Details button pressed?
- super.buttonPressed(id);
- else
- {
- setReturnCode(id);
- close();
- }
- }
-
- protected void setReturnCode(int id)
- {
- returnCode_ = id;
- }
-
- public int getReturnCode()
- {
- return returnCode_;
- }
- /*
- * This is one of the few methods that needs to be overwritten by the
- * subclasses. The image names can be found in the Dialog class
- */
- protected Image getDialogImage()
- {
- // create image
- switch (status.getSeverity())
- {
- case Status.INFO :
- return JFaceResources.getImageRegistry().get(DLG_IMG_INFO);
- case Status.WARNING :
- return JFaceResources.getImageRegistry().get(DLG_IMG_WARNING);
- default :
- return JFaceResources.getImageRegistry().get(DLG_IMG_ERROR);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/StatusDialogConstants.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/StatusDialogConstants.java
deleted file mode 100644
index 4e56788..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/StatusDialogConstants.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.dialog;
-
-/**
-* Constants for status dialogs
-*/
-public interface StatusDialogConstants {
-
- /*
- * Button ID for the "Yes" button
- */
- public static final int YES_ID = 2;
- /*
- * Button ID for the "Yes to all" button
- */
- public static final int YES_TO_ALL_ID = 4;
- /*
- * Button ID for the "Cancel" button
- */
- public static final int CANCEL_ID = 1;
- /*
- * Button ID for the "OK" button
- */
- public static final int OK_ID = 0;
- /*
- * Button ID for the "Details" button
- */
- public static final int DETAILS_ID = 13;
-
- /*
- * Button label for the "Yes" button
- */
- // public static final String YES_LABEL = EnvironmentPlugin.getInstance().getMessage("%STATUS_DIALOG_YES_LABEL");
- /*
- * Button label for the "Yes to all" button
- */
- // public static final String YES_TO_ALL_LABEL = EnvironmentPlugin.getInstance().getMessage("%STATUS_DIALOG_YES_TO_ALL_LABEL");
- /*
- * Button label for the "Cancel" button
- */
- // public static final String CANCEL_LABEL = EnvironmentPlugin.getInstance().getMessage("%STATUS_DIALOG_CANCEL_LABEL");
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/WarningDialog.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/WarningDialog.java
deleted file mode 100644
index 7ec24e5..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/dialog/WarningDialog.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.dialog;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-/**
- * A dialog to display one or more errors to the user, as contained in an
- * <code>Status</code> object. If an error contains additional detailed
- * information then a Details button is automatically supplied, which shows or
- * hides an error details viewer when pressed by the user.
- *
- */
-public class WarningDialog extends MessageDialog
-{
- /**
- * Creates an error dialog. Note that the dialog will have no visual
- * representation (no widgets) until it is told to open.
- * <p>
- * Normally one should use <code>openError</code> to create and open one of
- * these. This constructor is useful only if the error object being displayed
- * contains child items <it>and</it> you need to specify a mask which will
- * be used to filter the displaying of these children.
- * </p>
- *
- * @param parentShell
- * the shell under which to create this dialog
- * @param dialogTitle
- * the title to use for this dialog, or <code>null</code> to
- * indicate that the default title should be used
- * @param message
- * the message to show in this dialog, or <code>null</code> to
- * indicate that the error's message should be shown as the
- * primary message
- * @param status
- * the error to show to the user
- * @param displayMask
- * the mask to use to filter the displaying of child items, as per
- * <code>Status.matches</code>
- */
- public WarningDialog(
- Shell parentShell,
- String dialogTitle,
- String message,
- Status status,
- int displayMask)
- {
- super(parentShell, dialogTitle, message, status, displayMask);
- }
-
- /*
- * (non-Javadoc) This should also be overwritten Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent)
- {
- // create OK, Cancel and Details buttons
- createButton(
- parent,
- StatusDialogConstants.OK_ID,
- IDialogConstants.OK_LABEL,
- true);
- createButton(
- parent,
- StatusDialogConstants.CANCEL_ID,
- IDialogConstants.CANCEL_LABEL,
- false);
- if (status.hasChildren())
- {
- detailsButton =
- createButton(
- parent,
- StatusDialogConstants.DETAILS_ID,
- IDialogConstants.SHOW_DETAILS_LABEL,
- false);
- }
- }
-
- /*
- * This is one of the few methods that needs to be overwritten by the
- * subclasses. The image names can be found in the Dialog class
- */
- protected Image getDialogImage()
- {
- // create image
- return JFaceResources.getImageRegistry().get(DLG_IMG_WARNING);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/preferences/ActionDialogsPreferencePage.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/preferences/ActionDialogsPreferencePage.java
deleted file mode 100644
index 5aafea5..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/preferences/ActionDialogsPreferencePage.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.preferences;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.internal.env.context.PersistentActionDialogsContext;
-import org.eclipse.wst.command.internal.env.preferences.ActionDialogPreferenceType;
-
-
-/**
- * This class can be used to create a popup actions preference page for a
- * particular category. For example:
- *
- * <extension
- * point="org.eclipse.ui.preferencePages">
- * <page
- * name="%PREFERENCE_CATEGORY_DIALOGS"
- * category="org.eclipse.jst.ws.ui.preferences.name"
- * class="org.eclipse.wst.command.internal.env.preferences.ActionDialogsPreferencePage"
- * id="org.eclipse.jst.wss.popup.category">
- * </page>
- *
- * This entry specifies that all popup actions that are associated with the
- * org.eclipse.jst.wss.popup.category will be displayed on this
- * preference page.
- */
-public class ActionDialogsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Listener, IExecutableExtension
-{
- /*CONTEXT_ID PPAD0001 for the Action Dialogs Preference Page*/
- private String INFOPOP_PPAD_PAGE = "org.eclipse.wst.command.env.ui.PPAD0001";
- //
- private Button showAll;
- /*CONTEXT_ID PPAD0002 for the show all check box on the Action Dialogs Preference Page*/
- private String INFOPOP_PPAD_BUTTON_SHOW_ALL = "org.eclipse.wst.command.env.ui.PPAD0002";
- //
- private Button hideAll;
- /*CONTEXT_ID PPAD0003 for the hide all check box on the Action Dialogs Preference Page*/
- private String INFOPOP_PPAD_BUTTON_HIDE_ALL = "org.eclipse.wst.command.env.ui.PPAD0003";
-
- private Hashtable checkBoxes_;
- private String categoryId_;
-
- public void setInitializationData( IConfigurationElement config,
- String propertyName,
- Object data )
- throws CoreException
- {
- categoryId_ = config.getAttribute( "id" );
- }
-
- /**
- * Creates preference page controls on demand.
- * @param parent the parent for the preference page
- */
- protected Control createContents(Composite superparent)
- {
- MessageUtils msgUtils = new MessageUtils( "org.eclipse.wst.command.env.ui.environmentui", this );
-
- checkBoxes_ = new Hashtable();
- addOptionalDialogsCheckBoxes (superparent);
- new Label(superparent, SWT.HORIZONTAL);
-
- Composite parent = new Composite( superparent, SWT.NONE );
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- parent.setLayout( layout );
- parent.setToolTipText(msgUtils.getMessage("TOOLTIP_PPAD_PAGE"));
- WorkbenchHelp.setHelp(parent, INFOPOP_PPAD_PAGE );
-
- showAll = new Button(parent, SWT.NONE);
- showAll.setText(msgUtils.getMessage("BUTTON_SHOW_ALL_DIALOGS"));
- showAll.addListener(SWT.Selection, this);
- showAll.setToolTipText(msgUtils.getMessage("TOOLTIP_PPAD_BUTTON_SHOW_ALL"));
- WorkbenchHelp.setHelp(showAll, INFOPOP_PPAD_BUTTON_SHOW_ALL );
-
- hideAll = new Button(parent, SWT.NONE);
- hideAll.setText(msgUtils.getMessage("BUTTON_HIDE_ALL_DIALOGS"));
- hideAll.addListener ( SWT.Selection, this);
- hideAll.setToolTipText(msgUtils.getMessage("TOOLTIP_PPAD_BUTTON_HIDE_ALL"));
- WorkbenchHelp.setHelp(hideAll, INFOPOP_PPAD_BUTTON_HIDE_ALL );
-
- initializeValues();
- org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent);
- return parent;
- }
-
- public void handleEvent (Event event)
- {
- if (showAll == event.widget)
- handleShowAllEvent();
-
- else if ( hideAll == event.widget)
- handleHideAllEvent();
- }
-
- private void handleShowAllEvent ()
- {
- Enumeration e = checkBoxes_.elements();
- for (int i=0; e.hasMoreElements(); i++)
- {
- Button dialog = (Button) e.nextElement();
- dialog.setSelection( false );
- }
- }
-
- private void handleHideAllEvent ()
- {
- Enumeration e = checkBoxes_.elements();
- for (int i=0; e.hasMoreElements(); i++)
- {
- Button dialog = (Button) e.nextElement();
- dialog.setSelection( true );
- }
- }
-
- private void addOptionalDialogsCheckBoxes ( Composite parent)
- {
- PersistentActionDialogsContext context = PersistentActionDialogsContext.getInstance();
- ActionDialogPreferenceType[] dialogs = context.getDialogs();
-
- for (int i = 0; i < dialogs.length; i++)
- {
- ActionDialogPreferenceType dialog = dialogs[i];
- String category = dialog.getCategory();
-
- if( dialog.getShowCheckbox() && category != null && category.equals( categoryId_) )
- {
- Button checkBox = createCheckBox(parent, dialog.getName());
- checkBox.setToolTipText( dialog.getTooltip() );
- WorkbenchHelp.setHelp(checkBox, dialog.getInfopop() );
- checkBoxes_.put(dialog.getId(), checkBox);
- }
- }
- }
-
- private Button createCheckBox( Composite parent, String text )
- {
- Button button = new Button( parent, SWT.CHECK );
- button.setText( text );
- return button;
- }
-
- /**
- * Does anything necessary because the default button has been pressed.
- */
- protected void performDefaults()
- {
- super.performDefaults();
- initializeDefaults();
- }
-
- /**
- * Do anything necessary because the OK button has been pressed.
- * @return whether it is okay to close the preference page
- */
- public boolean performOk()
- {
- storeValues();
- return true;
- }
-
- protected void performApply()
- {
- performOk();
- }
-
- /**
- * @see IWorkbenchPreferencePage
- */
- public void init(IWorkbench workbench) { }
-
- /**
- * Initializes states of the controls using default values
- * in the preference store.
- */
- private void initializeDefaults()
- {
- Enumeration e = checkBoxes_.elements();
- for (int i=0; e.hasMoreElements(); i++)
- {
- Button dialog = (Button) e.nextElement();
- dialog.setSelection(true);
- }
- }
-
- /**
- * Initializes states of the controls from the preferences.
- */
- private void initializeValues()
- {
- PersistentActionDialogsContext context = PersistentActionDialogsContext.getInstance();
- Enumeration e = checkBoxes_.keys();
- for (int i=0; e.hasMoreElements(); i++)
- {
- String id = (String) e.nextElement();
- Button button = (Button) checkBoxes_.get(id);
- button.setSelection(context.isActionDialogEnabled(id));
- }
- }
-
- /**
- * Stores the values of the controls back to the preference store.
- */
- private void storeValues()
- {
- PersistentActionDialogsContext context = PersistentActionDialogsContext.getInstance();
-
- Enumeration e = checkBoxes_.keys();
- for (int i=0; e.hasMoreElements(); i++)
- {
- String id = (String) e.nextElement();
- context.setActionDialogEnabled(id, ((Button)checkBoxes_.get(id)).getSelection());
- }
- }
-}
-
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/CommandWidgetBindingList.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/CommandWidgetBindingList.java
deleted file mode 100644
index 4e1e5bc..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/CommandWidgetBindingList.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.widgets;
-
-import java.util.Vector;
-
-import org.eclipse.wst.command.env.core.data.DataMappingRegistry;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.core.fragment.CommandFragmentFactory;
-import org.eclipse.wst.command.env.core.fragment.SequenceFragment;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-import org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class CommandWidgetBindingList implements CommandWidgetBinding
-{
- private Vector bindings_;
- private Vector fragments_;
- private CommandFragmentFactory factory_;
-
- /**
- * This CommandWidgetBinding combines a list of CommandWidgetBindings.
- * There should be the same number of entries in both the bindings
- * parameter and the fragments parameter. Entries in either of the
- * bindings for fragments vectors are allowed to be null.
- *
- * @param bindings the bindings to combine.
- * @param fragments These fragments will be interspersed with the
- * fragments associated with each binding. The first
- * fragment will be put before the fragment from the
- * first binding. Following this will be the second
- * fragment from the fragments vector and then the
- * second fragment from the bindings vector, etc.
- */
- public CommandWidgetBindingList( Vector bindings, Vector fragments )
- {
- bindings_ = bindings;
- fragments_ = fragments;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry)
- */
- public void registerCanFinish(CanFinishRegistry canFinishRegistry)
- {
- int length = bindings_.size();
-
- for( int index = 0; index < length; index++ )
- {
- CommandWidgetBinding binding = (CommandWidgetBinding)bindings_.elementAt( index );
-
- if( binding != null ) binding.registerCanFinish( canFinishRegistry );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.env.core.data.DataMappingRegistry)
- */
- public void registerDataMappings(DataMappingRegistry dataRegistry)
- {
- int length = bindings_.size();
-
- for( int index = 0; index < length; index++ )
- {
- CommandWidgetBinding binding = (CommandWidgetBinding)bindings_.elementAt( index );
- if( binding != null ) binding.registerDataMappings( dataRegistry );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry)
- */
- public void registerWidgetMappings(WidgetRegistry widgetRegistry)
- {
- int length = bindings_.size();
-
- for( int index = 0; index < length; index++ )
- {
- CommandWidgetBinding binding = (CommandWidgetBinding)bindings_.elementAt( index );
- if( binding != null ) binding.registerWidgetMappings( widgetRegistry );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.fragment.CommandFragmentFactoryFactory#create()
- */
- public CommandFragmentFactory create()
- {
- if( factory_ == null )
- {
- factory_ = new CommandFragmentFactory()
- {
- public CommandFragment create()
- {
- SequenceFragment fragmentList = new SequenceFragment();
- int length = bindings_.size();
-
- for( int index = 0; index < length; index++ )
- {
- CommandFragment fragment = (CommandFragment)fragments_.elementAt( index );
-
- if( fragment != null )
- {
- fragmentList.add( fragment );
- }
-
- CommandWidgetBinding binding = (CommandWidgetBinding)bindings_.elementAt( index );
-
- if( binding != null )
- {
- fragmentList.add( binding.create().create() );
- }
- }
-
- return fragmentList;
- }
- };
- }
-
- return factory_;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/PageInfo.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/PageInfo.java
deleted file mode 100644
index 26ff0f0..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/PageInfo.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.widgets;
-
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-
-
-public class PageInfo
-{
- private String pageName_;
- private String pageTitle_;
- private WidgetContributorFactory widgetFactory_;
-
- public PageInfo( String pageName,
- String pageTitle,
- WidgetContributorFactory widgetFactory )
- {
- pageName_ = pageName;
- pageTitle_ = pageTitle;
- widgetFactory_ = widgetFactory;
- }
-
- public String getPageName()
- {
- return pageName_;
- }
-
- public String getPageTitle()
- {
- return pageTitle_;
- }
-
- public WidgetContributorFactory getWidgetFactory()
- {
- return widgetFactory_;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleCanFinishRegistry.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleCanFinishRegistry.java
deleted file mode 100644
index efba827..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleCanFinishRegistry.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.widgets;
-
-import java.util.Vector;
-
-import org.eclipse.wst.command.env.core.common.Condition;
-import org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry;
-
-
-
-public class SimpleCanFinishRegistry extends Vector implements CanFinishRegistry
-{
-
- /* (non-Javadoc)
- * @see org.eclipse.env.widgets.CanFinishRegistry#addCondition(org.eclipse.env.command.fragment.Condition)
- */
- public void addCondition(Condition condition)
- {
- add( condition );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimplePageFactory.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimplePageFactory.java
deleted file mode 100644
index 284a3a7..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimplePageFactory.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.widgets;
-
-import org.eclipse.wst.command.env.ui.widgets.PageWizardDataEvents;
-
-public class SimplePageFactory implements WizardPageFactory
-{
- public PageWizardDataEvents getPage( PageInfo pageInfo, WizardPageManager manager )
- {
- return new SimpleWizardPage( pageInfo, manager );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimplePopupPageFactory.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimplePopupPageFactory.java
deleted file mode 100644
index 97efa55..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimplePopupPageFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.widgets;
-
-import org.eclipse.wst.command.env.ui.widgets.PageWizardDataEvents;
-
-public class SimplePopupPageFactory implements WizardPageFactory
-{
- private String id_;
-
- public SimplePopupPageFactory( String id )
- {
- id_ = id;
- }
-
- public PageWizardDataEvents getPage( PageInfo pageInfo, WizardPageManager manager )
- {
- return new SimplePopupWizardPage( pageInfo, manager, id_ );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimplePopupWizardPage.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimplePopupWizardPage.java
deleted file mode 100644
index 7f9a928..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimplePopupWizardPage.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.widgets;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-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.ui.help.WorkbenchHelp;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.internal.env.context.PersistentActionDialogsContext;
-
-
-
-public class SimplePopupWizardPage extends SimpleWizardPage
-{
- private String id_;
-
- public SimplePopupWizardPage( PageInfo pageInfo, WizardPageManager pageManager, String id )
- {
- super( pageInfo, pageManager );
-
- id_ = id;
- }
-
- public void createControl( Composite parent )
- {
- Composite composite = new Composite( parent, SWT.NONE );
- MessageUtils msgUtils = new MessageUtils("org.eclipse.wst.command.env.ui.environmentui", this );
- final PersistentActionDialogsContext context = PersistentActionDialogsContext.getInstance();
-
- GridLayout gridlayout = new GridLayout();
- gridlayout.marginHeight = 0;
- gridlayout.marginWidth = 0;
-
- composite.setLayout( gridlayout );
- GridData griddata = new GridData(GridData.FILL_BOTH );
- composite.setLayoutData( griddata );
-
- super.createControl( composite );
-
- // If the current page is null then this must be the first page.
- if( pageManager_.getCurrentPage() == null && context.showCheckbox(id_) )
- {
- final Button button = new Button( composite, SWT.CHECK );
- String label = msgUtils.getMessage( "CHECKBOX_DO_NOT_SHOW_DIALOG_AGAIN" );
-
- /*CONTEXT_ID TWP0001 for the show/hide check box*/
- String infopop = "org.eclipse.wst.command.env.ui.TWP0001";
- String tooltip = msgUtils.getMessage( "TOOLTIP_DO_NOT_SHOW_DIALOG_AGAIN" );
-
- button.setText( label );
- button.setToolTipText( tooltip );
- button.addSelectionListener( new SelectionAdapter()
- {
- public void widgetSelected( SelectionEvent evt )
- {
- context.setActionDialogEnabled( id_, button.getSelection() );
- }
- });
- button.setSelection( false );
-
- WorkbenchHelp.setHelp( button, infopop );
- }
-
- setControl( composite );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleWidgetRegistry.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleWidgetRegistry.java
deleted file mode 100644
index 9cd9327..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleWidgetRegistry.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.widgets;
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributorFactory;
-import org.eclipse.wst.command.env.ui.widgets.WidgetRegistry;
-
-
-public class SimpleWidgetRegistry implements WidgetRegistry
-{
- private Hashtable table_ = new Hashtable();
-
- public void add( String fragmentId,
- String pageName,
- String pageTitle,
- WidgetContributorFactory widgetFactory )
- {
- PageInfo entry = new PageInfo( pageName, pageTitle, widgetFactory );
- table_.put( fragmentId, entry );
- }
-
- public PageInfo getPageInfo( String fragmentId )
- {
- return (PageInfo)table_.get( fragmentId );
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleWizardPage.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleWizardPage.java
deleted file mode 100644
index a3462f7..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/SimpleWizardPage.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.widgets;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.ui.widgets.PageWizardDataEvents;
-import org.eclipse.wst.command.env.ui.widgets.WidgetContributor;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-
-
-
-public class SimpleWizardPage extends WizardPage implements PageWizardDataEvents
-{
- private WidgetContributor widget_;
- private WidgetDataEvents dataEvents_;
- private Listener statusListener_;
- protected WizardPageManager pageManager_;
-
- public SimpleWizardPage( PageInfo pageInfo, WizardPageManager pageManager )
- {
- super( "" );
-
- setTitle( pageInfo.getPageName() );
- setDescription( pageInfo.getPageTitle());
-
- widget_ = pageInfo.getWidgetFactory().create();
- statusListener_ = new StatusListener();
- pageManager_ = pageManager;
- }
-
- public void createControl( Composite parent )
- {
- Composite control = new Composite( parent, SWT.NONE );
- control.setLayout( new GridLayout() );
- control.setLayoutData( new GridData( GridData.FILL_BOTH ));
-
- dataEvents_ = widget_.addControls( control, statusListener_ );
-
- org.eclipse.jface.dialogs.Dialog.applyDialogFont(control);
- setControl( control );
- }
-
- public WidgetDataEvents getDataEvents()
- {
- return dataEvents_;
- }
-
- public void validatePageToStatus()
- {
- Status status = widget_.getStatus();
-
- if( status != null )
- {
- if( status.getSeverity() == Status.ERROR )
- {
- String message = status.getMessage();
-
- if( message.length() == 0 )
- {
- setErrorMessage( null );
- setMessage( getDescription() );
- }
- else
- {
- setErrorMessage( message );
- }
-
- setPageComplete( false );
- }
- else if (status.getSeverity() == Status.WARNING )
- {
- setErrorMessage( null );
- setMessage(status.getMessage(), IStatus.WARNING );
- setPageComplete( true );
- }
- else if( status.getSeverity() == Status.INFO )
- {
- setErrorMessage( null );
- setMessage( status.getMessage(), IStatus.INFO );
- setPageComplete( true );
- }
- else
- {
- setErrorMessage( null );
- setMessage( getDescription() );
- setPageComplete( true );
- }
- }
- else
- {
- setErrorMessage( null );
- setMessage( getDescription() );
- setPageComplete( true );
- }
-
- getContainer().updateButtons();
- }
-
- public boolean canFlipToNextPage()
- {
- return isPageComplete() && pageManager_.hasNextPage();
- }
-
- public IWizardPage getNextPage()
- {
- return pageManager_.getNextPage();
- }
-
- public void setVisible(boolean value)
- {
- pageManager_.handlePageVisible( this, value );
-
- super.setVisible(value);
- }
-
- private class StatusListener implements Listener
- {
- public void handleEvent( Event evt )
- {
- validatePageToStatus();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/WizardPageFactory.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/WizardPageFactory.java
deleted file mode 100644
index 3490aba..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/WizardPageFactory.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.widgets;
-
-import org.eclipse.wst.command.env.ui.widgets.PageWizardDataEvents;
-
-/**
- *
- *
- *
- *
- */
-public interface WizardPageFactory
-{
- public PageWizardDataEvents getPage( PageInfo pageInfo, WizardPageManager manager );
-}
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/WizardPageManager.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/WizardPageManager.java
deleted file mode 100644
index 5d5ed67..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/WizardPageManager.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.widgets;
-
-import java.util.Hashtable;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.ui.widgets.PageWizardDataEvents;
-import org.eclipse.wst.command.env.ui.widgets.SimpleCommandEngineManager;
-import org.eclipse.wst.command.env.ui.widgets.WidgetDataEvents;
-import org.eclipse.wst.command.internal.env.core.data.DataFlowManager;
-
-
-
-public class WizardPageManager extends SimpleCommandEngineManager
-{
- private WizardPageFactory pageFactory_;
- private Hashtable pageTable_;
- private IWizard wizard_;
- protected SimpleWidgetRegistry registry_;
-
- // These variables are used and set by our methods which is
- // why they are not initialized in the constructor.
- private PageWizardDataEvents currentPage_;
- private PageWizardDataEvents nextPage_;
- private PageWizardDataEvents firstPage_;
- private CommandFragment lastUndoFragment_;
- private boolean firstFragment_;
-
- public WizardPageManager( SimpleWidgetRegistry registry,
- WizardPageFactory pageFactory,
- IWizard wizard,
- DataFlowManager dataManager,
- Environment environment )
- {
- super( environment, dataManager );
-
- pageFactory_ = pageFactory;
- pageTable_ = new Hashtable();
- registry_ = registry;
- wizard_ = wizard;
- }
-
- public Status runForwardToNextStop()
- {
- firstFragment_ = true;
- nextPage_ = null;
-
- IWizardContainer container = wizard_.getContainer();
-
- if( container == null || container.getCurrentPage() == null )
- {
- container = null;
- }
-
- return super.runForwardToNextStop( container );
- }
-
- public IWizardPage getCurrentPage()
- {
- return currentPage_;
- }
-
- public boolean hasNextPage()
- {
- nextPage_ = null;
- engine_.peekForwardToNextStop();
-
- return nextPage_ != null;
- }
-
- public IWizardPage getNextPage()
- {
- // Need to externalize the data for the current page so that
- // when we move forward below the data is available.
- if( currentPage_ != null ) currentPage_.getDataEvents().externalize();
-
- Status status = runForwardToNextStop();
-
- if( status.getSeverity() == Status.ERROR )
- {
- // An error has occured so we need undo to the previous stop point.
- undoToLastPage();
- }
-
- if( nextPage_ != null ) nextPage_.setWizard( wizard_ );
-
- return nextPage_;
- }
-
- public void handlePageVisible( PageWizardDataEvents page, boolean isPageVisible )
- {
- if( !isPageVisible && page == firstPage_ && page == currentPage_ )
- {
- // We are moving back one page from the first page. This can't happen with popup wizards
- // since the previous button would be greyed out. But when the new wizard launches this wizard
- // the previous button is not greyed out and brings the user back to the list wizards to select.
- // Therefore, we must unwind the command engine and get ready for the user to invoke this wizard
- // again.
- undoToLastPage();
- currentPage_ = null;
- firstPage_ = null;
- }
- if( currentPage_ != null && page == currentPage_.getPreviousPage() && isPageVisible )
- {
- // We are moving back one page.
- // Note: we don't internalize the previous page and we do not externalize the current page.
- // we are basically just leaving the current page without retrieving its state and
- // moving to the previous page which already has its state set.
- undoToLastPage();
- currentPage_ = page;
- }
- else if( isPageVisible )
- {
- // We are moving forward one page.
- WidgetDataEvents dataEvents = page.getDataEvents();
-
- dataManager_.process( dataEvents ); // Push model data into the new page.
- dataEvents.internalize();
-
- page.validatePageToStatus();
-
- if( currentPage_ != null ) page.setPreviousPage( currentPage_ );
-
- if( firstPage_ == null ) firstPage_ = page;
-
- currentPage_ = page;
- }
- }
-
- public boolean performFinish()
- {
- // We need to simulate the next button being pressed until there are no more pages.
- // If an error occurs we will return false and reset the command stack back our original state.
- boolean doneOk = true;
- PageWizardDataEvents startPage = currentPage_;
-
- // Externalize the current page.
- currentPage_.getDataEvents().externalize();
-
- // Loop through subsequent pages.
- do
- {
- Status status = runForwardToNextStop();
-
- if( status.getSeverity() == Status.ERROR )
- {
- // An error occured in one of the commands.
- doneOk = false;
- }
- else
- {
- currentPage_ = nextPage_;
- }
- }
- while( nextPage_ != null && doneOk);
-
- if( !doneOk )
- {
- // An error occured, so we need to return the command stack to it's
- // orginal state.
- PageWizardDataEvents page = null;
- boolean done = false;
-
- do
- {
- done = engine_.undoToLastStop();
- page = getPage( lastUndoFragment_ );
- }
- while( page != startPage && !done );
-
- currentPage_ = page;
- }
-
- return doneOk;
- }
-
- public boolean performCancel()
- {
- while( !engine_.undoToLastStop() ){}
-
- return true;
- }
-
- protected boolean peekFragment( CommandFragment fragment )
- {
- // Check to see if this fragment is in our page table.
- nextPage_ = getPage( fragment );
-
- return nextPage_ == null;
- }
-
- protected boolean nextFragment( CommandFragment fragment )
- {
- // If the super class nextFragment want us to stop then we will stop right away.
- if( !super.nextFragment( fragment ) ) return false;
-
- // The first fragment is either at the start of the wizard
- // or it is on a wizard page. In either case we do not want
- // to stop if a page is found.
- if( firstFragment_ )
- {
- firstFragment_ = false;
- }
- else
- {
- nextPage_ = getPage( fragment );
- }
-
- return nextPage_ == null;
- }
-
- protected boolean undoFragment( CommandFragment fragment )
- {
- lastUndoFragment_ = fragment;
-
- return true;
- }
-
- private void undoToLastPage()
- {
- boolean stackEmpty = false;
-
- do
- {
- stackEmpty = engine_.undoToLastStop();
- }while( getPage( lastUndoFragment_ ) == null && !stackEmpty );
- }
-
- private PageWizardDataEvents getPage( CommandFragment fragment )
- {
- // Check to see if this fragment is in our page table.
- PageWizardDataEvents page = (PageWizardDataEvents)pageTable_.get( fragment );
- String id = fragment.getId();
-
- if( page == null && id != null )
- {
- // Check to see if this fragment id is in the registry.
- PageInfo pageInfo = registry_.getPageInfo( id );
-
- if( pageInfo != null )
- {
- page = pageFactory_.getPage( pageInfo, this );
- pageTable_.put( fragment, page );
- }
- }
-
- return page;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/popup/DynamicPopupWizard.java b/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/popup/DynamicPopupWizard.java
deleted file mode 100644
index 650737e..0000000
--- a/bundles/org.eclipse.wst.command.env.ui/src/org/eclipse/wst/command/internal/env/ui/widgets/popup/DynamicPopupWizard.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.ui.widgets.popup;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.command.env.core.fragment.CommandFragment;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseEnvironment;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseProgressMonitor;
-import org.eclipse.wst.command.env.ui.eclipse.EclipseStatusHandler;
-import org.eclipse.wst.command.env.ui.widgets.DynamicWizard;
-import org.eclipse.wst.command.env.ui.widgets.SimpleCommandEngineManager;
-import org.eclipse.wst.command.internal.env.context.PersistentActionDialogsContext;
-import org.eclipse.wst.command.internal.env.context.PersistentResourceContext;
-import org.eclipse.wst.command.internal.env.core.data.DataFlowManager;
-import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistryImpl;
-import org.eclipse.wst.command.internal.env.ui.widgets.SimplePopupPageFactory;
-import org.eclipse.wst.command.internal.env.ui.widgets.WizardPageFactory;
-
-
-/**
- * This class is used to popup dynamic wizards. The popupMenus extension is used
- * the contribute a popup to Eclipse. The class in the action element should reference
- * this DynamicPopupWizard class. This id attribute in the action element should contain
- * an id that references a dynamicWizard extension point. This is how the DynamicPopupWizard
- * class knows which wizard to display.
- *
- * Note: the id attribute in the objectContribution element refers to an
- * actionDialogPreferenceType extension point. The ids in objectContribution
- * element and the action element need not be the same as they are in the
- * example below.
- *
- *<pre>
- * <extension
- * point="org.eclipse.ui.popupMenus">
- *<!-- IFile *.wsdl popup menu -->
- * <objectContribution
- * objectClass="org.eclipse.core.resources.IFile"
- * nameFilter="*.wsdl"
- * id="org.eclipse.jst.ws.consumption.ui.wizard.client.clientwizard">
- *<!-- WSDL To Java Bean Proxy -->
- * <action
- * label="%ACTION_GENERATE_JAVA_PROXY"
- * class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard"
- * menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- * id="org.eclipse.jst.ws.consumption.ui.wizard.client.clientwizard">
- * </action>
- * </objectContribution>
- * </extension>
- *
- * <extension
- * point="org.eclipse.wst.command.env.dynamicWizard">
- * <dynamicWizard
- * iconbanner="icons/full/wizban/webservicesclient_wiz.gif"
- * class="org.eclipse.jst.ws.consumption.ui.widgets.binding.ClientWidgetBinding"
- * title="%WIZARD_TITLE_WSC"
- * id="org.eclipse.jst.ws.consumption.ui.wizard.client.clientwizard">
- * </dynamicWizard>
- * </extension>
- *</pre>
- *
- */
-public class DynamicPopupWizard extends DynamicWizard implements IActionDelegate
-{
- private ISelection selection_;
-
- public DynamicPopupWizard()
- {
- super();
- }
-
- /**
- *
- * @see org.eclipse.wst.command.env.ui.widgets.DynamicWizard#getWizardPageFactory()
- */
- protected WizardPageFactory getWizardPageFactory()
- {
- return new SimplePopupPageFactory( getId() );
- }
-
- private String getId()
- {
- return ((IConfigurationElement)originalElement_.getParent()).getAttribute( "id" );
- }
-
- /**
- * @see IActionDelegate#run
- */
- public void run(IAction action)
- {
- PersistentActionDialogsContext context = PersistentActionDialogsContext.getInstance();
- String id = getId();
-
- if( context.showDialog(id) )
- {
- // Launch the wizard.
- init( PlatformUI.getWorkbench(), getSelection() );
-
- WizardDialog dialog= new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), this);
- dialog.setPageSize( 400, 500 );
- dialog.create();
- dialog.open();
- }
- else
- {
- final ProgressMonitorDialog monitor = new ProgressMonitorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
-
- try
- {
- monitor.run( false, false, new IRunnableWithProgress()
- {
- public void run( IProgressMonitor progressMonitor )
- {
- runHeadLess( getSelection(), monitor );
- }
- } );
- }
- catch( InterruptedException exc )
- {
- }
- catch( InvocationTargetException exc )
- {
- }
- }
- }
-
- /**
- * Runs only the Commands associated with the dynamic wizard.
- *
- * @param selection the initial selection from the user.
- * @param context the context that this execution should take place in. This
- * is usually a progress context so that the user can get feedback
- * on how execution is progressing. The context may be null.
- */
- public void runHeadLess( IStructuredSelection selection, IRunnableContext context )
- {
- CommandFragment rootFragment = getRootFragment( selection, null );
- PersistentResourceContext resourceContext = PersistentResourceContext.getInstance();
- EclipseStatusHandler handler = new EclipseStatusHandler();
- EclipseProgressMonitor monitor = new EclipseProgressMonitor();
- EclipseEnvironment environment = new EclipseEnvironment( null, resourceContext, monitor, handler );
-
- DataMappingRegistryImpl dataRegistry_ = new DataMappingRegistryImpl();
- DataFlowManager dataManager = new DataFlowManager( dataRegistry_, environment );
- SimpleCommandEngineManager manager = new SimpleCommandEngineManager(environment, dataManager );
-
- commandWidgetBinding_.registerDataMappings( dataRegistry_ );
- manager.setRootFragment( rootFragment );
- manager.runForwardToNextStop( context );
- }
-
- /**
- * @see IActionDelegate#selectionChanged
- */
- public void selectionChanged(IAction action, ISelection selection)
- {
- selection_ = selection;
- }
-
- private IStructuredSelection getSelection()
- {
- IStructuredSelection result = new StructuredSelection();
-
- if( selection_ != null)
- {
- if( selection_ instanceof IStructuredSelection )
- {
- result = (IStructuredSelection)selection_;
- }
- }
- else
- {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-
- if( window != null )
- {
- ISelection selection = window.getSelectionService().getSelection();
-
- if( selection instanceof IStructuredSelection )
- {
- result = (IStructuredSelection)selection;
- }
- }
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/.classpath b/bundles/org.eclipse.wst.command.env/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/bundles/org.eclipse.wst.command.env/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.command.env/.cvsignore b/bundles/org.eclipse.wst.command.env/.cvsignore
deleted file mode 100644
index 512f021..0000000
--- a/bundles/org.eclipse.wst.command.env/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-build.xml
-runtime
-temp.folder
diff --git a/bundles/org.eclipse.wst.command.env/.options b/bundles/org.eclipse.wst.command.env/.options
deleted file mode 100644
index 1e0b724..0000000
--- a/bundles/org.eclipse.wst.command.env/.options
+++ /dev/null
@@ -1,18 +0,0 @@
-# Debugging options for the org.eclipse.wst.env plugin.
-
-# Turn on debugging master switch for the org.eclipse.wst.command.env plugin.
-org.eclipse.wst.command.env/debug=true
-
-# Turn on different tracing level
-org.eclipse.wst.command.env/trace/info=true
-org.eclipse.wst.command.env/trace/warning=true
-org.eclipse.wst.command.env/trace/error=true
-
-# Turn on data flow tracing
-org.eclipse.wst.command.env/trace/data=true
-
-# Turn on command tracing
-org.eclipse.wst.command.env/trace/command=true
-
-# Turn on emitter tracing
-org.eclipse.wst.command.env/trace/emitter=true
diff --git a/bundles/org.eclipse.wst.command.env/.project b/bundles/org.eclipse.wst.command.env/.project
deleted file mode 100644
index 74dad12..0000000
--- a/bundles/org.eclipse.wst.command.env/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.command.env</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.command.env/build.properties b/bundles/org.eclipse.wst.command.env/build.properties
deleted file mode 100644
index 142076d..0000000
--- a/bundles/org.eclipse.wst.command.env/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-bin.includes = plugin.xml,\
- *.jar,\
- plugin.properties,\
- env.jar
-src.includes = .classpath,\
- .project,\
- build.properties,\
- plugin.xml,\
- src/,\
- plugin.properties
-source.env.jar = src/
-output.env.jar = bin/
-jars.compile.order = env.jar
diff --git a/bundles/org.eclipse.wst.command.env/plugin.properties b/bundles/org.eclipse.wst.command.env/plugin.properties
deleted file mode 100644
index afde089..0000000
--- a/bundles/org.eclipse.wst.command.env/plugin.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Environment Command Framework (headless)
-PLUGIN_PROVIDER=Eclipse.org
-
-PLUGIN_XP_DYNAMIC_WIZARD=Dynamic Wizard
-PLUGIN_XP_POPUP_DIALOGS=Optional Pop-up Action Dialogs Types
-
-
diff --git a/bundles/org.eclipse.wst.command.env/plugin.xml b/bundles/org.eclipse.wst.command.env/plugin.xml
deleted file mode 100644
index 4695aad..0000000
--- a/bundles/org.eclipse.wst.command.env/plugin.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id = "org.eclipse.wst.command.env"
- version = "1.0.0"
- name = "%PLUGIN_NAME"
- provider-name = "%PLUGIN_PROVIDER">
-
- <runtime>
- <library name="env.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.wst.command.env.core"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.osgi"/>
- </requires>
-
- <extension-point
- id="dynamicWizard"
- name="%PLUGIN_XP_DYNAMIC_WIZARD"/>
-
- <extension-point
- id="actionDialogPreferenceType"
- name="%PLUGIN_XP_POPUP_DIALOGS"/>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/ClassPath.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/ClassPath.java
deleted file mode 100644
index 911a7d6..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/ClassPath.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.common;
-
-import java.io.File;
-
-/**
- *
- * The class provides and easy way to build classpaths.
- *
- */
-public class ClassPath
-{
- private StringBuffer path = new StringBuffer();
-
- /**
- *
- * @param newPath appends this new path to the end of the classpath.
- */
- public void appendPath( String newPath )
- {
- // No value to put on path, so just return
- if( newPath.equals( "" ) ) return;
-
- // If this is the first path in the string then we don't need a path
- // separator.
- if( path.length() == 0 )
- {
- path.append( newPath );
- }
- else
- {
- path.append( File.pathSeparatorChar + newPath );
- }
- }
-
- /**
- * This method appends all jar and zip files in a particular directory to
- * the classpath.
- *
- * @param directory specifies a directory contains jar and zip files.
- */
- public void appendDir( String directory )
- {
- File dir = new File( directory );
-
- if( !dir.isDirectory() ) return;
-
- File[] files = dir.listFiles();
-
- for( int index = 0; index < files.length; index++ )
- {
- File file = files[index];
- String name = file.getName();
-
- if( file.isFile() &&
- ( name.endsWith( ".jar" ) ||
- name.endsWith( ".zip" ) ) )
- {
- appendPath( file.getAbsolutePath() );
- }
-
- }
- }
-
- /**
- *
- * @param newPath appends a new classpath to the end of this classpath.
- */
- public void appendPath( ClassPath newPath )
- {
- appendPath( newPath.path.toString() );
- }
-
- /**
- * @return returns the full string classpath with separators.
- */
- public String toString()
- {
- return path.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/FileResourceOutputStream.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/FileResourceOutputStream.java
deleted file mode 100644
index 1a514db..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/FileResourceOutputStream.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.common;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import org.eclipse.core.internal.resources.ResourceException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.command.env.core.common.ProgressMonitor;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-
-
-
-/**
-* This class defines an output stream that writes to an
-* {@link org.eclipse.core.resources.IFile IFile}.
-*/
-public class FileResourceOutputStream extends OutputStream
-{
-
- IPath fFilePath;
- ResourceContext fResourceContext;
- ProgressMonitor fMonitor;
- StatusHandler fStatusHandler;
- ByteArrayOutputStream fByteArrayOutputStream;
- boolean fOpen;
-
- /**
- * Constructs an output stream that can be used to write to the
- * given <code>file</code>. The workspace is neither examined nor
- * altered during construction. All resource creation is deferred
- * until later in the stream's lifecycle, such as during writing
- * or closure.
- * <b>Note:</b> The preferred mechanism for creating a stream that
- * writes to an IFile is to call the static factory method
- * {@link FileResourceUtils#newFileOutputStream FileResourceUtils.newFileOutputStream()}
- * and work with the resulting <code>OutputStream</code>.
- * Direct construction of a FileResourceOutputStream is not recommended.
- * @param file The {@link org.eclipse.core.resources.IFile IFile}
- * handle of the file resource to create. The project implied by the
- * pathname of the file must already exist,
- * that is, this method cannot be used to create projects.
- * @param progressMonitor The progress monitor for the operation, or null.
- */
- public FileResourceOutputStream (
- ResourceContext resourceContext,
- IPath filePath,
- ProgressMonitor monitor,
- StatusHandler statusHandler
- )
- {
- fFilePath = filePath;
- fResourceContext = resourceContext;
- fMonitor = monitor;
- fStatusHandler = statusHandler;
- fByteArrayOutputStream = new ByteArrayOutputStream();
- fOpen = true;
- }
-
- /**
- * Closes the stream.
- * @throws IOException If an error occurs while closing the stream.
- * For example, if this stream was constructed with overwriteFile = false
- * and a file of the same name already exists, then an IOException will
- * be thrown either now or during an earlier {@link #write write}.
- */
- public void close ()
- throws IOException
- {
- if (!fOpen) return;
- fOpen = false;
- fByteArrayOutputStream.close();
- byte[] buffer = fByteArrayOutputStream.toByteArray();
- ByteArrayInputStream tempInputStream = new ByteArrayInputStream(buffer);
- try
- {
- FileResourceUtils.createFile(fResourceContext, fFilePath, tempInputStream, fMonitor, fStatusHandler);
- }
-
- catch (ResourceException e )
- {
- throw new IOException(e.getMessage());
- }
-
- catch (CoreException e)
- {
- throw new IOException(e.getMessage());
- }
- }
-
- /**
- * Flushes the stream. This does not imply the File resource
- * will be created or become visible within the workbench.
- * @throws IOException If an error occurs. For example, if this
- * stream was constructed with overwriteFile = false and a file of the
- * same name already exists, then an IOException may be thrown at
- * this point.
- */
- public void flush ()
- throws IOException
- {
- fByteArrayOutputStream.flush();
- }
-
- /**
- * Writes all bytes from the given array to the stream.
- * @param b The array of bytes to write.
- * @throws IOException If an error occurs. For example, if this
- * stream was constructed with overwriteFile = false and a file of the
- * same name already exists, then an IOException may be thrown at
- * this point.
- */
- public void write ( byte[] b )
- throws IOException
- {
- fByteArrayOutputStream.write(b);
- }
-
- /**
- * Writes bytes from the given array beginning at some offset
- * and continuing for some number of bytes (len) to the stream.
- * @param b The array of bytes to write.
- * @param off The offset into the array to begin writing.
- * @param len The number of bytes to write.
- * @throws IOException If an error occurs. For example, if this
- * stream was constructed with overwriteFile = false and a file of the
- * same name already exists, then an IOException may be thrown at
- * this point.
- */
- public void write ( byte[] b, int off, int len )
- {
- fByteArrayOutputStream.write(b,off,len);
- }
-
- /**
- * Writes a single byte to the stream.
- * @param b The byte to write.
- * @throws IOException If an error occurs. For example, if this
- * stream was constructed with overwriteFile = false and a file of the
- * same name already exists, then an IOException may be thrown at
- * this point.
- */
- public void write ( int b )
- {
- fByteArrayOutputStream.write(b);
- }
-}
-
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/FileResourceUtils.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/FileResourceUtils.java
deleted file mode 100644
index 22494f2..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/FileResourceUtils.java
+++ /dev/null
@@ -1,672 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.common;
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.command.env.core.common.Choice;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.ProgressMonitor;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.StatusException;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-
-
-
-/**
-* This class contains useful methods for working with Eclipse resources.
-*/
-public final class FileResourceUtils
-{
- //
- // Keeps the IWorkspace hanging around. See getWorkspace().
- //
- private static IWorkspace workspace_ = null;
- //
- // Keeps the IWorkspaceRoot hanging around. See getWorkspaceRoot().
- //
- private static IWorkspaceRoot root_ = null;
-
- private static MessageUtils msg_ = new MessageUtils( "org.eclipse.wst.command.env.common.environment", new FileResourceUtils() );
-
-
- /**
- * Returns the IWorkspaceRoot object.
- * @return The IWorkspaceRoot object.
- */
- public static IWorkspaceRoot getWorkspaceRoot ()
- {
- if (root_ == null)
- {
- root_ = ResourcesPlugin.getWorkspace().getRoot();
- }
- return root_;
- }
-
- /**
- * Returns the IWorkspace object.
- * @return The IWorkspace object.
- */
- public static IWorkspace getWorkspace ()
- {
- if (workspace_ == null)
- {
- if (root_ == null)
- {
- root_ = ResourcesPlugin.getWorkspace().getRoot();
- }
-
- workspace_ = root_.getWorkspace();
- }
-
- return workspace_;
- }
-
- /**
- *
- * @return returns an array of three common choices. (ie. Yes, yes all, and cancel )
- */
- public static Choice[] getThreeStateFileOptions()
- {
- Vector choices = new Vector();
-
- choices.add(new Choice( 'Y', msg_.getMessage("LABEL_YES")));
- choices.add(new Choice( 'A', msg_.getMessage("LABEL_YES_TO_ALL")));
- choices.add(new Choice( 'C', msg_.getMessage("LABEL_CANCEL")));
-
- return (Choice[])choices.toArray(new Choice[choices.size()]);
- }
-
- /**
- * Returns an
- * {@link org.eclipse.core.resources.IResource IResource}
- * of the given absolute pathname or null if no such resource exists.
- * @param absolutePathname The absolute path of the resource.
- * @return The <code>IResource</code>.
- */
- public static IResource findResource ( String absolutePathname )
- {
- if (absolutePathname == null)
- {
- return null;
- }
-
- return findResource(new Path(absolutePathname));
- }
-
- /**
- * Returns an
- * {@link org.eclipse.core.resources.IResource IResource}
- * of the given absolute path or null if no such resource exists.
- * @param absolutePath The absolute <code>IPath</code> of the resource.
- * @return The <code>IResource</code>.
- */
- public static IResource findResource ( IPath absolutePath )
- {
- if (absolutePath == null)
- {
- return null;
- }
-
- return FileResourceUtils.getWorkspaceRoot().findMember(absolutePath);
- }
-
- /**
- * Copies a file from a plugin's installation location
- * to an Eclipse folder.
- * @param plugin The plugin containing the files to copy.
- * Must not be null.
- * @param sourcePath The path, relative to the <code>plugin</code>
- * install location, containing the files to copy.
- * If null, then the plugin install location is the source path
- * (ie. null is equivalent to ".").
- * @param pathname The pathname of the file to copy.
- * The pathname is relative to the <code>plugin sourcePath</code>.
- * Must not be null.
- * @param targetPath The absolute Eclipse path of the folder to
- * which the file will be copied. The relative pathname of the
- * file is preserved.
- * Must not be null.
- * @param createFolders The intermediate folder creation policy, one of
- * {@link #CREATE CREATE} or {@link #DONT_CREATE DONT_CREATE}.
- * <ul>
- * <li><code>CREATE</code> -
- * If any intermediate folders in the given <code>absolutePath</code>
- * do not exist, they will be created.
- * <li><code>DONT_CREATE</code> -
- * If any intermediate folders in the given <code>absolutePath</code>
- * do not exist, the method will throw a <code>CoreException</code>.
- * </ul>
- * @param overwriteFile The policy for existing files, one of
- * {@link #OVERWRITE OVERWRITE} or {@link #DONT_OVERWRITE DONT_OVERWRITE}.
- * <ul>
- * <li><code>OVERWRITE</code> -
- * If a resource of the same name as the given
- * <code>absolutePath</code> already exists and is a file,
- * it will be replaced.
- * If the resource already exists and it is not a file,
- * then no file will be created and
- * a <code>CoreException</code> will be thrown.
- * <li><code>DONT_OVERWRITE</code> -
- * If any resource of the same name as the given
- * <code>absolutePath</code> already exists,
- * then no file will be created and
- * a <code>CoreException</code> will be thrown.
- * </ul>
- * @param progressMonitor The progress monitor for the operation, or null.
- * @throws CoreException An exception containing an
- * {@link org.eclipse.core.runtime.IStatus IStatus}
- * with a severity of <code>IStatus.ERROR</code> and a
- * locale-specific description of the cause.
- */
- static public void copyFile( ResourceContext resourceContext,
- Plugin plugin,
- IPath sourcePath,
- IPath pathname,
- IPath targetPath,
- ProgressMonitor progressMonitor,
- StatusHandler statusMonitor )
- throws CoreException
- {
- try
- {
- IPath target = targetPath.append(pathname);
- IPath source = sourcePath == null ? pathname : sourcePath.append(pathname);
- InputStream input = plugin.openStream(source);
- createFile(resourceContext, target, input, progressMonitor, statusMonitor);
- }
- catch (IOException e)
- {
- throw new CoreException(new Status(IStatus.ERROR,
- plugin.getDescriptor().getUniqueIdentifier(),
- 0,
- msg_.getMessage("MSG_ERROR_IO"),e));
- }
- }
-
- /**
- * Deletes a file under a container.
- * The container must already exist.
- * @param file - the IFile to be deleted
- * @param progressMonitor
- * @param statusMonitor
- * @return True if the file does not exist or if it exists and is successfully deleted. False otherwise.
- */
- public static boolean deleteFile( ResourceContext resourceContext,
- IFile file,
- ProgressMonitor progressMonitor,
- StatusHandler statusMonitor)
- throws CoreException
- {
- if (file.exists())
- {
- if (!resourceContext.isOverwriteFilesEnabled())
- {
- SimpleStatus status
- = new SimpleStatus("", msg_.getMessage( "MSG_ERROR_FILE_OVERWRITE_DISABLED",
- new Object[]{ file.getParent().getFullPath().toString(),
- file.getName()}),
- Status.WARNING );
-
- Choice choice = statusMonitor.report( status, getThreeStateFileOptions() );
-
- if( choice.getShortcut() == 'C' ) return false;
-
- if( choice.getShortcut() == 'A' ) resourceContext.setOverwriteFilesEnabled(true);
- }
-
- //We have permission to overwrite so check if file is read-only
- if (file.isReadOnly())
- {
- if (!resourceContext.isCheckoutFilesEnabled())
- {
- SimpleStatus status
- = new SimpleStatus("", msg_.getMessage( "MSG_ERROR_FILE_CHECKOUT_DISABLED",
- new Object[]{ file.getParent().getFullPath().toString(),
- file.getName()}),
- Status.WARNING );
-
- Choice choice = statusMonitor.report( status, getThreeStateFileOptions() );
-
- if( choice.getShortcut() == 'C' ) return false;
-
- if( choice.getShortcut() == 'A' ) resourceContext.setCheckoutFilesEnabled(true);
- }
-
- IFile[] files = new IFile[1];
- files[0] = file;
- IStatus status = getWorkspace().validateEdit(files, null);
-
- if( status.getSeverity() == IStatus.ERROR )
- {
- SimpleStatus validateStatus = new SimpleStatus( "", status.getMessage(), SimpleStatus.ERROR );
- statusMonitor.reportError( validateStatus );
- return false;
- }
- }
-
- file.delete(true, null);
- }
- //At this point, either the file did not exist or we successfully deleted
- // it. Return success.
- return true;
- }
-
- /**
- * Deletes a folder under a container.
- * @param folder - the IFolder to be deleted
- * @param progressMonitor
- * @param statusMonitor
- * @return True if the folder does not exist or if it exists and is successfully deleted along with its members. False otherwise.
- */
- public static boolean deleteFolder( ResourceContext resourceContext,
- IFolder folder,
- ProgressMonitor progressMonitor,
- StatusHandler statusMonitor )
- throws CoreException
- {
- if (!folder.exists()) return true;
-
- boolean deleted = true;
- IResource[] resources = folder.members();
-
- for (int i=0; i<resources.length; i++)
- {
- IResource resource = resources[i];
- if (resource instanceof IFile)
- {
- deleted = deleteFile(resourceContext, (IFile)resource, progressMonitor, statusMonitor);
- }
- if (resource instanceof IFolder)
- {
- deleted = deleteFolder( resourceContext, (IFolder)resource, progressMonitor, statusMonitor);
- }
-
- if( !deleted ) break;
- }
-
- if( deleted )
- {
- folder.delete(true, true, null);
- return true;
- }
- else
- return false;
- }
-
- /**
- * Creates a file of the given <code>absolutePath</code>
- * and returns its handle as an <code>IFile</code>.
- * If the file cannot be created, a
- * <code>CoreException</code> containing an
- * <code>IStatus</code> object is thrown.
- * @param absolutePath The absolute path of the file to create.
- * The project at the beginning of the path must already exist,
- * that is, this method cannot be used to create projects.
- * @param progressMonitor The progress monitor for the operation, or null.
- * @return The {@link org.eclipse.core.resources.IFile IFile}
- * handle of the file.
- * @throws CoreException An exception containing an
- * {@link org.eclipse.core.runtime.IStatus IStatus}
- * with a severity of <code>IStatus.ERROR</code> and a
- * locale-specific description of the cause.
- */
- public static IFile createFile (
- ResourceContext resourceContext,
- IPath absolutePath,
- InputStream inputStream,
- ProgressMonitor progressMonitor,
- StatusHandler statusHandler )
-
- throws CoreException
- {
- if (!absolutePath.isAbsolute())
- {
- throw new CoreException(new Status(IStatus.ERROR, "ResourceUtils",0,msg_.getMessage("MSG_ERROR_PATH_NOT_ABSOLUTE",new Object[] {absolutePath.toString()}),null));
- }
- if (absolutePath.segmentCount() < 1)
- {
- throw new CoreException(new Status(IStatus.ERROR,"ResourceUtils",0,msg_.getMessage("MSG_ERROR_PATH_EMPTY",new Object[] {absolutePath.toString()}),null));
- }
- if (absolutePath.segmentCount() < 2)
- {
- throw new CoreException(new Status(IStatus.ERROR,"ResourceUtils",0,msg_.getMessage("MSG_ERROR_PATH_NOT_FOLDER",new Object[] {absolutePath.toString()}),null));
- }
- IContainer parent = makeFolderPath(resourceContext, absolutePath.removeLastSegments(1), progressMonitor, statusHandler);
- String fileName = absolutePath.lastSegment();
-
- return makeFile(resourceContext, parent, fileName, inputStream, progressMonitor, statusHandler);
- }
-
- /**
- * Creates under the given <code>project</code>
- * a file of the given <code>relativePath</code>
- * and returns its handle as an <code>IFile</code>.
- * If the file cannot be created, a
- * <code>CoreException</code> containing an
- * <code>IStatus</code> object is thrown.
- * @param absolutePath The absolute path of the file to create.
- * The project at the beginning of the path must already exist,
- * that is, this method cannot be used to create projects.
- * @param createFolders The intermediate folder creation policy, one of
- * {@link #CREATE CREATE} or {@link #DONT_CREATE DONT_CREATE}.
- * <ul>
- * <li><code>CREATE</code> -
- * If any intermediate folders in the given <code>absolutePath</code>
- * do not exist, they will be created.
- * <li><code>DONT_CREATE</code> -
- * If any intermediate folders in the given <code>absolutePath</code>
- * do not exist, the method will throw a <code>CoreException</code>.
- * </ul>
- * @param overwriteFile The policy for existing files, one of
- * {@link #OVERWRITE OVERWRITE} or {@link #DONT_OVERWRITE DONT_OVERWRITE}.
- * <ul>
- * <li><code>OVERWRITE</code> -
- * If a resource of the same name as the given
- * <code>absolutePath</code> already exists and is a file,
- * it will be replaced.
- * If the resource already exists and it is not a file,
- * then no file will be created and
- * a <code>CoreException</code> will be thrown.
- * <li><code>DONT_OVERWRITE</code> -
- * If any resource of the same name as the given
- * <code>absolutePath</code> already exists,
- * then no file will be created and
- * a <code>CoreException</code> will be thrown.
- * </ul>
- * @param progressMonitor The progress monitor for the operation, or null.
- * @return The {@link org.eclipse.core.resources.IFile IFile}
- * handle of the file.
- * @throws CoreException An exception containing an
- * {@link org.eclipse.core.runtime.IStatus IStatus}
- * with a severity of <code>IStatus.ERROR</code> and a
- * locale-specific description of the cause.
- */
- public static IFile createFile (
- ResourceContext resourceContext,
- IProject project,
- IPath relativePath,
- InputStream inputStream,
- ProgressMonitor progressMonitor,
- StatusHandler statusMonitor )
-
- throws CoreException
- {
- IPath absolutePath = project.getFullPath().append(relativePath);
- return createFile(resourceContext, absolutePath, inputStream, progressMonitor, statusMonitor);
- }
-
- /**
- * Creates an output stream that can be used to write to the
- * given <code>file</code>. Actual changes to the workspace
- * may occur during creation of the stream, while writing to
- * the stream, or when the stream is closed.
- * A <code>CoreException</code> containing
- * an <code>IStatus</code> will be thrown
- * at some point in the lifecycle of the stream
- * if the file resource cannot be created.
- * @param file The {@link org.eclipse.core.resources.IFile IFile}
- * handle of the file resource to create. The project implied by the
- * pathname of the file must already exist,
- * that is, this method cannot be used to create projects.
- * @param progressMonitor The progress monitor for the operation, or null.
- * @return An <code>OutputStream</code> tied to the file resource.
- * Actual checks of or changes to the workspace may occur as early during
- * stream creation, closure, or any time in between.
- * @throws CoreException An exception containing an
- * {@link org.eclipse.core.runtime.IStatus IStatus}
- * with a severity of <code>IStatus.ERROR</code> and a
- * locale-specific description of the cause.
- * Reasons include:
- * <ol>
- * <li>The project of the given file's path does not exist.
- * <li>A non-file resource of the same name of the given file
- * already exists.
- * <li>A file resource of the same name of the given file
- * already exists, and <code>overwriteFile</code> is false.
- * <li>One or more intermediate folders to the given file
- * do not exist, and <code>createFolders</code> is false.
- * </ol>
- */
-
- public static OutputStream newFileOutputStream (
- ResourceContext context,
- IPath file,
- ProgressMonitor progressMonitor,
- StatusHandler statusHandler )
-
- {
- return new FileResourceOutputStream(context, file, progressMonitor, statusHandler);
- }
-
- //----------------------------------------------------------------------
- // Naughty bits...
- //----------------------------------------------------------------------
-
- //
- // Creates a path of folders.
- // Do not call with an absolutePath of less than one segment.
- //
- /**
- * Creates a path of folders.
- * Do not call with an absolutePath of less than one segment.
- * @param resourceContext the resource context for making folders.
- * @param absolutePath the path of folders that will be created.
- * @param progressMonitor the progress monitor to be used.
- * @param statusHandler the status handler.
- * @return returns the IContainer of the created folder.
- */
- public static IContainer makeFolderPath (
- ResourceContext resourceContext,
- IPath absolutePath,
- ProgressMonitor progressMonitor,
- StatusHandler statusHandler )
-
- throws CoreException
- {
- if (absolutePath.segmentCount() <= 1)
- {
- return getWorkspaceRoot().getProject(absolutePath.segment(0));
- }
- else
- {
- IContainer parent = makeFolderPath(resourceContext, absolutePath.removeLastSegments(1), progressMonitor, statusHandler );
- String folderName = absolutePath.lastSegment();
-
- return makeFolder(resourceContext, parent,folderName, progressMonitor , statusHandler );
- }
- }
- //
- // Creates a folder under a container.
- // The container must already exist.
- //
- private static IFolder makeFolder (
- ResourceContext resourceContext,
- IContainer parent,
- String folderName,
- ProgressMonitor progressMonitor,
- StatusHandler statusHandler )
-
- throws CoreException
- {
- IResource child = parent.findMember(folderName);
- Choice result = null;
-
- if( child == null )
- {
- if (!resourceContext.isCreateFoldersEnabled())
- {
- result = statusHandler.report(
- new SimpleStatus( "ResourceUtils",
- msg_.getMessage("MSG_ERROR_FOLDER_CREATION_DISABLED",
- new Object[]{ parent.getFullPath().toString(), folderName} ),
- Status.WARNING, null ),
- getThreeStateFileOptions() );
-
- if( result == null || result.getShortcut() == 'C' )
- {
- return null;
- }
- else if( result.getShortcut() == 'A' )
- {
- resourceContext.setCreateFoldersEnabled(true);
- }
- }
-
- IFolder folder = parent.getFolder(new Path(folderName));
- folder.create(true,true,null);
- return folder;
- }
- else if( child.getType() == IResource.FOLDER )
- {
- return (IFolder)child;
- }
- else
- {
- throw new CoreException(
- new Status( IStatus.ERROR,
- "ResourceUtils",
- 0,
- msg_.getMessage( "MSG_ERROR_RESOURCE_NOT_FOLDER",
- new Object[]{ parent.getFullPath().append(folderName).toString() }),
- null ) );
- }
- }
-
- //
- // Creates a file under a container.
- // The container must already exist.
- //
- private static IFile makeFile (
- ResourceContext resourceContext,
- IContainer parent,
- String fileName,
- InputStream inputStream,
- ProgressMonitor progressMonitor,
- StatusHandler statusHandler )
-
- throws CoreException
- {
- IResource child = parent.findMember(fileName);
- Choice result = null;
-
- if( child != null )
- {
- if( child.getType() == IResource.FILE )
- {
- if( !resourceContext.isOverwriteFilesEnabled() )
- {
- result = statusHandler.report(
- new SimpleStatus( "ResourceUtils",
- msg_.getMessage( "MSG_ERROR_FILE_OVERWRITE_DISABLED",
- new Object[] {parent.getFullPath().toString(),fileName}),
- Status.WARNING ),
-
- getThreeStateFileOptions() );
-
- if( result == null || result.getShortcut() == 'C' )
- {
- return null;
- }
- else if( result.getShortcut() == 'A' )
- {
- resourceContext.setOverwriteFilesEnabled(true);
- }
- }
-
- //We have permission to overwrite so check if file is read-only
- if( child.isReadOnly() )
- {
- if( !resourceContext.isCheckoutFilesEnabled() )
- {
- result = statusHandler.report(
- new SimpleStatus( "ResourceUtils",
- msg_.getMessage( "MSG_ERROR_FILE_CHECKOUT_DISABLED",
- new Object[]{ parent.getFullPath().toString(),fileName} ),
- Status.WARNING ),
- getThreeStateFileOptions() );
-
- if( result == null || result.getShortcut() == 'C' )
- {
- return null;
- }
- else if( result.getShortcut() == 'A' )
- {
- resourceContext.setCheckoutFilesEnabled(true);
- }
- }
-
- IFile[] files = new IFile[1];
- files[0] = (IFile)child;
-
- IStatus status = getWorkspace().validateEdit(files,null);
- SimpleStatus ss = new SimpleStatus( status.getPlugin(),
- status.getMessage(),
- status.getSeverity(),
- status.getException() );
-
- try
- {
- statusHandler.report( ss );
- }
- catch( StatusException exc )
- {
- return null;
- }
- }
-
- //Change the contents of the existing file.
- IFile file = parent.getFile( new Path(fileName) );
- file.setContents( inputStream, true, true, null );
-
- return file;
-
- }
- else
- {
- throw new CoreException(
- new Status( IStatus.ERROR,
- "ResourceUtils",
- 0,
- msg_.getMessage( "MSG_ERROR_RESOURCE_NOT_FILE",
- new Object[] {parent.getFullPath().append(fileName)}),
- null ) );
- }
- }
- else
- {
- //Create a new file.
- IFile file = parent.getFile( new Path(fileName) );
- file.create( inputStream, true, null);
-
- return file;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/StringUtils.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/StringUtils.java
deleted file mode 100644
index fefac6b..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/StringUtils.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.common;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.Enumeration;
-import java.util.Vector;
-
-/**
- * This class contains some useful string utilities that are not provided by
- * either String or StringBuffer.
- *
- * @author Peter Moogk
- * @date July 13, 2000
-**/
-public final class StringUtils
-{
- /**
- * The platform-specific line separator.
- */
- public static final String NEWLINE = System.getProperty("line.separator");
-
- private StringUtils(){};
-
- /**
- * This method splits a single line of text into multiple lines
- * based on a maximum line length. The method will try to fit as
- * many words as possible onto a line without exceeding the maximum
- * line length. Note: the only case where a line might exceed the
- * maximum is if a single word is longer than the maximum.
- * @param text a single line a text that is to be split.
- * @param max_length the maximum length of each split line.
- * @return a string array of the split lines.
- **/
- public static String[] splitter( String text, int max_length )
- {
- Vector return_text = new Vector(20);
- String[] return_str;
- int index = 0;
-
- while( index < text.length() )
- {
- String str = text.substring( index, Math.min( max_length + index,
- text.length() ) );
- int space_index = str.lastIndexOf( " " );
-
- if( index + str.length() < text.length() &&
- text.charAt( index + str.length() - 1 ) != ' ' &&
- text.charAt( index + str.length() ) != ' ' &&
- space_index != -1 )
- {
- return_text.addElement( str.substring( 0, space_index ) );
- index += space_index + 1;
- }
- else
- {
- return_text.addElement( str.trim() );
- index += str.length();
- }
- }
-
- return_str = new String[return_text.size()];
-
- for( index = 0; index < return_text.size(); index++ )
- {
- return_str[index] = (String)(return_text.elementAt(index));
- }
-
- return return_str;
- }
-
- /**
- * This method returns a string with a repeated number of characters.
- * @param the_char the character to be repeated.
- * @param count the number of time this character should be repeated.
- * @return the resulting string of repeated characters.
- **/
- static public String repeat( char the_char, int count )
- {
- StringBuffer buf = new StringBuffer( count );
-
- for( int index = 0; index < count; index++ )
- {
- buf.append( the_char );
- }
-
- return buf.toString();
- }
-
- /**
- * This method flattens an array of arguments to a string.
- * The method respects embedded whitespace and quotes.
- * <ul>
- * <li>Any argument with embedded whitespace will be flattened out
- * with enclosing quotes. For example, the single argument
- * <u>Hello World</u>
- * will be returned as
- * <u>"Hello World"</u>.
- * <li>Any argument with quotes will be flattened out with the
- * quotes escaped. For example, the single argument
- * <u>"Happy days"</u>
- * will be returned as
- * <u>\"Happy days\"</u>.
- * </ul>
- * @param arguments The array of strings to flatten.
- * @return the flattened string.
- */
- static public String flattenArguments ( String[] arguments )
- {
- StringBuffer buf = new StringBuffer();
-
- for (int i=0; i<arguments.length; i++)
- {
- //
- // Append a separator (except the first time).
- //
- if (i > 0) buf.append(' ');
-
- //
- // Look for whitespace.
- //
- boolean whitespace = false;
- char[] chars = arguments[i].toCharArray();
- for (int j=0; !whitespace && j<chars.length; j++)
- {
- if (Character.isWhitespace(chars[j]))
- {
- whitespace = true;
- }
- }
-
- //
- // Append the argument, quoted as necessary.
- //
- if (whitespace) buf.append('"');
- for (int j=0; j<chars.length; j++)
- {
- if (chars[j] == '"') buf.append('\\');
- buf.append(chars[j]);
- }
- if (whitespace) buf.append('"');
- }
-
- return buf.toString();
- }
-
- /**
- * This method parses whitespace-delimitted filenames from
- * the given <code>input</code> stream. <b>Limitation:</b>
- * Quoted filenames or filenames with embedded whitespace
- * are not currently supported.
- * @param input The input stream.
- * @return An enumeration of filenames from the stream.
- */
- static public Enumeration parseFilenamesFromStream ( InputStream input )
- throws IOException
- {
- Vector filenames = new Vector(64,64);
- StringBuffer buffer = null;
- byte state = STATE_WS;
- int ic = input.read();
- while (ic >= 0)
- {
- char c = (char)ic;
- switch (state)
- {
- case STATE_WS:
- if (!Character.isWhitespace(c))
- {
- buffer = new StringBuffer();
- buffer.append(c);
- state = STATE_NWS;
- }
- break;
- case STATE_NWS:
- if (!Character.isWhitespace(c))
- {
- buffer.append(c);
- }
- else
- {
- String filename = buffer.toString();
- filenames.add(filename);
- buffer = null;
- state = STATE_WS;
- }
- break;
- default:
- break;
- }
- ic = input.read();
- }
- return filenames.elements();
- }
-
- private static final byte STATE_WS = 0;
- private static final byte STATE_NWS = 1;
-
-
- /**
- * Returns true is the type passed in is a primtive java type
- * @param class name String
- * @return true is primitive type
- */
- public static boolean isPrimitiveType(String typeName)
- {
-
- if (typeName.equalsIgnoreCase("boolean") ||
- typeName.equalsIgnoreCase("byte") ||
- typeName.equalsIgnoreCase("double") ||
- typeName.equalsIgnoreCase("float") ||
- typeName.equalsIgnoreCase("int") ||
- typeName.equalsIgnoreCase("long") ||
- typeName.equalsIgnoreCase("short") ||
- typeName.equalsIgnoreCase("char"))
- return true;
- return false;
-
- }
-
- /**
- * The method replace the characters that are allowed in URIs
- * and not allowed in Java class names to an underscore ('_')
- * @param URI String
- * @return valid Java class name String
- */
- public static String URI2ClassName( String uri ) {
- String className = uri;
- for ( int i = 0; i < URI_SYMBOLS.length; i++ ) {
- className = className.replace ( URI_SYMBOLS[i], UNDERSCORE );
- }
- return className;
- }
-
- /**
- * Creates and array of strings containing the exception traceback information of
- * a Throwable. This is the same traceback data that is displayed by exc.printStackTrace().
- * @param exc the exception
- * @return a string array of the traceback information.
- */
- public static String[] getStackTrace( Throwable exc )
- {
- Vector lines = new Vector();
- StringWriter stringWriter = new StringWriter();
- PrintWriter printWriter = new PrintWriter( stringWriter );
-
- exc.printStackTrace( printWriter );
-
- try
- {
- printWriter.close();
- stringWriter.close();
- }
- catch( Exception nestedExc )
- {
- return new String[0];
- }
-
- StringReader stringReader = new StringReader( stringWriter.toString() );
- BufferedReader reader = new BufferedReader( stringReader );
- String line = null;
-
- try
- {
- line = reader.readLine();
-
- while( line != null )
- {
- lines.add( line.trim() );
- line = reader.readLine();
- }
- }
- catch( Exception nestedExc )
- {
- return new String[0];
- }
-
- return (String[])lines.toArray( new String[0] );
- }
-
- private static final char[] URI_SYMBOLS = {'-', '~', '#', '/', '.'};
- private static final char UNDERSCORE = '_';
-
- private static boolean isDelimiter(char character)
- {
- return "\u002D\u002E\u003A\u005F\u00B7\u0387\u06DD\u06DE".indexOf(character) != -1;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/WaitForAutoBuildCommand.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/WaitForAutoBuildCommand.java
deleted file mode 100644
index b931f1a..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/WaitForAutoBuildCommand.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.common;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.command.env.core.SimpleCommand;
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-
-
-public class WaitForAutoBuildCommand extends SimpleCommand
-{
- public Status execute(Environment environment)
- {
- SimpleStatus status = new SimpleStatus( "" );
-
- try
- {
- Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
- }
- catch( InterruptedException exc )
- {
- // UISynchronizer.syncExec seems to interrupt the UI tread when the autobuilder is done. Not sure, why.
- // I'm assuming here that the autobuilder has actually completed its stuff.
- }
-
- return status;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/environment.properties b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/environment.properties
deleted file mode 100644
index 6c160b0..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/common/environment.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages for EclipseScheme
-#
-MSG_INVALID_PLATFORM_URL=Invalid URL: {0} for an Eclipse platform.
-
-#
-# Messages for ResouceUtils
-#
-MSG_ERROR_PATH_NOT_ABSOLUTE=IWAB0003E Path {0} is not absolute for creating a file.
-MSG_ERROR_PATH_EMPTY=IWAB0004E Path {0} is empty while creating a file.
-MSG_ERROR_PATH_NOT_FOLDER=IWAB0005E Path {0} is not a folder for creating a file.
-MSG_ERROR_FOLDER_CREATION_DISABLED=IWAB0007E Folder creation has been disabled for parent folder {0} and child {1}.
-MSG_ERROR_RESOURCE_NOT_FOLDER=IWAB0008E Resource {0} is not a folder.
-MSG_WARN_FILE_OVERWRITE_DISABLED=IWAB0009W Can not overwrite file {1} in folder {0}.
-MSG_ERROR_FILE_CHECKOUT_DISABLED=IWAB0010E Can not checkout file {1} in folder {0}.
-MSG_ERROR_RESOURCE_NOT_FILE=IWAB0011E The following path is not a resource: {0}.
-MSG_ERROR_FOLDER_HAS_CHILDREN=IWAB0012E Can not create folder: {0} that already has children.
-MSG_ERROR_IO=IWAB0006E An input/output error occurred while processing the resource "{0}".
-MSG_ERROR_FILE_OVERWRITE_DISABLED=IWAB0164E Cannot create the file "{1}" relative to the path "{0}" because automatic file overwriting has not been enabled. Do you want to enable it for this file?
-MSG_ERROR_FILE_CHECKOUT_DISABLED=IWAB0061E Cannot create the file "{1}" relative to the path "{0}" because automatic file check out has not been enabled. Do you want to enable it for this file?
-
-LABEL_YES=Yes
-LABEL_YES_TO_ALL=Yes All
-LABEL_CANCEL=Cancel
-
-TITLE_WARNING=Warning:
-TITLE_ERROR=Error:
-TITLE_INFO=Info:
-
-
-
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/context/PersistentContext.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/context/PersistentContext.java
deleted file mode 100644
index 0cd8135..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/context/PersistentContext.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.context;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.command.env.core.context.Context;
-
-/**
- * This class is used as the base class for types that what to persist preference
- * data in the plugin preferences area.
- *
- *
- */
-public abstract class PersistentContext implements Context
-{
- protected Preferences preferences_;
- protected Plugin plugin_;
-
- public PersistentContext ( Plugin plugin)
- {
- plugin_ = plugin;
- preferences_ = plugin.getPluginPreferences();
- }
-
- /**
- * Sets the default for a boolean preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setDefault (String name, boolean value) {
- preferences_.setDefault(name, value);
- }
-
- /**
- * Sets the default for a string preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setDefault (String name, String value) {
- preferences_.setDefault(name,value);
- }
-
- /**
- * Sets the default for a int preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setDefault (String name, int value) {
- preferences_.setDefault(name,value);
- }
-
- /**
- * Sets the value for a string preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setValue (String name, String value) {
- preferences_.setValue(name,value);
- plugin_.savePluginPreferences();
- }
-
- /**
- * Sets the value for a boolean preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setValue (String name, boolean value) {
- preferences_.setValue(name, value);
- plugin_.savePluginPreferences();
- }
-
- /**
- * Sets the value for a int preference.
- * @param name the preference name.
- * @param value the preference value.
- */
- public void setValue (String name, int value) {
- preferences_.setValue(name, value);
- plugin_.savePluginPreferences();
- }
-
- /**
- * Gets the value for a string preference.
- * @param name the preference name.
- * @return the preference value.
- */
- public String getValueAsString ( String name) {
- return preferences_.getString(name);
- }
-
- /**
- * Gets the value for a boolean preference.
- * @param name the preference name.
- * @return the preference value.
- */
- public boolean getValueAsBoolean ( String name) {
- return preferences_.getBoolean(name);
- }
-
- /**
- * Gets the value for a int preference.
- * @param name the preference name.
- * @return the preference value.
- */
- public int getValueAsInt( String name) {
- return preferences_.getInt(name);
- }
-
- /**
- * Gets the default value for a string preference.
- * @param name the preference name.
- * @return the default preference value.
- */
- public String getDefaultString(String name)
- {
- return preferences_.getDefaultString(name);
- }
-
- /**
- * Gets the default value for a boolean preference.
- * @param name the preference name.
- * @return the default preference value.
- */
- public boolean getDefaultBoolean(String name)
- {
- return preferences_.getDefaultBoolean(name);
- }
-
- /**
- * Gets the default value for a int preference.
- * @param name the preference name.
- * @return the default preference value.
- */
- public int getDefaultInt(String name)
- {
- return preferences_.getDefaultInt(name);
- }
-
- /**
- * Sets the default value for a string preference if a default value has
- * not already been set.
- * @param name the preference name.
- * @param value the default preference value
- */
- public void setDefaultStringIfNoDefault( String key, String value )
- {
- // If the key already has a default value we don't want to override it.
- if( preferences_.getDefaultString( key ).equals("") )
- {
- preferences_.setDefault( key, value );
- }
- }
-
- /**
- * Sets the default value for a boolean preference if a default value has
- * not already been set.
- * @param name the preference name.
- * @param value the default preference value
- */
- public void setDefaultBooleanIfNoDefault( String key, boolean value )
- {
- // If the key already has a default value we don't want to override it.
- if( preferences_.getDefaultString( key ).equals("") )
- {
- preferences_.setDefault( key, value );
- }
- }
-
- /**
- * Sets the default value for a int preference if a default value has
- * not already been set.
- * @param name the preference name.
- * @param value the default preference value
- */
- public void setDefaultIntIfNoDefault( String key, int value )
- {
- // If the key already has a default value we don't want to override it.
- if( preferences_.getDefaultString( key ).equals("") )
- {
- preferences_.setDefault( key, value );
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/BaseEclipseEnvironment.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/BaseEclipseEnvironment.java
deleted file mode 100644
index 643c06c..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/BaseEclipseEnvironment.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.eclipse;
-
-import org.eclipse.wst.command.env.core.common.Environment;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-
-
-/**
- * This interface adds resources to the base Environment.
- */
-public interface BaseEclipseEnvironment extends Environment
-{
- /**
- *
- * @return returns a ResourceContext object for this environment.
- */
- public ResourceContext getResourceContext();
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/ConsoleEclipseEnvironment.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/ConsoleEclipseEnvironment.java
deleted file mode 100644
index 40c7082..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/ConsoleEclipseEnvironment.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.eclipse;
-
-import org.eclipse.wst.command.env.core.CommandManager;
-import org.eclipse.wst.command.env.core.common.JavaCompiler;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.NullProgressMonitor;
-import org.eclipse.wst.command.env.core.common.NullStatusHandler;
-import org.eclipse.wst.command.env.core.common.ProgressMonitor;
-import org.eclipse.wst.command.env.core.common.StatusHandler;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.core.uri.SimpleURIFactory;
-import org.eclipse.wst.command.env.core.uri.URIFactory;
-import org.eclipse.wst.command.env.core.uri.file.FileScheme;
-
-
-/**
- * This class is intended for use in a headless Eclipse environment.
- */
-public class ConsoleEclipseEnvironment implements BaseEclipseEnvironment
-{
- private CommandManager commandManager_ = null;
- private SimpleURIFactory uriFactory_ = null;
- private ResourceContext resourceContext_ = null;
- private ProgressMonitor monitor_ = null;
- private StatusHandler statusHandler_ = null;
-
- public ConsoleEclipseEnvironment( ResourceContext resourceContext )
- {
- this( null, resourceContext, new NullProgressMonitor(), new NullStatusHandler() );
- }
-
- public ConsoleEclipseEnvironment( CommandManager commandManager,
- ResourceContext resourceContext,
- ProgressMonitor monitor,
- StatusHandler statusHandler )
- {
- commandManager_ = commandManager;
- resourceContext_ = resourceContext;
- uriFactory_ = new SimpleURIFactory();
- monitor_ = monitor;
- statusHandler_ = statusHandler;
-
- uriFactory_.registerScheme( "platform", new EclipseScheme( this ) );
- uriFactory_.registerScheme( "file", new FileScheme() );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.eclipse.BaseEclipseEnvironment#getResourceContext()
- */
- public ResourceContext getResourceContext()
- {
- return resourceContext_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getCommandManager()
- */
- public CommandManager getCommandManager()
- {
- return commandManager_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getJavaCompiler()
- */
- public JavaCompiler getJavaCompiler()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getLog()
- */
- public Log getLog()
- {
- return new EclipseLog();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getProgressMonitor()
- */
- public ProgressMonitor getProgressMonitor()
- {
- return monitor_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getStatusHandler()
- */
- public StatusHandler getStatusHandler()
- {
- return statusHandler_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.common.Environment#getURIFactory()
- */
- public URIFactory getURIFactory()
- {
- return uriFactory_;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/EclipseLog.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/EclipseLog.java
deleted file mode 100644
index a1b8f2d..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/EclipseLog.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.eclipse;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.command.env.core.common.Log;
-import org.eclipse.wst.command.env.core.common.Status;
-
-public class EclipseLog implements Log
-{
-// private Logger logger;
- public EclipseLog() {
- /*
- logger = Logger.getLogger("org.eclipse.wst.command.env");
- // logger.setLogFileName("env.log");
- logger.setLevel(Level.INFO); // log all levels for now
- */
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Log#isEnabled()
- */
- public boolean isEnabled() {
- return Platform.getPlugin("org.eclipse.wst.command.env").isDebugging();
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Log#isEnabled(java.lang.String)
- */
- public boolean isEnabled(String option) {
- return "true".equals(Platform.getDebugOption("org.eclipse.wst.command.env/trace/"
- + option));
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, int, java.lang.Object, java.lang.String, java.lang.Object)
- */
- public void log(int severity, int messageNum, Object caller,
- String method, Object object) {
-
- if (isEnabled()) {
- switch (severity) {
- case Log.ERROR :
- if (isEnabled("error"))
-// logger
-// .logError(getMessageNumString(messageNum) + "E "
-// + caller + "::" + method + ": object="
-// + object);
- System.out.println(getMessageNumString(messageNum) + "E "
- + caller + "::" + method + ": object="
- + object);
- break;
- case Log.WARNING :
- if (isEnabled("warning"))
-// logger
-// .logWarning(getMessageNumString(messageNum)
-// + "W " + caller + "::" + method
-// + ": object=" + object);
- System.out.println(getMessageNumString(messageNum)
- + "W " + caller + "::" + method
- + ": object=" + object);
- break;
- case Log.INFO :
- if (isEnabled("info"))
-// logger
-// .logInfo(getMessageNumString(messageNum) + "I "
-// + caller + "::" + method + ": object="
-// + object);
- System.out.println(getMessageNumString(messageNum) + "I "
- + caller + "::" + method + ": object="
- + object);
- break;
- }
- }
-
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, int, java.lang.Object, java.lang.String, org.eclipse.wst.command.env.core.common.Status)
- */
- public void log(int severity, int messageNum, Object caller,
- String method, Status status) {
- log(severity, messageNum, caller, method, (Object)status);
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, int, java.lang.Object, java.lang.String, java.lang.Throwable)
- */
- public void log(int severity, int messageNum, Object caller,
- String method, Throwable throwable) {
- log( severity, messageNum, caller, method, (Object)null );
- throwable.printStackTrace();
- /*
- if (isEnabled()) {
- switch (severity) {
- case Log.ERROR :
- if (isEnabled("error"))
- logger.logError(getMessageNumString(messageNum) + "E "
- + caller + "::" + method);
- logger.logError(throwable);
- break;
- case Log.WARNING :
- if (isEnabled("warning"))
- logger.logWarning(getMessageNumString(messageNum) + "W "
- + caller + "::" + method);
- logger.logWarning(throwable);
- break;
- case Log.INFO :
- if (isEnabled("info"))
- logger.logInfo(getMessageNumString(messageNum) + "I "
- + caller + "::" + method);
- logger.logInfo(throwable);
- break;
- }
- }
- */
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, java.lang.String, int, java.lang.Object, java.lang.String, java.lang.Object)
- */
- public void log(int severity, String option, int messageNum,
- Object caller, String method, Object object) {
- /*
- if (isEnabled(option))
- logger.logInfo(getMessageNumString(messageNum) + "I " + caller
- + "::" + method + ": object=" + object);
- */
- if (isEnabled(option))
- System.out.println(getMessageNumString(messageNum) + "I " + caller
- + "::" + method + ": object=" + object);
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, java.lang.String, int, java.lang.Object, java.lang.String, java.lang.Throwable)
- */
- public void log(int severity, String option, int messageNum,
- Object caller, String method, Throwable throwable) {
- /*
- if (isEnabled(option)) {
- logger.logInfo(getMessageNumString(messageNum) + "I " + caller
- + "::" + method);
- logger.logInfo(throwable);
- }
- */
- if (isEnabled(option)) {
- System.out.println(getMessageNumString(messageNum) + "I " + caller
- + "::" + method);
- throwable.printStackTrace();
- }
- }
-
- /**
- * @see org.eclipse.wst.command.env.core.common.Log#log(int, java.lang.String, int, java.lang.Object, java.lang.String, org.eclipse.wst.command.env.core.common.Status)
- */
- public void log(int severity, String option, int messageNum,
- Object caller, String method, Status status) {
- log(severity, option, messageNum, caller, method, (Object)status);
- }
-
- private String getMessageNumString(int messageNum) {
- String messageNumString = "IWAB";
- if (messageNum > 9999 || messageNum < 0)
- messageNum = 9999; //default message number
- messageNumString += (new Integer(messageNum)).toString();
- return messageNumString;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/EclipseScheme.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/EclipseScheme.java
deleted file mode 100644
index 5499711..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/EclipseScheme.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.eclipse;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.uri.RelativeURI;
-import org.eclipse.wst.command.env.core.uri.URI;
-import org.eclipse.wst.command.env.core.uri.URIException;
-import org.eclipse.wst.command.env.core.uri.URIScheme;
-
-
-public class EclipseScheme implements URIScheme
-{
- private BaseEclipseEnvironment environment_;
- private MessageUtils msg_;
-
- public EclipseScheme( BaseEclipseEnvironment environment )
- {
- environment_ = environment;
- msg_ = new MessageUtils( "org.eclipse.wst.command.env.common.environment", this );
- }
-
- /**
- */
- public boolean isHierarchical()
- {
- return true;
- }
-
- /**
- */
- public boolean isValid(URI uri)
- {
- boolean result = true;
-
- if( uri == null ) return false;
-
- try
- {
- getPathFromPlatformURI( uri.toString() );
- }
- catch( URIException exc )
- {
- result = false;
- }
-
- return result;
- }
-
- /**
- */
- public URI newURI(String uri) throws URIException
- {
- String newURI = null;
-
- if( uri.startsWith( "platform:/resource") )
- {
- // The platform has been specified so keep it as is.
- newURI = uri;
- }
- else if( uri.indexOf( ":") != -1 )
- {
- // The platform uri is not allowed to contain some other protocol.
- throw new URIException(
- new SimpleStatus( "EclipseScheme",
- msg_.getMessage("MSG_INVALID_PLATFORM_URL", new Object[]{uri}),
- Status.ERROR ) );
- }
- else if( uri.startsWith( "/") )
- {
- // The platform scheme has not been specified so we will add it.
- newURI = "platform:/resource" + uri;
- }
-
- if( newURI == null )
- {
- return new RelativeURI( uri );
- }
- else
- {
- return new EclipseURI( newURI, environment_ );
- }
- }
-
- /**
- */
- public URI newURI(URI uri) throws URIException
- {
- return newURI( uri.toString() );
- }
-
- /**
- */
- public URI newURI(URL url) throws URIException
- {
- return newURI( url.toString() );
- }
-
- /**
- */
- public Status validate(URI uri)
- {
- Status status = null;
-
- try
- {
- getPathFromPlatformURI( uri.toString() );
- status = new SimpleStatus( "" );
- }
- catch( URIException exc )
- {
- status = exc.getStatus();
- }
-
- return status;
- }
-
- /**
- * Gets the "platform:/resource" IPath given a url
- *
- */
- public String getPathFromPlatformURI(String uri) throws URIException
- {
- String resourceFile = null;
- URL url = null;
-
- try
- {
- url = new URL( uri );
- }
- catch( MalformedURLException exc )
- {
- }
-
- if( url == null )
- {
- throw new URIException(
- new SimpleStatus( "EclipseScheme",
- msg_.getMessage("MSG_INVALID_PLATFORM_URL", new Object[]{uri}),
- Status.ERROR ) );
- }
- if( url.getProtocol().equals("platform") )
- {
- String resourceURL = url.getFile();
-
- if (resourceURL.startsWith("/resource"))
- {
- resourceFile = resourceURL.substring(10); // omit the "/resource" portion
- }
- }
- else
- {
- throw new URIException(
- new SimpleStatus( "EclipseScheme",
- msg_.getMessage("MSG_INVALID_PLATFORM_URL", new Object[]{url.getFile()}),
- Status.ERROR ) );
- }
-
- return resourceFile;
- }
-
- /**
- *
- * @param absolutePath an absolute IPath
- * @return returns the platform URI for this path.
- */
- public String getURLFromPath( IPath absolutePath )
- {
- return "platform:/resource" + absolutePath;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/EclipseURI.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/EclipseURI.java
deleted file mode 100644
index f15b4e7..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/env/eclipse/EclipseURI.java
+++ /dev/null
@@ -1,495 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.env.eclipse;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.command.env.common.FileResourceUtils;
-import org.eclipse.wst.command.env.core.common.MessageUtils;
-import org.eclipse.wst.command.env.core.common.SimpleStatus;
-import org.eclipse.wst.command.env.core.common.Status;
-import org.eclipse.wst.command.env.core.uri.RelativeURI;
-import org.eclipse.wst.command.env.core.uri.URI;
-import org.eclipse.wst.command.env.core.uri.URIException;
-import org.eclipse.wst.command.env.core.uri.URIFilter;
-import org.eclipse.wst.command.env.core.uri.URIScheme;
-
-
-public class EclipseURI extends RelativeURI
-{
- private BaseEclipseEnvironment environment_;
- private EclipseScheme scheme_;
- private MessageUtils msg_;
- private File file_;
-
- public EclipseURI( String uri, BaseEclipseEnvironment environment )
- {
- super( uri );
-
- environment_ = environment;
- scheme_ = new EclipseScheme( environment );
- msg_ = new MessageUtils( "org.eclipse.wst.command.env.common.environment", this );
- file_ = getFile();
- }
-
- /**
- * @see org.eclipse.env.uri.URI#erase()
- */
- public void erase() throws URIException
- {
- try
- {
- IResource file = getResource();
-
- if( file != null && file.exists() )
- {
- if( file instanceof IFile )
- {
- FileResourceUtils.deleteFile( environment_.getResourceContext(),
- (IFile)file,
- environment_.getProgressMonitor(),
- environment_.getStatusHandler() );
- }
- else if( file instanceof IFolder )
- {
- FileResourceUtils.deleteFolder( environment_.getResourceContext(),
- (IFolder)file,
- environment_.getProgressMonitor(),
- environment_.getStatusHandler() );
- }
- }
-
- }
- catch( Exception exc )
- {
- throw new URIException(
- new SimpleStatus( "EclipseURI",
- exc.getMessage(),
- Status.ERROR,
- exc ),
- this );
- }
- }
-
- /**
- * @see org.eclipse.env.uri.URI#getInputStream()
- */
- public InputStream getInputStream() throws URIException
- {
- try
- {
- // If a class cast exception is throw it will be propogated as
- // a URIException.
- IFile file = (IFile)getResource();
-
- //call getContents on the eclipse File object
- if( file != null )
- {
- return file.getContents();
- }
- }
- catch( Throwable exc )
- {
- throw new URIException(
- new SimpleStatus( "EclipseURI",
- exc.getMessage(),
- Status.ERROR,
- exc ),
- this );
- }
-
- return null;
- }
-
- /**
- * @see org.eclipse.env.uri.URI#getOutputStream()
- */
- public OutputStream getOutputStream() throws URIException
- {
- // Ensure that the parent folder exists.
- URI parent = parent();
-
- if( !parent.isPresent() )
- {
- parent().touchFolder();
- }
-
- return getOutStream();
- }
-
- /**
- * @see org.eclipse.env.uri.URI#getURIScheme()
- */
- public URIScheme getURIScheme()
- {
- return scheme_;
- }
-
- /**
- * @see org.eclipse.env.uri.URI#isLeaf()
- */
- public boolean isLeaf()
- {
- boolean result = false;
-
- try
- {
- IResource resource = getResource();
-
- if( resource != null &&
- resource.exists() &&
- resource.getType() == IResource.FILE )
- {
- result = true;
- }
- }
- catch( URIException exc )
- {
- // This URI does not exist.
- result = false;
- }
-
- return result;
- }
-
- /**
- * @see org.eclipse.env.uri.URI#isPresent()
- */
- public boolean isPresent()
- {
- boolean result = false;
-
- try
- {
- IResource resource = getResource();
-
- if( resource != null && resource.exists() )
- {
- result = true;
- }
- }
- catch( URIException exc )
- {
- // This URI does not exist.
- result = false;
- }
-
- return result;
- }
-
- /**
- * @see org.eclipse.env.uri.URI#isReadable()
- */
- public boolean isReadable()
- {
- boolean result = false;
-
- try
- {
- IResource resource = getResource();
-
- if( resource != null && resource.isAccessible() )
- {
- result = true;
- }
- }
- catch( URIException exc )
- {
- // This URI does not exist.
- result = false;
- }
-
- return result;
- }
-
- /**
- * @see org.eclipse.env.uri.URI#isRelative()
- */
- public boolean isRelative()
- {
- return false;
- }
-
- /**
- * @see org.eclipse.env.uri.URI#isWritable()
- */
- public boolean isWritable()
- {
- boolean result = false;
-
- try
- {
- IResource resource = getResource();
-
- if( resource != null &&
- resource.isAccessible() &&
- !resource.isReadOnly() )
- {
- result = true;
- }
- }
- catch( URIException exc )
- {
- // This URI does not exist.
- result = false;
- }
-
- return result;
- }
-
- /**
- * @see org.eclipse.env.uri.URI#list()
- */
- public URI[] list() throws URIException
- {
- IResource resource = getResource();
- URI[] uriChildren = new URI[0];
-
- if( resource.getType() == IResource.FOLDER )
- {
- IFolder folder = (IFolder)resource;
-
- try
- {
- IResource[] children = folder.members();
-
- uriChildren = new URI[children.length];
-
- for( int index = 0; index < children.length; index++ )
- {
- IPath path = children[index].getFullPath();
- uriChildren[index] = new EclipseURI( scheme_.getURLFromPath(path), environment_ );
- }
- }
- catch( CoreException exc )
- {
- }
- }
-
- return uriChildren;
- }
-
- /**
- * @see org.eclipse.env.uri.URI#list(org.eclipse.env.uri.URIFilter)
- */
- public URI[] list(URIFilter uriFilter) throws URIException
- {
- IResource resource = getResource();
- URI[] result = new URI[0];
-
- if( resource.getType() == IResource.FOLDER )
- {
- IFolder folder = (IFolder)resource;
-
- try
- {
- IResource[] children = folder.members();
- Vector uriChildren = new Vector();
-
- for( int index = 0; index < children.length; index++ )
- {
- IPath path = children[index].getFullPath();
- URI uri = new EclipseURI( scheme_.getURLFromPath(path), environment_ );
-
- if( uriFilter.accepts( uri ) )
- {
- uriChildren.add( uri );
- }
- }
-
- result = (URI[])uriChildren.toArray( new URI[0] );
- }
- catch( CoreException exc )
- {
- }
- }
-
- return result;
- }
-
- /**
- * @see org.eclipse.env.uri.URI#rename(org.eclipse.env.uri.URI)
- */
- public void rename(URI newURI )
- {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * @see org.eclipse.env.uri.URI#touchFolder()
- */
- public void touchFolder() throws URIException
- {
- IResource resource = getResource();
-
- if( resource != null )
- {
- if( resource.getType() == IResource.FOLDER )
- {
- IFolder folder = (IFolder)resource;
-
- try
- {
- if( folder.members().length > 0 )
- {
- throw new URIException(
- new SimpleStatus( "EclipseURI",
- msg_.getMessage( "MSG_ERROR_FOLDER_HAS_CHILDREN", new Object[]{ folder.toString() } ),
- Status.ERROR ),
- this );
-
- }
- }
- catch( CoreException exc )
- {
- throw new URIException(
- new SimpleStatus( "EclipseURI",
- exc.getMessage(),
- Status.ERROR,
- exc ),
- this );
- }
- }
- else
- {
- //??? Not sure what to do if touching a folder and the URI exists and it is not a folder.
- }
- }
- else
- {
- IPath newPath = new Path( scheme_.getPathFromPlatformURI( uri_ ) ).makeAbsolute();
-
- try
- {
- FileResourceUtils.makeFolderPath( environment_.getResourceContext(),
- newPath,
- environment_.getProgressMonitor(),
- environment_.getStatusHandler() );
- }
- catch( CoreException exc )
- {
- throw new URIException(
- new SimpleStatus( "EclipseURI",
- exc.getMessage(),
- Status.ERROR,
- exc ),
- this );
-
- }
- }
- }
-
- /**
- * @see org.eclipse.env.uri.URI#touchLeaf()
- */
- public void touchLeaf() throws URIException
- {
- IResource resource = getResource();
-
- if( resource != null )
- {
- // The resource already exists so do nothing.
- }
- else
- {
- // Get the parent for this leaf and create it if required.
- URI parent = parent();
-
- if( !parent.isPresent() )
- {
- parent().touchFolder();
- }
-
- try
- {
- // Get an output stream to the specified file and immediately close it.
- // This should create a 0 byte file.
- getOutStream().close();
- }
- catch( IOException exc )
- {
- throw new URIException( new SimpleStatus( "EclipseURI",
- exc.getMessage(),
- Status.ERROR,
- exc ),
- this );
- }
- }
-
- }
-
- private IResource getResource() throws URIException
- {
- IPath path = new Path( scheme_.getPathFromPlatformURI(uri_) );
- String absolutePathname = path.makeAbsolute().toString();
-
- return FileResourceUtils.findResource(absolutePathname);
- }
-
- /**
- * @see org.eclipse.env.uri.URI#getOutputStream()
- */
- private OutputStream getOutStream() throws URIException
- {
- IPath file = new Path( scheme_.getPathFromPlatformURI( uri_ ) ).makeAbsolute();
- OutputStream stream = null;
-
- stream = FileResourceUtils.newFileOutputStream ( environment_.getResourceContext(),
- file,
- environment_.getProgressMonitor(),
- environment_.getStatusHandler() );
- return stream;
- }
-
- /**
- * Returns a File object for the resource under this URI.
- * There are many URIs and URISchemes for which this method
- * will fail and throw an exception. It should be used only
- * in cases where URIs are known to be backed by physical files.
- */
- public File asFile ()
- {
- return file_;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.command.env.core.uri.URI#isAvailableAsFile()
- */
- public boolean isAvailableAsFile()
- {
- return file_ != null;
- }
-
- private File getFile()
- {
- String platformRes = "platform:/resource";
- File result = null;
-
- if (uri_.startsWith(platformRes))
- {
- result = new File(ResourcesPlugin.getWorkspace().getRoot().getLocation().removeTrailingSeparator().append(uri_.substring(platformRes.length(), uri_.length())).toString());
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/commandline/CommandLine.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/commandline/CommandLine.java
deleted file mode 100644
index ebe4485..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/commandline/CommandLine.java
+++ /dev/null
@@ -1,841 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.commandline;
-
-import java.text.MessageFormat;
-import java.util.Arrays;
-import java.util.BitSet;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-import org.eclipse.wst.command.env.common.StringUtils;
-
-
-/**
- * <p>This is a generic command line parsing class. The programmer need only specify
- * the characteristics of their command line(ie. positional parameters, flags, etc)
- * and this class will perform the rest of the parsing work. As an added bonus this
- * class will also create formated help text that displays the syntax of this
- * command line.
- *
- * <p>The main parameter to the CommandLine constructor is a two dimensional String
- * array. There are 5 columns in this array and as many rows as needed for each
- * flag or positional parameter. The five columns are:
- *
- * <ol>
- * <li>The name of the flag(eg. "help" or "a", etc)
- * Note: no dash should be in the name here. The user would specify "-help" on the
- * command line though.
- * <li>The name of the flag parameter(if any)
- * <li>A string indicating whether this flag can appear more than once on the
- * command line.
- * <li>A string indicating whether this flag must be specified on the command line.
- * <li>A help text string which describes this particular flag or positional parameter.
- * </ol>
- *
- * <p>Each row in the string array is associate with either a positional parameter
- * or with a flag. For example, consider this command line:
- * <ul>
- * <li>My_prog required_parm1 -ab parm_for_ab required_parm2 -help optional_parms
- * </ul>
- *
- * <p>In this example My_prog is the name of the program. required_parm1 and
- * required_parm2 must be specified on the command line. Notice that they do not
- * have to be adjacent to each other on the command line. optional_parms may optionally
- * specified. optional_parms can be 0 or more parameters. They does not need to be
- * adjacent to the required parameters, but they do need to follow the required
- * parameters. Two flags are specified "-ab" and "-help". The "-ab" flag has a
- * parameter "parm_for_ab" associated with it. Note: a flag can not have an optional
- * parameter. (ie. a flag either never have a parameter or it always has a parameter)
- * In this example, the first two rows in the string array would describe required_parm1
- * and required_parm2. The third entry would describe optional_parms. The fourth and
- * fifth rows would describe "-ab" and "-help". For this command line the string array
- * would look like this:
- *
- * <ul>
- * <li>{ { CommandLine.POSITIONAL, "parm1", CommandLine.NO_DUPS,
- * CommandLine.REQUIRED, "parm1 help text" },
- * <li>{ CommandLine.POSITIONAL, "parm2", CommandLine.NO_DUPS,
- * CommandLine.REQUIRED, "parm2 help text" },
- * <li>{ CommandLine.POSITIONAL, "optional_parms", CommandLine.DUPS_OK,
- * CommandLine.REQUIRED, "optional help text" },
- * <li>{ "ab", "parm_for_ab", CommandLine.NO_DUPS,
- * CommandLine.OPTIONAL, "ab help text" },
- * <li>{ "help", CommandLine.NO_PARM, CommandLine.NO_DUPS,
- * CommandLine.OPTIONAL, "displays this help text" } }
- * </ul>
- *
- * <p>String array rules:
- *
- * <ol>
- * <li>Positional rows must always come first in the array. These rows must
- * have a name specified in column 2, except for one case. If you want to indicate that
- * there are no optional positional parameters you would put CommandLine.NO_PARM
- * in column 2 of the positional row. You would also need to put CommandLine.OPTIONAL
- * in column 4 since this row is for optional parameters(or the non-existence of
- * optional parameters as the case may be)
- * <li>Once a positional row specifies that it is optional, no further positional rows
- * may be specified.
- * <li>At least one positional row must be specified, even if it is to just to specify that
- * there are no optional parameters.
- * <li>Flag names must be in lower case. Note: the user can specify upper or lower case
- * on the command line.
- * <li>If a flag has a parameter the name of the parameter should be put into column 2.
- * otherwise CommandLine.NO_PARM should be put in column 2.
- * <li>If a flag is allowed to appear more than once on the command line then
- * CommandLine.DUPS_OK should be put into column 3, otherwise CommandLine.NO_DUPS
- * should be put into column 3.
- * <li>If a flag must be specified on the command line then CommandLine.REQUIRED should
- * be specified in column 4, otherwise CommandLine.OPTIONAL should be specified.
- * <li>A help flag must be specified.
- * <li>The strings specified in the flags column, the parameter name column, and the
- * help column are always translated using the resource bundle specified. Of
- * course the special string values such as POSITIONAL and NO_PARM are not
- * translated.
- * </ol>
- *
- * <p> Flag matching rules:
- * <ol>
- * <li>The parser will attempt to match a user specified flag with the minimum number
- * of programmer specified flag characters. For example, if the programmer has
- * specified that the flag is "help" the user could specify "-h", "-he", "-hel", or
- * "-help". If the programmer has also specified a flag called "hello", the
- * user would get an error message for specifing either "-h", "-he" or "-hel", since
- * it is ambiguous which flag is being refered to. Both "-hell" and "-hello"
- * would be ok for the user to specify the hello flag on the command line.
- * <li>If a flag has a parameter, the parameter may be immediately adjacent to the flag.
- * For example if "abcd" is specified as a flag with a parameter, the user could
- * specify the following assuming there are no other ambiguous flags. "-abcdparm",
- * "-abcparm", "-abparm", or "-aparm" where parm is the parameter for the flag.
- * (Of course the user can always put a white space between the flag and the
- * parameter.)
- * <li>If a flag does not have a parameter and a parameter is adjacent to it then this
- * parameter is interpreted as a positional parameter. For example if "abcb" is
- * specified as a flag and the user specifies "-abhello", then the first "ab" will be
- * interpreted as the flag and "hello" will be interpreted as a positional
- * parameter.
- * </ol>
- *
- * @author Peter Moogk
- * @date July 13, 2000
-**/
-
-public class CommandLine
-{
- // Constant strings that the user should use in their flags_info input array.
- /**
- * Specifies that this flag or positional parameter is required.
- **/
- public static final String REQUIRED = "required";
- /**
- * Specifies that this flag or positional parameter is optional.
- **/
- public static final String OPTIONAL = "optional";
- /**
- * Specifies that this flag may be specified more than once on the command line.
- * Note: This string has no meaning for positional parameters.
- **/
- public static final String DUPS_OK = "dups_ok";
- /**
- * Specifies that this flag may not be specified more than once on the command line.
- * Note: This string has no meaning for positional parameters.
- **/
- public static final String NO_DUPS = "no_dups";
- /**
- * Specifies that a row is a positional parameter row.
- **/
- public static final String POSITIONAL = "";
- /**
- * Specifies that a flag has no parameter. For positional parameters this
- * string indicates that there are no optional parameters.
- **/
- public static final String NO_PARM = "";
-
- /**
- * @param flags_info This parameter specifies the characteristics of the
- * command line parser. See the class description for a
- * definition of what this string array should look like.
- * @param help_flag This string indicates which flag in the flags_info
- * array is the help flag.
- * @param tool_name This string indicates the name of the tool that this
- * command line parser is being used for. This string
- * is only used when creating the help text.
- **/
- public CommandLine( String[][] flags_info,
- String help_flag,
- String tool_name,
- ResourceBundle flagMessages )
-
- throws InternalErrorExc
- {
- this.flags_info = flags_info;
- this.help_flag = help_flag;
- this.tool_name = tool_name;
- this.flagMessages = flagMessages;
-
- messages = ResourceBundle.getBundle( "org.eclipse.wst.command.internal.env.commandline.commandline" );
- verify_flags_info();
- }
-
- /**
- * Call this method to parse a command line.
- * @param args This is the string array from the command line.
- * @throws Flag_error If the user has specified the command line incorrectly
- * a Flag_error exception will be thrown. Use getMessage
- * to get a description of the user error.
- *
- * @throws Help_specified If the user specifies the help flag this exception
- * will be thrown. Use getMessage to get a fully
- * formatted syntax description of this command line.
- **/
- public void check_flags( String[] args ) throws Flag_error
- {
- flags_specified = new Vector[flags_info.length];
-
- for( int index = 0; index < args.length; index++ )
- {
- boolean processed_the_next_arg = process_arg( args, index );
- if( processed_the_next_arg == true ) index++;
- }
-
- // If help was specified we will not check the regular rules.
- if( !flag_specified( help_flag ) )
- {
- // Check for flags breaking the rules specified in flags_info.
- check_rules();
-
- // Call subclassed method to see if more processing is required.
- more_processing();
- }
- }
-
- /**
- * This method is for subclasses of this class. This method is called at
- * the very end of check_flags method. It is intended that subclasses would
- * perform additional command line checking here.
- **/
- protected void more_processing() throws Flag_error, InternalErrorExc
- {
- }
-
- /**
- * Once the command line has been parsed by calling check_flags a
- * call can be made to this method to get the parameters for this flag.
- * If the flag was not specified on the command line null will be returned.
- * If the flag was specified, but has no parameters a valid vector will be
- * returned containing a null.
- **/
- public String[] get_flag_parms( String flag )
- {
- int row = 0;
- boolean flag_found = false;
-
- while( flag_found == false && row < flags_info.length )
- {
- if( flags_info[row][FLAG_COL].equals( flag ) )
- {
- flag_found = true;
- }
- else
- {
- row++;
- }
- }
-
- if( flag_found == true )
- {
- Vector parms = flags_specified[row];
- return parms == null ? null : (String[])(parms.toArray( new String[0] ));
- }
-
- return null;
- }
-
- /**
- * Call this method to get all of the positional parameters.
- * This method returns both the required positionals and the
- * optional positionals in that order. If no positional parameters
- * were specified null will be returned.
- **/
- public String[] get_positionals()
- {
- return (String[])flags_specified[POSITIONAL_ROW].toArray( new String[0] );
- }
-
- /**
- * This method returns true if this flag was specified by the user
- * otherwise false is returned.
- **/
- public boolean flag_specified( String flag )
- {
- return get_flag_parms( flag ) != null;
- }
-
- /**
- * This method returns fully formated help text syntax for this
- * command line.
- **/
- public String get_help_text()
- {
- StringBuffer help_text = new StringBuffer(400);
- int help_width = HELP_LINE_LEN -
- 2 - // blanks
- 1 - // dash
- max_flag_size - // flag field
- 1 - // blank
- max_name_size - // name field
- 1; // blank
-
- help_text.append( messages.getString( FlagMessages.PARSER_INFO_SYNTAX ) +
- ": " + tool_name + " " );
-
- // Display the required positionals if any.
- for( int index = 0; index < required_positionals; index++ )
- {
- help_text.append( flagMessages.getString( flags_info[index][NAME_COL] ) +
- " " );
- }
-
- help_text.append( "[" + messages.getString( FlagMessages.PARSER_FLAGS ) +
- "] " );
-
- if( optional_positionals_allowed == true )
- {
- help_text.append( flagMessages.getString( flags_info[optional_list_index][NAME_COL] ) );
- }
-
- help_text.append( "\n " + messages.getString( FlagMessages.PARSER_INFO_WHERE ) + "\n" );
-
- // Create one line of description for each parameter
- for( int row = 0; row < flags_info.length; row++ )
- {
- String columnId = flags_info[row][NAME_COL];
- String columnName = columnId == NO_PARM ? "" : flagMessages.getString( columnId );
-
- String flagId = flags_info[row][FLAG_COL];
- String flagName = flagId == POSITIONAL ? POSITIONAL : flagMessages.getString(flagId);
-
- int flag_padding = max_flag_size - flagName.length();
- int name_padding = max_name_size - columnName.length();
-
- // Skip this row if this is a marker for no optional positionals.
- if( flags_info[row][FLAG_COL] == POSITIONAL &&
- flags_info[row][NAME_COL] == NO_PARM ) continue;
-
- if( flagName == POSITIONAL )
- {
- help_text.append( getBlanks(3 ) );
- }
- else
- {
- help_text.append( " -" + flagName );
- }
-
- help_text.append( getBlanks( flag_padding + 1 ) );
- help_text.append( columnName );
- help_text.append( getBlanks( name_padding + 1 ) );
-
- String columnHelp = flagMessages.getString( flags_info[row][HELP_COL] );
- String[] split_help_text
- = StringUtils.splitter( columnHelp, help_width );
-
- if( split_help_text.length > 0 )
- help_text.append( split_help_text[0] + "\n" );
- else
- help_text.append( "\n" );
-
- for( int index = 1; index < split_help_text.length; index++ )
- {
- help_text.append( getBlanks( HELP_LINE_LEN - help_width ) );
- help_text.append( split_help_text[index] + "\n" );
- }
-
- help_text.append( "\n" );
- }
-
- return "" + help_text;
- }
-
- /**
- * Return a string with the specified number of blanks.
- */
- private String getBlanks( int count )
- {
- char[] blanks = new char[count];
- Arrays.fill( blanks, 0, count, ' ' );
-
- return new String( blanks );
- }
-
- /**
- * This class is the base for all command line exception classes.
- **/
- static public class ErrorExc extends Exception
- {
- public ErrorExc( String message, String[] args )
- {
- super( MessageFormat.format( message, args ) );
- }
- }
-
- /**
- * This class will be thrown when an internal error is detected.
- * This usually happens if the flag description information was
- * specified incorrectly.
- **/
- static public class InternalErrorExc extends IllegalArgumentException
- {
- public InternalErrorExc( String message, String[] args )
- {
- super( MessageFormat.format( message, args ) );
- }
-
- public InternalErrorExc( String message )
- {
- this( message, (String[])null );
- }
-
- public InternalErrorExc( String message, String arg )
- {
- this( message, new String[]{ arg } );
- }
- }
-
- /**
- * This class will be thrown if a user error occurs while parsing the command line.
- **/
- static public class Flag_error extends ErrorExc
- {
- public Flag_error( String message, String[] args )
- {
- super( message, args );
- }
-
- public Flag_error( String message, String arg )
- {
- super( message, new String[]{ arg } );
- }
-
- public Flag_error( String message )
- {
- super( message, null );
- }
- }
-
- /**
- * Tries to process a single flag on the command line.
- * @param args All the command line parameters.
- * @param arg_index This is the index of the argument that is to be processed.
- * @return returns true if the argument we are processing is a flag that has a
- * parameter and the parameter is specified in the next argument.
- **/
- private boolean process_arg( String[] args, int arg_index ) throws Flag_error
- {
- boolean processed_next_arg = false;
-
- if( args[arg_index].charAt(0) == '-' )
- {
- // This is the start of a flag.
- int flag_index = 1;
- int info_index = get_info_index( args[arg_index], flag_index );
- int max_index = get_max_index( args[arg_index], flag_index, info_index );
-
- if( flags_info[info_index][NAME_COL] != NO_PARM )
- {
- // This flag takes a parameter so check if it is stuck to this
- // arg.
- if( max_index < args[arg_index].length() )
- {
- add_flag_parm( info_index,
- args[arg_index].substring( max_index,
- args[arg_index].length() ) );
- }
- else
- {
- // This flag has a parameter and it wasn't stuck to the flag,
- // so we will try to get it from the next arg.
- if( arg_index+1 < args.length &&
- args[arg_index+1].charAt(0) != '-' )
- {
- // We found an parameter in the next string so we will use this
- // one as a parameter for this flag. Note: if was no parameter
- // after the flag at all, the error will be caught in the
- // check_rules method.
- add_flag_parm( info_index, args[arg_index+1] );
- processed_next_arg = true;
- }
- else
- {
- // Error missing paramater. This error is caught by check_rules.
- add_flag_parm( info_index, null );
- }
- }
- }
- else
- {
- // The flag does not have a parameter so we will add a null.
- add_flag_parm( info_index, null );
-
- // Check to see if a positional parameter is stuck to this flag.
- if( max_index < args[arg_index].length() )
- {
- add_positional( args[arg_index].substring( max_index,
- args[arg_index].length() ) );
- }
- }
- }
- else
- {
- // This is a positional parameter.
- add_positional( args[arg_index] );
- }
-
- return processed_next_arg;
- }
-
- /**
- * Finds the row for the flag that uniquely matched this flag str.
- * @return returns the flags_info index of the matching flag.
- **/
- private int get_info_index( String flag_str, int start_index )
- throws Flag_error
- {
- //int info_start = 1;
- //int info_end = flags_info.length;
- int info_index;
- int found_count = 0;
- int info_col_index = 0;
- int last_info_index = 0;
-
- BitSet flags_rejected = new BitSet();
-
- // Loop over each char in flag_str. Note: we will probably bail early.
- for( int flag_col_index = start_index; flag_col_index < flag_str.length(); flag_col_index++ )
- {
- // Loop over each flag in flag_info
- for( info_index = 0; info_index < flags_info.length; info_index++ )
- {
- String flagId = flags_info[info_index][FLAG_COL];
- String flagName = flagId == POSITIONAL ? POSITIONAL : flagMessages.getString( flagId );
-
- if( flags_rejected.get( info_index ) == false &&
- info_col_index < flagName.length() &&
- Character.toLowerCase(flag_str.charAt(flag_col_index)) ==
- flagName.charAt(info_col_index) )
- {
- found_count++;
- last_info_index = info_index;
- }
- else
- {
- flags_rejected.set( info_index );
- }
- }
-
- if( found_count == 1 )
- {
- // We have a match.
- return last_info_index;
- }
- else if( found_count == 0 )
- {
- // Flag not found at all.
- throw new Flag_error( messages.getString( FlagMessages.PARSER_ERROR_FLAG_NOT_FOUND ),
- flag_str.substring( start_index ) );
- }
- else
- {
- // More than one flag was found with this char so we will go to the
- // next char to uniquely match it.
- info_col_index++;
- //info_start = last_info_index - found_count + 1;
- //info_end = last_info_index + 1;
- found_count = 0;
- }
- }
-
- // The only way to get to this code is if the loop exited with
- // the found_count greater than 1. Therefore, the flag specified is
- // ambiguous.
- throw new Flag_error( messages.getString( FlagMessages.PARSER_ERROR_AMBIGUOUS_FLAG ),
- flag_str.substring( start_index) );
- }
-
- /**
- * This method tries to match as many characters as possible of the user
- * specified flag with the matched flag string.
- * @return returns the position of the last matching flag chararacter.
- **/
- private int get_max_index( String flag_str, int flag_start, int info_index )
- {
- int flag_col_index = flag_start;
- int info_col_index = 0;
-
- String info_str = flagMessages.getString( flags_info[info_index][FLAG_COL] );
-
- while( flag_col_index < flag_str.length() &&
- info_col_index < info_str.length() )
- {
- if( Character.toLowerCase( flag_str.charAt(flag_col_index) ) !=
- info_str.charAt(info_col_index) )
- break;
-
- flag_col_index++;
- info_col_index++;
- }
-
- return flag_col_index;
- }
-
- /**
- * Adds a positional parameter to flags_specified.
- **/
- private void add_positional( String positional_parm )
- {
- if( flags_specified[POSITIONAL_ROW] == null )
- flags_specified[POSITIONAL_ROW] = new Vector(3);
-
- flags_specified[POSITIONAL_ROW].add( positional_parm );
- }
-
- /**
- * Adds a flag and its parameter to flags_specified. If only the
- * flag was specified, then a null should be passed to flag_parm.
- **/
- private void add_flag_parm( int flag_index, String flag_parm )
- throws Flag_error
- {
- if( flags_info[flag_index][DUP_COL] == NO_DUPS &&
- flags_specified[flag_index] != null )
- throw new Flag_error( messages.getString( FlagMessages.PARSER_ERROR_DUPLICATE_FLAGS_NOT_ALLOWED ),
- flagMessages.getString( flags_info[flag_index][FLAG_COL] ) );
-
- if( flags_specified[flag_index] == null )
- flags_specified[flag_index] = new Vector(3);
-
- flags_specified[flag_index].add( flag_parm );
- }
-
- /**
- * Checks that the user hasn't broken any command line rules.
- **/
- private void check_rules() throws Flag_error
- {
- // Check that all of the required positionals were specified.
- int positional_count = 0;
-
- if( flags_specified[POSITIONAL_ROW] != null )
- {
- positional_count = flags_specified[POSITIONAL_ROW].size();
- }
-
- if( required_positionals > positional_count )
- throw new Flag_error( messages.getString( FlagMessages.PARSER_ERROR_MISSING_POSITIONAL ),
- flagMessages.getString( flags_info[required_positionals-1][NAME_COL] ) );
-
- else if( required_positionals < positional_count &&
- optional_positionals_allowed == false )
- throw new Flag_error( messages.getString( FlagMessages.PARSER_ERROR_TOO_MANY_POSITIONALS ) );
-
- for( int row = 0; row < flags_info.length; row++ )
- {
- if( flags_info[row][FLAG_COL] == POSITIONAL ) continue;
-
- if( flags_specified[row] == null &&
- flags_info[row][REQUIRED_COL] == REQUIRED )
- throw new Flag_error( messages.getString( FlagMessages.PARSER_ERROR_MISSING_REQUIRED_FLAG ),
- flagMessages.getString( flags_info[row][FLAG_COL] ) );
-
- int parm_count = 0;
-
- if( flags_specified[row] != null ) parm_count = flags_specified[row].size();
-
- // Check for too many flag parameters.
- if( flags_info[row][DUP_COL] == NO_DUPS && parm_count > 1 )
- throw new Flag_error( messages.getString( FlagMessages.PARSER_ERROR_DUPLICATE_FLAGS_NOT_ALLOWED ),
- flagMessages.getString( flags_info[row][FLAG_COL] ) );
-
- // Check for missing flag parameter.
- if( parm_count > 0 && flags_info[row][NAME_COL] != NO_PARM )
- {
- for( int index = 0; index < flags_specified[row].size(); index++ )
- {
- if( flags_specified[row].elementAt(index) == null )
- throw new Flag_error( messages.getString( FlagMessages.PARSER_ERROR_MISSING_FLAG_PARAMETER ),
- new String[]
- { flagMessages.getString( flags_info[row][FLAG_COL] ),
- flagMessages.getString( flags_info[row][NAME_COL] ) } );
-
- }
- }
- }
- }
-
- /**
- * This method verifies that a proper flags_info string array was passed
- * to us by the programmer.
- **/
- private void verify_flags_info() throws InternalErrorExc
- {
- boolean done_positionals = false;
- boolean help_specified = false;
-
- required_positionals = 0;
- optional_positionals_allowed = false;
- optional_list_index = -1;
- max_flag_size = 0;
- max_name_size = 0;
-
- if( flags_info == null || flags_info.length == 0 )
- throw new InternalErrorExc( messages.getString( FlagMessages.PARSER_ERROR_NO_FLAGS_DATA_SPECIFIED ) );
-
- if( flags_info[POSITIONAL_ROW] != null &&
- flags_info[POSITIONAL_ROW].length > 0 &&
- flags_info[POSITIONAL_ROW][FLAG_COL] != POSITIONAL )
- throw new InternalErrorExc( messages.getString( FlagMessages.PARSER_ERROR_FIRST_FLAG_NOT_POSITIONAL ) );
-
- for( int row = 0; row < flags_info.length; row++ )
- {
- if( flags_info[row] == null )
- throw new InternalErrorExc( messages.getString( FlagMessages.PARSER_ERROR_NULL_FLAG_ROW ) );
-
- if( flags_info[row].length != 5 )
- throw new InternalErrorExc( messages.getString( FlagMessages.PARSER_ERROR_INCORRECT_ROW_SIZE ) );
-
- if( flags_info[row][FLAG_COL] == null ||
- flags_info[row][NAME_COL] == null ||
- flags_info[row][HELP_COL] == null )
- throw new InternalErrorExc( messages.getString( FlagMessages.PARSER_ERROR_NULL_IN_ROW ) );
-
- if( flags_info[row][FLAG_COL].equals( help_flag ) ) help_specified = true;
-
- String flagId = flags_info[row][FLAG_COL];
- String nameId = flags_info[row][NAME_COL];
-
- String flag_col = flagId == POSITIONAL ? POSITIONAL : flagMessages.getString( flagId );
- String name_col = nameId == NO_PARM ? NO_PARM : flagMessages.getString( nameId );
-
- if( flag_col.length() > max_flag_size )
- max_flag_size = flag_col.length();
-
- if( name_col != NO_PARM && name_col.length() > max_name_size )
- max_name_size = name_col.length();
-
- // Ensure that flags are all in lowercase.
- if( !flag_col.equals( flag_col.toLowerCase() ) )
- throw new InternalErrorExc( messages.getString( FlagMessages.PARSER_ERROR_FLAG_NOT_LOWERCASE ),
- flag_col );
-
- // Ensure that only the predefined dup strings are used.
- // Note: it's ok to use != when comparing constant strings literals.
- if( flags_info[row][DUP_COL] == null ||
- ( flags_info[row][DUP_COL] != NO_DUPS &&
- flags_info[row][DUP_COL] != DUPS_OK ) )
- throw new InternalErrorExc( messages.getString( FlagMessages.PARSER_ERROR_INCORRECT_DUP_STRING ),
- flags_info[row][DUP_COL] );
-
- // Ensure that only the predefined required strings are used.
- if( flags_info[row][REQUIRED_COL] == null ||
- ( flags_info[row][REQUIRED_COL] != REQUIRED &&
- flags_info[row][REQUIRED_COL] != OPTIONAL ) )
- throw new InternalErrorExc( messages.getString( FlagMessages.PARSER_ERROR_INCORRECT_REQUIRED_STRING ),
- flags_info[row][REQUIRED_COL] );
-
- // Count the number of required positionals.
- if( flags_info[row][FLAG_COL] == POSITIONAL )
- {
- if( flags_info[row][REQUIRED_COL] == REQUIRED )
- {
- if( flags_info[row][NAME_COL] == NO_PARM )
- throw new InternalErrorExc( messages.getString( FlagMessages.PARSER_ERROR_REQUIRED_POSITIONAL_NEEDS_NAME ) );
-
- required_positionals++;
- }
- else if( flags_info[row][NAME_COL] != NO_PARM )
- {
- // We use the NAME_COL field for an optional positional to denote
- // whether additional positionals are allowed or not.
- optional_positionals_allowed = true;
- optional_list_index = row;
- }
- }
-
- // Ensure that positionals are at the beginning of the info.
- if( flags_info[row][FLAG_COL] != POSITIONAL ||
- ( done_positionals == false &&
- flags_info[row][FLAG_COL] == POSITIONAL &&
- flags_info[row][REQUIRED_COL] == OPTIONAL ) )
- {
- done_positionals = true;
- }
- else if( done_positionals == true )
- throw new InternalErrorExc( messages.getString( FlagMessages.PARSER_ERROR_POSITIONAL_NOT_AT_BEGINNING ) );
- }
-
- // Ensure that a help flag was specified in the info list.
- if( help_specified == false )
- throw new InternalErrorExc( messages.getString( FlagMessages.PARSER_ERROR_HELP_FLAG_NOT_SPECIFIED ) );
- }
-
- /**
- * This method is used to dump internal information about a parsed
- * command line.
- **/
- public String toString()
- {
- StringBuffer b = new StringBuffer(100);
-
- for( int row = 0; row < flags_info.length; row++ )
- {
- b.append( "\n" );
-
- if( flags_info[row][FLAG_COL] == POSITIONAL )
- b.append( "Positional:" );
- else
- b.append( flagMessages.getString( flags_info[row][FLAG_COL] ) + ":" );
-
-
- if( flags_specified[row] == null )
- b.append( "no parameters" );
- else
- for( int parm_index = 0; parm_index < flags_specified[row].size(); parm_index++ )
- {
- String parm = (String)flags_specified[row].elementAt(parm_index);
- b.append( parm + ":" );
- }
- b.append( "\n" );
- }
-
- return ""+b;
- }
-
- private static final int FLAG_COL = 0;
- private static final int NAME_COL = 1;
- private static final int DUP_COL = 2;
- private static final int REQUIRED_COL = 3;
- private static final int HELP_COL = 4;
-
- private static final int POSITIONAL_ROW = 0;
- private static final int HELP_LINE_LEN = 75;
-
- private String[][] flags_info;
- private String help_flag;
- private String tool_name;
- private Vector[] flags_specified;
- private int required_positionals;
- private boolean optional_positionals_allowed;
- private int optional_list_index;
- private int max_flag_size;
- private int max_name_size;
-
- protected ResourceBundle messages;
- private ResourceBundle flagMessages;
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/commandline/FlagMessages.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/commandline/FlagMessages.java
deleted file mode 100644
index 49a128c..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/commandline/FlagMessages.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.commandline;
-
-/**
- * This class is used to store constant string error messages
- * generated by CommandLine.java
- *
- *
- * @author Peter Moogk
- * @date July 13, 2000
- * @see org.eclipse.wst.command.internal.env.commandline.CommandLine
-**/
-
-public final class FlagMessages
-{
-
- // Copyright
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
-
- public static final String PARSER_ERROR_FLAG_NOT_FOUND = "PARSER_ERROR_FLAG_NOT_FOUND";
-
- public static final String PARSER_ERROR_AMBIGUOUS_FLAG = "PARSER_ERROR_AMBIGUOUS_FLAG";
-
- public static final String PARSER_ERROR_MISSING_POSITIONAL = "PARSER_ERROR_MISSING_POSITIONAL";
-
- public static final String PARSER_ERROR_TOO_MANY_POSITIONALS = "PARSER_ERROR_TOO_MANY_POSITIONALS";
-
- public static final String PARSER_ERROR_MISSING_REQUIRED_FLAG = "PARSER_ERROR_MISSING_REQUIRED_FLAG";
-
- public static final String PARSER_ERROR_DUPLICATE_FLAGS_NOT_ALLOWED = "PARSER_ERROR_DUPLICATE_FLAGS_NOT_ALLOWED";
-
- public static final String PARSER_ERROR_MISSING_FLAG_PARAMETER = "PARSER_ERROR_MISSING_FLAG_PARAMETER";
-
- // Error internal error messages.
- public static final String PARSER_ERROR_MESSAGE_MISSING_ARG = "PARSER_ERROR_MESSAGE_MISSING_ARG";
-
- // Internal command line error messages.
- public static final String PARSER_ERROR_NO_FLAGS_DATA_SPECIFIED = "PARSER_ERROR_NO_FLAGS_DATA_SPECIFIED";
-
- public static final String PARSER_ERROR_FIRST_FLAG_NOT_POSITIONAL = "PARSER_ERROR_FIRST_FLAG_NOT_POSITIONAL";
-
- public static final String PARSER_ERROR_NULL_FLAG_ROW = "PARSER_ERROR_NULL_FLAG_ROW";
-
- public static final String PARSER_ERROR_INCORRECT_ROW_SIZE = "PARSER_ERROR_INCORRECT_ROW_SIZE";
-
- public static final String PARSER_ERROR_NULL_IN_ROW = "PARSER_ERROR_NULL_IN_ROW";
-
- public static final String PARSER_ERROR_INCORRECT_DUP_STRING = "PARSER_ERROR_INCORRECT_DUP_STRING";
-
- public static final String PARSER_ERROR_INCORRECT_REQUIRED_STRING = "PARSER_ERROR_INCORRECT_REQUIRED_STRING";
-
- public static final String PARSER_ERROR_POSITIONAL_NOT_AT_BEGINNING = "PARSER_ERROR_POSITIONAL_NOT_AT_BEGINNING";
-
- public static final String PARSER_ERROR_HELP_FLAG_NOT_SPECIFIED = "PARSER_ERROR_HELP_FLAG_NOT_SPECIFIED";
-
- public static final String PARSER_ERROR_FLAGS_NOT_ORDERED = "PARSER_ERROR_FLAGS_NOT_ORDERED";
-
- public static final String PARSER_ERROR_FLAG_NOT_LOWERCASE = "PARSER_ERROR_FLAG_NOT_LOWERCASE";
-
- public static final String PARSER_ERROR_REQUIRED_POSITIONAL_NEEDS_NAME = "PARSER_ERROR_REQUIRED_POSITIONAL_NEEDS_NAME";
-
- public static final String PARSER_INFO_SYNTAX = "PARSER_SYNTAX";
-
- public static final String PARSER_FLAGS = "PARSER_FLAGS";
-
- public static final String PARSER_INFO_WHERE = "PARSER_WHERE";
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/commandline/commandline.properties b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/commandline/commandline.properties
deleted file mode 100644
index 7852981..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/commandline/commandline.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-PARSER_ERROR_FLAG_NOT_FOUND=IWAB0123E Flag -{0} is not valid.
-PARSER_ERROR_AMBIGUOUS_FLAG=IWAB0284E Flag -{0} is ambiguous.
-PARSER_ERROR_MISSING_POSITIONAL=IWAB0285E Missing {0} parameter.
-PARSER_ERROR_TOO_MANY_POSITIONALS=IWAB0286E Too many positional parameters specified.
-PARSER_ERROR_MISSING_REQUIRED_FLAG=IWAB0288E Flag -{0} is missing.
-PARSER_ERROR_DUPLICATE_FLAGS_NOT_ALLOWED=IWAB0293E Flag -{0} has been specified more than once.
-PARSER_ERROR_MISSING_FLAG_PARAMETER=IWAB0294E Flag -{0} is missing parameter {1}.
-PARSER_ERROR_MESSAGE_MISSING_ARG=IWAB0319E Error message {0} is missing an argument.
-PARSER_ERROR_NO_FLAGS_DATA_SPECIFIED=IWAB0345E Specify flag information.
-PARSER_ERROR_FIRST_FLAG_NOT_POSITIONAL=IWAB0346E The first flag must be positional.
-PARSER_ERROR_NULL_FLAG_ROW=IWAB0347E Null flag row.
-PARSER_ERROR_INCORRECT_ROW_SIZE=IWAB0348E Flag row must have 5 strings.
-PARSER_ERROR_NULL_IN_ROW=IWAB0349E Flag information contains a null string.
-PARSER_ERROR_INCORRECT_DUP_STRING=IWAB0350E Duplicate string {0} is not valid.
-PARSER_ERROR_INCORRECT_REQUIRED_STRING=IWAB0351E Required string {0} is not valid.
-PARSER_ERROR_POSITIONAL_NOT_AT_BEGINNING=IWAB0352E Positional flag is not at the beginning.
-PARSER_ERROR_HELP_FLAG_NOT_SPECIFIED=IWAB0353E Help flag is not specified in information array.
-PARSER_ERROR_FLAGS_NOT_ORDERED=IWAB0354E Flags are not in lexical order.
-PARSER_ERROR_FLAG_NOT_LOWERCASE=IWAB0355E Flag {0} is not lowercase.
-PARSER_ERROR_REQUIRED_POSITIONAL_NEEDS_NAME=IWAB0356E Required positional parameters must have a name specified.
-PARSER_SYNTAX=Syntax
-PARSER_FLAGS=Flags
-PARSER_WHERE=Where
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/context/ActionDialogPreferenceTypeRegistry.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/context/ActionDialogPreferenceTypeRegistry.java
deleted file mode 100644
index b931ebd..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/context/ActionDialogPreferenceTypeRegistry.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.command.internal.env.context;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.command.internal.env.preferences.ActionDialogPreferenceType;
-
-
-public class ActionDialogPreferenceTypeRegistry
-{
- private Vector preferences_;
-
- private static ActionDialogPreferenceTypeRegistry registry_;
-
- private ActionDialogPreferenceTypeRegistry()
- {
- preferences_ = new Vector();
-
- loadDialogsPreferences();
- }
-
- static public ActionDialogPreferenceTypeRegistry getInstance()
- {
- if( registry_ == null )
- {
- registry_ = new ActionDialogPreferenceTypeRegistry();
- }
-
- return registry_;
- }
-
- //
- private void loadDialogsPreferences ()
- {
- IPluginRegistry reg = Platform.getPluginRegistry();
- IConfigurationElement[] config = reg.getConfigurationElementsFor( "org.eclipse.wst.command.env",
- "actionDialogPreferenceType");
-
- for(int idx=0; idx<config.length; idx++)
- {
- IConfigurationElement elem = config[idx];
- ActionDialogPreferenceType dialog = new ActionDialogPreferenceType();
-
- dialog.setId( elem.getAttribute("id") );
- dialog.setName( elem.getAttribute("name") );
- dialog.setInfopop( elem.getAttribute("infopop") );
- dialog.setTooltip( elem.getAttribute("tooltip") );
- dialog.setCategory( elem.getAttribute("category") );
-
- String showCheckbox = elem.getAttribute( "showcheckbox" );
- String alwaysHide = elem.getAttribute( "alwayshide" );
-
- dialog.setShowCheckbox( showCheckbox == null ? true : showCheckbox.equals( "true" ) );
- dialog.setAlwaysHide( alwaysHide == null ? false : alwaysHide.equals( "true" ) );
-
- preferences_.add(dialog);
- }
- }
-
- /**
- * Returns all registered <code>WebServiceType</code> objects.
- * @return All registered <code>WebServiceType</code> objects.
- */
- public ActionDialogPreferenceType[] getActionDialogsPrefrences ()
- {
- return (ActionDialogPreferenceType[])preferences_.toArray( new ActionDialogPreferenceType[0]);
- }
-
- public ActionDialogPreferenceType getActionDialogsPrefrence( String id )
- {
- int length = preferences_.size();
- ActionDialogPreferenceType result = null;
-
- for( int index = 0; index < length; index++ )
- {
- ActionDialogPreferenceType preference = (ActionDialogPreferenceType)preferences_.elementAt( index );
-
- if( preference.getId().equals( id ) )
- {
- result = preference;
- break;
- }
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/context/PersistentActionDialogsContext.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/context/PersistentActionDialogsContext.java
deleted file mode 100644
index ee94b59..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/context/PersistentActionDialogsContext.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.context;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.command.env.context.PersistentContext;
-import org.eclipse.wst.command.internal.env.preferences.ActionDialogPreferenceType;
-
-
-public class PersistentActionDialogsContext extends PersistentContext
-{
- private ActionDialogPreferenceTypeRegistry registry;
-
- private static PersistentActionDialogsContext instance_ = null;
-
- private PersistentActionDialogsContext()
- {
- super(Platform.getPlugin("org.eclipse.wst.command.env"));
- }
-
- static public PersistentActionDialogsContext getInstance()
- {
- if( instance_ == null )
- {
- instance_ = new PersistentActionDialogsContext();
- instance_.load();
- }
-
- return instance_;
- }
-
- public void load()
- {
- registry = ActionDialogPreferenceTypeRegistry.getInstance();
- ActionDialogPreferenceType[] dialogs = registry.getActionDialogsPrefrences();
-
- for (int i = 0; i < dialogs.length; i++)
- {
- setDefault(dialogs[i].getId(), false);
- }
- }
-
- public ActionDialogPreferenceType[] getDialogs()
- {
- return registry.getActionDialogsPrefrences();
- }
-
- public void setActionDialogEnabled(String id, boolean value)
- {
- setValue(id, value);
- }
-
- public boolean isActionDialogEnabled(String id)
- {
- if (id == null) return true;
- return getValueAsBoolean(id);
- }
-
- public boolean showDialog( String id )
- {
- ActionDialogPreferenceType dialog = registry.getActionDialogsPrefrence( id );
-
- return (dialog.getShowCheckbox() && !dialog.getAlwaysHide() && !isActionDialogEnabled( id )) ||
- !dialog.getShowCheckbox() && !dialog.getAlwaysHide();
- }
-
- public boolean showCheckbox( String id )
- {
- ActionDialogPreferenceType dialog = registry.getActionDialogsPrefrence( id );
-
- return dialog == null ? false : dialog.getShowCheckbox();
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/context/PersistentResourceContext.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/context/PersistentResourceContext.java
deleted file mode 100644
index 7400eec..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/context/PersistentResourceContext.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.context;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.command.env.context.PersistentContext;
-import org.eclipse.wst.command.env.core.context.ResourceContext;
-import org.eclipse.wst.command.env.core.context.ResourceDefaults;
-import org.eclipse.wst.command.env.core.context.TransientResourceContext;
-
-
-public class PersistentResourceContext extends PersistentContext implements ResourceContext
-{
- private static PersistentResourceContext context_ = null;
-
- public static PersistentResourceContext getInstance()
- {
- if( context_ == null )
- {
- context_ = new PersistentResourceContext();
- context_.load();
- }
-
- return context_;
- }
-
- private PersistentResourceContext()
- {
- super(Platform.getPlugin( "org.eclipse.wst.command.env"));
- }
-
- public void load()
- {
- setDefault(PREFERENCE_OVERWRITE, ResourceDefaults
- .getOverwriteFilesDefault());
- setDefault(PREFERENCE_CREATE_FOLDERS, ResourceDefaults
- .getCreateFoldersDefault());
- setDefault(PREFERENCE_CHECKOUT, ResourceDefaults.getCheckoutFilesDefault());
- }
-
- public void setOverwriteFilesEnabled(boolean enable)
- {
- setValue(PREFERENCE_OVERWRITE, enable);
- }
-
- public boolean isOverwriteFilesEnabled()
- {
- return getValueAsBoolean(PREFERENCE_OVERWRITE);
- }
-
- public void setCreateFoldersEnabled(boolean enable)
- {
- setValue(PREFERENCE_CREATE_FOLDERS, enable);
- }
-
- public boolean isCreateFoldersEnabled()
- {
- return getValueAsBoolean(PREFERENCE_CREATE_FOLDERS);
- }
-
- public void setCheckoutFilesEnabled(boolean enable)
- {
- setValue(PREFERENCE_CHECKOUT, enable);
- }
-
- public boolean isCheckoutFilesEnabled()
- {
- return getValueAsBoolean(PREFERENCE_CHECKOUT);
- }
-
- public ResourceContext copy()
- {
- ResourceContext cc = new TransientResourceContext();
- cc.setOverwriteFilesEnabled(isOverwriteFilesEnabled());
- cc.setCreateFoldersEnabled(isCreateFoldersEnabled());
- cc.setCheckoutFilesEnabled(isCheckoutFilesEnabled());
- return cc;
- }
-}
diff --git a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/preferences/ActionDialogPreferenceType.java b/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/preferences/ActionDialogPreferenceType.java
deleted file mode 100644
index 2a7b6b9..0000000
--- a/bundles/org.eclipse.wst.command.env/src/org/eclipse/wst/command/internal/env/preferences/ActionDialogPreferenceType.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.command.internal.env.preferences;
-
-/**
- * This class is used to define preference ids. It corresponds to information
- * specified by a actionDialogPreferenceType extension point.
- * Each actionDialogPreferenceType entry will result in an entry in the
- * action dialogs preference page if the showcheckbox field is true.
- *
- * Here is an example of this extension point.
- *
- * <extension
- * point="org.eclipse.wst.command.env.actionDialogPreferenceType">
- * <actionDialogPreferenceType
- * showcheckbox="true"
- * name="%CHECKBOX_SHOW_GENERATE_JAVA_PROXY_DIALOG"
- * category="org.eclipse.jst.wss.popup.category"
- * tooltip="%TOOLTIP_PPAD_CHECKBOX_WSDL2PROXY"
- * infopop="org.eclipse.jst.ws.consumption.ui.PPAD0004"
- * alwayshide="false"
- * id="org.eclipse.jst.ws.consumption.ui.wizard.client.clientwizard">
- * </actionDialogPreferenceType>
- *
- * This actionDialogPreferenceType extension point is associated with an ObjectContribution
- * extension point. For example:
- *
- * <objectContribution
- * objectClass="org.eclipse.core.resources.IFile"
- * nameFilter="*.wsdl"
- * id="org.eclipse.jst.ws.consumption.ui.wizard.client.clientwizard">
- * <!-- WSDL To Java Bean Proxy -->
- * <action
- * label="%ACTION_GENERATE_JAVA_PROXY"
- * class="org.eclipse.wst.command.env.ui.widgets.popup.DynamicPopupWizard"
- * menubarPath="org.eclipse.jst.ws.atk.ui.webservice.category.popupMenu/popupActions"
- * id="org.eclipse.jst.ws.consumption.ui.wizard.client.clientwizard">
- * </action>
- * </objectContribution>
- *
- * The ObjectContribution entry is linked with the actionDialogPreferenceType entry
- * via the id attribute of the ObjectContirbution and the id attribute of actionDialogPreferenceType.
- * Note: the id in the action entry is always associated with the dynamic wizard that
- * should be popuped up. In the example above the ObjectionContribution id and the
- * action ids are the same, but this need not be the case.
- */
-public class ActionDialogPreferenceType
-{
- private String id_;
- private String name_;
- private String infopop_;
- private String tooltip_;
- private boolean showCheckbox_;
- private boolean alwaysHide_;
- private String category_;
-
- /**
- * Sets the id for this popup action. This id link the actionDialogPreference
- * with an ObjectContribution.
- * @param id the id.
- */
- public void setId(String id)
- {
- id_ = id;
- }
-
- /**
- * Gets the id for this popup action.
- * @return the id.
- */
- public String getId()
- {
- return id_;
- }
-
- /**
- * Sets the name for this popup action. This name is displayed on the
- * dialog preferences page and must be translated.
- * @param name the name of the popup check box.
- */
- public void setName(String name)
- {
- name_ = name;
- }
-
- /**
- * Gets the display value for this popup check box.
- * Note: this value may be null if the getShowCheckBox method returns false.
- * @return the name.
- */
- public String getName()
- {
- return name_;
- }
-
- /**
- * Sets the info pop value for this popup check box.
- * @param infopop
- */
- public void setInfopop(String infopop)
- {
- infopop_ = infopop;
- }
-
- /**
- * Gets the info pop value for this popup check box.
- * Note: this value may be null if the getShowCheckBox method returns false.
- *
- * @return the infopop value.
- */
- public String getInfopop()
- {
- return infopop_;
- }
-
- /**
- * Sets the tooltip value for this popup check box.
- * @param tooltip
- */
- public void setTooltip(String tooltip)
- {
- tooltip_ = tooltip;
- }
-
- /**
- * Gets the tooltip value for this popup check box.
- * Note: this value may be null if the getShowCheckBox method returns false.
- *
- * @return the tooltip value.
- */
- public String getTooltip()
- {
- return tooltip_;
- }
-
- /**
- * Sets the show check box value for this popup. If the value is true then
- * this popup will appear on an action dialogs preference page. Also if this
- * value is true and the always hide value is false then a check box will be displayed
- * on the first page of this popup which asks the user if they want the popup
- * to be displayed the next time are to just execute the popup action.
- * @param value the show check box value.
- */
- public void setShowCheckbox( boolean value )
- {
- showCheckbox_ = value;
- }
-
- /**
- * Gets the show check box value.
- * @return the show check box value.
- */
- public boolean getShowCheckbox()
- {
- return showCheckbox_;
- }
-
- /**
- * Sets the always hide value. This value specifies that the popup should always
- * be executed without bringing up the popup wizard.
- * @param value the always hide value.
- */
- public void setAlwaysHide( boolean value )
- {
- alwaysHide_ = value;
- }
-
- /**
- *
- * @return returns the always hide value.
- */
- public boolean getAlwaysHide()
- {
- return alwaysHide_;
- }
-
- /**
- * Sets the category id for popup action. All popup actions with the same
- * category id will be grouped together on the same popup action preference page.
- * @param value the category.
- */
- public void setCategory( String value )
- {
- category_ = value;
- }
-
- /**
- *
- * @return the category id.
- */
- public String getCategory()
- {
- return category_;
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/.classpath b/bundles/org.eclipse.wst.ws.parser/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/bundles/org.eclipse.wst.ws.parser/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.ws.parser/.cvsignore b/bundles/org.eclipse.wst.ws.parser/.cvsignore
deleted file mode 100644
index 06824de..0000000
--- a/bundles/org.eclipse.wst.ws.parser/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-.cdtproject
-build.xml
diff --git a/bundles/org.eclipse.wst.ws.parser/.project b/bundles/org.eclipse.wst.ws.parser/.project
deleted file mode 100644
index feb6640..0000000
--- a/bundles/org.eclipse.wst.ws.parser/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.ws.parser</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.ws.parser/build.properties b/bundles/org.eclipse.wst.ws.parser/build.properties
deleted file mode 100644
index 5e76599..0000000
--- a/bundles/org.eclipse.wst.ws.parser/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = plugin.xml,\
- parser.jar
-source.parser.jar = src/
-output.parser.jar = bin/
-src.includes = plugin.xml,\
- src/,\
- build.properties
diff --git a/bundles/org.eclipse.wst.ws.parser/plugin.properties b/bundles/org.eclipse.wst.ws.parser/plugin.properties
deleted file mode 100644
index 395ac6e..0000000
--- a/bundles/org.eclipse.wst.ws.parser/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2001,2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-PLUGIN_NAME=Web Services Description Parser
-PLUGIN_PROVIDER=Eclipse.org
diff --git a/bundles/org.eclipse.wst.ws.parser/plugin.xml b/bundles/org.eclipse.wst.ws.parser/plugin.xml
deleted file mode 100644
index bc06189..0000000
--- a/bundles/org.eclipse.wst.ws.parser/plugin.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin
- id="org.eclipse.wst.ws.parser"
- version="1.0.0"
- name="%PLUGIN_NAME"
- provider-name="%PLUGIN_PROVIDER"
- class="org.eclipse.wst.ws.parser.ParserPlugin">
-
- <runtime>
- <library name="parser.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.wst.ws.apache.wsil"/>
- <import plugin="org.eclipse.wst.ws.uddi4j"/>
- <import plugin="org.eclipse.wst.wsdl"/>
- <import plugin="org.eclipse.wst.ws.apache.soap"/>
- <import plugin="org.eclipse.core.runtime"/>
- </requires>
-
-</plugin>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/ParserPlugin.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/ParserPlugin.java
deleted file mode 100644
index 4a39b5f..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/ParserPlugin.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser;
-
-import org.eclipse.core.runtime.*;
-
-import java.util.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class ParserPlugin extends Plugin {
- //The shared instance.
- private static ParserPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public ParserPlugin() {
- super();
- plugin = this;
- try {
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.ws.parser.ParserPluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
-
- /**
- * Returns the shared instance.
- */
- public static ParserPlugin 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 = ParserPlugin.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;
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/disco/DISCOContractReference.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/disco/DISCOContractReference.java
deleted file mode 100644
index 2e4b713..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/disco/DISCOContractReference.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.disco;
-
-public class DISCOContractReference extends DISCOReference
-{
- private String docRef_;
-
- public DISCOContractReference(String ref,String docRef)
- {
- super(ref);
- docRef_ = docRef;
- }
-
- public String getDocRef()
- {
- return docRef_;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/disco/DISCOParser.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/disco/DISCOParser.java
deleted file mode 100644
index f5f3cb0..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/disco/DISCOParser.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.disco;
-
-import java.util.Vector;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-
-/**
- * See http://msdn.microsoft.com/msdnmag/issues/02/02/xml/default.aspx for more
- * details on DISCO.
- */
-public class DISCOParser
-{
- private DocumentBuilder parser_;
- private final String NS_DISCO = "http://schemas.xmlsoap.org/disco/";
- private final String DISCOVERY = "discovery";
- private final String DISCOVERY_REF = "discoveryRef";
- private final String NS_CONTRACT_REF = "http://schemas.xmlsoap.org/disco/scl/";
- private final String CONTRACT_REF = "contractRef";
- private final String REF = "ref";
- private final String DOC_REF = "docRef";
-
- public DISCOParser()
- {
- try
- {
- DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
- docBuilderFactory.setNamespaceAware(true);
- parser_ = docBuilderFactory.newDocumentBuilder();
- }
- catch (ParserConfigurationException pce)
- {
- parser_ = null;
- }
- }
-
- public DISCOReference[] parse(String discoURI, InputSource source) throws Exception
- {
- if (parser_ != null)
- {
- Document doc = parser_.parse(source);
- Element rootElement = doc.getDocumentElement();
- // Root element must by <disco:discovery
- // xmlns:disco="http://schemas.xmlsoap.org/disco/">
- if (rootElement != null && rootElement.getNamespaceURI().equals(NS_DISCO) && rootElement.getLocalName().equals(DISCOVERY))
- {
- NodeList childNodes = rootElement.getChildNodes();
- Vector discoReferences = new Vector();
- for (int i = 0; i < childNodes.getLength(); i++)
- {
- Node childNode = childNodes.item(i);
- if (childNode instanceof Element)
- {
- Element element = (Element)childNode;
- String localName = element.getLocalName();
- String nsURI = element.getNamespaceURI();
- if (nsURI.equals(NS_DISCO) && localName.equals(DISCOVERY_REF))
- {
- // DISCO link.
- String ref = convertToAbsoluteURI(discoURI, element.getAttribute(REF));
- discoReferences.addElement(new DISCOReference(ref));
- }
- else if (nsURI.equals(NS_CONTRACT_REF) && localName.equals(CONTRACT_REF))
- {
- // WSDL link.
- String ref = convertToAbsoluteURI(discoURI, element.getAttribute(REF));
- String docRef = convertToAbsoluteURI(discoURI, element.getAttribute(DOC_REF));
- discoReferences.addElement(new DISCOContractReference(ref, docRef));
- }
- }
- }
- int numberOfDISCOReferences = discoReferences.size();
- if (numberOfDISCOReferences > 0)
- {
- DISCOReference[] references = new DISCOReference[numberOfDISCOReferences];
- discoReferences.copyInto(references);
- return references;
- }
- }
- else
- {
- // The document is not a valid DISCO document.
- throw new Exception();
- }
- }
- return null;
- }
-
- private String convertToAbsoluteURI(String discoURI, String refURI)
- {
- if (refURI != null)
- {
- if (refURI.indexOf("://") > -1)
- {
- // refURI is already absolute.
- return refURI;
- }
- else
- {
- StringBuffer absoluteURI = new StringBuffer(discoURI.substring(0, Math.max(discoURI.lastIndexOf('\\'), discoURI.lastIndexOf('/') + 1)));
- absoluteURI.append(refURI);
- return absoluteURI.toString();
- }
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/disco/DISCOReference.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/disco/DISCOReference.java
deleted file mode 100644
index 3c13bba..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/disco/DISCOReference.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.disco;
-
-public class DISCOReference
-{
- private String ref_;
-
- public DISCOReference(String ref)
- {
- ref_ = ref;
- }
-
- public String getRef()
- {
- return ref_;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/discovery/NetUtils.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/discovery/NetUtils.java
deleted file mode 100644
index 5d9e5a8..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/discovery/NetUtils.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.discovery;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-
-
-import org.apache.soap.transport.http.SOAPHTTPConnection;
-
-import sun.misc.BASE64Encoder;
-
-public final class NetUtils
-{
-
- /**
- * Get the java.net.URLConnection given a string representing the URL. This class ensures
- * that proxy settings in WSAD are respected.
- * @param urlString String representing the URL.
- * @return java.net.URLCDonnection URLConnection to the URL.
- */
- public static final URLConnection getURLConnection(String urlString)
- {
- try
- {
- URL url = createURL(urlString);
- URLConnection uc = url.openConnection();
- String proxyUserName = System.getProperty("http.proxyUserName");
- String proxyPassword = System.getProperty("http.proxyPassword");
- if (proxyUserName != null && proxyPassword != null)
- {
- StringBuffer userNamePassword = new StringBuffer(proxyUserName);
- userNamePassword.append(':').append(proxyPassword);
- BASE64Encoder encoder = new BASE64Encoder();
- String encoding = encoder.encode(userNamePassword.toString().getBytes());
- userNamePassword.setLength(0);
- userNamePassword.append("Basic ").append(encoding);
- uc.setRequestProperty("Proxy-authorization",userNamePassword.toString());
- }
- return uc;
- }
- catch (MalformedURLException e)
- {
- }
- catch (IOException e)
- {
- }
- return null;
- }
-
- /**
- * Get the java.io.InputStream for a URL given a string representing the URL. This class
- * ensures that proxy settings in WSAD are respected.
- * @param urlString String representing the URL.
- * @return java.io.InputStream InputStream for reading the URL stream.
- */
- public static final InputStream getURLInputStream(String urlString)
- {
- try
- {
- URLConnection uc = getURLConnection(urlString);
- if (uc != null)
- {
- InputStream is = uc.getInputStream();
- return is;
- }
- }
- catch (IOException e)
- {
- }
- return null;
- }
-
- /**
- * Create a org.apache.soap.transport.http.SOAPHTTPConnection that accounts for WSAD proxy
- * information.
- * @return SOAPHTTPConnection org.apache.soap.transport.http.SOAPHTTPConnection
- */
- public static final SOAPHTTPConnection createSOAPHTTPConnection()
- {
- SOAPHTTPConnection soapHttpConnection = new SOAPHTTPConnection();
- String proxyHost = System.getProperty("http.proxyHost");
- String proxyPort = System.getProperty("http.proxyPort");
- String proxyUserName = System.getProperty("http.proxyUserName");
- String proxyPassword = System.getProperty("http.proxyPassword");
- if (proxyHost != null && proxyPort != null)
- {
- soapHttpConnection.setProxyHost(proxyHost);
- soapHttpConnection.setProxyPort(Integer.parseInt(proxyPort));
- }
- if (proxyUserName != null)
- soapHttpConnection.setProxyUserName(proxyUserName);
- if (proxyPassword != null)
- soapHttpConnection.setProxyPassword(proxyPassword);
- return soapHttpConnection;
- }
-
- /**
- * Create a URL from a string.
- * @param urlString String representing the URL.
- * @return URL java.lang.URL representation of the URL.
- * @throws MalformedURLException
- */
- public static final URL createURL(String urlString) throws MalformedURLException
- {
- return new URL(urlString);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/discovery/WebServicesParserExt.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/discovery/WebServicesParserExt.java
deleted file mode 100644
index 37a972e..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/discovery/WebServicesParserExt.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.discovery;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import org.eclipse.wst.ws.parser.wsil.WebServicesParser;
-
-public class WebServicesParserExt extends WebServicesParser {
-
- public WebServicesParserExt() {
- super();
- }
-
- public WebServicesParserExt(String uri) {
- super(uri);
- }
-
- protected URL createURL(String url) throws MalformedURLException {
- return NetUtils.createURL(url);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesConstants.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesConstants.java
deleted file mode 100644
index bcb5a55..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesConstants.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-public class FavoritesConstants
-{
- // Namespace
- public static final String NAMESPACE_WSDL = "http://schemas.xmlsoap.org/wsdl/";
- public static final String NAMESPACE_UDDI_V1 = "urn:uddi-org:api";
- public static final String NAMESPACE_UDDI_V2 = "urn:uddi-org:api_v2";
- public static final String NAMESPACE_UDDI_BINDING = "http://schemas.xmlsoap.org/ws/2001/10/inspection/uddi/";
- public static final String NAMESPACE_WSIL_INSPECTION = "http://schemas.xmlsoap.org/ws/2001/10/inspection/";
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesLink.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesLink.java
deleted file mode 100644
index 128f10d..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesLink.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-import org.apache.wsil.Link;
-
-public class FavoritesLink
-{
- protected Link link_;
-
- public FavoritesLink()
- {
- link_ = null;
- }
-
- public Link getLink()
- {
- return link_;
- }
-
- public void setLink(Link link)
- {
- link_ = link;
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesRegistryTypeAbstract.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesRegistryTypeAbstract.java
deleted file mode 100644
index 7f9268c..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesRegistryTypeAbstract.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.Vector;
-
-import org.apache.wsil.Abstract;
-import org.apache.wsil.Description;
-import org.apache.wsil.Inspection;
-import org.apache.wsil.Link;
-import org.apache.wsil.Service;
-import org.apache.wsil.ServiceName;
-import org.apache.wsil.WSILDocument;
-import org.apache.wsil.WSILException;
-import org.apache.wsil.extension.uddi.BusinessDescription;
-import org.apache.wsil.extension.uddi.ServiceDescription;
-import org.apache.wsil.impl.AbstractImpl;
-import org.apache.wsil.impl.DescriptionImpl;
-import org.apache.wsil.impl.LinkImpl;
-import org.apache.wsil.impl.ServiceImpl;
-import org.apache.wsil.impl.ServiceNameImpl;
-import org.apache.wsil.impl.extension.uddi.BusinessDescriptionImpl;
-import org.apache.wsil.impl.extension.uddi.ServiceDescriptionImpl;
-import org.uddi4j.util.BusinessKey;
-import org.uddi4j.util.ServiceKey;
-
-public abstract class FavoritesRegistryTypeAbstract implements IFavoritesRegistryType
-{
- public FavoritesRegistryTypeAbstract()
- {
- }
-
- public abstract String getReadLocation();
- public abstract String getWriteLocation();
- protected abstract WSILDocument getWSILDocument();
-
- public void init()
- {
- getWSILDocument();
- }
-
- protected WSILDocument loadWSILDocument(String path, boolean force)
- {
- try
- {
- WSILDocument wsilDoc = WSILDocument.newInstance();
- wsilDoc.read(new FileReader(new File(path)));
- return wsilDoc;
- }
- catch (Throwable t)
- {
- if (force)
- {
- try
- {
- return WSILDocument.newInstance();
- }
- catch (Throwable t2)
- {
- return null;
- }
- }
- else
- return null;
- }
- }
-
- public String getFavoritesVersion()
- {
- WSILDocument wsilDoc = getWSILDocument();
- Inspection inspection = wsilDoc.getInspection();
- Abstract[] abstracts = inspection.getAbstracts();
- if (abstracts.length > 0)
- return abstracts[0].getText();
- else
- return null;
- }
-
- public void setFavoritesVersion(String version)
- {
- WSILDocument wsilDoc = getWSILDocument();
- Inspection inspection = wsilDoc.getInspection();
- Abstract abst = new AbstractImpl();
- abst.setText(version);
- inspection.removeAbstracts();
- inspection.addAbstract(abst);
- }
-
- public synchronized void save() throws WSILException, IOException
- {
- WSILDocument wsilDoc = getWSILDocument();
- if (wsilDoc != null)
- wsilDoc.write(getWriteLocation());
- }
-
- public IFavoritesUDDIRegistry[] getFavoritesUDDIRegistries()
- {
- Link[] links = loadUDDIRegistries();
- FavoritesUDDIRegistry[] registries = new FavoritesUDDIRegistry[links.length];
- for (int i = 0; i < links.length; i++)
- {
- registries[i] = new FavoritesUDDIRegistry();
- registries[i].setLink(links[i]);
- }
- return registries;
- }
-
- public IFavoritesUDDIBusiness[] getFavoritesUDDIBusinesses()
- {
- Link[] links = loadUDDIBusinesses();
- FavoritesUDDIBusiness[] businesses = new FavoritesUDDIBusiness[links.length];
- for (int i = 0; i < links.length; i++)
- {
- businesses[i] = new FavoritesUDDIBusiness();
- businesses[i].setLink(links[i]);
- }
- return businesses;
- }
-
- public IFavoritesUDDIService[] getFavoritesUDDIServices()
- {
- Service[] services = loadUDDIServices();
- FavoritesUDDIService[] uddiServices = new FavoritesUDDIService[services.length];
- for (int i = 0; i < services.length; i++)
- {
- uddiServices[i] = new FavoritesUDDIService();
- uddiServices[i].setService(services[i]);
- }
- return uddiServices;
- }
-
- public IFavoritesUDDIServiceInterface[] getFavoritesUDDIServiceInterfaces()
- {
- Service[] services = loadUDDIServiceInterfaces();
- FavoritesUDDIServiceInterface[] serInts = new FavoritesUDDIServiceInterface[services.length];
- for (int i = 0; i < services.length; i++)
- {
- serInts[i] = new FavoritesUDDIServiceInterface();
- serInts[i].setService(services[i]);
- }
- return serInts;
- }
-
- public IFavoritesWSDL[] getFavoritesWSDLs()
- {
- Service[] services = loadWSDLServices();
- FavoritesWSDL[] wsdls = new FavoritesWSDL[services.length];
- for (int i = 0; i < services.length; i++)
- {
- wsdls[i] = new FavoritesWSDL();
- wsdls[i].setService(services[i]);
- }
- return wsdls;
- }
-
- public IFavoritesWSIL[] getFavoritesWSILs()
- {
- Link[] links = loadWSILs();
- FavoritesWSIL[] wsils = new FavoritesWSIL[links.length];
- for (int i = 0; i < links.length; i++)
- {
- wsils[i] = new FavoritesWSIL();
- wsils[i].setLink(links[i]);
- }
- return wsils;
- }
-
- public Link[] loadUDDIRegistries() {
- return loadLinksByNamespace(FavoritesConstants.NAMESPACE_UDDI_V1);
- }
-
- public Link[] loadUDDIBusinesses() {
- return loadLinksByNamespace(FavoritesConstants.NAMESPACE_UDDI_V2);
- }
-
- public Service[] loadUDDIServices() {
- return loadServicesByNamespace(FavoritesConstants.NAMESPACE_UDDI_V2);
- }
-
- public Service[] loadUDDIServiceInterfaces() {
- return loadServicesByNamespace(FavoritesConstants.NAMESPACE_UDDI_V1);
- }
-
- public Service[] loadWSDLServices() {
- return loadServicesByNamespace(FavoritesConstants.NAMESPACE_WSDL);
- }
-
- public Link[] loadWSILs() {
- return loadLinksByNamespace(FavoritesConstants.NAMESPACE_WSIL_INSPECTION);
- }
-
- private Service[] loadServicesByNamespace(String namespace) {
- Vector serviceVector = new Vector();
- WSILDocument wsilDoc = getWSILDocument();
- if (wsilDoc != null)
- {
- Inspection inspection = wsilDoc.getInspection();
- Service[] services = inspection.getServices();
- for (int i = 0; i < services.length; i++)
- {
- Description[] desc = services[i].getDescriptions();
- if (desc[0].getReferencedNamespace().equals(namespace))
- serviceVector.add(services[i]);
- }
- }
- Service[] services = new Service[serviceVector.size()];
- serviceVector.copyInto(services);
- return services;
- }
-
- private Link[] loadLinksByNamespace(String namespace) {
- Vector linkVector = new Vector();
- WSILDocument wsilDoc = getWSILDocument();
- if (wsilDoc != null)
- {
- Inspection inspection = wsilDoc.getInspection();
- Link[] links = inspection.getLinks();
- for (int i = 0; i < links.length; i++)
- {
- if (links[i].getReferencedNamespace().equals(namespace))
- linkVector.add(links[i]);
- }
- }
- Link[] links = new Link[linkVector.size()];
- linkVector.copyInto(links);
- return links;
- }
-
- public void addFavoritesUDDIRegistry(IFavoritesUDDIRegistry registry)
- {
- addUDDIRegistry(registry.getName(), registry.getInquiryURL(), registry.getPublishURL(), registry.getRegistrationURL());
- }
-
- public void addFavoritesUDDIBusiness(IFavoritesUDDIBusiness business)
- {
- addUDDIBusiness(business.getName(), business.getInquiryURL(), business.getBusinessKey());
- }
-
- public void addFavoritesUDDIService(IFavoritesUDDIService service)
- {
- addUDDIService(service.getName(), service.getInquiryURL(), service.getServiceKey());
- }
-
- public void addFavoritesUDDIServiceInterface(IFavoritesUDDIServiceInterface serviceInterface)
- {
- addUDDIServiceInterface(serviceInterface.getName(), serviceInterface.getInquiryURL(), serviceInterface.getServiceInterfaceKey());
- }
-
- public void addFavoritesWSDL(IFavoritesWSDL wsdl)
- {
- addWSDLService(wsdl.getWsdlUrl());
- }
-
- public void addFavoritesWSIL(IFavoritesWSIL wsil)
- {
- addWSILLink(wsil.getWsilUrl());
- }
-
- public Link addUDDIRegistry(String registryName, String inquiryAPI, String publishAPI, String registrationURL) {
- WSILDocument wsilDoc = getWSILDocument();
- Inspection inspection = wsilDoc.getInspection();
- Link link = new LinkImpl();
- // registry name
- Abstract abst = new AbstractImpl();
- abst.setText(registryName);
- link.addAbstract(abst);
- // inquiry URL
- Abstract abst2 = new AbstractImpl();
- abst2.setText(inquiryAPI);
- link.addAbstract(abst2);
- // publish URL
- Abstract abst3 = new AbstractImpl();
- if (publishAPI != null)
- abst3.setText(publishAPI);
- else
- abst3.setText("");
- link.addAbstract(abst3);
- // registration URL
- Abstract abst4 = new AbstractImpl();
- if (registrationURL != null)
- abst4.setText(registrationURL);
- else
- abst4.setText("");
- link.addAbstract(abst4);
- // add namespace
- link.setReferencedNamespace(FavoritesConstants.NAMESPACE_UDDI_V1);
- inspection.addLink(link);
- return link;
- }
-
- public Link addUDDIBusiness(String businessName, String inquiryAPI, String businessKey) {
- WSILDocument wsilDoc = getWSILDocument();
- Inspection inspection = wsilDoc.getInspection();
- Link link = new LinkImpl();
- Abstract abst = new AbstractImpl();
- abst.setText(businessName);
- link.addAbstract(abst);
- link.setReferencedNamespace(FavoritesConstants.NAMESPACE_UDDI_V2);
- BusinessDescription bd = new BusinessDescriptionImpl();
- bd.setLocation(inquiryAPI);
- BusinessKey key = new BusinessKey(businessKey);
- bd.setBusinessKey(key);
- link.setExtensionElement(bd);
- inspection.addLink(link);
- return link;
- }
-
- public Service addUDDIService(String serviceName, String inquiryAPI, String serviceKey) {
- WSILDocument wsilDoc = getWSILDocument();
- Inspection inspection = wsilDoc.getInspection();
- Service service = new ServiceImpl();
- ServiceName name = new ServiceNameImpl();
- name.setText(serviceName);
- service.addServiceName(name);
- Description desc = new DescriptionImpl();
- desc.setReferencedNamespace(FavoritesConstants.NAMESPACE_UDDI_V2);
- ServiceDescription sd = new ServiceDescriptionImpl();
- sd.setLocation(inquiryAPI);
- ServiceKey key = new ServiceKey(serviceKey);
- sd.setServiceKey(key);
- desc.setExtensionElement(sd);
- service.addDescription(desc);
- inspection.addService(service);
- return service;
- }
-
- public Service addUDDIServiceInterface(String serIntName, String inquiryAPI, String serIntKey) {
- WSILDocument wsilDoc = getWSILDocument();
- Inspection inspection = wsilDoc.getInspection();
- Service service = new ServiceImpl();
- ServiceName name = new ServiceNameImpl();
- name.setText(serIntName);
- service.addServiceName(name);
- Description desc = new DescriptionImpl();
- desc.setReferencedNamespace(FavoritesConstants.NAMESPACE_UDDI_V1);
- ServiceDescription sd = new ServiceDescriptionImpl();
- sd.setLocation(inquiryAPI);
- ServiceKey key = new ServiceKey(serIntKey);
- sd.setServiceKey(key);
- desc.setExtensionElement(sd);
- service.addDescription(desc);
- inspection.addService(service);
- return service;
- }
-
- public Service addWSDLService(String url) {
- WSILDocument wsilDoc = getWSILDocument();
- Inspection inspection = wsilDoc.getInspection();
- Service service = new ServiceImpl();
- Description desc = new DescriptionImpl();
- desc.setLocation(url);
- desc.setReferencedNamespace(FavoritesConstants.NAMESPACE_WSDL);
- service.addDescription(desc);
- inspection.addService(service);
- return service;
- }
-
- public Link addWSILLink(String url) {
- WSILDocument wsilDoc = getWSILDocument();
- Inspection inspection = wsilDoc.getInspection();
- Link link = new LinkImpl();
- link.setLocation(url);
- link.setReferencedNamespace(FavoritesConstants.NAMESPACE_WSIL_INSPECTION);
- inspection.addLink(link);
- return link;
- }
-
- public void removeFavoritesUDDIRegistry(IFavoritesUDDIRegistry registry)
- {
- if (registry instanceof FavoritesUDDIRegistry)
- removeLink(((FavoritesUDDIRegistry)registry).getLink());
- }
-
- public void removeFavoritesUDDIBusiness(IFavoritesUDDIBusiness business)
- {
- if (business instanceof FavoritesUDDIBusiness)
- removeLink(((FavoritesUDDIBusiness)business).getLink());
- }
-
- public void removeFavoritesUDDIService(IFavoritesUDDIService service)
- {
- if (service instanceof FavoritesUDDIService)
- removeService(((FavoritesUDDIService)service).getService());
- }
-
- public void removeFavoritesUDDIServiceInterface(IFavoritesUDDIServiceInterface serviceInterface)
- {
- if (serviceInterface instanceof FavoritesUDDIServiceInterface)
- removeService(((FavoritesUDDIServiceInterface)serviceInterface).getService());
- }
-
- public void removeFavoritesWSDL(IFavoritesWSDL wsdl)
- {
- if (wsdl instanceof FavoritesWSDL)
- removeService(((FavoritesWSDL)wsdl).getService());
- }
-
- public void removeFavoritesWSIL(IFavoritesWSIL wsil)
- {
- if (wsil instanceof FavoritesWSIL)
- removeLink(((FavoritesWSIL)wsil).getLink());
- }
-
- public void removeService(Service service)
- {
- WSILDocument wsilDoc = getWSILDocument();
- Inspection inspection = wsilDoc.getInspection();
- inspection.removeService(service);
- }
-
- public void removeLink(Link link)
- {
- WSILDocument wsilDoc = getWSILDocument();
- Inspection inspection = wsilDoc.getInspection();
- inspection.removeLink(link);
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesService.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesService.java
deleted file mode 100644
index 63a246b..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-import org.apache.wsil.Service;
-
-public class FavoritesService
-{
- protected Service service_;
-
- public FavoritesService()
- {
- service_ = null;
- }
-
- public Service getService()
- {
- return service_;
- }
-
- public void setService(Service service)
- {
- service_ = service;
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIBusiness.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIBusiness.java
deleted file mode 100644
index 5df8175..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIBusiness.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-import org.apache.wsil.extension.uddi.BusinessDescription;
-
-public class FavoritesUDDIBusiness extends FavoritesLink implements IFavoritesUDDIBusiness
-{
- public FavoritesUDDIBusiness()
- {
- super();
- }
-
- public String getName()
- {
- return (link_.getAbstracts())[0].getText();
- }
-
- public String getInquiryURL()
- {
- return ((BusinessDescription)link_.getExtensionElement()).getLocation();
- }
-
- public String getBusinessKey()
- {
- return ((BusinessDescription)link_.getExtensionElement()).getBusinessKey().getText();
- }
-
- public void setName(String name)
- {
- }
-
- public void setInquiryURL(String inquiryURL)
- {
- }
-
- public void setBusinessKey(String key)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIRegistry.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIRegistry.java
deleted file mode 100644
index 459a33e..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIRegistry.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-import org.apache.wsil.Abstract;
-
-public class FavoritesUDDIRegistry extends FavoritesLink implements IFavoritesUDDIRegistry
-{
- public FavoritesUDDIRegistry()
- {
- super();
- }
-
- public String getName()
- {
- return (link_.getAbstracts())[0].getText();
- }
-
- public String getInquiryURL()
- {
- return (link_.getAbstracts())[1].getText();
- }
-
- public String getPublishURL()
- {
- Abstract[] abstracts = link_.getAbstracts();
- if (abstracts.length > 2)
- {
- String publishURL = abstracts[2].getText();
- if (publishURL != null && publishURL.length() > 0)
- return publishURL;
- }
- return null;
- }
-
- public String getRegistrationURL()
- {
- Abstract[] abstracts = link_.getAbstracts();
- if (abstracts.length > 3)
- {
- String registrationURL = abstracts[3].getText();
- if (registrationURL != null && registrationURL.length() > 0)
- return registrationURL;
- }
- return null;
- }
-
- public void setName(String name)
- {
- (link_.getAbstracts())[0].setText(name);
- }
-
- public void setInquiryURL(String inquiryURL)
- {
- (link_.getAbstracts())[1].setText(inquiryURL);
- }
-
- public void setPublishURL(String publishURL)
- {
- Abstract[] abstracts = link_.getAbstracts();
- if (abstracts.length > 2)
- abstracts[2].setText(publishURL);
- }
-
- public void setRegistrationURL(String registrationURL)
- {
- Abstract[] abstracts = link_.getAbstracts();
- if (abstracts.length > 3)
- abstracts[3].setText(registrationURL);
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIService.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIService.java
deleted file mode 100644
index 9aae28b..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIService.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-import org.apache.wsil.extension.uddi.ServiceDescription;
-
-public class FavoritesUDDIService extends FavoritesService implements IFavoritesUDDIService
-{
- public FavoritesUDDIService()
- {
- super();
- }
-
- public String getName()
- {
- return (service_.getServiceNames())[0].getText();
- }
-
- public String getInquiryURL()
- {
- ServiceDescription sd = (ServiceDescription)(service_.getDescriptions())[0].getExtensionElement();
- return sd.getLocation();
- }
-
- public String getServiceKey()
- {
- ServiceDescription sd = (ServiceDescription)(service_.getDescriptions())[0].getExtensionElement();
- return sd.getServiceKey().getText();
- }
-
- public void setName(String name)
- {
- }
-
- public void setInquiryURL(String inquiryURL)
- {
- }
-
- public void setServiceKey(String key)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIServiceInterface.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIServiceInterface.java
deleted file mode 100644
index 0c3cc2a..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesUDDIServiceInterface.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-import org.apache.wsil.extension.uddi.ServiceDescription;
-
-public class FavoritesUDDIServiceInterface extends FavoritesService implements IFavoritesUDDIServiceInterface
-{
- public FavoritesUDDIServiceInterface()
- {
- super();
- }
-
- public String getName()
- {
- return (service_.getServiceNames())[0].getText();
- }
-
- public String getInquiryURL()
- {
- ServiceDescription sd = (ServiceDescription)(service_.getDescriptions())[0].getExtensionElement();
- return sd.getLocation();
- }
-
- public String getServiceInterfaceKey()
- {
- ServiceDescription sd = (ServiceDescription)(service_.getDescriptions())[0].getExtensionElement();
- return sd.getServiceKey().getText();
- }
-
- public void setName(String name)
- {
- }
-
- public void setInquiryURL(String inquiryURL)
- {
- }
-
- public void setServiceInterfaceKey(String key)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesWSDL.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesWSDL.java
deleted file mode 100644
index 046d751..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesWSDL.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-public class FavoritesWSDL extends FavoritesService implements IFavoritesWSDL
-{
- public FavoritesWSDL()
- {
- super();
- }
-
- public String getName()
- {
- return getWsdlUrl();
- }
-
- public String getWsdlUrl()
- {
- return (service_.getDescriptions())[0].getLocation();
- }
-
- public void setName(String name)
- {
- }
-
- public void setWsdlUrl(String wsdlURL)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesWSIL.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesWSIL.java
deleted file mode 100644
index b66f312..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/FavoritesWSIL.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-public class FavoritesWSIL extends FavoritesLink implements IFavoritesWSIL
-{
- public FavoritesWSIL()
- {
- super();
- }
-
- public String getName()
- {
- return getWsilUrl();
- }
-
-
- public String getWsilUrl()
- {
- return link_.getLocation();
- }
-
- public void setName(String name)
- {
- }
-
- public void setWsilUrl(String wsilURL)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesRegistryType.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesRegistryType.java
deleted file mode 100644
index 13e7e1d..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesRegistryType.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-public interface IFavoritesRegistryType
-{
- public IFavoritesUDDIRegistry[] getFavoritesUDDIRegistries();
- public IFavoritesUDDIBusiness[] getFavoritesUDDIBusinesses();
- public IFavoritesUDDIService[] getFavoritesUDDIServices();
- public IFavoritesUDDIServiceInterface[] getFavoritesUDDIServiceInterfaces();
- public IFavoritesWSDL[] getFavoritesWSDLs();
- public IFavoritesWSIL[] getFavoritesWSILs();
-
- public void addFavoritesUDDIRegistry(IFavoritesUDDIRegistry registry);
- public void addFavoritesUDDIBusiness(IFavoritesUDDIBusiness business);
- public void addFavoritesUDDIService(IFavoritesUDDIService service);
- public void addFavoritesUDDIServiceInterface(IFavoritesUDDIServiceInterface serviceInterface);
- public void addFavoritesWSDL(IFavoritesWSDL wsdl);
- public void addFavoritesWSIL(IFavoritesWSIL wsil);
-
- public void removeFavoritesUDDIRegistry(IFavoritesUDDIRegistry registry);
- public void removeFavoritesUDDIBusiness(IFavoritesUDDIBusiness business);
- public void removeFavoritesUDDIService(IFavoritesUDDIService service);
- public void removeFavoritesUDDIServiceInterface(IFavoritesUDDIServiceInterface serviceInterface);
- public void removeFavoritesWSDL(IFavoritesWSDL wsdl);
- public void removeFavoritesWSIL(IFavoritesWSIL wsil);
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIBusiness.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIBusiness.java
deleted file mode 100644
index 0f63d09..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIBusiness.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-public interface IFavoritesUDDIBusiness
-{
- public String getName();
- public String getInquiryURL();
- public String getBusinessKey();
-
- public void setName(String name);
- public void setInquiryURL(String inquiryURL);
- public void setBusinessKey(String key);
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIRegistry.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIRegistry.java
deleted file mode 100644
index 3acd516..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIRegistry.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-public interface IFavoritesUDDIRegistry
-{
- public String getName();
- public String getInquiryURL();
- public String getPublishURL();
- public String getRegistrationURL();
-
- public void setName(String name);
- public void setInquiryURL(String inquiryURL);
- public void setPublishURL(String publishURL);
- public void setRegistrationURL(String registrationURL);
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIService.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIService.java
deleted file mode 100644
index c26a9f6..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIService.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-public interface IFavoritesUDDIService
-{
- public String getName();
- public String getInquiryURL();
- public String getServiceKey();
-
- public void setName(String name);
- public void setInquiryURL(String inquiryURL);
- public void setServiceKey(String key);
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIServiceInterface.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIServiceInterface.java
deleted file mode 100644
index ead7c13..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesUDDIServiceInterface.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-public interface IFavoritesUDDIServiceInterface
-{
- public String getName();
- public String getInquiryURL();
- public String getServiceInterfaceKey();
-
- public void setName(String name);
- public void setInquiryURL(String inquiryURL);
- public void setServiceInterfaceKey(String key);
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesWSDL.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesWSDL.java
deleted file mode 100644
index 832bcf3..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesWSDL.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-public interface IFavoritesWSDL
-{
- public String getName();
- public String getWsdlUrl();
-
- public void setName(String name);
- public void setWsdlUrl(String wsdlURL);
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesWSIL.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesWSIL.java
deleted file mode 100644
index 90ef394..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/favorites/IFavoritesWSIL.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.ws.parser.favorites;
-
-public interface IFavoritesWSIL
-{
- public String getName();
- public String getWsilUrl();
-
- public void setName(String name);
- public void setWsilUrl(String wsilURL);
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/HTMLHeadHandler.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/HTMLHeadHandler.java
deleted file mode 100644
index 98ef2b9..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/HTMLHeadHandler.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.wsil;
-
-import java.io.UnsupportedEncodingException;
-import java.util.Vector;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-public class HTMLHeadHandler extends DefaultHandler
-{
- private final char START_TAG = '<';
- private final char END_TAG = '>';
- private final String HEAD_START_TAG = "<head>";
- private final String HEAD_END_TAG = "</head>";
- private final String ROOT_START_TAG = "<root>";
- private final String ROOT_END_TAG = "</root>";
- private final String UTF8 = "UTF-8";
-
- // WSIL tag information.
- private final String META = "meta";
- private final String NAME = "name";
- private final String SERVICE_INSPECTION = "serviceInspection";
- private final String CONTENT = "content";
-
- // DISCO tag information.
- private final String LINK = "link";
- private final String TYPE = "type";
- private final String TEXT_XML = "text/xml";
- private final String REL = "rel";
- private final String ALTERNATE = "alternate";
- private final String HREF = "href";
-
- private String baseURI_;
- private Vector wsils_;
- private Vector discos_;
-
- public HTMLHeadHandler(String baseURI)
- {
- super();
- baseURI_ = baseURI;
- wsils_ = new Vector();
- discos_ = new Vector();
- }
-
- public String[] getWsils()
- {
- String[] wsils = new String[wsils_.size()];
- wsils_.copyInto(wsils);
- return wsils;
- }
-
- public String[] getDiscos()
- {
- String[] discos = new String[discos_.size()];
- discos_.copyInto(discos);
- return discos;
- }
-
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- {
- String qNameLC = qName.toLowerCase();
- if (qNameLC.equals(META))
- {
- String nameValue = attributes.getValue(NAME);
- if (SERVICE_INSPECTION.equals(nameValue))
- {
- String wsilURI = attributes.getValue(CONTENT);
- if (baseURI_ != null && wsilURI.indexOf(":/") == -1)
- {
- StringBuffer sb = new StringBuffer();
- sb.append(baseURI_.substring(0, baseURI_.lastIndexOf("/")+1));
- sb.append(wsilURI);
- wsilURI = sb.toString();
- }
- if (!wsils_.contains(wsilURI))
- wsils_.add(wsilURI);
- }
- }
- else if (qNameLC.equals(LINK))
- {
- // See http://msdn.microsoft.com/msdnmag/issues/02/02/xml/default.aspx for more details on DISCO.
- String type = attributes.getValue(TYPE);
- String rel = attributes.getValue(REL);
- String href = attributes.getValue(HREF);
- if (TEXT_XML.equals(type) && ALTERNATE.equals(rel) && href != null)
- {
- String discoURI = href;
- if (discoURI.indexOf(":/") == -1)
- {
- StringBuffer sb = new StringBuffer();
- sb.append(baseURI_.substring(0,baseURI_.lastIndexOf("/")+1));
- sb.append(discoURI);
- discoURI = sb.toString();
- }
- if (!discos_.contains(discoURI))
- discos_.add(discoURI);
- }
- }
- }
-
- public void error(SAXParseException e) throws SAXException
- {
- }
-
- public void fatalError(SAXParseException e) throws SAXException
- {
- }
-
- public void warning(SAXParseException e) throws SAXException
- {
- }
-
- private void harvestTags(StringBuffer target,String document,String tag)
- {
- int index = document.indexOf(START_TAG);
- int documentLength = document.length();
- int tagLength = tag.length();
- while (index != -1 && (index+1+tagLength)<documentLength)
- {
- String str = document.substring(index+1,index+1+tagLength);
- if (str.toLowerCase().equals(tag))
- {
- str = document.substring(index,document.indexOf(END_TAG,index+1)+1);
- target.append(str);
- index += str.length();
- }
- else
- index++;
- index = document.indexOf(START_TAG,index);
- }
- }
-
- public byte[] harvestHeadTags(byte[] b)
- {
- String s;
- try
- {
- s = new String(b, UTF8);
- }
- catch (UnsupportedEncodingException uee)
- {
- s = new String(b);
- }
- String head = s.toLowerCase();
- int headStartIndex = head.indexOf(HEAD_START_TAG);
- int headEndIndex = head.indexOf(HEAD_END_TAG);
- StringBuffer sb = new StringBuffer();
- sb.append(ROOT_START_TAG);
- if (headStartIndex != -1 && headEndIndex != -1)
- {
- head = s.substring(headStartIndex, headEndIndex+HEAD_END_TAG.length());
- harvestTags(sb,head,META);
- harvestTags(sb,head,LINK);
- }
- sb.append(ROOT_END_TAG);
- return sb.toString().getBytes();
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/IllegalArgumentsException.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/IllegalArgumentsException.java
deleted file mode 100644
index 4a3cf0f..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/IllegalArgumentsException.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.wsil;
-
-public class IllegalArgumentsException extends Exception
-{
- private static final long serialVersionUID = -2533981176285561234L;
-
- public IllegalArgumentsException(String arg)
- {
- super(arg);
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/UDDIURIHelper.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/UDDIURIHelper.java
deleted file mode 100644
index 05b21fd..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/UDDIURIHelper.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.wsil;
-
-import java.text.MessageFormat;
-import java.text.ParseException;
-
-public class UDDIURIHelper
-{
- private static final String QUERYSERVICE_URI_TEMPLATE = "uddiservice:query:{0}:query:{1}";
- private static final String SERVICEKEY_URI_TEMPLATE = "uddiservice:serviceKey:{0}:serviceKey:{1}";
-
- public static final String getQueryServiceURI(String query,String inquiryURL)
- {
- String[] uriParams = {query,inquiryURL};
- return MessageFormat.format(QUERYSERVICE_URI_TEMPLATE,uriParams);
- }
-
- public static final String getServiceKeyURI(String serviceKey,String inquiryURL)
- {
- String[] uriParams = {serviceKey,inquiryURL};
- return MessageFormat.format(SERVICEKEY_URI_TEMPLATE,uriParams);
- }
-
- private static final String[] parseURI(String pattern,String uri)
- {
- try
- {
- MessageFormat mf = new MessageFormat(pattern);
- Object[] parsedResults = mf.parse(uri);
- if (parsedResults != null && parsedResults.length > 0)
- {
- String[] results = new String[parsedResults.length];
- for (int i=0;i<parsedResults.length;i++)
- results[i] = (String)parsedResults[i];
- return results;
- }
- }
- catch (ParseException e)
- {
- }
- return null;
- }
-
- public static final String[] parseServiceKeyURI(String uri)
- {
- return parseURI(SERVICEKEY_URI_TEMPLATE,uri);
- }
-
- public static final String[] parseQueryServiceURI(String uri)
- {
- return parseURI(QUERYSERVICE_URI_TEMPLATE,uri);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WWWAuthenticationException.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WWWAuthenticationException.java
deleted file mode 100644
index 723a361..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WWWAuthenticationException.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.wsil;
-
-import java.io.IOException;
-
-public class WWWAuthenticationException extends Exception
-{
- private static final long serialVersionUID = -4918211021620316049L;
-
- private IOException ioe_;
- private String wwwAuthMsg_;
- private String url_;
-
- public WWWAuthenticationException(IOException ioe, String wwwAuthMsg, String url)
- {
- super(ioe.getMessage());
- ioe_ = ioe;
- wwwAuthMsg_ = wwwAuthMsg;
- url_ = url;
- }
-
- public IOException getIOException()
- {
- return ioe_;
- }
-
- public String getWWWAuthenticationMsg()
- {
- return wwwAuthMsg_;
- }
-
- public String getURL()
- {
- return url_;
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WWWAuthenticationHandler.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WWWAuthenticationHandler.java
deleted file mode 100644
index 86ddc42..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WWWAuthenticationHandler.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.wsil;
-
-public interface WWWAuthenticationHandler
-{
- public void handleWWWAuthentication(WWWAuthenticationException wwwae);
- public String getUsername();
- public String getPassword();
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WebServiceEntity.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WebServiceEntity.java
deleted file mode 100644
index 776bd2a..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WebServiceEntity.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.wsil;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class WebServiceEntity
-{
- public static final int TYPE_UNKNOWN = -1;
- public static final int TYPE_HTML = 0;
- public static final int TYPE_WSIL = 1;
- public static final int TYPE_WSDL = 2;
- public static final int TYPE_UDDI_SERVICE = 3;
- public static final int TYPE_DISCO = 4;
-
- private Object parent_;
- private List children_;
- private int type_;
- private String uri_;
- private byte[] bytes_;
- private String httpUsername_;
- private String httpPassword_;
- private String documentation_;
- private Object model_;
-
- public WebServiceEntity()
- {
- parent_ = null;
- children_ = new ArrayList();
- type_ = TYPE_UNKNOWN;
- uri_ = null;
- bytes_ = null;
- httpUsername_ = null;
- httpPassword_ = null;
- documentation_ = null;
- model_ = null;
- }
-
- public Object getParent()
- {
- return parent_;
- }
-
- public void setParent(Object parent)
- {
- parent_ = parent;
- }
-
- public List getChildren()
- {
- return children_;
- }
-
- public void addChild(Object child)
- {
- children_.add(child);
- }
-
- public void removeChild(Object child)
- {
- children_.remove(child);
- }
-
- public int getType()
- {
- return type_;
- }
-
- public void setType(int type)
- {
- type_ = type;
- }
-
- public String getURI()
- {
- return uri_;
- }
-
- public void setURI(String uri)
- {
- uri_ = uri;
- }
-
- public byte[] getBytes()
- {
- return bytes_;
- }
-
- public void setBytes(byte[] bytes)
- {
- bytes_ = bytes;
- }
-
- public String getHTTPUsername()
- {
- return httpUsername_;
- }
-
- public void setHTTPUsername(String httpUsername)
- {
- httpUsername_ = httpUsername;
- }
-
- public String getHTTPPassword()
- {
- return httpPassword_;
- }
-
- public void setHTTPPassword(String httpPassword)
- {
- httpPassword_ = httpPassword;
- }
-
- public String getDocumentation()
- {
- return documentation_;
- }
-
- public void setDocumentation(String documentation)
- {
- documentation_ = documentation;
- }
-
- public Object getModel()
- {
- return model_;
- }
-
- public void setModel(Object model)
- {
- model_ = model;
- }
-
- public boolean isEntityResolved()
- {
- return (bytes_ != null);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WebServicesParser.java b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WebServicesParser.java
deleted file mode 100644
index cd0f440..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/WebServicesParser.java
+++ /dev/null
@@ -1,559 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.wst.ws.parser.wsil;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Hashtable;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.apache.wsil.Abstract;
-import org.apache.wsil.Description;
-import org.apache.wsil.Inspection;
-import org.apache.wsil.Link;
-import org.apache.wsil.Service;
-import org.apache.wsil.WSILConstants;
-import org.apache.wsil.WSILDocument;
-import org.apache.wsil.WSILException;
-import org.apache.wsil.extension.ExtensionElement;
-import org.apache.wsil.extension.uddi.ServiceDescription;
-import org.apache.wsil.extension.uddi.UDDIConstants;
-import org.apache.wsil.extension.wsdl.WSDLConstants;
-import org.eclipse.wst.ws.parser.disco.DISCOContractReference;
-import org.eclipse.wst.ws.parser.disco.DISCOParser;
-import org.eclipse.wst.ws.parser.disco.DISCOReference;
-import org.eclipse.wst.wsdl.WSDLPlugin;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-import sun.misc.BASE64Encoder;
-
-public class WebServicesParser
-{
- public static final int PARSE_NONE = 0;
- public static final int PARSE_WSIL = 1<<0;
- public static final int PARSE_WSDL = 1<<1;
- public static final int PARSE_LINKS = 1<<2;
- public static final int PARSE_DISCO = 1<<3;
-
- private String uri_;
- private Hashtable uriToEntityTable_;
-
- private String httpBasicAuthUsername_;
- private String httpBasicAuthPassword_;
-
- public WebServicesParser()
- {
- this(null);
- }
-
- public WebServicesParser(String uri)
- {
- uri_ = uri;
- uriToEntityTable_ = new Hashtable();
- httpBasicAuthUsername_ = null;
- httpBasicAuthPassword_ = null;
- }
-
- public String getURI()
- {
- return uri_;
- }
-
- public void setURI(String uri)
- {
- uri_ = uri;
- }
-
- public WebServiceEntity getWebServiceEntityByURI(String uri)
- {
- if (uri != null)
- return (WebServiceEntity)uriToEntityTable_.get(uri);
- else
- return null;
- }
-
- public WSILDocument getWSILDocument(String wsilURI)
- {
- try
- {
- return getWSILDocumentVerbose(wsilURI);
- }
- catch (Throwable t)
- {
- }
- return null;
- }
-
- public WSILDocument getWSILDocumentVerbose(String wsilURI) throws MalformedURLException, IOException, WWWAuthenticationException, WSILException
- {
- WebServiceEntity wsEntity = getWebServiceEntityByURI(wsilURI);
- if (wsEntity == null)
- {
- wsEntity = new WebServiceEntity();
- wsEntity.setURI(wsilURI);
- uriToEntityTable_.put(wsilURI, wsEntity);
- }
- WSILDocument wsilDocument = (WSILDocument)wsEntity.getModel();
- if (wsilDocument == null)
- {
- byte[] b = getInputStreamAsByteArray(wsilURI);
- wsEntity.setBytes(b);
- setHTTPSettings(wsEntity);
- InputStreamReader isr = new InputStreamReader(new ByteArrayInputStream(b));
- wsilDocument = WSILDocument.newInstance();
- wsilDocument.read(isr);
- wsEntity.setType(WebServiceEntity.TYPE_WSIL);
- wsEntity.setModel(wsilDocument);
- }
- return wsilDocument;
- }
-
- public Definition getWSDLDefinition(String wsdlURI)
- {
- try
- {
- return getWSDLDefinitionVerbose(wsdlURI);
- }
- catch (Throwable t)
- {
- }
- return null;
- }
-
- public Definition getWSDLDefinitionVerbose(String wsdlURI) throws MalformedURLException, IOException, WWWAuthenticationException, WSDLException
- {
- WebServiceEntity wsEntity = getWebServiceEntityByURI(wsdlURI);
- if (wsEntity == null)
- {
- wsEntity = new WebServiceEntity();
- wsEntity.setURI(wsdlURI);
- uriToEntityTable_.put(wsdlURI, wsEntity);
- }
- Definition definition = (Definition)wsEntity.getModel();
- if (definition == null)
- {
- byte[] b = getInputStreamAsByteArray(wsdlURI);
- wsEntity.setBytes(b);
- setHTTPSettings(wsEntity);
- ByteArrayInputStream bais = new ByteArrayInputStream(b);
- WSDLFactory factory = WSDLPlugin.INSTANCE.createWSDL4JFactory();
- WSDLReader wsdlReader = factory.newWSDLReader();
- definition = wsdlReader.readWSDL(wsdlURI, new InputSource(bais));
- wsEntity.setType(WebServiceEntity.TYPE_WSDL);
- wsEntity.setModel(definition);
- }
- return definition;
- }
-
- public void parse() throws MalformedURLException, IOException, ParserConfigurationException, SAXException, WWWAuthenticationException
- {
- parseURL(PARSE_WSIL | PARSE_WSDL | PARSE_LINKS | PARSE_DISCO);
- }
-
- public void parse(int parseOption) throws MalformedURLException, IOException, ParserConfigurationException, SAXException, WWWAuthenticationException
- {
- parseURL(parseOption);
- }
-
- private void parseURL(int parseOption) throws MalformedURLException, IOException, ParserConfigurationException, SAXException, WWWAuthenticationException
- {
- WebServiceEntity wsEntity = new WebServiceEntity();
- wsEntity.setURI(uri_);
- byte[] b = getInputStreamAsByteArray(uri_);
- wsEntity.setBytes(b);
- setHTTPSettings(wsEntity);
- uriToEntityTable_.put(uri_, wsEntity);
- // parse uri_ as a HTML document
- HTMLHeadHandler headHandler = new HTMLHeadHandler(uri_);
- byte[] head = headHandler.harvestHeadTags(b);
- SAXParserFactory factory = SAXParserFactory.newInstance();
- factory.setNamespaceAware(false);
- factory.setValidating(false);
- SAXParser parser = factory.newSAXParser();
- try
- {
- parser.parse(new ByteArrayInputStream(head), headHandler);
- }
- catch (Throwable t)
- {
- }
- String[] wsilURIs = headHandler.getWsils();
- String[] discoURIs = headHandler.getDiscos();
- // true if uri_ is a HTML document
- if (wsilURIs.length > 0 || discoURIs.length > 0)
- {
- wsEntity.setType(WebServiceEntity.TYPE_HTML);
- for (int i = 0; i < wsilURIs.length; i++)
- {
- String absoluteURI = convertToAbsoluteURI(uri_, wsilURIs[i]);
- WebServiceEntity wsilEntity = new WebServiceEntity();
- wsilEntity.setType(WebServiceEntity.TYPE_WSIL);
- wsilEntity.setURI(absoluteURI);
- associate(wsEntity, wsilEntity);
- uriToEntityTable_.put(absoluteURI, wsilEntity);
- if ((parseOption | PARSE_WSIL) == parseOption)
- {
- try
- {
- parseWSIL(absoluteURI, parseOption);
- }
- catch (Throwable t)
- {
- }
- }
- }
- for (int i=0;i<discoURIs.length;i++)
- {
- WebServiceEntity discoEntity = new WebServiceEntity();
- discoEntity.setType(WebServiceEntity.TYPE_DISCO);
- discoEntity.setURI(discoURIs[i]);
- associate(wsEntity,discoEntity);
- uriToEntityTable_.put(discoURIs[i],discoEntity);
- if ((parseOption | PARSE_DISCO) == parseOption)
- {
- try
- {
- parseDISCO(discoURIs[i],parseOption);
- }
- catch (Throwable t)
- {
- }
- }
- }
- }
- // false if uri_ is not a HTML document
- // then parse uri_ as a WSIL document
- else
- {
- try
- {
- parseWSIL(uri_, parseOption);
- // no exception thrown if uri_ is a WSIL document
- wsEntity.setType(WebServiceEntity.TYPE_WSIL);
- }
- catch (Throwable t)
- {
- // exception thrown if uri_ is not a WSIL document
- // then parse uri_ as a DISCO document.
- try
- {
- parseDISCO(uri_, parseOption);
- // no exception thrown if uri_ is a DISCO document
- wsEntity.setType(WebServiceEntity.TYPE_DISCO);
- }
- catch (Throwable t2)
- {
- // exception thrown if uri_ is not a DISCO document
- // then parse uri_ as a WSDL document
- try
- {
- parseWSDL(uri_);
- // no exception thrown if uri_ is a WSDL document
- wsEntity.setType(WebServiceEntity.TYPE_WSDL);
- }
- catch (Throwable t3)
- {
- // exception thrown if uri_ is not a WSDL document
- // then do nothing
- }
- }
- }
- }
- }
-
- private void parseWSIL(String wsilURI, int parseOption) throws WSILException, MalformedURLException, IOException, WSDLException, WWWAuthenticationException
- {
- WebServiceEntity wsilEntity = getWebServiceEntityByURI(wsilURI);
- WSILDocument wsilDoc = (WSILDocument)wsilEntity.getModel();
- if (wsilDoc != null)
- {
- // Prevent infinite loops from occurring when a WSIL cycles occur.
- return;
- }
- wsilDoc = getWSILDocumentVerbose(wsilURI);
- Inspection inspection = wsilDoc.getInspection();
- Service[] services = inspection.getServices();
- for (int i = 0; i < services.length; i++)
- {
- Description[] descs = services[i].getDescriptions();
- // Set the documentation to the <service> element's first abstract.
- String documentation = null;
- Abstract[] abstracts = services[i].getAbstracts();
- if (abstracts != null && abstracts.length > 0)
- documentation = abstracts[0].getText();
- for (int j = 0; j < descs.length; j++)
- {
- String referencedNS = descs[j].getReferencedNamespace();
- // If a <description> element contains an abstract, use it to override the service documentation.
- abstracts = descs[j].getAbstracts();
- if (abstracts != null && abstracts.length > 0)
- documentation = abstracts[0].getText();
- if (WSDLConstants.NS_URI_WSDL.equals(referencedNS))
- {
- String location = descs[j].getLocation();
- if (location != null && location.length() > 0)
- {
- String absoluteURI = convertToAbsoluteURI(wsilURI, location);
- WebServiceEntity wsdlEntity = new WebServiceEntity();
- wsdlEntity.setType(WebServiceEntity.TYPE_WSDL);
- wsdlEntity.setURI(absoluteURI);
- wsdlEntity.setDocumentation(documentation);
- associate(wsilEntity, wsdlEntity);
- uriToEntityTable_.put(absoluteURI, wsdlEntity);
- if ((parseOption | PARSE_WSDL) == parseOption)
- parseWSDL(absoluteURI);
- }
- }
- else if (UDDIConstants.NS_URI_UDDI_V2.equals(referencedNS))
- {
- ExtensionElement ee = descs[j].getExtensionElement();
- if (ee instanceof ServiceDescription)
- {
- ServiceDescription sd = (ServiceDescription)ee;
- String inquiryURL = sd.getLocation();
- String serviceKey = sd.getServiceKey().getText();
- WebServiceEntity uddiServiceEntity = new WebServiceEntity();
- uddiServiceEntity.setType(WebServiceEntity.TYPE_UDDI_SERVICE);
- String uddiServiceKeyURI = UDDIURIHelper.getServiceKeyURI(serviceKey,inquiryURL);
- uddiServiceEntity.setURI(uddiServiceKeyURI);
- uddiServiceEntity.setDocumentation(documentation);
- associate(wsilEntity,uddiServiceEntity);
- uriToEntityTable_.put(uddiServiceKeyURI,uddiServiceEntity);
- // TODO: parse WSDL if necessary...
- }
- }
- }
- }
- Link[] links = inspection.getLinks();
- for (int i = 0; i < links.length; i++)
- {
- if (WSILConstants.NS_URI_WSIL.equals(links[i].getReferencedNamespace()))
- {
- String documentation = null;
- Abstract[] abstracts = links[i].getAbstracts();
- if (abstracts != null && abstracts.length > 0)
- documentation = abstracts[0].getText();
- String linkLocation = links[i].getLocation();
- String absoluteURI = convertToAbsoluteURI(wsilURI, linkLocation);
- // Prevent cycles.
- WebServiceEntity wsilLinkEntity = getWebServiceEntityByURI(absoluteURI);
- if (wsilLinkEntity == null)
- {
- wsilLinkEntity = new WebServiceEntity();
- wsilLinkEntity.setType(WebServiceEntity.TYPE_WSIL);
- wsilLinkEntity.setURI(absoluteURI);
- wsilLinkEntity.setDocumentation(documentation);
- uriToEntityTable_.put(absoluteURI, wsilLinkEntity);
- if ((parseOption | PARSE_LINKS) == parseOption)
- parseWSIL(absoluteURI, parseOption);
- }
- associate(wsilEntity,wsilLinkEntity);
- }
- }
- }
-
- private void parseDISCO(String discoURI, int parseOption) throws MalformedURLException, WWWAuthenticationException, Exception
- {
- WebServiceEntity discoEntity = getWebServiceEntityByURI(discoURI);
- byte[] b = getInputStreamAsByteArray(discoURI);
- discoEntity.setBytes(b);
- setHTTPSettings(discoEntity);
- ByteArrayInputStream bais = new ByteArrayInputStream(b);
- DISCOParser parser = new DISCOParser();
- DISCOReference[] references = parser.parse(discoURI,new InputSource(bais));
- if (references != null && references.length > 0)
- {
- for (int i=0;i<references.length;i++)
- {
- if (references[i] instanceof DISCOContractReference)
- {
- // contractRef
- DISCOContractReference reference = (DISCOContractReference)references[i];
- String ref = reference.getRef();
- String docRef = reference.getDocRef();
- WebServiceEntity wsdlEntity = new WebServiceEntity();
- wsdlEntity.setType(WebServiceEntity.TYPE_WSDL);
- wsdlEntity.setURI(ref);
- wsdlEntity.setDocumentation(docRef);
- associate(discoEntity,wsdlEntity);
- uriToEntityTable_.put(ref,wsdlEntity);
- if ((parseOption | PARSE_WSDL) == parseOption)
- parseWSDL(ref);
- }
- else
- {
- // discoveryRef
- String ref = references[i].getRef();
- // Prevent cycles.
- WebServiceEntity discoLinkEntity = getWebServiceEntityByURI(ref);
- if (discoLinkEntity == null)
- {
- discoLinkEntity = new WebServiceEntity();
- discoLinkEntity.setType(WebServiceEntity.TYPE_DISCO);
- discoLinkEntity.setURI(ref);
- uriToEntityTable_.put(ref,discoLinkEntity);
- if ((parseOption | PARSE_LINKS) == parseOption)
- parseDISCO(ref,parseOption);
- }
- associate(discoEntity,discoLinkEntity);
- }
- }
- }
- }
-
- private Definition parseWSDL(String wsdlURI) throws WSDLException, MalformedURLException, IOException, WWWAuthenticationException
- {
- return getWSDLDefinitionVerbose(wsdlURI);
- }
-
- private byte[] getInputStreamAsByteArray(String uriString) throws MalformedURLException, IOException, WWWAuthenticationException
- {
- // Try to get a cached copy of the byte[]
- WebServiceEntity wsEntity = getWebServiceEntityByURI(uriString);
- if (wsEntity != null)
- {
- byte[] bytes = wsEntity.getBytes();
- if (bytes != null)
- return bytes;
- }
- // Get the byte[] by opening a stream to the URI
- URL url = createURL(uriString);
- URLConnection conn = url.openConnection();
- // proxy server setting
- String proxyUserName = System.getProperty("http.proxyUserName");
- String proxyPassword = System.getProperty("http.proxyPassword");
- if (proxyUserName != null && proxyPassword != null)
- {
- StringBuffer userNamePassword = new StringBuffer(proxyUserName);
- userNamePassword.append(':').append(proxyPassword);
- BASE64Encoder encoder = new BASE64Encoder();
- String encoding = encoder.encode(userNamePassword.toString().getBytes());
- userNamePassword.setLength(0);
- userNamePassword.append("Basic ").append(encoding);
- conn.setRequestProperty("Proxy-authorization", userNamePassword.toString());
- }
- // HTTP basic authentication setting
- if (httpBasicAuthUsername_ != null && httpBasicAuthPassword_ != null)
- {
- StringBuffer sb = new StringBuffer(httpBasicAuthUsername_);
- sb.append(':').append(httpBasicAuthPassword_);
- BASE64Encoder encoder = new BASE64Encoder();
- String encoding = encoder.encode(sb.toString().getBytes());
- sb.setLength(0);
- sb.append("Basic ").append(encoding);
- conn.setRequestProperty("Authorization", sb.toString());
- }
- InputStream is = null;
- try
- {
- is = conn.getInputStream();
- String wwwAuthMsg = conn.getHeaderField("WWW-Authenticate");
- if (wwwAuthMsg != null)
- throw new WWWAuthenticationException(new IOException(), wwwAuthMsg, uriString);
- }
- catch (IOException ioe)
- {
- String wwwAuthMsg = conn.getHeaderField("WWW-Authenticate");
- if (wwwAuthMsg != null)
- throw new WWWAuthenticationException(ioe, wwwAuthMsg, uriString);
- else
- throw ioe;
- }
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- byte[] b = new byte[1024];
- int byteRead = is.read(b);
- while (byteRead != -1)
- {
- baos.write(b, 0, byteRead);
- byteRead = is.read(b);
- }
- is.close();
- return baos.toByteArray();
- }
-
- protected URL createURL(String url) throws MalformedURLException
- {
- return new URL(url);
- }
-
- private byte[] getBytes(WebServiceEntity wsEntity) throws MalformedURLException, IOException, WWWAuthenticationException
- {
- byte[] b = wsEntity.getBytes();
- if (b == null)
- {
- b = getInputStreamAsByteArray(wsEntity.getURI());
- wsEntity.setBytes(b);
- setHTTPSettings(wsEntity);
- }
- return b;
- }
-
- private void associate(WebServiceEntity parent, WebServiceEntity child)
- {
- parent.addChild(child);
- child.setParent(parent);
- }
-
- private String convertToAbsoluteURI(String baseURI,String refURI)
- {
- if (refURI != null && refURI.indexOf(":") < 0)
- {
- StringBuffer absoluteURI = new StringBuffer(baseURI.substring(0,Math.max(baseURI.lastIndexOf('\\'),baseURI.lastIndexOf('/')+1)));
- absoluteURI.append(refURI);
- return absoluteURI.toString();
- }
- return refURI;
- }
-
- private void setHTTPSettings(WebServiceEntity entity)
- {
- if (httpBasicAuthUsername_ != null && httpBasicAuthPassword_ != null)
- {
- entity.setHTTPUsername(httpBasicAuthUsername_);
- entity.setHTTPPassword(httpBasicAuthPassword_);
- }
- }
-
- public String getHTTPBasicAuthUsername()
- {
- return httpBasicAuthUsername_;
- }
-
- public void setHTTPBasicAuthUsername(String username)
- {
- httpBasicAuthUsername_ = username;
- }
-
- public String getHTTPBasicAuthPassword()
- {
- return httpBasicAuthPassword_;
- }
-
- public void setHTTPBasicAuthPassword(String password)
- {
- httpBasicAuthPassword_ = password;
- }
-}
diff --git a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/wsil.properties b/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/wsil.properties
deleted file mode 100644
index 1e60c01..0000000
--- a/bundles/org.eclipse.wst.ws.parser/src/org/eclipse/wst/ws/parser/wsil/wsil.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2001,2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages for AddWSDLToWSILCommand
-#
-MSG_ERROR_INVALID_ARGUMENTS=IWAB0055E Invalid command arguments.
-MSG_ERROR_ILLEGAL_ARGUMENTS=IWAB0105E Illegal argument.
-MSG_ERROR_INVALID_WSDL_URI=IWAB0185E Invalid WSDL URI.
-MSG_ERROR_INVALID_WSIL_URI=IWAB0206E Invalid WSIL URI.
-MSG_ERROR_UNRESOLVABLE_WSDL=IWAB0405E WSDL is unresolvable.
-MSG_ERROR_UNEXPECTED_EXCEPTION=IWAB0451E An unexpected exception has occured.
-MSG_ERROR_MALFORMED_WSDL=IWAB0452E WSDL is malformed, error parsing WSDL.
-MSG_ERROR_WRITE_WSIL=IWAB0453E Error writing WSIL.
diff --git a/bundles/org.eclipse.wst.wsdl.ui/.classpath b/bundles/org.eclipse.wst.wsdl.ui/.classpath
deleted file mode 100644
index 275b34c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/.cvsignore b/bundles/org.eclipse.wst.wsdl.ui/.cvsignore
deleted file mode 100644
index f13f259..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.xml
-wsdleditor.jar
-temp.folder
-org.eclipse.wst.wsdl.ui_1.0.0.jar
diff --git a/bundles/org.eclipse.wst.wsdl.ui/.project b/bundles/org.eclipse.wst.wsdl.ui/.project
deleted file mode 100644
index c5a4ddc..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.wsdl.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.wsdl.ui/build.properties b/bundles/org.eclipse.wst.wsdl.ui/build.properties
deleted file mode 100644
index 08f690e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = plugin.xml,\
- plugin.properties,\
- icons/,\
- wsdleditor.jar
-src.includes = plugin.xml,\
- plugin.properties,\
- src/,\
- icons/,\
- build.properties
-jars.compile.order = wsdleditor.jar
-source.wsdleditor.jar = src/
-output.wsdleditor.jar = bin/
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/reloadgrammar.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/reloadgrammar.gif
deleted file mode 100644
index 9d4c9ca..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/reloadgrammar.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/validate.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/validate.gif
deleted file mode 100644
index 2b347ac..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/validate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/icons/wsdl_file_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/icons/wsdl_file_obj.gif
deleted file mode 100644
index 75b1f92..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/icons/wsdl_file_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/plugin.properties b/bundles/org.eclipse.wst.wsdl.ui/plugin.properties
deleted file mode 100644
index ee657eb..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/plugin.properties
+++ /dev/null
@@ -1,287 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-!
-! Plugin
-!
-_UI_PLUGIN_NAME = WSDL Editor
-_UI_EDITOR_NAME = WSDL Editor
-_UI_WSDL_LABEL = WSDL Files
-
-
-_UI_HIDE_BINDINGS = Hide Bindings
-_UI_BACK_TO = Back to {0}
-_UI_BACK = Back to Previous View
-
-! New property tabs
-_UI_LABEL_GENERAL = General
-_UI_LABEL_OTHER = Other
-_UI_LABEL_ATTRIBUTES = Attributes
-_UI_LABEL_DOCUMENTATION = Documentation
-_UI_LABEL_FACETS = Facets
-_UI_LABEL_ENUMERATIONS = Enumerations
-_UI_LABEL_NAMESPACE = Namespace
-
-! Section title for other attributes
-_UI_SECTION_ADVANCED_ATTRIBUTES = Advanced
-
-!
-! Workbook Pages
-!
-_UI_TAB_SOURCE = Source
-_UI_TAB_GRAPH = Graph
-
-_UI_ADD_EXTENSIBILITY_ELEMENT = Add Extensibility Element
-_UI_CREATE_WSDL_DOCUMENTATION = Create WSDL Documentation
-_UI_FOLDER_NOT_CREATED = Folder not created
-_UI_CREATING_DOCUMENTATION = Creating Documentation
-_UI_LABEL_CREATE_FOLDER_FOR_DOCS = Create a new folder for the html documentation files
-_UI_LABEL_CREATING_HTML_FILES = Creating HTML files
-_UI_LABEL_NEW_FOLDER = New folder
-
-_UI_ACTION_ADD = Add
-_UI_ACTION_COPY = Copy
-_UI_ACTION_PASTE = Paste
-_UI_ACTION_DELETE = Delete
-_UI_ACTION_MULTIPLE_DELETE = Multiple Delete
-_UI_ACTION_RENAME = Rename
-
-_UI_LABEL_BINDING_WIZARD = Binding Wizard
-_UI_ACTION_GENERATE_HTML_DOCUMENTATION = Generate HTML Documentation for this WSDL document
-_UI_ACTION_VALIDATE_WSDL_DOCUMENT = Validate WSDL Document
-
-_UI_ACTION_ADD_CHILD = Add Child
-_UI_ACTION_SET_BINDIG = Set Binding...
-_UI_ACTION_SET_PORTTYPE = Set PortType...
-_UI_ACTION_SET_MESSAGE = Set Message...
-_UI_ACTION_SET_ELEMENT = Set Element...
-_UI_ACTION_SET_TYPE = Set Type...
-_UI_LABEL_BINDING_OPERATION = Binding Operation
-_UI_ACTION_NEW_MESSAGE = New Message
-_UI_ACTION_NEW_SERVICE = New Service
-_UI_ACTION_NEW_PORTTYPE = New PortType
-_UI_ACTION_NEW_BINDING = New Binding
-_UI_ACTION_NEW_PORT = New Port
-_UI_ACTION_NEW_OPERATION = New Operation
-_UI_ACTION_NEW_FAULT = New Fault
-_UI_ACTION_NEW_PART = New Part
-
-_UI_ACTION_ADD_IMPORT = Add Import
-_UI_ACTION_ADD_SCHEMA = Add Schema
-_UI_ACTION_ADD_SERVICE = Add Service
-_UI_ACTION_ADD_BINDING = Add Binding
-_UI_ACTION_ADD_OPERATION = Add Operation
-_UI_ACTION_ADD_BINDING_OPERATION = Add Binding Operation
-_UI_ACTION_ADD_PART = Add Part
-_UI_ACTION_ADD_PORT = Add Port
-_UI_ACTION_ADD_PORTTYPE = Add Port Type
-_UI_ACTION_ADD_MESSAGE = Add Message
-_UI_ACTION_ADD_INPUT = Add Input
-_UI_ACTION_ADD_OUTPUT = Add Output
-_UI_ACTION_ADD_FAULT = Add Fault
-
-_UI_LABEL_DEFINITION = Definition
-_UI_LABEL_BINDING = Binding
-_UI_LABEL_INPUT = Input
-_UI_LABEL_OUTPUT = Output
-_UI_LABEL_FAULT = Fault
-_UI_LABEL_MESSAGE = Message
-_UI_LABEL_PORT = Port
-_UI_LABEL_PORTTYPE = Port Type
-_UI_LABEL_SERVICE = Service
-_UI_LABEL_ELEMENTS = Elements
-_UI_LABEL_TYPES = Types
-_UI_LABEL_NAME = Name
-_UI_LABEL_OPERATION = Operation
-_UI_LABEL_ELEMENT = Element
-_UI_LABEL_TYPE = Type
-
-_UI_LABEL_READ_ONLY = read-only
-
-! Note to translators: keep the one character space and colon after the translation of View
-_UI_MENU_VIEW = View :
-_UI_LABEL_XSD_COMPONENTS = XSD Components
-
-_UI_LABEL_UNKNOWN_OBJECT = Unknown Object
-_UI_LABEL_UNKNOWN_NODE = Unknown Node
-_UI_LABEL_VIEW_NOT_AVAILABLE = View not available for selected object
-
-_UI_LABEL_PORT_W_COLON = Port :
-_UI_LABEL_PORTTYPE_W_COLON = PortType :
-_UI_LABEL_SERVICE_W_COLON = Service :
-_UI_LABEL_UNKNOWN = Unknown :
-_UI_LABEL_VIEW_BY_SERVICE = View By : Service
-
-_UI_FOLDER_IMPORTS = Imports
-_UI_FOLDER_MESSAGES= Messages
-_UI_FOLDER_SERVICES = Services
-_UI_FOLDER_BINDINGS = Bindings
-_UI_FOLDER_PORTTYPES = Port Types
-_UI_FOLDER_TYPES = Types
-_UI_FOLDER_EXTENSIBILITY_ELEMENTS = Extensiblity Elements
-_UI_FOLDER_DEFINITION = Definition
-
-_UI_LABEL_NONE = (none)
-_UI_MENUBAR_GENERATE_BINDING = Generate Binding
-
-_UI_LABEL_HTTP_BINDING_OPTIONS = HTTP Binding Options
-
-_UI_SOME_ELEMENT_NAME = some-element-name
-
-_UI_LABEL_BINDING_INPUT = Binding Input
-_UI_LABEL_BINDING_OUTPUT = Binding Output
-_UI_LABEL_BINDING_FAULT = Binding Fault
-
-_UI_LABEL_BINDING_OPERATION = Binding Operation
-
-_UI_LABEL_UNKNOWN_EXTENSIBILITY_ELEMENT = Unknown Extensibility Element
-
-_UI_LABEL_IMPORT = Import
-_UI_LABEL_NAMESPACE = Namespace
-_UI_LABEL_PREFIX = Prefix
-_UI_LABEL_LOCATION = Location
-_UI_TITLE_SELECT = Select
-_UI_TITLE_SELECT_FILE = Select File
-_UI_DESCRIPTION_SELECT_WSDL_OR_XSD = Select a WSDL or XSD file to import.
-
-_UI_LABEL_PARAMETER_ORDER = Parameter Order
-_UI_LABEL_PART = Part
-_UI_LABEL_REFERENCE_KIND = Reference kind:
-_UI_LABEL_OVERVIEW = Overview
-_UI_LABEL_VIEW_NOT_IMPLEMENTED = This view is not yet implemented.
-_UI_LABEL_BINDING_VIEW = Binding View
-_UI_LABEL_DOCUMENTION = Documentation
-_UI_LABEL_PROPERTY = Property
-_UI_LABEL_VALUE = Value
-
-_UI_BUTTON_NEW = New...
-_UI_BUTTON_IMPORT = Import...
-
-_UI_BUTTON_CREATE_ASSOCIATED_BINDINGS = Create associated bindings
-_UI_TITLE_GENERATE_BINDING_WIZARD = Generate Binding Wizard
-
-_UI_LABEL_NAMESPACE_URIS_TO_BE_INCLUDED = Namespace URIs to be included
-_UI_ACTION_ADD = Add
-
-_UI_TITLE_SELECT_WSDL_FILE = Select WSDL File
-_UI_DESCRIPTION_SELECT_WSDL_FILE_TO_IMPORT = Select a WSDL file to import
-
-_UI_TITLE_SPECIFY_BINDING = Specify Binding
-_UI_TITLE_SPECIFY_TYPE = Specify Type
-_UI_TITLE_SPECIFY_ELEMENT = Specify Element
-_UI_TITLE_SPECIFY_MESSAGE = Specify Message
-_UI_TITLE_SPECIFY_PORTTYPE = Specify Port Type
-
-_UI_TITLE_SPECIFY_BINDING_DETAILS = Specify Binding Details
-_UI_LABEL_SPECIFY_BINDING_DETAILS_DESC = Specify the details of the binding you wish to generate.
-
-! Translators: Leave the {0} as is
-_UI_RADIO_SELECT_EXISTING = Select an existing {0}
-_UI_RADIO_CREATE_NEW = Create a new {0}
-_UI_RADIO_IMPORT_FROM_FILE = Import {0} from a file
-_UI_LABEL_NAME_OF_ITEM = Name of {0}:
-
-! Translators: Leave the {0} as is
-_UI_DESCRIPTION_CHOOSE_FROM_EXISTING = Choose {0} from the list
-_UI_DESCRIPTION_PROVIDE_NAME = Provide a name of the {0} to create
-_UI_DESCRIPTION_IMPORT_FILE = Select a file and then choose the {0}
-_UI_HELP = Help
-_UI_LABEL_FILE = File:
-_UI_BUTTON_BROWSE = Browse...
-
-_UI_TITLE_NEW_WSDL_FILE = New WSDL File
-_UI_TITLE_OPTIONS = Options
-
-_UI_DESCRIPTION_SPECIFY_BINDING_PAGE = Description of Specify Binding Page
-_UI_RADIO_GENERATE_CONTENT = Generate content for an existing binding
-_UI_RADIO_GENERATE_NEW_BINDING = Generate a new binding
-_UI_LABEL_BINDING_NAME = Name:
-_UI_LABEL_BINDING_PROTOCOL = Protocol:
-_UI_CHECKBOX_OVERWRITE = Overwrite existing binding information
-_UI_LABEL_SOAP_BINDING_OPTIONS = SOAP Binding Options
-_UI_RADIO_DOCUMENT_LITERAL = document literal
-_UI_RADIO_RPC_LITERAL = rpc literal
-_UI_RADIO_RPC_ENCODED = rpc encoded
-
-_UI_DESCRIPTION_NEW_WSDL_FILE = Specify the attributes for the new WSDL file.
-_UI_LABEL_TARGET_NAMESPACE = Target namespace:
-_UI_LABEL_PREFIX_WITH_COLON = Prefix:
-_UI_LABEL_DEFINITION_NAME = Definition name:
-_UI_LABEL_CREATE_NEW_WSDL_FILE = Create a new WSDL File
-_UI_LABEL_CREATE_WSDL_SKELETON = Create WSDL Skeleton
-_UI_LABEL_NEW_CATEGORY_NAME_WS = Web Services
-
-! Translators: Leave the {0} as is
-_UI_ERROR_NAMESPACE_INVALID = The target namespace is invalid
-_UI_ERROR_PREFIX_IS_INVALID = Prefix {0} is invalid
-_UI_ERROR_PREFIX_IS_A_DUPLICATE = Prefix {0} is a duplicate
-_UI_ERROR_MORE_THAN_ONE_PREFIX_IS_BLANK = More than one prefix is blank
-_UI_ERROR_FILE_MUST_END_WITH_WSDL = Error: File must end with wsdl
-_UI_ERROR_FILE_ALREADY_EXISTS = File already exists: {0}
-
-_UI_ERROR_INVALID_WSDL = Invalid WSDL
-_UI_ERROR_INVALID_WSDL_DESC = The WSDL File is invalid. Fix errors and then retry this action.
-_UI_ERROR_ERROR = Error
-_UI_ERROR_FOLDER_NOT_CREATED = Folder not created.
-_UI_ERROR_CREATING_HTML_FILES = Error creating HTML files.
-
-_UI_ERROR_IMPORT_ERROR = Import Error
-_UI_ERROR_IMPORTING_ITSELF = This file is attempting to import itself. Change the location of the import.
-
-
-_UI_USE_WS-I_STYLE_SCHEMA_IMPORT = Use WS-I style schema import
-_UI_BINDING_WIZARD = Binding Wizard
-_UI_SPECIFY_BINDING_DETAILS_LABEL = Specify the details of the binding that will be created
-_UI_PORT_TYPE = Port Type
-_UI_PORT_WIZARD = Port Wizard
-_UI_SPECIFY_PORT_DETAILS = Specify Port Details
-_UI_SPECIFY_PORT_DETAILS_TO_BE_CREATED = Specify the details of the port that will be created
-_UI_BINDING = Binding
-_UI_NAMESPACES = Namespaces
-_UI_EDIT_NAMESPACES = Edit Namespaces...
-_UI_SELECT_REGISTERED_NAMESPACES = Select From Registered Namespaces
-_UI_SPECIFY_NEW_NAMESPACE = Specify New Namespace
-_UI_SELECT_NAMESPACE_TO_ADD = Select the namespace declarations to add.
-_UI_ENTER_REQ_PREFIX_AND_NAMESPACE = Enter the required prefix and namespace URI for the namespace declaration.
-_UI_TARGET_NAMESPACE = Target Namespace
-_UI_NAMESPACE_DECLARATIONS = Namespace Declarations
-_UI_ADD = Add...
-_UI_ADD_NAMESPACE_DECLARATIONS_TITLE = Add Namespace Declarations
-_UI_SOAP_PORT_DETAILS = SOAP Port Details
-_UI_LOCATION = Location:
-_UI_HTTP_PORT_DETAILS = HTTP Port Details
-_UI_EDIT_NAMESPACES_DIALOG_TITLE = Edit Namespaces
-_UI_DEPENDENCIES_CHANGED = Dependencies Changed
-_UI_DEPENDENCIES_CHANGED_REFRESH = One or more dependencies have changed. Do you want to refresh the editor to reflect these changes?
-_UI_RELOAD_DEPENDENCIES = Reload Dependencies
-_UI_UNSPECIFIED = (unspecified)
-_UI_NO_IMPORT_SPECIFIED = (no import location specified)
-_UI_GENERATE_BINDING_CONTENT = Generate Binding Content...
-_UI_OPEN_IMPORT = Open Import
-
-_UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE = Default Target Namespace:
-_UI_PREF_PAGE_CREATING_FILES = Creating files
-
-_UI_CREATE_MESSAGE_CHECKBOX_LABEL = Create default messages
-_UI_DELETE_ASSOCIATED_MSG_AND_PARTS = Delete associated Messages and Parts
-_UI_DELETE_OPERATION_TITLE = Delete Operation
-_UI_LABEL_WARNING_DUPLICATE_NAME_EXISTS = Warning: duplicate name already exists
-
-_WARN_NAME_HAS_SPACE = IWAX1402W Name field cannot contain a space
-_WARN_NAME_INVALID_FIRST = IWAX1403W First character in name field must be one of the following ('_', ':', 'letter')
-_WARN_NAME_MUST_CONTAIN_AT_LEAST_ONE_CHAR = IWAX1415W Name field must contain at least one character
-_WARN_NAME_INVALID_CHAR = IWAX1404W Name field contains invalid character ('
-_UI_NAME_INVALID_CHAR_END = ')
-
-
-! ----------------------------------------------------------------
-! Translators : please don't translate any string below this line
-! ----------------------------------------------------------------
-! _DEBUG_UPDATE_POLICY = 0
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/plugin.xml b/bundles/org.eclipse.wst.wsdl.ui/plugin.xml
deleted file mode 100644
index 9b124a9..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/plugin.xml
+++ /dev/null
@@ -1,312 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.wsdl.ui"
- name="%_UI_PLUGIN_NAME"
- version="1.0.0"
- provider-name = "Eclipse.org"
- class="org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin">
-
- <runtime>
- <library name="wsdleditor.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.emf.common"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="org.eclipse.gef"/>
- <import plugin="org.eclipse.jface"/>
- <import plugin="org.eclipse.jface.text"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.ui.editors"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui.views"/>
- <import plugin="org.eclipse.ui.workbench.texteditor"/>
- <import plugin="org.eclipse.wst.common.contentmodel"/>
- <import plugin="org.eclipse.wst.sse.core"/>
- <import plugin="org.eclipse.wst.sse.ui"/>
- <import plugin="org.eclipse.wst.common.uriresolver"/>
- <import plugin="org.eclipse.wst.common.ui"/>
- <import plugin="org.eclipse.wst.xml.core"/>
- <import plugin="org.eclipse.wst.xml.ui"/>
- <import plugin="org.eclipse.wst.xml.uriresolver"/>
- <import plugin="org.eclipse.xsd"/>
- <import plugin="org.eclipse.wst.wsdl"/>
- <import plugin="org.eclipse.wst.common.ui.properties"/>
- <import plugin="org.eclipse.wst.xsd.ui"/>
- <import plugin="org.eclipse.emf.edit"/>
- <import plugin="org.eclipse.emf.edit.ui"/>
- </requires>
-
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
- name="%_UI_EDITOR_NAME"
- default="true"
- icon="icons/wsdl_file_obj.gif"
- extensions="wsdl"
- class="org.eclipse.wst.wsdl.ui.internal.WSDLEditor"
- contributorClass="org.eclipse.wst.wsdl.ui.internal.actions.WSDLActionBarContributor"
- id="org.eclipse.wst.wsdl.ui.internal.WSDLEditor">
- </editor>
- </extension>
-
- <extension-point id="internalEditorExtensions" name="Internal Editor Extensions"/>
- <extension-point id="extensibilityItemTreeProviders" name="Extensibility Item Tree Providers"/>
- <extension-point id="contentGenerators" name="Port and Binding Content Generators"/>
- <extension-point id="propertySourceProvider" name="Property Source Providers"/>
-
- <!-- This extension point is used to suplement WSDL 1.1 schemas in order to -->
- <!-- constrain the extensiblity elements that are allowed at the 'wsdl' level -->
- <extension-point id="extensibilityElementFilter" name="Extensiblity Element Filter"/>
-
- <extension-point id="propertyDescriptorProvider" name="Property Descriptor Provider"/>
-
- <extension-point id="detailsViewerProviders" name="Details Viewer Providers"/>
-
- <extension point = "org.eclipse.wst.wsdl.ui.extensibilityItemTreeProviders">
- <extensibilityItemTreeProvider
- id="org.eclipse.wst.wsdl.ui.internal.extensibilityItemTreeProviders.http"
- namespace="http://schemas.xmlsoap.org/wsdl/http/"
- labelProviderClass="org.eclipse.wst.wsdl.ui.internal.outline.HTTPLabelProvider">
- </extensibilityItemTreeProvider>
- </extension>
-
-
- <extension point = "org.eclipse.wst.wsdl.ui.extensibilityItemTreeProviders">
- <extensibilityItemTreeProvider
- id="org.eclipse.wst.wsdl.ui.extensibilityItemTreeProviders.soap"
- namespace="http://schemas.xmlsoap.org/wsdl/soap/"
- labelProviderClass="org.eclipse.wst.wsdl.ui.internal.outline.SOAPLabelProvider">
- </extensibilityItemTreeProvider>
- </extension>
-
-
- <extension point = "org.eclipse.wst.wsdl.ui.contentGenerators">
- <contentGenerator
- name="SOAP"
- namespace="http://schemas.xmlsoap.org/wsdl/soap/"
- contentGeneratorClass="org.eclipse.wst.wsdl.ui.internal.contentgenerator.SoapContentGenerator"
- portOptionsPageClass="org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.SoapPortOptionsPage"
- bindingOptionsPageClass="org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.SoapBindingOptionsPage">
- </contentGenerator>
- </extension>
-
-
- <extension point = "org.eclipse.wst.wsdl.ui.contentGenerators">
- <contentGenerator
- name="HTTP"
- namespace="http://schemas.xmlsoap.org/wsdl/http/"
- contentGeneratorClass="org.eclipse.wst.wsdl.ui.internal.contentgenerator.HttpContentGenerator"
- portOptionsPageClass="org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.HttpPortOptionsPage"
- bindingOptionsPageClass="org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.HttpBindingOptionsPage">
- </contentGenerator>
- </extension>
-
- <extension point = "org.eclipse.wst.wsdl.ui.extensibilityElementFilter">
- <extensibilityElementFilter
- namespace="http://schemas.xmlsoap.org/wsdl/soap/"
- class="org.eclipse.wst.wsdl.ui.internal.filter.SoapExtensiblityElementFilter">
- </extensibilityElementFilter>
- </extension>
-
- <extension point = "org.eclipse.wst.wsdl.ui.extensibilityElementFilter">
- <extensibilityElementFilter
- namespace="http://schemas.xmlsoap.org/wsdl/http/"
- class="org.eclipse.wst.wsdl.ui.internal.filter.HttpExtensiblityElementFilter">
- </extensibilityElementFilter>
- </extension>
-
- <extension point = "org.eclipse.wst.wsdl.ui.extensibilityElementFilter">
- <extensibilityElementFilter
- namespace="http://schemas.xmlsoap.org/wsdl/mime/"
- class="org.eclipse.wst.wsdl.ui.internal.filter.MimeExtensiblityElementFilter">
- </extensibilityElementFilter>
- </extension>
-
- <extension point = "org.eclipse.wst.wsdl.ui.extensibilityElementFilter">
- <extensibilityElementFilter
- namespace="http://www.w3.org/2001/XMLSchema"
- class="org.eclipse.wst.wsdl.ui.internal.filter.XSDExtensiblityElementFilter">
- </extensibilityElementFilter>
- </extension>
-
- <extension point="org.eclipse.ui.newWizards">
- <category
- id="org.eclipse.wst.webservice.ui.new"
- name="%_UI_LABEL_NEW_CATEGORY_NAME_WS"/>
- <wizard
- id="org.eclipse.wst.wsdl.ui"
- name="WSDL"
- class="org.eclipse.wst.wsdl.ui.internal.wizards.NewWSDLWizard"
- category="org.eclipse.wst.webservice.ui.new"
- icon="icons/wsdl_file_obj.gif">
- <description>%_UI_LABEL_CREATE_NEW_WSDL_FILE</description>
- <selection class="org.eclipse.core.resources.IResource" />
- </wizard>
-
- <wizard
- id="org.eclipse.wst.wsdl.ui"
- name="WSDL"
- class="org.eclipse.wst.wsdl.ui.internal.wizards.NewWSDLWizard"
- category="org.eclipse.wst.XMLCategory"
- icon="icons/wsdl_file_obj.gif">
- <description>%_UI_LABEL_CREATE_NEW_WSDL_FILE</description>
- <selection class="org.eclipse.core.resources.IResource" />
- </wizard>
- </extension>
-
-
-<extension point="org.eclipse.ui.editorActions">
- <editorContribution
- id="org.eclipse.ui.articles.action.contribution.editor2"
- targetID="org.eclipse.wst.wsdl.ui.internal.WSDLEditor">
-
- <menu
- id="WSDLEditor"
- label="%_UI_EDITOR_NAME"
- path="additions">
- <separator name="group1"/>
- </menu>
-
- <action
- id="org.eclipse.wst.wsdl.ui.actions.ReloadDependenciesActionDelegate"
- label="%_UI_RELOAD_DEPENDENCIES"
- icon="icons/reloadgrammar.gif"
- tooltip="Reload Dependencies"
- menubarPath="WSDLEditor/group1"
- class="org.eclipse.wst.wsdl.ui.internal.actions.ReloadDependenciesActionDelegate">
- </action>
-
- <!--
- <action
- id="org.eclipse.wst.wsdl.ui.internal.actions.ValidateActionDelegate"
- label="%_UI_ACTION_VALIDATE_WSDL_DOCUMENT"
- icon="icons/validate.gif"
- tooltip="%_UI_ACTION_VALIDATE_WSDL_DOCUMENT"
- menubarPath="WSDLEditor/group1"
- toolbarPath="%Normal/WSDLEditor"
- class="org.eclipse.wst.wsdl.ui.internal.actions.ValidateActionDelegate">
- </action>
- -->
-
- </editorContribution>
-</extension>
-
- <extension
- point="org.eclipse.ui.preferencePages">
- <!-- place everything in "Web and XML" -->
- <page
- name="%_UI_WSDL_LABEL"
- category="org.eclipse.wst.sse.ui.preferences"
- class="org.eclipse.wst.wsdl.ui.internal.util.WSDLPreferencePage"
- id="org.eclipse.wst.wsdl.ui.internal.util.WSDLPreferencePage"
- />
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.extendedconfiguration">
- <!-- add preference pages to the context menu action (ID must correspond to the declared "path" above) -->
- <definition
- type="preferencepages"
- value="org.eclipse.wst.wsdl.ui.internal.util.WSDLPreferencePage"
- target="org.eclipse.wst.wsdl.ui.internal.WSDLEditor.source" />
-<!--
- <propertysheetconfiguration
- class="org.eclipse.wst.wsdl.ui.internal.properties.WSDLPropertySheetConfiguration"
- target="org.eclipse.wst.wsdl.ui.internal.WSDLTextEditor">
- </propertysheetconfiguration>
--->
- </extension>
-
- <extension
- point="org.eclipse.wst.common.ui.properties.propertyContributor">
- <propertyContributor
- typeMapper="org.eclipse.wst.wsdl.ui.internal.properties.section.WSDLTypeMapper"
- contributorId="org.eclipse.wst.wsdl.ui.internal.WSDLTextEditor"
- sectionDescriptorProvider="org.eclipse.wst.wsdl.ui.internal.properties.section.WSDLSectionDescriptorProvider"
- labelProvider="org.eclipse.wst.wsdl.ui.internal.properties.section.WSDLLabelProvider">
- <propertyCategory
- category="general">
- </propertyCategory>
- <propertyCategory
- category="namespace">
- </propertyCategory>
- <propertyCategory
- category="other">
- </propertyCategory>
- <propertyCategory
- category="attributes">
- </propertyCategory>
- <propertyCategory
- category="enumerations">
- </propertyCategory>
- <propertyCategory
- category="documentation">
- </propertyCategory>
- <propertyCategory
- category="facets">
- </propertyCategory>
- </propertyContributor>
- </extension>
- <extension
- point="org.eclipse.wst.common.ui.properties.propertyTabs">
- <propertyTabs
- contributorId="org.eclipse.wst.wsdl.ui.internal.WSDLTextEditor">
- <propertyTab
- label="%_UI_LABEL_GENERAL"
- category="general"
- id="com.ibm.xmlwebservices.general">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_NAMESPACE"
- category="namespace"
- afterTab="com.ibm.xmlwebservices.general"
- id="com.ibm.xmlwebservices.namespace">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_OTHER"
- category="other"
- id="com.ibm.xmlwebservices.other">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_ATTRIBUTES"
- category="attributes"
- id="com.ibm.xmlwebservices.attributes">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_ENUMERATIONS"
- category="enumerations"
- id="com.ibm.xmlwebservices.enumerations">
- </propertyTab>
- <propertyTab
- label="%_UI_LABEL_DOCUMENTATION"
- category="documentation"
- id="com.ibm.xmlwebservices.documentation">
- </propertyTab>
- <propertyTab
- label="%_UI_SECTION_ADVANCED_ATTRIBUTES"
- category="facets"
- id="com.ibm.xmlwebservices.facets">
- </propertyTab>
- </propertyTabs>
- </extension>
-
- <extension point="org.eclipse.wst.wsdl.ui.internalEditorExtensions">
- <internalEditorExtension class="org.eclipse.wst.wsdl.ui.internal.xsd.XSDExtension"/>
- </extension>
-
- <extension point = "org.eclipse.wst.wsdl.ui.extensibilityItemTreeProviders">
- <extensibilityItemTreeProvider
- id="org.eclipse.wst.wsdl.ui.extensibilityItemTreeProviders.xsd"
- namespace="http://www.w3.org/2001/XMLSchema"
- labelProviderClass="org.eclipse.wst.wsdl.ui.internal.xsd.XSDLabelProvider">
- </extensibilityItemTreeProvider>
- </extension>
-
-</plugin>
-
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLEditor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLEditor.java
deleted file mode 100644
index ba89de4..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLEditor.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.INavigationLocation;
-import org.eclipse.ui.INavigationLocationProvider;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextSelectionNavigationLocation;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.exceptions.SourceEditingRuntimeException;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl;
-import org.eclipse.wst.wsdl.ui.internal.actions.WSDLMenuActionContributor;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.graph.WSDLGraphViewer;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.WSDLEditPartFactory;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.outline.ExtensibleOutlineProvider;
-import org.eclipse.wst.wsdl.ui.internal.outline.ModelAdapterContentProvider;
-import org.eclipse.wst.wsdl.ui.internal.outline.ModelAdapterLabelProvider;
-import org.eclipse.wst.wsdl.ui.internal.reconciler.SEDDocumentAdapter;
-import org.eclipse.wst.wsdl.ui.internal.typesystem.ExtensibleTypeSystemProvider;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLModelLocatorAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLNodeAssociationProvider;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLResourceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.XSDSchemaLocationResolverAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.viewers.WSDLDetailsViewer;
-import org.eclipse.wst.wsdl.ui.internal.viewers.WSDLDetailsViewerProvider;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.w3c.dom.Document;
-
-//public class WSDLEditor extends StructuredTextMultiPageEditorPart implements INavigationLocationProvider
-public class WSDLEditor extends WSDLMultiPageEditorPart implements INavigationLocationProvider
-{
- protected ExtensibleOutlineProvider extensibleOutlineProvider;
-
- protected WSDLTextEditor textEditor;
- protected WSDLGraphViewer graphViewer;
- protected WSDLDetailsViewer detailsViewer;
- protected WSDLSelectionManager selectionManager;
- protected SashForm sashForm;
-
- int graphPageIndex;
-
- //protected Resource resource;
- protected Definition definition;
- protected WSDLEditorResourceChangeHandler resourceChangeHandler;
-
- // Used for Cut, Copy, Paste actions. This acts as a copy, cut, paste clipboard
- protected WSDLElement clipboardElement;
-
- public WSDLEditor()
- {
- selectionManager = new WSDLSelectionManager();
- }
-
- public void init(IEditorSite site, IEditorInput input) throws PartInitException
- {
- super.init(site, input);
-
- try
- {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = window.getActivePage();
- if (page != null)
- {
- page.showView("org.eclipse.ui.views.PropertySheet");
- }
- }
- catch (PartInitException partInitException)
- {
-
- }
- catch (Exception exception)
- {
-
- }
- }
-
- public Object getAdapter(Class key)
- {
- Object result = null;
- if (key == ISelectionProvider.class)
- {
- result = selectionManager;
- }
- else
- {
- result = super.getAdapter(key);
- }
- return result;
- }
-
- public void dispose()
- {
- // call the extensibleOutlineProvider's inputChanged method a null viewer
- // so that the outline's contentprovider/adapters don't attempt to update the viewer
- // after the editor closes
- extensibleOutlineProvider.inputChanged(null, null, null);
- if (resourceChangeHandler != null)
- {
- resourceChangeHandler.dispose();
- }
- super.dispose();
- }
-
- public WSDLSelectionManager getSelectionManager()
- {
- return selectionManager;
- }
-
- public ExtensibleOutlineProvider getExtensibleOutlineProvider()
- {
- if (extensibleOutlineProvider == null)
- {
- extensibleOutlineProvider = new ExtensibleOutlineProvider(this);
- }
- return extensibleOutlineProvider;
- }
-
- public WSDLTextEditor getWSDLTextEditor()
- {
- return textEditor;
- }
-
- public WSDLGraphViewer getGraphViewer()
- {
- return graphViewer;
- }
-
- public IStructuredModel getStructuredModel()
- {
- return textEditor.getModel();
- }
-
- public Document getXMLDocument()
- {
- return ((XMLModel)textEditor.getModel()).getDocument();
- }
-
- public Definition getDefinition()
- {
- return definition;
- }
-
- /**
- * Creates the pages of this multi-page editor.
- * <p>
- * Subclasses of <code>MultiPageEditor</code> must implement this method.
- * </p>
- */
- protected void createPages()
- {
- try
- {
- if (resourceChangeHandler == null)
- {
- resourceChangeHandler = new WSDLEditorResourceChangeHandler(this);
- resourceChangeHandler.attach();
- }
- createSourcePage();
- addSourcePage();
-
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getAdapterFactories().add(new WSDLModelLocatorAdapterFactory());
- resourceSet.getAdapterFactories().add(new XSDSchemaLocationResolverAdapterFactory());
- resourceSet.getLoadOptions().put(WSDLResourceImpl.USE_EXTENSION_FACTORIES, Boolean.FALSE);
-
- IFile file = ((IFileEditorInput)getEditorInput()).getFile();
-
- // create a definition based on the text editor document
- //
- definition = WSDLResourceUtil.createDefinition(resourceSet, file, getXMLDocument());
-
- WSDLEditorUtil.getInstance().setTypeSystemProvider(definition, new ExtensibleTypeSystemProvider(this));
-
- //ReferenceManager.adaptDefinition(definition);
- new SEDDocumentAdapter(getStructuredModel(), definition);
- createAndAddGraphPage();
-
- // get the type of page and set the active page to show
- int pageIndexToShow = getDefaultPageIndex();
- setActivePage(pageIndexToShow);
-
- getSelectionManager().setSelection(new StructuredSelection(getDefinition()));
- }
- catch (PartInitException exception)
- {
- throw new SourceEditingRuntimeException(SSECorePlugin.getResourceString("An_error_has_occurred_when1_ERROR_")); //$NON-NLS-1$ = "An error has occurred when initializing the input for the the editor's source page."
- }
- // TODO: add a catch block here for any exception the design page throws and convert it into a more informative message.
- }
-
- protected int getDefaultPageIndex()
- {
- if (WSDLEditorPlugin.getInstance().getDefaultPage().equals(WSDLEditorPlugin.GRAPH_PAGE))
- {
- if (graphPageIndex != -1)
- {
- return graphPageIndex;
- }
- }
- return sourcePageIndex;
- }
-
- /**
- * @see org.eclipse.wst.wsdl.ui.WSDLMultiPageEditorPart#createTextEditor()
- */
- protected StructuredTextEditor createTextEditor()
- {
- textEditor = new WSDLTextEditor(this);
- return textEditor;
- }
-
- /**
- * create our own
- */
- protected void createSourcePage() throws PartInitException
- {
- super.createSourcePage();
-
- textEditor = (WSDLTextEditor)getTextEditor();
- }
-
- int sourcePageIndex = -1;
- /**
- * Adds the source page of the multi-page editor.
- */
- protected void addSourcePage() throws PartInitException
- {
- sourcePageIndex = addPage(textEditor, getEditorInput());
-
- setPageText(sourcePageIndex, WSDLEditorPlugin.getWSDLString("_UI_TAB_SOURCE"));
- // defect 223043 ... do textEditor.setModel() here instead of in createSourcePage()
- textEditor.setModel((IFileEditorInput)getEditorInput());
- // the updates critical, to get viewer selection manager and highlighting to work
- textEditor.update();
- }
-
- int[] weights;
- public void setDesignWeights(int[] weights, boolean updateSourceDesign)
- {
- this.weights = weights;
- if (updateSourceDesign)
- {
- sashForm.setWeights(weights);
- }
- }
-
- protected void pageChange(int arg)
- {
- super.pageChange(arg);
- if (getPageText(arg).equals(WSDLEditorPlugin.getWSDLString("_UI_TAB_SOURCE"))) // TRANSLATE !
- {
- // update the input
- }
- else if (getPageText(arg).equals(WSDLEditorPlugin.getWSDLString("_UI_TAB_GRAPH"))) // TRANSLATE !
- {
- // update the input
- }
- }
-
- static private Color dividerColor;
-
- /**
- * Creates the graph page and adds it to the multi-page editor.
- **/
- protected void createAndAddGraphPage() throws PartInitException
- {
- // create the graph page
- sashForm = new SashForm(getContainer(), SWT.BORDER);
- sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
- sashForm.setOrientation(SWT.VERTICAL);
- int[] weights = { 8, 3 };
-
- graphPageIndex = addPage(sashForm);
- setPageText(graphPageIndex, WSDLEditorPlugin.getWSDLString("_UI_TAB_GRAPH"));
-
- // create the graph viewer
- graphViewer = new WSDLGraphViewer(this);
- graphViewer.createControl(sashForm);
-
-// detailsViewer = new WSDLDetailsViewer(this);
-// detailsViewer.createControl(sashForm);
-//
-// sashForm.setWeights(weights);
-
- if (dividerColor == null)
- {
- dividerColor = new Color(getContainer().getDisplay(), 143, 141, 138);
- }
-
- getContainer().addPaintListener(new PaintListener()
- {
- /**
- * @see org.eclipse.swt.events.PaintListener#paintControl(PaintEvent)
- */
- public void paintControl(PaintEvent e)
- {
- Object source = e.getSource();
- if (source instanceof Composite)
- {
- Composite comp = (Composite)source;
- Rectangle boundary = comp.getClientArea();
- e.gc.setForeground(dividerColor);
- e.gc.drawLine(boundary.x, boundary.y, boundary.x + boundary.width, boundary.y);
- setDesignWeights(sashForm.getWeights(), true);
- }
- }
- });
- }
-
- public void setFocus()
- {
- super.setFocus();
- int activePage = getActivePage();
- if (activePage == sourcePageIndex)
- {
- WSDLEditorPlugin.getInstance().setDefaultPage(WSDLEditorPlugin.SOURCE_PAGE);
- }
- else
- {
- WSDLEditorPlugin.getInstance().setDefaultPage(WSDLEditorPlugin.GRAPH_PAGE);
- }
- }
-
- //
- //
- public static class BuiltInWSDLEditorExtension implements WSDLEditorExtension
- {
- public boolean isExtensionTypeSupported(int type)
- {
- return type == OUTLINE_TREE_CONTENT_PROVIDER
- || type == OUTLINE_LABEL_PROVIDER
- || type == EDIT_PART_FACTORY
- || type == DETAILS_VIEWER_PROVIDER
- || type == MENU_ACTION_CONTRIBUTOR
- || type == NODE_RECONCILER
- || type == NODE_ASSOCIATION_PROVIDER;
- }
-
- public boolean isApplicable(Object object)
- {
- return (object instanceof WSDLElement && !(object instanceof XSDSchemaExtensibilityElement)) || (object instanceof WSDLGroupObject);
- }
-
- public Object createExtensionObject(int type, WSDLEditor wsdlEditor)
- {
- Object result = null;
- switch (type)
- {
- case OUTLINE_TREE_CONTENT_PROVIDER :
- {
- result = new ModelAdapterContentProvider(WSDLModelAdapterFactory.getWSDLModelAdapterFactory());
- break;
- }
- case OUTLINE_LABEL_PROVIDER :
- {
- result = new ModelAdapterLabelProvider(WSDLModelAdapterFactory.getWSDLModelAdapterFactory());
- break;
- }
- case DETAILS_VIEWER_PROVIDER :
- {
- result = new WSDLDetailsViewerProvider();
- break;
- }
- case MENU_ACTION_CONTRIBUTOR :
- {
- result = new WSDLMenuActionContributor(wsdlEditor);
- break;
- }
- case NODE_ASSOCIATION_PROVIDER :
- {
- result = new WSDLNodeAssociationProvider();
- break;
- }
- case EDIT_PART_FACTORY :
- {
- result = new WSDLEditPartFactory();
- break;
- }
- }
- return result;
- }
- }
-
-
- public void reloadDependencies()
- {
- try
- {
- getGraphViewer().getComponentViewer().setPreserveExpansionEnabled(true);
- WSDLResourceUtil.reloadDirectives(definition);
- ComponentReferenceUtil.updateBindingReferences(definition);
- ComponentReferenceUtil.updatePortTypeReferences(definition);
- ComponentReferenceUtil.updateMessageReferences(definition);
- ComponentReferenceUtil.updateSchemaReferences(definition);
-
- // the line below simply causes a notification in order to update our views
- //
- definition.setDocumentationElement(definition.getDocumentationElement());
- }
- finally
- {
- getGraphViewer().getComponentViewer().setPreserveExpansionEnabled(false);
- }
- }
-
- public void openOnSelection(String specification)
- {
- EObject eObject = getDefinition().eResource().getEObject(specification);
- if (eObject != null)
- {
- getSelectionManager().setSelection(new StructuredSelection(eObject));
- }
- }
-
- public INavigationLocation createEmptyNavigationLocation()
- {
- return new InternalTextSelectionNavigationLocation(textEditor, false);
- }
-
- public INavigationLocation createNavigationLocation()
- {
- return new InternalTextSelectionNavigationLocation(textEditor, true);
- }
-
- static class InternalTextSelectionNavigationLocation extends TextSelectionNavigationLocation
- {
- public InternalTextSelectionNavigationLocation(ITextEditor part, boolean initialize)
- {
- super(part, initialize);
- }
-
- protected IEditorPart getEditorPart()
- {
- IEditorPart part = super.getEditorPart();
- if (part instanceof WSDLEditor)
- {
- part = ((WSDLEditor)part).getTextEditor();
- }
- return part;
- }
-
- public String getText()
- {
- IEditorPart part = getEditorPart();
- if (part instanceof WSDLTextEditor)
- {
- return ((WSDLTextEditor)part).getWSDLEditor().getTitle();
- }
- else
- {
- return super.getText();
- }
- }
- }
-
- // Returns the element currently on the copy, cut, paste clipboard
- public WSDLElement getClipboardContents() {
- return clipboardElement;
- }
-
- public void setClipboardContents(WSDLElement element) {
- clipboardElement = element;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLEditorPlugin.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLEditorPlugin.java
deleted file mode 100644
index 825df14..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLEditorPlugin.java
+++ /dev/null
@@ -1,672 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal;
-
-import java.io.IOException;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Hashtable;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.ContentGeneratorExtension;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.ContentGeneratorExtensionRegistry;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.ContentGeneratorProviderExtension;
-import org.eclipse.wst.wsdl.ui.internal.extension.ExtensibilityItemTreeProviderRegistry;
-import org.eclipse.wst.wsdl.ui.internal.extension.NSKeyedExtensionRegistry;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtensionRegistry;
-
-
-public class WSDLEditorPlugin extends AbstractUIPlugin //, IPluginHelper
-{
- public static final String DEFAULT_PAGE = "org.eclipse.wst.wsdl.ui.internal.defaultpage";
- public static final String GRAPH_PAGE = "org.eclipse.wst.wsdl.ui.internal.graphpage";
- public static final String SOURCE_PAGE = "org.eclipse.wst.wsdl.ui.internal.sourcepage";
-
- public final static String PLUGIN_ID = "org.eclipse.wst.wsdl.ui";
- public final static String XSD_EDITOR_ID = "org.eclipse.wst.xsd.ui.XSDEditor";
-
- public final static String DEFAULT_TARGET_NAMESPACE = "http://tempuri.org";
-
- public static int DEPENDECIES_CHANGED_POLICY_PROMPT = 0;
- public static int DEPENDECIES_CHANGED_POLICY_IGNORE = 1;
- public static int DEPENDECIES_CHANGED_POLICY_RELOAD = 2;
-
- protected static WSDLEditorPlugin instance;
- // protected XMLSchemaPackage xmlschemaPackage;
-// private static MsgLogger myMsgLogger;
-
- private WSDLEditorExtensionRegistry wsdlEditorExtensionRegistry;
- private NSKeyedExtensionRegistry extensiblityElementFilterRegistry;
- private ExtensibilityItemTreeProviderRegistry treeProviderRegistry;
- private NSKeyedExtensionRegistry propertyDescriptorProviderRegistry;
- private NSKeyedExtensionRegistry propertySourceProviderRegistry;
- private NSKeyedExtensionRegistry propertySectionDescriptorProviderRegistry;
- private ContentGeneratorExtensionRegistry contentGeneratorExtensionRegistry;
- private NSKeyedExtensionRegistry detailsViewerProviderRegistry;
- //private static Hashtable grayedImageMap = new Hashtable();
- private int dependenciesChangedPolicy = DEPENDECIES_CHANGED_POLICY_RELOAD;
-
-
- public static void logMessage(String message)
- {
- }
-
- /**
- * Resources helper.
- */
-
- public WSDLEditorPlugin(IPluginDescriptor descriptor)
- {
- super(descriptor);
- instance = this;
-
- // TODO... remove this code when we add 'dependenciesChangedPolicy'
- // to an editor preferences page
- try
- {
- String string = getWSDLString("_DEBUG_UPDATE_POLICY");
- int policy = Integer.parseInt(string);
- if (policy >= 0 && policy <= DEPENDECIES_CHANGED_POLICY_RELOAD)
- {
- dependenciesChangedPolicy = policy;
- }
- }
- catch (Exception e)
- {
- }
- }
-
- public WSDLEditorExtensionRegistry getWSDLEditorExtensionRegistry()
- {
- if (wsdlEditorExtensionRegistry == null)
- {
- wsdlEditorExtensionRegistry = new WSDLEditorExtensionRegistry();
- new InternalEditorExtensionRegistryReader(wsdlEditorExtensionRegistry).readRegistry();
- }
- return wsdlEditorExtensionRegistry;
- }
-
- public NSKeyedExtensionRegistry getDetailsViewerProviderRegistry()
- {
- if (detailsViewerProviderRegistry == null)
- {
- detailsViewerProviderRegistry = new NSKeyedExtensionRegistry();
- new DetailsViewerProviderRegistryReader(detailsViewerProviderRegistry).readRegistry();
- }
- return detailsViewerProviderRegistry;
- }
-
- public NSKeyedExtensionRegistry getExtensiblityElementFilterRegistry()
- {
- if (extensiblityElementFilterRegistry == null)
- {
- extensiblityElementFilterRegistry = new NSKeyedExtensionRegistry();
- new ElementContentFilterExtensionRegistryReader(extensiblityElementFilterRegistry).readRegistry();
- }
- return extensiblityElementFilterRegistry;
- }
-
- public ExtensibilityItemTreeProviderRegistry getExtensibilityItemTreeProviderRegistry()
- {
- if (treeProviderRegistry == null)
- {
- treeProviderRegistry = new ExtensibilityItemTreeProviderRegistry();
- new ExtensibilityItemTreeProviderRegistryReader(treeProviderRegistry).readRegistry();
- }
- return treeProviderRegistry;
- }
-
- public NSKeyedExtensionRegistry getPropertyDescriptorProviderRegistry()
- {
- if (propertyDescriptorProviderRegistry == null)
- {
- propertyDescriptorProviderRegistry = new NSKeyedExtensionRegistry();
- new PropertyDescriptorProviderRegistryReader(propertyDescriptorProviderRegistry).readRegistry();
- }
- return propertyDescriptorProviderRegistry;
- }
-
- public NSKeyedExtensionRegistry getPropertySourceProviderRegistry()
- {
- if (propertySourceProviderRegistry == null)
- {
- propertySourceProviderRegistry = new NSKeyedExtensionRegistry();
- new PropertySourceProviderRegistryReader(propertySourceProviderRegistry).readRegistry();
- }
- return propertySourceProviderRegistry;
- }
-
- public NSKeyedExtensionRegistry getPropertySectionDescriptorProviderRegistry()
- {
- if (propertySectionDescriptorProviderRegistry == null)
- {
- propertySectionDescriptorProviderRegistry = new NSKeyedExtensionRegistry();
- new PropertySectionDescriptorProviderRegistry(propertySectionDescriptorProviderRegistry).readRegistry();
- }
- return propertySectionDescriptorProviderRegistry;
- }
-
- public ContentGeneratorExtensionRegistry getContentGeneratorExtensionRegistry()
- {
- if (contentGeneratorExtensionRegistry == null)
- {
- contentGeneratorExtensionRegistry = new ContentGeneratorExtensionRegistry();
- new ContentGeneratorExtensionRegistryReader(contentGeneratorExtensionRegistry).readRegistry();
- }
- return contentGeneratorExtensionRegistry;
- }
-
- /**
- * Get the Install URL
- */
- public static URL getInstallURL()
- {
- return getInstance().getDescriptor().getInstallURL();
- }
-
- /**
- * Get resource string
- */
- public static String getWSDLString(String key)
- {
- return getInstance().getDescriptor().getResourceBundle().getString(key);
- }
-
- /**
- * Get resource string
- */
- public static String getWSDLString(String key, String arg0)
- {
- return MessageFormat.format(getWSDLString(key), new Object [] { arg0 });
- }
-
- /**
- * Get resource string
- */
- public static String getWSDLString(String key, String arg0, String arg1)
- {
- return MessageFormat.format(getWSDLString(key), new Object [] { arg0, arg1 });
- }
-
- /**
- * Return the plugin physical directory location
- */
- public static IPath getPluginLocation()
- {
- try
- {
- IPath installPath = new Path(getInstallURL().toExternalForm()).removeTrailingSeparator();
- String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile();
- return new Path(installStr);
- }
- catch (IOException e)
- {
- //System.out.println("WSDLEditorPlugin.getPluginLocation() exception.." + e);
- }
- return null;
- }
-
- protected Hashtable imageDescriptorCache = new Hashtable();
-
- protected ImageDescriptor internalGetImageDescriptor(String key)
- {
- ImageDescriptor imageDescriptor = (ImageDescriptor) imageDescriptorCache.get(key);
- if (imageDescriptor == null)
- {
- imageDescriptor = ImageDescriptor.createFromFile(WSDLEditorPlugin.class, key);
- if (imageDescriptor != null)
- {
- imageDescriptorCache.put(key, imageDescriptor);
- }
- }
- return imageDescriptor;
- }
-
- public static ImageDescriptor getImageDescriptor(String key)
- {
- return getInstance().internalGetImageDescriptor(key);
- }
-
- public Image getImage(String iconName)
- {
- ImageRegistry imageRegistry = getImageRegistry();
-
- if (imageRegistry.get(iconName) != null)
- {
- return imageRegistry.get(iconName);
- }
- else
- {
- imageRegistry.put(iconName, ImageDescriptor.createFromFile(getClass(), iconName));
- return imageRegistry.get(iconName);
- }
- }
-
- /*
- public Image getImage(String key, boolean isGrayed)
- {
- Image image = null;
- if (!isGrayed)
- {
- image = super.getImage(key);
- }
- else
- {
- image = (Image)grayedImageMap.get(key);
- if (image == null)
- {
- Image colorImage = super.getImage(key);
- if (colorImage != null)
- {
- image = new Image(Display.getCurrent(), colorImage, SWT.IMAGE_GRAY);//SWT.IMAGE_DISABLE);
- grayedImageMap.put(key, image);
- }
- }
- }
- return image;
- }
- */
-
- /**
- * Get the metadata directory for this plugin
- */
- public static String getMetaDataDirectory()
- {
- return getInstance().getStateLocation().toOSString();
- }
-
- /**
- * Get the singleton instance.
- */
- public static WSDLEditorPlugin getInstance()
- {
- return instance;
- }
-
- public IWorkspace getWorkspace()
- {
- return ResourcesPlugin.getWorkspace();
- }
-
- public static Shell getShell()
- {
- return getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPreferences(org.eclipse.jface.preference.IPreferenceStore)
- */
- protected void initializeDefaultPreferences(IPreferenceStore store)
- {
- super.initializeDefaultPreferences(store);
- store.setDefault(DEFAULT_PAGE, GRAPH_PAGE);
-
- // WSDLPreferencePage prefs
- store.setDefault(WSDLEditorPlugin.getWSDLString("_UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE"), DEFAULT_TARGET_NAMESPACE);
- // Do we need this preference below? Look at WSDLPreferencePage.java
-// store.setDefault("Defualt Location:", "http://www.example.com");
- }
-
- /**
- * setDefaultPage
- * Set the default page to open when the editor starts. Maintains the state
- * when WSAD is shutdown and restarted.
- * @param page
- */
- public void setDefaultPage(String page)
- {
- getPreferenceStore().setValue(DEFAULT_PAGE, page);
- }
-
- public String getDefaultPage()
- {
- return getPreferenceStore().getString(DEFAULT_PAGE);
- }
-
- public int getDependenciesChangedPolicy()
- {
- //return getPreferenceStore().getInt(DEPENDECIES_CHANGED_POLICY);
- return dependenciesChangedPolicy;
- }
-}
-
-class BaseRegistryReader
-{
- protected static final String PLUGIN_ID = "org.eclipse.wst.wsdl.ui";
-
- /**
- * read from plugin registry and parse it.
- */
- public void readRegistry(String extensionPointId)
- {
- boolean boo = true;
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- IExtensionPoint point = pluginRegistry.getExtensionPoint(PLUGIN_ID, extensionPointId);
- if (point != null)
- {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++)
- {
- readElement(elements[i]);
- }
- }
- }
-
- protected void readElement(IConfigurationElement element)
- {
- }
-}
-
-/**
- * This class reads the plugin manifests and registers each internal editor extension
- */
-class InternalEditorExtensionRegistryReader extends BaseRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "internalEditorExtensions";
- protected static final String TAG_NAME = "internalEditorExtension";
- protected static final String ATT_CLASS = "class";
- protected WSDLEditorExtensionRegistry registry;
-
- public InternalEditorExtensionRegistryReader(WSDLEditorExtensionRegistry registry)
- {
- this.registry = registry;
- }
-
- /**
- * read from plugin registry and parse it.
- */
- public void readRegistry()
- {
- super.readRegistry(EXTENSION_POINT_ID);
- }
-
- /**
- * readElement()
- */
- protected void readElement(IConfigurationElement element)
- {
- if (element.getName().equals(TAG_NAME))
- {
- String className = element.getAttribute(ATT_CLASS);
- if (className != null)
- {
- try
- {
- ClassLoader pluginClsLoader = element.getDeclaringExtension().getDeclaringPluginDescriptor().getPlugin().getClass().getClassLoader();
- registry.add(pluginClsLoader, className);
- }
- catch (Exception e)
- {
- }
- }
- }
- }
-}
-
-/**
- * This class reads the plugin manifests and registers each extensibility item tree provider
- */
-class ContentGeneratorExtensionRegistryReader extends BaseRegistryReader
-{
- protected static final String PLUGIN_ID = "org.eclipse.wst.wsdl.ui";
- protected static final String EXTENSION_POINT_ID = "contentGenerators";
- protected static final String ELEMENT_CONTENT_GENERATOR = "contentGenerator";
- protected static final String ELEMENT_CONTENT_GENERATOR_PROVIDER = "contentGeneratorProvider";
- protected static final String ATT_CLASS = "class";
- protected static final String ATT_NAME = "name";
- protected static final String ATT_NAMESPACE = "namespace";
- protected static final String ATT_CONTENT_GENERATOR_CLASS = "contentGeneratorClass";
- protected static final String ATT_PORT_OPTIONS_PAGE_CLASS = "portOptionsPageClass";
- protected static final String ATT_BINDING_OPTIONS_PAGE_CLASS = "bindingOptionsPageClass";
-
- protected ContentGeneratorExtensionRegistry registry;
-
- public ContentGeneratorExtensionRegistryReader(ContentGeneratorExtensionRegistry registry)
- {
- this.registry = registry;
- }
-
- /**
- * read from plugin registry and parse it.
- */
- public void readRegistry()
- {
- super.readRegistry(EXTENSION_POINT_ID);
- }
-
- /**
- * readElement()
- */
- protected void readElement(IConfigurationElement element)
- {
- if (element.getName().equals(ELEMENT_CONTENT_GENERATOR))
- {
- String name = element.getAttribute(ATT_NAME);
- String namespace = element.getAttribute(ATT_NAMESPACE);
- String generatorClass = element.getAttribute(ATT_CONTENT_GENERATOR_CLASS);
- if (name != null && generatorClass != null)
- {
- ContentGeneratorExtension bindingGeneratorExtension = new ContentGeneratorExtension(name, generatorClass);
- bindingGeneratorExtension.setNamespace(namespace);
- bindingGeneratorExtension.setPortOptionsPageClassName(element.getAttribute(ATT_PORT_OPTIONS_PAGE_CLASS));
- bindingGeneratorExtension.setBindingOptionsPageClassName(element.getAttribute(ATT_BINDING_OPTIONS_PAGE_CLASS));
- try
- {
- ClassLoader pluginClasssLoader = element.getDeclaringExtension().getDeclaringPluginDescriptor().getPlugin().getClass().getClassLoader();
- bindingGeneratorExtension.setClassLoader(pluginClasssLoader);
- registry.add(bindingGeneratorExtension);
- }
- catch (Exception e)
- {
- }
- }
- }
- else if (element.getName().equals(ELEMENT_CONTENT_GENERATOR_PROVIDER))
- {
- String className = element.getAttribute(ATT_CLASS);
- if (className != null)
- {
- ContentGeneratorProviderExtension contentGeneratorExtension = new ContentGeneratorProviderExtension(className);
- registry.add(contentGeneratorExtension);
- }
- }
- }
-}
-
-/**
- *
- */
-abstract class NSKeyedExtensionRegistryReader extends BaseRegistryReader
-{
- protected static final String ATT_NAME_SPACE = "namespace";
- protected String extensionPointId;
- protected String tagName;
- protected String[] attributeNames;
- protected NSKeyedExtensionRegistry nsKeyedExtensionRegistry;
-
- private NSKeyedExtensionRegistryReader(String extensionPointId, String tagName, NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- this.extensionPointId = extensionPointId;
- this.tagName = tagName;
- this.nsKeyedExtensionRegistry = nsKeyedExtensionRegistry;
- }
-
- public NSKeyedExtensionRegistryReader(String extensionPointId, String tagName, String attributeName, NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- this(extensionPointId, tagName, nsKeyedExtensionRegistry);
- attributeNames = new String[1];
- attributeNames[0] = attributeName;
- }
-
- public NSKeyedExtensionRegistryReader(String extensionPointId, String tagName, String[] attributeNames, NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- this(extensionPointId, tagName, nsKeyedExtensionRegistry);
- this.attributeNames = attributeNames;
- }
- /**
- * read from plugin registry and parse it.
- */
- public void readRegistry()
- {
- super.readRegistry(extensionPointId);
- }
-
- /**
- * readElement()
- */
- protected void readElement(IConfigurationElement element)
- {
- if (element.getName().equals(tagName))
- {
- String namespace = element.getAttribute(ATT_NAME_SPACE);
- if (namespace != null)
- {
- ClassLoader pluginClasssLoader = element.getDeclaringExtension().getDeclaringPluginDescriptor().getPluginClassLoader();
- if (attributeNames.length == 1)
- {
- String className = element.getAttribute(attributeNames[0]);
- if (className != null)
- {
- nsKeyedExtensionRegistry.put(namespace, className, pluginClasssLoader);
- }
- }
- else
- {
- HashMap map = new HashMap();
- for (int i = 0; i < attributeNames.length; i++)
- {
- String attributeName = attributeNames[i];
- String className = element.getAttribute(attributeName);
- if (className != null && className.length() > 0)
- {
- map.put(attributeName, className);
- }
- }
- nsKeyedExtensionRegistry.put(namespace, map, pluginClasssLoader);
- }
- }
- }
- }
-}
-
-/**
- * This class reads the plugin manifests and registers each extensibility item tree provider
- */
-class ExtensibilityItemTreeProviderRegistryReader extends NSKeyedExtensionRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "extensibilityItemTreeProviders";
- protected static final String TAG_NAME = "extensibilityItemTreeProvider";
- protected static final String[] ATT_NAMES = { "labelProviderClass", "contentProviderClass" };
-
- public ExtensibilityItemTreeProviderRegistryReader(NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- super(EXTENSION_POINT_ID, TAG_NAME, ATT_NAMES, nsKeyedExtensionRegistry);
- }
-}
-
-/**
- *
- */
-class ElementContentFilterExtensionRegistryReader extends NSKeyedExtensionRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "extensibilityElementFilter";
- protected static final String TAG_NAME = "extensibilityElementFilter";
-
- public ElementContentFilterExtensionRegistryReader(NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- super(EXTENSION_POINT_ID, TAG_NAME, "class", nsKeyedExtensionRegistry);
- }
-}
-
-/**
- *
- */
-class PropertyDescriptorProviderRegistryReader extends NSKeyedExtensionRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "propertyDescriptorProvider";
- protected static final String TAG_NAME = "propertyDescriptorProvider";
-
- public PropertyDescriptorProviderRegistryReader(NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- super(EXTENSION_POINT_ID, TAG_NAME, "class", nsKeyedExtensionRegistry);
- }
-
- protected void readElement(IConfigurationElement element)
- {
- super.readElement(element);
- }
-}
-
-class PropertySourceProviderRegistryReader extends NSKeyedExtensionRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "propertySourceProvider";
- protected static final String TAG_NAME = "propertySourceProvider";
-
- public PropertySourceProviderRegistryReader(NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- super(EXTENSION_POINT_ID, TAG_NAME, "class", nsKeyedExtensionRegistry);
- }
-
- protected void readElement(IConfigurationElement element)
- {
- super.readElement(element);
- }
-}
-
-class PropertySectionDescriptorProviderRegistry extends NSKeyedExtensionRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "propertySectionDescriptorProvider";
- protected static final String TAG_NAME = "propertySectionDescriptorProvider";
-
- public PropertySectionDescriptorProviderRegistry(NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- super(EXTENSION_POINT_ID, TAG_NAME, "class", nsKeyedExtensionRegistry);
- }
-
- protected void readElement(IConfigurationElement element)
- {
- super.readElement(element);
- }
-}
-
-/**
- *
- */
-class DetailsViewerProviderRegistryReader extends NSKeyedExtensionRegistryReader
-{
- protected static final String EXTENSION_POINT_ID = "detailsViewerProviders";
- protected static final String TAG_NAME = "detailsViewerProvider";
-
- public DetailsViewerProviderRegistryReader(NSKeyedExtensionRegistry nsKeyedExtensionRegistry)
- {
- super(EXTENSION_POINT_ID, TAG_NAME, "class", nsKeyedExtensionRegistry);
- }
-
- protected void readElement(IConfigurationElement element)
- {
- super.readElement(element);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLEditorResourceChangeHandler.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLEditorResourceChangeHandler.java
deleted file mode 100644
index 1c77991..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLEditorResourceChangeHandler.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.wsdl.Definition;
-
-
-public class WSDLEditorResourceChangeHandler
-{
- protected WSDLEditor wsdlEditor;
- protected boolean isUpdateRequired;
- protected InternalResourceChangeListener resourceChangeListener;
- protected InternalPartListener partListener;
-
- public WSDLEditorResourceChangeHandler(WSDLEditor wsdlEditor)
- {
- this.wsdlEditor = wsdlEditor;
- resourceChangeListener = new InternalResourceChangeListener();
- partListener = new InternalPartListener();
- }
-
- public void attach()
- {
- ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener);
- wsdlEditor.getSite().getWorkbenchWindow().getPartService().addPartListener(partListener);
- }
-
- public void dispose()
- {
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
- wsdlEditor.getSite().getWorkbenchWindow().getPartService().removePartListener(partListener);
- }
-
- protected Map computeDependencyMap()
- {
- Map map = new HashMap();
- Definition definition = wsdlEditor.getDefinition();
- ResourceSet resourceSet = definition.eResource().getResourceSet();
- for (Iterator i = resourceSet.getResources().iterator(); i.hasNext();)
- {
- Resource resource = (Resource)i.next();
- if (resource != definition.eResource())
- {
- String uri = resource.getURI().toString();
- if (map.get(uri) == null)
- {
- map.put(uri, uri);
- }
- }
- }
- return map;
- }
-
- public void performReload()
- {
- boolean doReload = false;
- int policy = WSDLEditorPlugin.getInstance().getDependenciesChangedPolicy();
-
- if (policy == WSDLEditorPlugin.DEPENDECIES_CHANGED_POLICY_PROMPT)
- {
- doReload = MessageDialog.openQuestion(wsdlEditor.getSite().getShell(), WSDLEditorPlugin.getWSDLString("_UI_DEPENDENCIES_CHANGED"), WSDLEditorPlugin.getWSDLString("_UI_DEPENDENCIES_CHANGED_REFRESH"));
- }
- else if (policy == WSDLEditorPlugin.DEPENDECIES_CHANGED_POLICY_RELOAD)
- {
- doReload = true;
- }
-
- if (doReload)
- {
- wsdlEditor.reloadDependencies();
- }
- }
-
- public boolean isListeningToResourceChanges()
- {
- int policy = WSDLEditorPlugin.getInstance().getDependenciesChangedPolicy();
- return policy == WSDLEditorPlugin.DEPENDECIES_CHANGED_POLICY_PROMPT ||
- policy == WSDLEditorPlugin.DEPENDECIES_CHANGED_POLICY_RELOAD;
- }
-
-
- class InternalResourceChangeListener implements IResourceChangeListener, IResourceDeltaVisitor
- {
- protected List list = new ArrayList();
- protected boolean isPending = false;
- protected int count = 0;
-
- public void resourceChanged(IResourceChangeEvent event)
- {
- Display display = Display.getCurrent();
-
- if (display != null && isListeningToResourceChanges() && !isUpdateRequired)
- {
- if (event.getType() == IResourceChangeEvent.POST_CHANGE)
- {
- IResourceDelta[] deltas = event.getDelta().getAffectedChildren();
- for (int i = 0; i < deltas.length; i++)
- {
- try
- {
- deltas[i].accept(this);
- }
- catch (Exception e)
- {
- }
- }
- }
- if (list.size() > 0)
- {
- if (!isPending)
- {
- isPending = true;
- display.timerExec(2000, new TimerEvent());
- }
- }
- }
- }
-
- public boolean visit(IResourceDelta delta) throws CoreException
- {
- IResource resource = delta.getResource();
- if (resource.getType() == IResource.FILE)
- {
- if (!list.contains(resource))
- {
- list.add(resource);
- }
- }
- return true;
- }
-
- class TimerEvent implements Runnable
- {
- public TimerEvent()
- {
- //System.out.println("NewTimerEvent(" + wsdlEditor.getDefinition().eResource().getURI() + ") " + count);
- }
-
- public void run()
- {
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- IResource resource = (IResource)i.next();
- String platformPath = URI.createPlatformResourceURI(resource.getFullPath().toString()).toString();
- }
-
- Map dependencyMap = computeDependencyMap();
-
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- IResource resource = (IResource)i.next();
- String platformPath = URI.createPlatformResourceURI(resource.getFullPath().toString()).toString();
- if (dependencyMap.get(platformPath) != null)
- {
- isUpdateRequired = true;
- if (wsdlEditor.getSite().getWorkbenchWindow().getPartService().getActivePart() == wsdlEditor)
- {
- isUpdateRequired = false;
- performReload();
- }
- }
- }
-
- isPending = false;
- list = new ArrayList();
- }
- }
- }
-
- class InternalPartListener implements IPartListener
- {
- public void partActivated(IWorkbenchPart part)
- {
- if (part == wsdlEditor)
- {
- if (isUpdateRequired)
- {
- isUpdateRequired = false;
- performReload();
- }
- }
- }
-
- public void partBroughtToTop(IWorkbenchPart part)
- {
- }
-
- public void partClosed(IWorkbenchPart part)
- {
- }
-
-
- public void partDeactivated(IWorkbenchPart part)
- {
- }
-
- public void partOpened(IWorkbenchPart part)
- {
- }
- }
-
-
-}
-
-/*
-class DependencyVisitor
-{
- public void visitImport(Import theImport)
- {
- if (theImport.getEDefinition() != null)
- {
- visitDefinition(theImport.getEDefinition());
- }
- else if (theImport.getESchema() != null)
- {
- visitSchema(theImport.getESchema());
- }
- }
-
- public void visitXSDSchemaDirective(XSDSchemaDirective directive)
- {
- XSDSchema referencedSchema = directive.getResolvedSchema();
- if (referencedSchema != null)
- {
- visitSchema(referencedSchema);
- }
- }
-
- public void visitDefinition(Definition definition)
- {
- if (definition != null)
- {
- for (Iterator i = definition.getEImports().iterator(); i.hasNext();)
- {
- visitImport((Import)i.next());
- }
- Types types = definition.getETypes();
- if (types != null)
- {
-
- for (Iterator i = types.getEExtensibilityElements().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement e = (XSDSchemaExtensibilityElement)o;
- if (e.getEXSDSchema() != null)
- {
- visitSchema(e.getEXSDSchema());
- }
- }
- }
- }
- }
- }
-
- public void visitSchema(XSDSchema schema)
- {
- for (Iterator i = schema.getContents().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaDirective)
- {
- visitXSDSchemaDirective((XSDSchemaDirective)o);
- }
- }
- }
-}
-
-class ReloadDependencyVisitor extends DependencyVisitor
-{
- public void visitImport(Import theImport)
- {
- ComponentHandler handler = WSDLReconciler.getReconciler(theImport);
- Element element = WSDLUtil.getInstance().getElementForObject(theImport);
- if (element != null && handler != null)
- {
- handler.reconcile(wsdlEditor.getDefinition(), theImport, element);
- }
- }
-
- public void visitXSDSchemaDirective(XSDSchemaDirective directive)
- {
-
- }
-}*/
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLMultiPageEditorPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLMultiPageEditorPart.java
deleted file mode 100644
index 6803f7a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLMultiPageEditorPart.java
+++ /dev/null
@@ -1,726 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-
-import org.eclipse.core.internal.resources.ResourceException;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.part.MultiPageEditorSite;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.exceptions.SourceEditingRuntimeException;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.xml.core.XMLPreferenceNames;
-import org.eclipse.wst.xml.ui.StructuredTextEditorXML;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public class WSDLMultiPageEditorPart extends MultiPageEditorPart implements IPropertyListener
-{
-
- /**
- *
- */
- public WSDLMultiPageEditorPart()
- {
- super();
- }
-
- /**
- * Internal part activation listener
- */
- class PartListener extends ShellAdapter implements IPartListener {
- private IWorkbenchPart fActivePart;
- private boolean fIsHandlingActivation = false;
-
- private void handleActivation() {
-
- if (fIsHandlingActivation)
- return;
-
- if (fActivePart == WSDLMultiPageEditorPart.this) {
- fIsHandlingActivation = true;
- try {
- safelySanityCheckState();
- }
- finally {
- fIsHandlingActivation = false;
- }
- }
- }
-
- /**
- * @see IPartListener#partActivated(IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- fActivePart = part;
- handleActivation();
- }
-
- /**
- * @see IPartListener#partBroughtToTop(IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- }
-
- /**
- * @see IPartListener#partClosed(IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- }
-
- /**
- * @see IPartListener#partDeactivated(IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- fActivePart = null;
- }
-
- /**
- * @see IPartListener#partOpened(IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- }
-
- /*
- * @see ShellListener#shellActivated(ShellEvent)
- */
- public void shellActivated(ShellEvent e) {
- handleActivation();
- }
- }
-
- class TextInputListener implements ITextInputListener {
- public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
- }
-
- public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
- }
- }
-
- /** The source page index. */
- private int fSourcePageIndex;
- /** The text editor. */
- private StructuredTextEditor fTextEditor;
-
- private PartListener partListener;
-
-
- /*
- * This method is just to make firePropertyChanged accessbible from some
- * (anonomous) inner classes.
- */
- protected void _firePropertyChange(int property) {
- super.firePropertyChange(property);
- }
-
- /**
- * Adds the source page of the multi-page editor.
- */
- protected void addSourcePage() throws PartInitException {
- try {
- fSourcePageIndex = addPage(fTextEditor, getEditorInput());
- setPageText(fSourcePageIndex, WSDLEditorPlugin.getWSDLString("_UI_TAB_SOURCE")); //$NON-NLS-1$
- // the update's critical, to get viewer selection manager and
- // highlighting to work
- fTextEditor.update();
-
- firePropertyChange(PROP_TITLE);
-
- // Changes to the Text Viewer's document instance should also force an
- // input refresh
- fTextEditor.getTextViewer().addTextInputListener(new TextInputListener());
- }
- catch (PartInitException exception) {
- // dispose editor
- dispose();
-
- throw new SourceEditingRuntimeException(SSECorePlugin.getResourceString("An_error_has_occurred_when1_ERROR_")); //$NON-NLS-1$
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.MultiPageEditorPart#createPages()
- */
- protected void createPages()
- {
- try
- {
- // source page MUST be created before design page, now
- createSourcePage();
- addSourcePage();
- setActivePage();
-
- // future_TODO: add a catch block here for any exception the design
- // page throws and convert it into a more informative message.
- }
- catch (PartInitException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * @see org.eclipse.ui.part.MultiPageEditorPart#createSite(org.eclipse.ui.IEditorPart)
- */
- protected IEditorSite createSite(IEditorPart editor) {
- IEditorSite site = null;
- if (editor == fTextEditor) {
- site = new MultiPageEditorSite(this, editor) {
- /**
- * @see org.eclipse.ui.part.MultiPageEditorSite#getActionBarContributor()
- */
- public IEditorActionBarContributor getActionBarContributor() {
- IEditorActionBarContributor contributor = super.getActionBarContributor();
- IEditorActionBarContributor multiContributor = WSDLMultiPageEditorPart.this.getEditorSite().getActionBarContributor();
-// if (multiContributor instanceof XMLMultiPageEditorActionBarContributor) {
-// contributor = ((XMLMultiPageEditorActionBarContributor) multiContributor).sourceViewerActionContributor;
-// }
- return contributor;
- }
- };
- }
- else {
- site = super.createSite(editor);
- }
- return site;
- }
-
- /**
- * Creates the source page of the multi-page editor.
- */
- protected void createSourcePage() throws PartInitException {
- fTextEditor = createTextEditor();
- fTextEditor.setEditorPart(this);
-
- // Set the SourceViewerConfiguration now so the text editor won't use
- // the default configuration first
- // and switch to the StructuredTextViewerConfiguration later.
- // DMW removed setSourceViewerConfiguration 3/26/2003 since added
- // createPartControl to our text editor.
- // fTextEditor.setSourceViewerConfiguration();
- fTextEditor.addPropertyListener(this);
- }
-
- /**
- * Method createTextEditor.
- *
- * @return StructuredTextEditor
- */
- protected StructuredTextEditor createTextEditor() {
- return new StructuredTextEditorXML();
- }
-
- public void dispose()
- {
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- window.getPartService().removePartListener(partListener);
- window.getShell().removeShellListener(partListener);
-
- getSite().getPage().removePartListener(partListener);
- if (fTextEditor != null) {
- fTextEditor.removePropertyListener(this);
- }
-
- // moved to last when added window ... seems like
- // we'd be in danger of losing some data, like site,
- // or something.
- super.dispose();
- }
-
- /*
- * (non-Javadoc) Saves the contents of this editor. <p> Subclasses must
- * override this method to implement the open-save-close lifecycle for an
- * editor. For greater details, see <code> IEditorPart </code></p>
- *
- * @see IEditorPart
- */
- public void doSave(IProgressMonitor monitor) {
- fTextEditor.doSave(monitor);
- // // this is a temporary way to force validation.
- // // when the validator is a workbench builder, the following lines
- // can be removed
- // if (fDesignViewer != null)
- // fDesignViewer.saveOccurred();
-
- }
-
- /*
- * (non-Javadoc) Saves the contents of this editor to another object. <p>
- * Subclasses must override this method to implement the open-save-close
- * lifecycle for an editor. For greater details, see <code> IEditorPart
- * </code></p>
- *
- * @see IEditorPart
- */
- public void doSaveAs() {
- fTextEditor.doSaveAs();
- // 253619
- // following used to be executed here, but is
- // now called "back" from text editor (since
- // mulitiple paths to the performSaveAs in StructuredTextEditor.
- //doSaveAsForStructuredTextMulitPagePart();
- }
-
- private void editorInputIsAcceptable(IEditorInput input) throws PartInitException {
- if (input instanceof IFileEditorInput) {
- // verify that it can be opened
- CoreException[] coreExceptionArray = new CoreException[1];
- if (fileDoesNotExist((IFileEditorInput) input, coreExceptionArray)) {
- // todo use message formatter for {0}
- Throwable coreException = coreExceptionArray[0];
- if (coreException instanceof ResourceException) {
- // I'm assuming this is always 'does not exist'
- // we'll refresh local go mimic behavior of default
- // editor, where the
- // troublesome file is refreshed (and will cause it to
- // 'disappear' from Navigator.
- try {
- ((IFileEditorInput) input).getFile().refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
- }
- catch (CoreException ce) {
- // very unlikely
-// Logger.logException(ce);
- }
- throw new PartInitException(SSECorePlugin.getResourceString("23concat_EXC_", (new Object[]{input.getName()}))); //$NON-NLS-1$
- //$NON-NLS-1$ = "Resource {0} does not exist."
- }
- else {
- throw new PartInitException(SSECorePlugin.getResourceString("32concat_EXC_", (new Object[]{input.getName()}))); //$NON-NLS-1$
- //$NON-NLS-1$ = "Editor could not be open on {0}"
- }
- }
- }
- else if (input instanceof IStorageEditorInput) {
- InputStream contents = null;
- try {
- contents = ((IStorageEditorInput) input).getStorage().getContents();
- }
- catch (CoreException noStorageExc) {
- }
- if (contents == null) {
- throw new PartInitException(SSECorePlugin.getResourceString("32concat_EXC_", (new Object[]{input.getName()}))); //$NON-NLS-1$
- }
- else {
- try {
- contents.close();
- }
- catch (IOException e) {
- }
- }
- }
- }
-
- // void doSaveAsForStructuredTextMulitPagePart() {
- // setPageText(getActivePage(), fTextEditor.getTitle());
- // setInput(fTextEditor.getEditorInput());
- // if (fDesignViewer != null) {
- // //fDesignViewer.setEditorInput(fTextEditor.getEditorInput());
- // fDesignViewer.setModel(getModel());
- // fDesignViewer.saveAsOccurred();
- // }
- // // even though we've set title etc., several times already!
- // // only now is all prepared for it.
- // firePropertyChange(IWorkbenchPart.PROP_TITLE);
- // firePropertyChange(PROP_DIRTY);
- // }
- /*
- * (non-Javadoc) Initializes the editor part with a site and input. <p>
- * Subclasses of <code> EditorPart </code> must implement this method.
- * Within the implementation subclasses should verify that the input type
- * is acceptable and then save the site and input. Here is sample code:
- * </p><pre> if (!(input instanceof IFileEditorInput)) throw new
- * PartInitException("Invalid Input: Must be IFileEditorInput");
- * setSite(site); setInput(editorInput); </pre>
- */
- protected boolean fileDoesNotExist(IFileEditorInput input, Throwable[] coreException) {
- boolean result = false;
- InputStream inStream = null;
- if ((!(input.exists())) || (!(input.getFile().exists()))) {
- result = true;
- }
- else {
- try {
- inStream = input.getFile().getContents(true);
- }
- catch (CoreException e) {
- // very likely to be file not found
- result = true;
- coreException[0] = e;
- }
- finally {
- if (input != null) {
- try {
- if (inStream != null) {
- inStream.close();
- }
- }
- catch (IOException e) {
-
- }
- }
- }
- }
- return result;
- }
-
- public Object getAdapter(Class key) {
- Object result = null;
-
- // DMW: I'm bullet-proofing this because
- // its been reported (on 4.03 version) a null pointer sometimes
- // happens here on startup, when an editor has been left
- // open when workbench shutdown.
- if (fTextEditor != null) {
- result = fTextEditor.getAdapter(key);
- }
- return result;
- }
-
- /**
- * IExtendedMarkupEditor method
- */
- public Node getCaretNode() {
- if (getTextEditor() == null)
- return null;
-
- return getTextEditor().getCaretNode();
- }
-
- /**
- * IExtendedSimpleEditor method
- */
- public int getCaretPosition() {
- if (getTextEditor() == null)
- return -1;
-
- return getTextEditor().getCaretPosition();
- }
-
- /**
- * IExtendedSimpleEditor method
- */
- public IDocument getDocument() {
- if (getTextEditor() == null)
- return null;
-
- return getTextEditor().getDocument();
- }
-
- /**
- * IExtendedMarkupEditor method
- */
- public Document getDOMDocument() {
- if (getTextEditor() == null)
- return null;
-
- return getTextEditor().getDOMDocument();
- }
-
- /**
- * IExtendedSimpleEditor method
- */
- public IEditorPart getEditorPart() {
- return this;
- }
-
- protected IStructuredModel getModel() {
- IStructuredModel model = null;
- if (fTextEditor != null)
- model = fTextEditor.getModel();
- return model;
- }
-
- protected IPreferenceStore getPreferenceStore() {
- return WSDLEditorPlugin.getInstance().getPreferenceStore();
- }
-
- /**
- * IExtendedMarkupEditor method
- */
- public List getSelectedNodes() {
- if (getTextEditor() == null)
- return null;
- return getTextEditor().getSelectedNodes();
- }
-
- /**
- * IExtendedSimpleEditor method
- */
- public Point getSelectionRange() {
- if (getTextEditor() == null)
- return new Point(-1, -1);
-
- return getTextEditor().getSelectionRange();
- }
-
- public StructuredTextEditor getTextEditor() {
- return fTextEditor;
- }
-
- /*
- * (non-Javadoc) Method declared on IWorkbenchPart.
- */
- public String getTitle() {
- String title = null;
- if (getTextEditor() == null) {
- if (getEditorInput() != null) {
- title = getEditorInput().getName();
- }
- }
- else {
- title = getTextEditor().getTitle();
- }
- if (title == null) {
- title = getPartName();
- }
- return title;
- }
-
- /*
- * (non-Javadoc) Sets the cursor and selection state for this editor to
- * the passage defined by the given marker. <p> Subclasses may override.
- * For greater details, see <code> IEditorPart </code></p>
- *
- * @see IEditorPart
- */
- public void gotoMarker(IMarker marker) {
- // (pa) 20020217 this was null when opening an editor that was
- // already open
- if (fTextEditor != null) {
- IGotoMarker markerGotoer = (IGotoMarker) fTextEditor.getAdapter(IGotoMarker.class);
- markerGotoer.gotoMarker(marker);
- }
- }
-
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- editorInputIsAcceptable(input);
- try {
- super.init(site, input);
- if (partListener == null) {
- partListener = new PartListener();
- }
- //getSite().getPage().addPartListener(partListner);
- // we want to listen for our own activation
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- window.getPartService().addPartListener(partListener);
- window.getShell().addShellListener(partListener);
- }
- catch (Exception e) {
- if (e instanceof SourceEditingRuntimeException) {
- Throwable t = ((SourceEditingRuntimeException) e).getOriginalException();
- if (t instanceof IOException) {
- System.out.println(t);
- // file not found
- }
- }
- }
- setPartName(input.getName());
- }
-
- /*
- * (non-Javadoc) Returns whether the "save as" operation is supported by
- * this editor. <p> Subclasses must override this method to implement the
- * open-save-close lifecycle for an editor. For greater details, see
- * <code> IEditorPart </code></p>
- *
- * @see IEditorPart
- */
- public boolean isSaveAsAllowed() {
- return fTextEditor != null && fTextEditor.isSaveAsAllowed();
- }
-
- /*
- * (non-Javadoc) Returns whether the contents of this editor should be
- * saved when the editor is closed. <p> This method returns <code> true
- * </code> if and only if the editor is dirty ( <code> isDirty </code> ).
- * </p>
- */
- public boolean isSaveOnCloseNeeded() {
- // overriding super class since it does a lowly isDirty!
- if (fTextEditor != null)
- return fTextEditor.isSaveOnCloseNeeded();
- return isDirty();
- }
-
- /**
- * Notifies this multi-page editor that the page with the given id has
- * been activated. This method is called when the user selects a different
- * tab.
- *
- * @param newPageIndex
- * the index of the activated page
- */
- protected void pageChange(int newPageIndex) {
- super.pageChange(newPageIndex);
-
- saveLastActivePageIndex(newPageIndex);
- }
-
- /**
- * Posts the update code "behind" the running operation.
- */
- protected void postOnDisplayQue(Runnable runnable) {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
- if (windows != null && windows.length > 0) {
- Display display = windows[0].getShell().getDisplay();
- display.asyncExec(runnable);
- }
- else
- runnable.run();
- }
-
- /**
- * Indicates that a property has changed.
- *
- * @param source
- * the object whose property has changed
- * @param propId
- * the id of the property which has changed; property ids are
- * generally defined as constants on the source class
- */
- public void propertyChanged(Object source, int propId) {
- switch (propId) {
- // had to implement input changed "listener" so that
- // strucutedText could tell it containing editor that
- // the input has change, when a 'resource moved' event is
- // found.
- case IEditorPart.PROP_INPUT :
- case IEditorPart.PROP_DIRTY : {
- if (source == fTextEditor) {
- if (fTextEditor.getEditorInput() != getEditorInput()) {
- setInput(fTextEditor.getEditorInput());
- // title should always change when input changes.
- // create runnable for following post call
- Runnable runnable = new Runnable() {
- public void run() {
- _firePropertyChange(IWorkbenchPart.PROP_TITLE);
- }
- };
- // Update is just to post things on the display queue
- // (thread). We have to do this to get the dirty
- // property to get updated after other things on the
- // queue are executed.
- postOnDisplayQue(runnable);
- }
- }
- break;
- }
- case IWorkbenchPart.PROP_TITLE : {
- // update the input if the title is changed
- if (source == fTextEditor) {
- if (fTextEditor.getEditorInput() != getEditorInput()) {
- setInput(fTextEditor.getEditorInput());
- }
- }
- break;
- }
- default : {
- // propagate changes. Is this needed? Answer: Yes.
- if (source == fTextEditor) {
- firePropertyChange(propId);
- }
- break;
- }
- }
-
- }
-
- protected void safelySanityCheckState() {
- // If we're called before editor is created, simply ignore since we
- // delegate this function to our embedded TextEditor
- if (getTextEditor() == null)
- return;
-
- getTextEditor().safelySanityCheckState(getEditorInput());
-
- }
-
- protected void saveLastActivePageIndex(int newPageIndex) {
- // save the last active page index to preference manager
- getPreferenceStore().setValue(XMLPreferenceNames.LAST_ACTIVE_PAGE, newPageIndex);
- }
-
- /**
- * Sets the currently active page.
- */
- protected void setActivePage() {
- // retrieve the last active page index from preference manager
- int activePageIndex = getPreferenceStore().getInt(XMLPreferenceNames.LAST_ACTIVE_PAGE);
-
- // We check this range since someone could hand edit the XML
- // preference file to an invalid value ... which I know from
- // experience :( ... if they do, we'll reset to default and continue
- // rather than throw an assertion error in the setActivePage(int)
- // method.
- if (activePageIndex < 0 || activePageIndex >= getPageCount()) {
- activePageIndex = fSourcePageIndex;
- }
- setActivePage(activePageIndex);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput)
- */
- protected void setInput(IEditorInput input) {
- // If driven from the Source page, it's "model" may not be up to date
- // with the input just yet. We'll rely on later notification from the
- // TextViewer to set us straight
- super.setInput(input);
- setPartName(input.getName());
- }
-
- /**
- * IExtendedMarkupEditor method
- */
- public IStatus validateEdit(Shell context) {
- if (getTextEditor() == null)
- return new Status(IStatus.ERROR, WSDLEditorPlugin.PLUGIN_ID, IStatus.INFO, "", null); //$NON-NLS-1$
-
- return getTextEditor().validateEdit(context);
- }
-
- }
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLSelectionManager.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLSelectionManager.java
deleted file mode 100644
index 55a4d83..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLSelectionManager.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-
-public class WSDLSelectionManager implements ISelectionProvider, ISelectionChangedListener
-{
- protected List listenerList = new ArrayList();
- protected ISelection currentSelection;
- protected boolean enableNotify = true;
-
- public void setSelection(ISelection selection, ISelectionProvider source)
- {
- if (enableNotify)
- {
- currentSelection = selection;
- enableNotify = false;
- try
- {
- SelectionChangedEvent event = new SelectionChangedEvent(source, selection);
- List copyOfListenerList = new ArrayList(listenerList);
- for (Iterator i = copyOfListenerList.iterator(); i.hasNext(); )
- {
- ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
- listener.selectionChanged(event);
- }
- }
- finally
- {
- enableNotify = true;
- }
- }
- }
-
- // implements ISelectionProvider
- //
- public void setSelection(ISelection selection)
- {
- setSelection(selection, this);
- }
-
- public ISelection getSelection()
- {
- return currentSelection;
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.remove(listener);
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.add(listener);
- }
-
- // implements ISelectionChangedListener
- //
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (enableNotify)
- {
- setSelection(event.getSelection(), event.getSelectionProvider());
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLTextEditor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLTextEditor.java
deleted file mode 100644
index 5271118..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/WSDLTextEditor.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.common.contentmodel.modelquery.extension.DataTypeValueExtension;
-import org.eclipse.wst.common.contentmodel.modelquery.extension.ElementContentFilterExtension;
-import org.eclipse.wst.common.ui.properties.ITabbedPropertySheetPageContributor;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.view.events.INodeSelectionListener;
-import org.eclipse.wst.sse.ui.view.events.NodeSelectionChangedEvent;
-import org.eclipse.wst.wsdl.ui.internal.extension.IModelQueryContributor;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.filter.ExtensiblityElementFilter;
-import org.eclipse.wst.wsdl.ui.internal.outline.WSDLContentOutlinePage;
-import org.eclipse.wst.wsdl.ui.internal.properties.section.WSDLTabbedPropertySheetPage;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.OpenOnSelectionHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.SelectionAdapter;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.eclipse.wst.xml.core.modelquery.ModelQueryUtil;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class WSDLTextEditor extends StructuredTextEditor implements INodeSelectionListener, ISelectionChangedListener, ITabbedPropertySheetPageContributor
-{
- protected WSDLEditor wsdlEditor;
- protected WSDLContentOutlinePage outlinePage;
- protected WSDLSelectionManager wsdlSelectionManager;
- protected InternalSelectionProvider internalSelectionProvider = new InternalSelectionProvider();
- protected ModelQueryExtensionHelper modelQueryExtensionHelper;
- protected List modelQueryContributorList = new ArrayList();
-
- public WSDLTextEditor(WSDLEditor wsdlEditor)
- {
- this.wsdlEditor = wsdlEditor;
- wsdlSelectionManager = wsdlEditor.getSelectionManager();
- wsdlSelectionManager.addSelectionChangedListener(this);
-
- WSDLEditorExtension[] extensions = WSDLEditorPlugin.getInstance().getWSDLEditorExtensionRegistry().getRegisteredExtensions(WSDLEditorExtension.MODEL_QUERY_CONTRIBUTOR);
- for (int i = 0; i < extensions.length; i++)
- {
- Object o = extensions[i].createExtensionObject(WSDLEditorExtension.MODEL_QUERY_CONTRIBUTOR, wsdlEditor);
- if (o != null)
- {
- modelQueryContributorList.add(o);
- }
- }
- }
-
- public void createPartControl(Composite arg0)
- {
- super.createPartControl(arg0);
- addOpenOnSelectionListener();
- }
-
- protected void addOpenOnSelectionListener()
- {
- KeyAdapter keyAdapter = new KeyAdapter()
- {
- public void keyReleased(KeyEvent arg0)
- {
- if (arg0.keyCode == SWT.F3)
- {
- List list = getViewerSelectionManager().getSelectedNodes();
- if (list.size() > 0)
- {
- Object object = list.get(0);
- if (object instanceof Node)
- {
- OpenOnSelectionHelper helper = new OpenOnSelectionHelper(wsdlEditor.getDefinition());
- helper.openEditor((Node)object);
- }
- }
- }
- }
- };
- getTextViewer().getTextWidget().addKeyListener(keyAdapter);
- }
-
-
- /*
- * @see StructuredTextEditor#setModel(IFileEditorInput)
- */
- public void setModel(IFileEditorInput input)
- {
- if (modelQueryExtensionHelper != null)
- {
- modelQueryExtensionHelper.dispose();
- modelQueryExtensionHelper = null;
- }
-
- super.setModel(input);
-
- for (Iterator i = modelQueryContributorList.iterator(); i.hasNext();)
- {
- IModelQueryContributor modelQueryContributor = (IModelQueryContributor)i.next();
- modelQueryContributor.setModel((XMLModel)getModel());
- }
-
- // contribute the ModelQueryExtensionHelper as an extension too
- //
- modelQueryExtensionHelper = new ModelQueryExtensionHelper((XMLModel)getModel());
- }
-
-
- public Object getAdapter(Class required)
- {
- if (IContentOutlinePage.class.equals(required))
- {
- return getContentOutlinePage();
- }
- if (IPropertySheetPage.class.equals(required))
- {
- if (fPropertySheetPage == null || fPropertySheetPage.getControl() == null || fPropertySheetPage.getControl().isDisposed())
- {
-// System.out.println("Create WSDL Property Sheet");
-// PropertySheetConfiguration cfg = createPropertySheetConfiguration();
-// if (cfg != null)
-// {
-// if (cfg instanceof StructuredPropertySheetConfiguration)
-// {
-// ((StructuredPropertySheetConfiguration) cfg).setEditor(this);
-// }
-// ConfigurablePropertySheetPage propertySheetPage = new ConfigurablePropertySheetPage();
-// propertySheetPage.setConfiguration(cfg);
-// propertySheetPage.setModel(getModel());
-// fPropertySheetPage = propertySheetPage;
-// }
-
-// fPropertySheetPage = new WSDLPropertySheetPage(getModel(), getEditorPart());
-// ((WSDLPropertySheetPage) fPropertySheetPage).setSelectionManager(getWSDLEditor().getSelectionManager()); //getViewerSelectionManager());
-//// ((WSDLPropertySheetPage) fPropertySheetPage).setPropertySourceProvider((WSDLPropertySheetPage) fPropertySheetPage);
-// ((WSDLPropertySheetPage)fPropertySheetPage).setPropertySourceProvider(new ExtensiblePropertySourceProvider(getWSDLEditor()));
-//// getWSDLEditor().getSelectionManager().addSelectionChangedListener((WSDLPropertySheetPage)fPropertySheetPage);
-
- fPropertySheetPage = new WSDLTabbedPropertySheetPage(this, getWSDLEditor());
- ((WSDLTabbedPropertySheetPage)fPropertySheetPage).setSelectionManager(getWSDLEditor().getSelectionManager());
-
- }
- return fPropertySheetPage;
- }
-
- return super.getAdapter(required);
- }
-
- public String[] getPropertyCategories()
- {
- return new String[] { "general", "namespace", "other", "attributes", "documentation", "facets" };
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.ITabbedPropertySheetPageContributor#getContributorId()
- */
- public String getContributorId()
- {
- return "org.eclipse.wst.wsdl.ui.internal.WSDLTextEditor";
- // return getSite().getId();
- }
-
- /*
- * @see StructuredTextEditor#getContentOutlinePage()
- */
- public IContentOutlinePage getContentOutlinePage()
- {
- if ((outlinePage == null) || outlinePage.getControl() == null || (outlinePage.getControl().isDisposed()))
- {
- outlinePage = new WSDLContentOutlinePage(wsdlEditor);
- outlinePage.setContentProvider(wsdlEditor.getExtensibleOutlineProvider());
- outlinePage.setLabelProvider(wsdlEditor.getExtensibleOutlineProvider());
- outlinePage.setModel(wsdlEditor.getDefinition()); //XMLDocument());
-
- getViewerSelectionManager().addNodeSelectionListener(this);
- internalSelectionProvider.addSelectionChangedListener(getViewerSelectionManager());
- internalSelectionProvider.setEventSource(outlinePage);
- }
- return outlinePage;
- }
-
- public WSDLEditor getWSDLEditor()
- {
- return (WSDLEditor)getEditorPart();
- }
-
- // used to map selections from the outline view to the source view
- // this class thinks of selections in terms of DOM element
- class InternalSelectionProvider extends SelectionAdapter
- {
- protected Object getObjectForOtherModel(Object object)
- {
- Node node = null;
-
- if (object instanceof Node)
- {
- node = (Node)object;
- }
- else
- {
- node = WSDLEditorUtil.getInstance().getNodeForObject(object);
- }
-
- // the text editor can only accept sed nodes!
- //
- if (!(node instanceof org.eclipse.wst.xml.core.document.XMLNode))
- {
- node = null;
- }
- return node;
- }
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- // here we convert the model selection to a node selection req'd for the source view
- //
- internalSelectionProvider.setSelection(event.getSelection());
- }
-
- public void nodeSelectionChanged(NodeSelectionChangedEvent event)
- {
- // here we convert an node seleciton to a model selection as req'd by the other views
- //
- if (!event.getSource().equals(internalSelectionProvider))
- {
- Element element = null;
- List list = event.getSelectedNodes();
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- Node node = (Node)i.next();
- if (node != null)
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- element = (Element)node;
- break;
- }
- else if (node.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- element = ((Attr)node).getOwnerElement();
- break;
- }
- }
- }
-
- Object o = element;
- if (element != null)
- {
- Object modelObject = WSDLEditorUtil.getInstance().findModelObjectForElement(wsdlEditor.getDefinition(), element);
- if (modelObject != null)
- {
- o = modelObject;
- }
- }
-
- if (o != null)
- {
- wsdlSelectionManager.setSelection(new StructuredSelection(o), internalSelectionProvider);
- }
- else
- {
- wsdlSelectionManager.setSelection(new StructuredSelection(), internalSelectionProvider);
- }
- }
- }
-
- public void update()
- {
- super.update();
- if (outlinePage != null)
- outlinePage.setModel(getModel());
- }
-
- public class ModelQueryExtensionHelper
- {
- protected ModelQuery modelQuery;
- protected DataTypeValueExtension dataTypeValueExtension;
- protected ElementContentFilterExtension elementContentFilterExtension;
-
- public ModelQueryExtensionHelper(XMLModel xmlModel)
- {
- dataTypeValueExtension = new WSDLDataTypeValueExtension();
- elementContentFilterExtension = new WSDLElementContentFilterExtension();
-
- modelQuery = ModelQueryUtil.getModelQuery(xmlModel.getDocument());
- if (modelQuery != null && modelQuery.getExtensionManager() != null)
- {
- modelQuery.getExtensionManager().addExtension(dataTypeValueExtension);
- modelQuery.getExtensionManager().addExtension(elementContentFilterExtension);
- }
- }
-
- protected void dispose()
- {
- if (modelQuery != null && modelQuery.getExtensionManager() != null)
- {
- modelQuery.getExtensionManager().removeExtension(dataTypeValueExtension);
- modelQuery.getExtensionManager().removeExtension(elementContentFilterExtension);
- }
- }
- }
-
- /**
- * This class is used to extend the ModelQuery behaviour so that we can contribute our own
- * 'allowed values' for attributes or elements (e.g. the 'type' attribute).
- */
- public class WSDLDataTypeValueExtension implements DataTypeValueExtension
- {
- public int getType()
- {
- return DATA_TYPE_VALUE_EXTENSION;
- }
-
- public String getId()
- {
- return "WSDLDataTypeValueExtension";
- }
-
- public java.util.List getDataTypeValues(Element element, CMNode cmNode)
- {
- java.util.List list = new Vector();
- if (cmNode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION)
- {
- ComponentReferenceUtil util = new ComponentReferenceUtil(getWSDLEditor().getDefinition());
- String name = cmNode.getNodeName();
- String currentElementName = element.getLocalName();
- Node parentNode = element.getParentNode();
- String parentName = "";
- if (parentNode != null)
- {
- parentName = parentNode.getLocalName();
- }
-
- if (checkName(name, "message"))
- {
- list.addAll(util.getMessageNames());
- }
- else if (checkName(name, "binding"))
- {
- list.addAll(util.getBindingNames());
- }
- else if (checkName(name, "type"))
- {
- if (checkName(currentElementName, "binding"))
- {
- list.addAll(util.getPortTypeNames());
- }
- else if (checkName(currentElementName, "part"))
- {
- list.addAll(util.getComponentNameList(true));
- }
- }
- else if (checkName(name, "element"))
- {
- if (checkName(currentElementName, "part"))
- {
- list.addAll(util.getComponentNameList(false));
- }
- }
- }
- return list;
- }
-
- protected boolean checkName(String localName, String token)
- {
- if (localName != null && localName.trim().equals(token))
- {
- return true;
- }
- return false;
- }
- }
-
- /**
- * This class performs some filtering for some known extensiblity elements to enable
- * smarter suggestions than those provided by the 'dumb' wsdl schema
- */
- public class WSDLElementContentFilterExtension implements ElementContentFilterExtension
- {
- public int getType()
- {
- return ELEMENT_CONTENT_FILTER;
- }
-
- public String getId()
- {
- return "WSDLElementContentFilterExtension";
- }
-
- protected boolean isParentElementMessageReference(String parentElementName)
- {
- return parentElementName.equals("input") || parentElementName.equals("output") || parentElementName.equals("fault");
- }
-
- protected boolean isCMNodeMessageReferenceContent(String cmNodeName)
- {
- return cmNodeName.equals("body") || cmNodeName.equals("header") || cmNodeName.equals("fault") || cmNodeName.equals("urlReplacement") || cmNodeName.equals("urlEncoded");
- }
-
- public void filterAvailableElementContent(List list, Element element, CMElementDeclaration ed)
- {
- String parentElementNamespaceURI = element.getNamespaceURI();
- String parentElementName = element.getLocalName();
-
- // only filter children for 'non-schema' elements
- //
- if (!WSDLConstants.XSD_NAMESPACE_URI.equals(parentElementNamespaceURI))
- {
- for (int i = list.size() - 1; i >= 0; i--)
- {
- boolean include = true;
- CMNode cmNode = (CMNode)list.get(i);
- String cmNodeName = cmNode.getNodeName();
- if (parentElementName != null && cmNodeName != null && cmNode.getNodeType() == CMNode.ELEMENT_DECLARATION)
- {
- CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument");
- if (cmDocument != null)
- {
- String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");
- if (namespaceURI != null)
- {
- // TODO... provide a list of namespaces that should always get filtered out
- //
- if (namespaceURI.equals("http://schemas.xmlsoap.org/soap/encoding/") || namespaceURI.equals(WSDLConstants.XSD_NAMESPACE_URI))
- {
- // exclude soap-enc elements
- //
- include = false;
- }
- else
- {
- ExtensiblityElementFilter filter = (ExtensiblityElementFilter)WSDLEditorPlugin.getInstance().getExtensiblityElementFilterRegistry().get(namespaceURI);
- if (filter != null)
- {
- include = filter.isValidContext(element, cmNodeName);
- }
- }
- }
- }
- }
- if (!include)
- {
- list.remove(i);
- }
- }
- }
- }
- }
-
- public InternalSelectionProvider getInternalSelectionProvider() {
- return internalSelectionProvider;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddEEMenuActionContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddEEMenuActionContributor.java
deleted file mode 100644
index b0a22e9..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddEEMenuActionContributor.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQueryAction;
-import org.eclipse.wst.common.contentmodel.util.DOMContentBuilder;
-import org.eclipse.wst.common.contentmodel.util.DOMContentBuilderImpl;
-import org.eclipse.wst.common.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.UnknownExtensibilityElement;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.IMenuActionContributor;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.format.FormatProcessorXML;
-import org.eclipse.wst.xml.core.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.ui.actions.MenuBuilder;
-import org.eclipse.wst.xml.ui.util.XMLCommonResources;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- * TODO... there are likely several places where we can refactor code from AbstractNodeActionManager
- */
-public class AddEEMenuActionContributor implements IMenuActionContributor
-{
- protected MenuBuilder menuBuilder = new MenuBuilder();
-
- public void contributeMenuActions(final IMenuManager menu, Node node, Object object)
- {
- boolean isSubmenuRequired = false;
- Element element = null;
-
- if (object instanceof WSDLElement)
- {
- WSDLSwitch wsdlSwitch = new WSDLSwitch()
- {
- public Object caseBinding(Binding binding)
- {
- return Boolean.TRUE;
- }
-
- public Object caseBindingOperation(BindingOperation bindingOperation)
- {
- return Boolean.TRUE;
- }
-
- public Object caseBindingInput(BindingInput bindingInput)
- {
- return Boolean.TRUE;
- }
-
- public Object caseBindingOutput(BindingOutput bindingOutput)
- {
- return Boolean.TRUE;
- }
-
- public Object caseBindingFault(BindingFault bindingFault)
- {
- return Boolean.TRUE;
- }
-
- public Object caseDefinition(Definition definition)
- {
- return Boolean.TRUE;
- }
-
- public Object casePort(Port port)
- {
- return Boolean.TRUE;
- }
- public Object caseUnknownExtensibilityElement(UnknownExtensibilityElement unknownExtensibilityElement)
- {
- if (getExtensibilityElementActions(unknownExtensibilityElement.getElement()).size() > 0)
- {
- return Boolean.TRUE;
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- };
- isSubmenuRequired = wsdlSwitch.doSwitch((WSDLElement)object) != null;
- element = WSDLEditorUtil.getInstance().getElementForObject(object);
- }
- else if (object instanceof WSDLGroupObject)
- {
- WSDLGroupObject groupObject = (WSDLGroupObject)object;
-
- switch (groupObject.getType())
- {
- case WSDLGroupObject.EXTENSIBILITY_ELEMENTS_GROUP :
- {
- isSubmenuRequired = true;
- element = WSDLEditorUtil.getInstance().getElementForObject(groupObject.getDefinition());
- break;
- }
- }
- }
-
- if (isSubmenuRequired)
- {
- MenuManager submenu = new MenuManager(WSDLEditorPlugin.getWSDLString("_UI_ADD_EXTENSIBILITY_ELEMENT")); //$NON-NLS-1$
- // here I'm attempting to add the menu item in a 'good' place in the exisiting menu
- // todo add menu groups to avoid the need for this test
- //
-// if (menu.find("addchild") != null)
-// {
-// menu.insertAfter("addchild", submenu);
-// }
-// else
-// {
-// menu.add(submenu);
-// }
- menu.add(submenu);
- if (element != null && element instanceof XMLNode)
- {
- addExtensibilityElementActions(submenu, element);
- }
- }
- }
-
- public void addExtensibilityElementActions(IMenuManager menu, Element element)
- {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- CMElementDeclaration ed = modelQuery.getCMElementDeclaration(element);
-
- if (ed != null)
- {
- addActionHelper(menu, getExtensibilityElementActions(element));
- }
- }
-
- public List getExtensibilityElementActions(Element element) {
- List modelQueryActionList = new ArrayList();
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- CMElementDeclaration ed = modelQuery.getCMElementDeclaration(element);
-
- if (ed != null)
- {
- // add insert child node actions
- //
- int ic = ModelQuery.INCLUDE_CHILD_NODES;
- int vc = ModelQuery.VALIDITY_STRICT;
-
- modelQuery.getInsertActions(element, ed, -1, ic, vc, modelQueryActionList);
- }
-
- return modelQueryActionList;
- }
-
-
- protected void addActionHelper(IMenuManager menu, List modelQueryActionList)
- {
- List actionList = new Vector();
-
- for (Iterator i = modelQueryActionList.iterator(); i.hasNext(); )
- {
- ModelQueryAction action = (ModelQueryAction)i.next();
- CMNode cmnode = action.getCMNode();
- if (cmnode != null)
- {
- boolean isOtherNamespace = false;
- CMDocument cmDocument = (CMDocument)cmnode.getProperty("CMDocument");
- if (cmDocument != null)
- {
- String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");
- isOtherNamespace = namespaceURI != null && !namespaceURI.equals(WSDLConstants.WSDL_NAMESPACE_URI);
- }
-
- if (isOtherNamespace)
- {
- int cmNodeType = cmnode.getNodeType();
- if (action.getKind() == ModelQueryAction.INSERT)
- {
- switch (cmNodeType)
- {
- case CMNode.ELEMENT_DECLARATION :
- {
- actionList.add(new AddNodeAction((CMElementDeclaration)cmnode, action.getParent(), action.getStartIndex()));
- break;
- }
- }
- }
- }
- }
- }
- menuBuilder.populateMenu(menu, actionList, false);
- }
-
- /**
- * AddNodeAction
- */
- public class AddNodeAction extends BaseNodeAction
- {
- protected String description;
- protected String undoDescription;
- protected CMNode cmnode;
- protected int index;
- protected Node parent;
-
-
- public AddNodeAction(CMNode cmnode, Node parent, int index)
- {
- this.cmnode = cmnode;
- this.parent = parent;
- this.index = index;
-
- String text = getLabel(parent, cmnode);
- setText(text);
- description = text;
- undoDescription = XMLCommonResources.getInstance().getString("_UI_MENU_ADD") + " " + text;
- //setImageDescriptor(imageDescriptorCache.getImageDescriptor(cmnode));
- }
-
- public String getLabel(Node parent, CMNode cmnode)
- {
- String result = "?" + cmnode + "?";
- if (cmnode != null)
- {
- result = DOMNamespaceHelper.computeName(cmnode, parent, null);
- }
- return result;
- }
-
- public Node getNode()
- {
- return parent;
- }
-
- public String getUndoDescription()
- {
- return undoDescription;
- }
-
- public void run()
- {
- beginRecording();
-
- if (cmnode != null && parent != null)
- {
- Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document)parent : parent.getOwnerDocument();
-
- DOMContentBuilder builder = new DOMContentBuilderImpl(document);
- builder.setProperty(DOMContentBuilder.PROPERTY_BUILD_BLANK_TEXT_NODES, Boolean.TRUE);
- builder.setBuildPolicy(DOMContentBuilder.BUILD_ONLY_REQUIRED_CONTENT);
- builder.build(parent, cmnode);
- insertNodesAtIndex(parent, builder.getResult(), index, true);
- }
-
- endRecording();
- }
-
- public void insertNodesAtIndex(Node parent, List list, int index, boolean format)
- {
- NodeList nodeList = parent.getChildNodes();
- if (index == -1)
- {
- index = nodeList.getLength();
- }
- Node refChild = (index < nodeList.getLength()) ? nodeList.item(index) : null;
-
- // here we consider the case where the previous node is a 'white space' Text node
- // we should really do the insert before this node
- //
- int prevIndex = index - 1;
- Node prevChild = (prevIndex < nodeList.getLength()) ? nodeList.item(prevIndex) : null;
- if (isWhitespaceTextNode(prevChild))
- {
- refChild = prevChild;
- }
-
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Node newNode = (Node)i.next();
-
- if (newNode.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- Element parentElement = (Element)parent;
- parentElement.setAttributeNode((Attr)newNode);
- }
- else
- {
- parent.insertBefore(newNode, refChild);
- }
- }
-
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Node newNode = (Node)i.next();
- if (format)
- {
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((XMLNode)newNode);
- }
- }
- //setViewerSelection(list);
- }
-
- protected boolean isWhitespaceTextNode(Node node)
- {
- return (node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().trim().length() == 0);
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddElementAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddElementAction.java
deleted file mode 100644
index cfae8e3..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddElementAction.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.HashMap;
-import java.util.List;
-
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.sse.core.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.ui.internal.widgets.NewComponentDialog;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.xml.core.XMLModelPlugin;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.format.FormatProcessorXML;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class AddElementAction extends BaseNodeAction
-{
- protected Node parentNode;
- protected String prefix;
- protected String nodeName;
- protected Element newElement;
- protected Node relativeNode = null;
- protected IEditorPart editorPart;
- protected Definition definition;
- protected Document document;
- protected boolean computeTopLevelRefChild;
-
- protected boolean selectNewlyCreatedObject = true; // We should not be selecting the object in the action..... TODO
-
- public AddElementAction(String text, String imageDescriptorKey, Node parentNode, String nodeName)
- {
- setText(text);
- setImageDescriptor(WSDLEditorPlugin.getImageDescriptor(imageDescriptorKey));
- this.parentNode = parentNode;
- this.nodeName = nodeName;
- }
-
- public AddElementAction(String text, String imageDescriptorKey, Node parentNode, String prefix, String localName)
- {
- setText(text);
- setImageDescriptor(WSDLEditorPlugin.getImageDescriptor(imageDescriptorKey));
- this.parentNode = parentNode;
- this.prefix = prefix;
- this.nodeName = localName;
- }
-
- public AddElementAction(String text, Node parentNode, String prefix, String localName)
- {
- setText(text);
- setImageDescriptor(null);
- this.parentNode = parentNode;
- this.prefix = prefix;
- this.nodeName = localName;
- }
-
- public AddElementAction(Node parentNode, String prefix, String localName, Node relativeNode)
- {
- this.parentNode = parentNode;
- this.prefix = prefix;
- this.nodeName = localName;
- this.relativeNode = relativeNode;
- }
-
- public void setComputeTopLevelRefChild(boolean isEnabled)
- {
- computeTopLevelRefChild = isEnabled;
- }
-
- protected void setEditorPart(IEditorPart editorPart)
- {
- this.editorPart = editorPart;
- }
-
- protected boolean showDialog()
- {
- return true;
- }
-
- public void run()
- {
- boolean ok = showDialog();
- if (ok)
- {
- beginRecording();
- performAddElement();
- endRecording();
- }
- }
-
- protected void performAddElement()
- {
- if (parentNode != null)
- {
- newElement = createElement(nodeName);
- addAttributes(newElement);
- if (relativeNode == null && computeTopLevelRefChild)
- {
- relativeNode = computeTopLevelRefChild(newElement);
- }
-
- if (relativeNode == null)
- {
- parentNode.appendChild(newElement);
- }
- else
- {
- parentNode.insertBefore(newElement, relativeNode);
- }
- //format(parentNode);
- format(newElement);
- // Ugly..... We should not be selecting the object in the graph view in the Action.
- // This should be refactored out. We add this boolean check because WSDLSetTypeDialog.java
- // uses AddImportAction.java but we should not be selecting the newly created import....
- if (selectNewlyCreatedObject) {
- selectObjectForNewElement();
- }
- }
- }
-
- // Ugly..... We should not be selecting the object in the graph view in the Action.
- // This should be refactored out. We add this boolean check because WSDLSetTypeDialog.java
- // uses AddImportAction.java but we should not be selecting the newly created import....
- // We should call this method before calling run()
- public void selectObjectForNewElement(boolean select) {
- selectNewlyCreatedObject = select;
- }
-
- public Node getNode()
- {
- if (parentNode != null) {
- return parentNode;
- }
- else {
- return document;
- }
- }
-
-
- public String getUndoDescription()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD");
- }
-
-
- protected Element createElement(String nodeName)
- {
- Document document = parentNode.getOwnerDocument();
-
- Element element = (prefix != null && prefix.length() > 0) ?
- document.createElement(prefix + ":" + nodeName) :
- document.createElement(nodeName);
-
- return element;
- }
-
- protected void addAttributes(Element newElement)
- {
- }
-
-
- protected void format(Node parentNode)
- {
- if (parentNode instanceof XMLNode)
- {
- // format selected node
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((XMLNode)parentNode);
-
- }
- }
-
- protected Element getDefinitionElement(Element parentElement)
- {
- Element definitionElement = null;
-
- for (Node node = parentElement.getOwnerDocument().getFirstChild(); node != null; node = node.getNextSibling())
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Element element = (Element)node;
- if (WSDLEditorUtil.getInstance().getWSDLType(element) == WSDLConstants.DEFINITION)
- {
- definitionElement = element;
- break;
- }
- }
- }
- return definitionElement;
- }
-
- public Element getNewElement()
- {
- return newElement;
- }
-
- public void setDefinition(Definition definition)
- {
- this.definition = definition;
- }
-
- public void selectObjectForNewElement()
- {
- if (editorPart == null) {
- editorPart = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- }
- if (editorPart != null && definition != null)
- {
- Object object = WSDLEditorUtil.getInstance().findModelObjectForElement(definition, newElement);
- if (object != null)
- {
- ISelectionProvider selectionProvider = (ISelectionProvider)editorPart.getAdapter(ISelectionProvider.class);
- if (selectionProvider != null)
- {
- selectionProvider.setSelection(new StructuredSelection(object));
- }
- }
- }
- }
-
- public void selectObject(WSDLElement object)
- {
- if (editorPart == null) {
- editorPart = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- }
- if (editorPart != null && definition != null)
- {
- if (object != null)
- {
- ISelectionProvider selectionProvider = (ISelectionProvider)editorPart.getAdapter(ISelectionProvider.class);
- if (selectionProvider != null)
- {
- selectionProvider.setSelection(new StructuredSelection(object));
- }
- }
- }
- }
-
- public String showDialogHelper(String title, String defaultName, List usedNames)
- {
- String result = defaultName;
- NewComponentDialog dialog = new NewComponentDialog(WSDLEditorPlugin.getShell(), title, defaultName, usedNames);
- int rc = dialog.createAndOpen();
- if (rc == IDialogConstants.OK_ID)
- {
- result = dialog.getName();
- }
- else
- {
- result = null;
- }
- return result;
- }
-
- protected Node computeTopLevelRefChild(Node nodeToAdd)
- {
- Node result = null;
- int a = getPrecedence(nodeToAdd);
-
- for (Node node = parentNode.getFirstChild(); node != null; node = node.getNextSibling())
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- int b = getPrecedence(node);
- if (b > a)
- {
- result = node;
- break;
- }
- }
- }
- return result;
- }
-
- protected void createDefinitionStub() {
- if (document != null) {
- // Create the Definitions element with proper namespace
- Preferences preference = XMLModelPlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonModelPreferenceNames.OUTPUT_CODESET);
- if (charSet == null || charSet.trim().equals(""))
- {
- charSet = "UTF-8";
- }
- document.appendChild(document.createProcessingInstruction("xml", "version=\"1.0\" encoding=\"" + charSet + "\""));
- Element root = document.createElement("wsdl:definitions");
- document.appendChild(root);
-
- // Add various namespace attributes here.
- root.setAttribute("xmlns:soap", "http://schemas.xmlsoap.org/wsdl/soap/");
- root.setAttribute("xmlns:tns", getDefaultNamespace());
- root.setAttribute("xmlns:wsdl", "http://schemas.xmlsoap.org/wsdl/");
- root.setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
- root.setAttribute("name", getFileName());
- root.setAttribute("targetNamespace", getDefaultNamespace());
-
- definition.setElement(root);
- parentNode = root;
- prefix = definition.getPrefix(WSDLConstants.WSDL_NAMESPACE_URI);
- }
- }
-
- private String getDefaultNamespace()
- {
- String namespace = WSDLEditorPlugin.getInstance().getPreferenceStore().getString(WSDLEditorPlugin.getWSDLString("_UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE"));
- if (!namespace.endsWith("/")) {
- namespace = namespace.concat("/");
- }
-
- namespace += getFileName() + "/";
-
- return namespace;
- }
-
- private String getFileName() {
- String fileLocation = definition.getLocation();
- IPath filePath = new Path(fileLocation);
- return filePath.removeFileExtension().lastSegment().toString();
- }
-
- protected static HashMap precedenceMap = createPrecedenceMap();
-
- protected static int getPrecedence(Node node)
- {
- int result = 2;
- String localName = node.getLocalName();
- if (localName != null)
- {
- Integer integer = (Integer)precedenceMap.get(localName);
- if (integer != null)
- {
- result = integer.intValue();
- }
- }
- return result;
- }
-
- protected static HashMap createPrecedenceMap()
- {
- HashMap hashMap = new HashMap();
- hashMap.put(WSDLConstants.DOCUMENTATION_ELEMENT_TAG, new Integer(1));
- hashMap.put(WSDLConstants.IMPORT_ELEMENT_TAG, new Integer(3));
- hashMap.put(WSDLConstants.TYPES_ELEMENT_TAG, new Integer(4));
- hashMap.put(WSDLConstants.MESSAGE_ELEMENT_TAG, new Integer(5));
- hashMap.put(WSDLConstants.PORT_TYPE_ELEMENT_TAG, new Integer(6));
- hashMap.put(WSDLConstants.BINDING_ELEMENT_TAG, new Integer(7));
- hashMap.put(WSDLConstants.SERVICE_ELEMENT_TAG, new Integer(8));
- return hashMap;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddElementDeclarationAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddElementDeclarationAction.java
deleted file mode 100644
index 8bdee2f..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddElementDeclarationAction.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-public class AddElementDeclarationAction extends Action
-{
- protected Definition definition;
- protected String namespace;
- protected String prefix;
-
- public AddElementDeclarationAction(Definition definition, String namespace, String suggestedPrefix)
- {
- this.definition = definition;
- this.namespace = namespace;
- this.prefix = suggestedPrefix;
- }
-
- public void run()
- {
- String existingPrefix = definition.getPrefix(namespace);
- if (existingPrefix != null)
- {
- prefix = existingPrefix;
- }
- else
- {
- prefix = NameUtil.buildUniquePrefix(definition, prefix);
- Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- if (definitionElement != null)
- {
- definitionElement.setAttribute("xmlns:" + prefix, namespace);
- }
- }
- }
-
- public String getPrefix()
- {
- return prefix;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddImportAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddImportAction.java
deleted file mode 100644
index fc85352..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddImportAction.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AddImportAction extends AddElementAction
-{
- protected String namespace;
- protected String location;
- protected String elementDeclarationNamespacePrefix;
-
- public AddImportAction(IEditorPart part, Definition definition, Node parentNode, String prefix)
- {
- this(part, definition, parentNode, prefix, null, null);
- }
-
- public AddImportAction(IEditorPart part, Definition definition, Node parentNode, String prefix, String namespace, String location)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_IMPORT"), "icons/import_obj.gif", parentNode, prefix, "import");
- setDefinition(definition);
- setComputeTopLevelRefChild(true);
- this.namespace = namespace;
- this.location = location;
- setEditorPart(part);
-
- if (part instanceof WSDLEditor) {
- document = ((WSDLEditor) part).getXMLDocument();
- }
- }
-
- protected Element createElement(String nodeName)
- {
- if (elementDeclarationNamespacePrefix != null && namespace != null)
- {
- Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- if (definitionElement != null)
- {
- definitionElement.setAttribute("xmlns:" + elementDeclarationNamespacePrefix, namespace);
- }
- }
- return super.createElement(nodeName);
- }
-
- public void setElementDeclarationNamespacePrefix(String nsPrefix)
- {
- this.elementDeclarationNamespacePrefix = nsPrefix;
- }
-
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("namespace", namespace != null ? namespace : "");
- newElement.setAttribute("location", location != null ? location : "");
- }
-
- public void performAddElement() {
- if (parentNode == null || (document != null && document.getChildNodes().getLength() == 0)) {
- createDefinitionStub();
- }
-
- super.performAddElement();
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddMessageUIAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddMessageUIAction.java
deleted file mode 100644
index f25b453..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddMessageUIAction.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddMessageCommand;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.widgets.NewComponentDialog;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-
-
-
-public final class AddMessageUIAction extends WSDLElementUIAction
-{
- private Definition definition;
- private String name;
- private IEditorPart editorPart;
-
- public AddMessageUIAction
- (Definition definition,
- String name,
- boolean createPart)
- {
- super
- (new AddMessageCommand(definition,name,createPart),
- WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD"),
- WSDLConstants.MESSAGE_ELEMENT_TAG,
- WSDLEditorPlugin.getImageDescriptor("icons/message_obj.gif"));
-
- this.definition = definition;
- this.name = name;
- }
-
- protected boolean showDialog()
- {
- name = NameUtil.buildUniqueMessageName(definition, name);
- name = showDialogHelper(WSDLEditorPlugin.getWSDLString("_UI_ACTION_NEW_MESSAGE"), name);
- return name != null;
- }
-
- protected String showDialogHelper(String title, String defaultName)
- {
- String result = defaultName;
- NewComponentDialog dialog = new NewComponentDialog(WSDLEditorPlugin.getShell(), title, defaultName);
- int rc = dialog.createAndOpen();
- if (rc == IDialogConstants.OK_ID)
- {
- result = dialog.getName();
- }
- else
- {
- result = null;
- }
- return result;
- }
-
- protected void preRun()
- {
- ((AddMessageCommand)super.modelAction).setLocalName(name);
- }
-
- protected WSDLElement getOwner()
- {
- return definition;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddNamespaceDeclarationsAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddNamespaceDeclarationsAction.java
deleted file mode 100644
index b352e34..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddNamespaceDeclarationsAction.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.Hashtable;
-
-import org.eclipse.jface.action.Action;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-public class AddNamespaceDeclarationsAction extends Action
-{
- protected Element ownerElement;
- protected String[] namespaceNames;
- protected String[] preferredPrefixes;
-
- public AddNamespaceDeclarationsAction(Element ownerElement, String[] namespaceNames, String[] preferredPrefixes)
- {
- this.ownerElement = ownerElement;
- this.namespaceNames = namespaceNames;
- this.preferredPrefixes = preferredPrefixes;
- }
-
- public AddNamespaceDeclarationsAction(Element ownerElement, String namespaceName, String preferredPrefix)
- {
- this.ownerElement = ownerElement;
- namespaceNames = new String[1];
- namespaceNames[0] = namespaceName;
-
- preferredPrefixes = new String[1];
- preferredPrefixes[0] = preferredPrefix;
- }
-
- public void run()
- {
- if (ownerElement != null)
- {
- NamedNodeMap map = ownerElement.getAttributes();
- Hashtable table = new Hashtable();
- Hashtable prefixTable = new Hashtable();
-
- int mapLength = map.getLength();
- for (int i = 0; i < mapLength; i++)
- {
- Attr attribute = (Attr) map.item(i);
- String attributeName = attribute.getName();
- if (attributeName.startsWith("xmlns:"))
- {
- table.put(attribute.getValue(), Boolean.TRUE);
- prefixTable.put(attributeName.substring(6), Boolean.TRUE);
- }
- else if (attributeName.equals("xmlns"))
- {
- table.put(attribute.getValue(), Boolean.TRUE);
- prefixTable.put("", Boolean.TRUE);
- }
- }
-
- for (int i = 0; i < namespaceNames.length; i++)
- {
- String namespace = namespaceNames[i];
- if (table.get(namespace) == null)
- {
- String prefix = (i < preferredPrefixes.length) ? preferredPrefixes[i] : "p0";
- if (prefixTable.get(prefix) != null)
- {
- prefix = computeUniquePrefix("p", prefixTable);
- }
-
- String attributeName = prefix.length() > 0 ? "xmlns:" + prefix : "xmlns";
- ownerElement.setAttribute(attributeName, namespace);
- }
- }
- }
- }
-
- protected String computeUniquePrefix(String base, Hashtable table)
- {
- int i = 0;
- String prefix = base;
- while (true)
- {
- if (table.get(prefix) == null)
- {
- break;
- }
- else
- {
- prefix = base + i;
- i++;
- }
- }
- return prefix;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddNewComponentAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddNewComponentAction.java
deleted file mode 100644
index 6bd0cfb..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddNewComponentAction.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.dialogs.InvokeSetDialog;
-import org.w3c.dom.Node;
-
-
-
-public class AddNewComponentAction extends AddElementAction
-{
- Object input;
- protected IEditorPart editorPart;
- protected String kind;
-
- /**
- * Constructor for AddNewComponentAction.
- * @param text
- * @param imageDescriptorKey
- * @param parentNode
- * @param nodeName
- */
- public AddNewComponentAction(
- String text,
- String imageDescriptorKey,
- Node parentNode,
- String nodeName,
- Object input)
- {
- super(text, imageDescriptorKey, parentNode, nodeName);
- this.input = input;
- }
- /**
- * Constructor for AddNewComponentAction.
- * @param text
- * @param imageDescriptorKey
- * @param parentNode
- * @param prefix
- * @param localName
- */
- public AddNewComponentAction(
- String text,
- String imageDescriptorKey,
- Node parentNode,
- String prefix,
- String localName,
- Object input)
- {
- super(text, imageDescriptorKey, parentNode, prefix, localName);
- this.input = input;
- }
-
- public AddNewComponentAction(
- String text,
- Node parentNode,
- String prefix,
- String localName,
- Object input)
- {
- super(text, parentNode, prefix, localName);
- this.input = input;
- }
-
- public void setEditor(IEditorPart editorPart)
- {
- this.editorPart = editorPart;
- }
-
- public void setReferenceKind(String kind)
- {
- this.kind = kind;
- }
-
- protected void performAddElement()
- {
- InvokeSetDialog dialog = new InvokeSetDialog();
- if (input instanceof Part)
- {
- dialog.setReferenceKind(kind);
- }
- dialog.run(input, editorPart);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddWSISchemaImportAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddWSISchemaImportAction.java
deleted file mode 100644
index a4924d4..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/AddWSISchemaImportAction.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.format.FormatProcessorXML;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class AddWSISchemaImportAction extends BaseNodeAction
-{
- protected Definition definition;
- protected Element definitionElement;
- protected String namespace;
- protected String location;
- protected String elementDeclarationNamespacePrefix;
-
- public AddWSISchemaImportAction(Definition definition, String namespace, String location)
- {
- this.definition = definition;
- this.namespace = namespace;
- this.location = location;
- definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- }
-
- public Node getNode()
- {
- return definitionElement;
- }
-
- public String getUndoDescription()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_IMPORT");
- }
-
- protected Element getOrCreateTypesElement()
- {
- Element typesElement = null;
- if (definition.getTypes() == null)
- {
- if (definitionElement != null)
- {
- AddElementAction addTypesAction = new AddElementAction("", "icons/xsd_obj.gif", definitionElement, definitionElement.getPrefix(), "types");
- addTypesAction.setComputeTopLevelRefChild(true);
- addTypesAction.run();
- typesElement = addTypesAction.getNewElement();
- format(typesElement);
- }
- }
- else
- {
- typesElement = WSDLEditorUtil.getInstance().getElementForObject(definition.getTypes());
- }
- return typesElement;
- }
-
- protected Element getImportHolderElement(Element typesElement) {
- Element importHolderElement = null;
- NodeList nodeList = typesElement.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++)
- {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Element element = (Element) node;
- if ("schema".equals(element.getLocalName()) && element.getAttribute("targetNamespace") == null)
- {
- importHolderElement = element;
- break;
- }
- }
- }
-
- return importHolderElement;
- }
-
- public Element getOrCreateImportHolderElement(Element typesElement)
- {
- Element importHolderElement = getImportHolderElement(typesElement);
- if (importHolderElement == null)
- {
- AddElementAction addImportHolderAction = new AddElementAction("", "icons/xsd_obj.gif", typesElement, "xsd", "schema")
- {
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("xmlns:xsd", WSDLConstants.XSD_NAMESPACE_URI);
- }
- };
- addImportHolderAction.run();
- importHolderElement = addImportHolderAction.getNewElement();
- format(importHolderElement);
- }
- return importHolderElement;
- }
-
- // We don't want to add the import if it's already there
- protected boolean importNotAlreadyExists() {
- boolean notExists = true;
-
- if (definition.getTypes() != null) {
- Element typesElement = WSDLEditorUtil.getInstance().getElementForObject(definition.getTypes());
- Element schemaElement = getImportHolderElement(typesElement);
-
- if (schemaElement != null) {
- // Collect children
- Node node = schemaElement.getFirstChild();
- java.util.Vector schemaChildren = new java.util.Vector();
- if (node != null) {
- Node child = node;
-
- if (!(child instanceof org.eclipse.wst.xml.core.internal.document.TextImpl)) {
- schemaChildren.addElement(child);
- }
-
- while (child.getNextSibling() != null) {
- child = child.getNextSibling();
- if (!(child instanceof org.eclipse.wst.xml.core.internal.document.TextImpl)) {
- schemaChildren.addElement(child);
- }
- }
-
- for (int index = 0; index < schemaChildren.size(); index++) {
- Element schemaChild = (Element) schemaChildren.elementAt(index);
- String schemaLocation = schemaChild.getAttribute("schemaLocation");
- String schemaNamespace = schemaChild.getAttribute("namespace");
-
- if (schemaLocation != null && namespace != null &&
- schemaLocation.equals(location) && schemaNamespace.equals(namespace)) {
- notExists = false;
- break;
- }
- }
- }
- }
- }
-
- return notExists;
- }
-
- public void run()
- {
- if (definitionElement != null && importNotAlreadyExists())
- {
- beginRecording();
- performAddElement();
- endRecording();
- }
- }
- public void performAddElement()
- {
- try
- {
- Element typesElement = getOrCreateTypesElement();
- Element importHolderElement = getOrCreateImportHolderElement(typesElement);
-
- AddElementAction addImportAction = new AddElementAction("", "icons/xsd_obj.gif", importHolderElement, importHolderElement.getPrefix(), "import")
- {
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("namespace", namespace);
- newElement.setAttribute("schemaLocation", location);
- }
- };
- addImportAction.run();
- Element newElement = addImportAction.getNewElement();
- format(newElement);
- }
- catch (Exception e)
- {
- }
- }
-
- public void setElementDeclarationNamespacePrefix(String nsPrefix)
- {
- this.elementDeclarationNamespacePrefix = nsPrefix;
- }
-
- protected static void format(Node parentNode)
- {
- if (parentNode instanceof XMLNode)
- {
- // format selected node
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((XMLNode)parentNode);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/BaseNodeAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/BaseNodeAction.java
deleted file mode 100644
index 8e1873e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/BaseNodeAction.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.w3c.dom.Node;
-
-import org.eclipse.wst.xml.core.document.XMLNode;
-
-public abstract class BaseNodeAction extends Action
-{
- public abstract Node getNode();
- public abstract String getUndoDescription();
-
- public void beginRecording()
- {
- Node node = getNode();
- if (node instanceof XMLNode)
- {
- ((XMLNode)node).getModel().beginRecording(this, getUndoDescription());
- }
- }
-
- public void endRecording()
- {
- Node node = getNode();
- if (node instanceof XMLNode)
- {
- ((XMLNode)node).getModel().endRecording(this);
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/CopyGlobalAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/CopyGlobalAction.java
deleted file mode 100644
index ba45fde..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/CopyGlobalAction.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class CopyGlobalAction extends Action {
- private IEditorPart editor;
- private WSDLElement selection;
-
- public CopyGlobalAction(WSDLElement selection, IEditorPart editor) {
- setText(WSDLEditorPlugin.getWSDLString("_UI_ACTION_COPY"));
- this.selection = selection;
- this.editor = editor;
- setEnabledState();
- }
-
- public void run() {
- if (editor instanceof WSDLEditor) {
- ((WSDLEditor) editor).setClipboardContents(selection);
-
- ((WSDLEditor) editor).getSelectionManager().setSelection(new StructuredSelection(selection));
- }
- }
-
- public void setSelection(WSDLElement newSelection) {
- selection = newSelection;
- setEnabledState();
- }
-
- protected void setEnabledState() {
- if (selection instanceof Operation) {
- setEnabled(true);
- }
- else {
- setEnabled(false);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/CopyWSDLElementAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/CopyWSDLElementAction.java
deleted file mode 100644
index b4e7f9a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/CopyWSDLElementAction.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.Iterator;
-import java.util.Map;
-
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOperationCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.WSDLElementCommand;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.WSDLTreeNodeEditPart;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-
-
-
-import org.w3c.dom.Node;
-
-/*
- * Class which copies a WSDLElement and it's 'children' elements.
- * For example, a copy command on a Operation will result in a copy
- * of the operation and it's input/output/faults, and it's message
- * and parts.
- */
-public class CopyWSDLElementAction extends WSDLDragAction {
- WSDLElement element, parent;
- Node parentNode;
- WSDLElementCommand wsdlElementCommand;
- EditPartViewer editPartViewer;
-
- /*
- * element = The WSDLElement being copied
- * parent = The Parent of the 'new' WSDLElement
- * parentNode = ElementImpl (for undo)
- */
- public CopyWSDLElementAction(EditPartViewer editPartViewer, WSDLElement element, WSDLElement parent, Node parentNode) {
- setText("Copy WSDLElement"); // Do not Translate This
- this.element = element;
- this.parent = parent;
- this.parentNode = parentNode;
- this.editPartViewer = editPartViewer;
- }
-
- public boolean canExecute() {
- if (element instanceof Operation){
- if(parent instanceof PortType) {
- PortType pt = (PortType) parent;
- Operation op = (Operation) element;
- wsdlElementCommand = new AddOperationCommand(pt, op, NameUtil.buildUniqueOperationName(pt, op.getName()), true);
- }
- }
- /*
- else if (element instanceof MessageReference) {
-
- }
- else if (element instanceof Input) {
-
- }
- else if (element instanceof Output) {
-
- }
- else if (element instanceof Fault) {
-
- }
- else if (element instanceof Message) {
-
- }
- */
-
- if (wsdlElementCommand != null) {
- return true;
- }
- else {
- return false;
- }
- }
-
- public void run() {
- if (wsdlElementCommand == null) {
- if (canExecute()) {
- runCommand();
- }
- }
- else {
- runCommand();
- }
- }
-
- private void runCommand() {
- this.beginRecording();
- wsdlElementCommand.run();
- selectWSDLElement(wsdlElementCommand.getWSDLElement());
- this.endRecording();
- }
-
- private void selectWSDLElement(WSDLElement element) {
- // Select the newly created element
- // Expand all the associated elements 'below' the given element
- Map editPartMap = editPartViewer.getEditPartRegistry();
- WSDLTreeNodeEditPart wsdlEditPart = (WSDLTreeNodeEditPart) editPartMap.get(element);
- if (wsdlEditPart != null) {
- editPartViewer.select(wsdlEditPart);
- expandEditParts(element, true);
- }
- }
-
- private void expandEditParts(Object element, boolean expandChildren) {
- if (element != null) {
- Map editPartMap = editPartViewer.getEditPartRegistry();
- WSDLTreeNodeEditPart wsdlEditPart = (WSDLTreeNodeEditPart) editPartMap.get(element);
- wsdlEditPart.setExpanded(true);
-
- if (expandChildren) {
- Iterator iterator = WSDLEditorUtil.getModelGraphViewChildren(element).iterator();
-
- while (iterator.hasNext()) {
- expandEditParts(iterator.next(), expandChildren);
- }
- }
- }
- }
-
- // Inherited classes from BaseNodeAction
- public Node getNode() {
- return parentNode;
- }
-
- public String getUndoDescription() {
- return WSDLEditorPlugin.getWSDLString("_UI_ACTION_COPY");
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/CreateDocActionDelegate.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/CreateDocActionDelegate.java
deleted file mode 100644
index 4e4b9c5..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/CreateDocActionDelegate.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.ActionDelegate;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.dialogs.WizardNewFolderMainPage;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-
-public class CreateDocActionDelegate extends ActionDelegate implements IEditorActionDelegate
-{
- protected IFile iFile;
- protected IEditorPart editorPart;
-
- protected final static String WSDLEDITOR_DOCGEN_PLUGIN_ID = "org.eclipse.wst.wsdl.ui.internal.docgen"; //$NON-NLS-1$
- protected final static String VALIDATE_WSDL_PLUGIN_ID = "org.eclipse.wst.validate.wsdl"; //$NON-NLS-1$
-
- protected IWorkspaceRoot workspaceRoot = null;
-
- public CreateDocActionDelegate()
- {
- }
-
- public void setFile(IFile iFile)
- {
- this.iFile = iFile;
- }
-
- public void setEditorPart(IEditorPart editorPart)
- {
- this.editorPart = editorPart;
- }
-
- public void run(IAction action)
- {
-// TODO: Uncomment when validation is checked into corona
-// ISharedService validateSharedService = ExtensionPlugin.getSharedService("ValidateWSDLSharedService"); //$NON-NLS-1$
-// System.out.println(validateSharedService);
-// if (validateSharedService != null)
-// {
-// try
-// {
-// Boolean rc = (Boolean) validateSharedService.run(iFile);
-// if (rc.booleanValue())
-// {
- NewWSDLDocFolderWizard wiz = new NewWSDLDocFolderWizard();
- NewWSDLDocDialog dlg = new NewWSDLDocDialog(WSDLEditorPlugin.getShell(), wiz);
- dlg.open();
-// }
-// else
-// {
-// MessageDialog.openError(Display.getCurrent().getActiveShell(), WSDLEditorPlugin.getWSDLString("_UI_ERROR_INVALID_WSDL"), //$NON-NLS-1$
-// WSDLEditorPlugin.getWSDLString("_UI_ERROR_INVALID_WSDL_DESC")); //$NON-NLS-1$
-// }
-// }
-// catch (Exception e)
-// {
-// }
-// }
-// else
-// {
-// MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", //$NON-NLS-1$
-// "Cannot find validator"); //$NON-NLS-1$
-// }
- }
-
- class GenHTMLOperation extends WorkspaceModifyOperation
- {
- IFile iFile;
- String outputLocation;
- public GenHTMLOperation(IFile iFile)
- {
- super();
- this.iFile = iFile;
- }
-
- public void setOutputLocation(String outputLocation)
- {
- this.outputLocation = outputLocation;
- }
-
- protected void execute(IProgressMonitor monitor) throws CoreException
- {
- /*
- monitor.beginTask(WSDLEditorPlugin.getWSDLString("_UI_LABEL_CREATING_HTML_FILES"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
- WSDLDoc doc = new WSDLDoc(new WSDLDocFileWriter());
-
- try
- {
- Plugin plugin = Platform.getPlugin("org.eclipse.wst.wsdl.ui.internal.docgen"); //$NON-NLS-1$
- IPath installPath = new Path(plugin.getDescriptor().getInstallURL().toExternalForm()).removeTrailingSeparator();
- String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile();
- Path docgenPath = new Path(installStr);
-
- doc.setTemplateLocation(docgenPath.toOSString() + "template" + File.separator); //$NON-NLS-1$
- doc.setOptions(iFile.getRawLocation().removeLastSegments(1).toOSString(), outputLocation, "");
-
- doc.addFile(iFile.getName());
- doc.doBuildStep();
- }
- catch (Exception e)
- {
- // e.printStackTrace();
- }
- finally
- {
- monitor.done();
- }
- */
- }
- }
-
- class WSDLDocNewFolderMainPage extends WizardNewFolderMainPage
- {
- public WSDLDocNewFolderMainPage(String pageName)
- {
- super(pageName, new StructuredSelection(iFile));
- setDescription(WSDLEditorPlugin.getWSDLString("_UI_LABEL_CREATE_FOLDER_FOR_DOCS")); //$NON-NLS-1$
- }
- }
-
- class NewWSDLDocFolderWizard extends Wizard
- {
- IFolder folder;
-
- private WSDLDocNewFolderMainPage newFolderPage;
-
- public NewWSDLDocFolderWizard()
- {
- super();
- setNeedsProgressMonitor(true);
- }
-
- public boolean performFinish()
- {
- folder = newFolderPage.createNewFolder();
- if (folder == null)
- {
- MessageDialog.openError(WSDLEditorPlugin.getShell(), WSDLEditorPlugin.getWSDLString("_UI_ERROR_ERROR"), //$NON-NLS-1$
- WSDLEditorPlugin.getWSDLString("_UI_ERROR_FOLDER_NOT_CREATED")); //$NON-NLS-1$
- return false;
- }
-
- GenHTMLOperation op = new GenHTMLOperation(iFile);
- op.setOutputLocation(folder.getLocation().toOSString());
-
- try
- {
- op.execute(new NullProgressMonitor());
-
- // refresh folder and open index.html in web browser
- folder.refreshLocal(IResource.DEPTH_INFINITE, null);
- String indexHtmlFile = folder.getLocation().toOSString() + File.separator + "index.html"; //$NON-NLS-1$
- IFile indexHtmlIFile = getWorkspaceFileFromLocalLocation(indexHtmlFile);
- if (indexHtmlIFile != null && indexHtmlIFile.exists())
- {
- revealSelection(new StructuredSelection(indexHtmlIFile));
-
- openEditor(indexHtmlIFile, "org.eclipse.webbrowser"); //$NON-NLS-1$
- }
- else
- {
- MessageDialog.openError(Display.getCurrent().getActiveShell(), WSDLEditorPlugin.getWSDLString("_UI_ERROR_ERROR"), //$NON-NLS-1$
- WSDLEditorPlugin.getWSDLString("_UI_ERROR_CREATING_HTML_FILES")); //$NON-NLS-1$
- }
- }
- catch (CoreException ce)
- {
- // ce.printStackTrace();
- }
- catch (Exception e)
- {
- // e.printStackTrace();
- }
- return true;
- }
-
- protected void revealSelection(final ISelection selection)
- {
- if (selection != null)
- {
- IWorkbench workbench = WSDLEditorPlugin.getInstance().getWorkbench();
- final IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- final IWorkbenchPart focusPart = workbenchWindow.getActivePage().getActivePart();
- if (focusPart instanceof ISetSelectionTarget)
- {
- Display.getCurrent().asyncExec
- (new Runnable()
- {
- public void run()
- {
- ((ISetSelectionTarget)focusPart).selectReveal(selection);
- }
- });
- }
- }
- }
-
- protected void openEditor(final IFile iFile, final String editorId)
- {
- if (iFile != null)
- {
- IWorkbench workbench = WSDLEditorPlugin.getInstance().getWorkbench();
- final IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-
- Display.getDefault().asyncExec
- (new Runnable()
- {
- public void run()
- {
- try
- {
- workbenchWindow.getActivePage().openEditor(new FileEditorInput(iFile), editorId);
- }
- catch (PartInitException ex)
- {
-// B2BGUIPlugin.getPlugin().getMsgLogger().write("Exception encountered when attempting to open file: " + iFile + "\n\n" + ex);
- }
- }
- });
- }
- }
-
- protected IFile getWorkspaceFileFromLocalLocation(String fileName)
- {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- if (workspace != null)
- {
- IFile iFile = workspace.getRoot().getFileForLocation(new Path(fileName));
- if (iFile != null)
- {
- return iFile;
- }
- }
- return null;
- }
-
- public void addPages()
- {
- newFolderPage = new WSDLDocNewFolderMainPage(WSDLEditorPlugin.getWSDLString("_UI_LABEL_NEW_FOLDER")); //$NON-NLS-1$
- addPage(newFolderPage);
- }
-
- public boolean canFinish()
- {
- if (newFolderPage.isPageComplete())
- {
- return true;
- }
- return false;
- }
-
- public IFolder getFolder()
- {
- return folder;
- }
- }
-
- class NewWSDLDocDialog extends WizardDialog
- {
- public NewWSDLDocDialog(Shell parentShell, IWizard newWizard)
- {
- super(parentShell, newWizard);
- }
- }
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor)
- {
- editorPart = targetEditor;
- iFile = null;
- if (editorPart != null)
- {
- IEditorInput input = targetEditor.getEditorInput();
- if (input instanceof IFileEditorInput)
- {
- iFile = ((IFileEditorInput) input).getFile();
- }
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteAction.java
deleted file mode 100644
index 002f226..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteAction.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.widgets.Shell;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.xsd.XSDSchema;
-
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.SelectionEvent;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.xml.core.document.XMLNode;
-
-public class DeleteAction extends BaseNodeAction {
- protected List list;
- protected String deleteString = WSDLEditorPlugin.getWSDLString("_UI_ACTION_DELETE") + " "; //$NON-NLS-1$
-// private Object object;
-// private Node node;
-
- public DeleteAction(Object object, Node node) {
- setText(WSDLEditorPlugin.getWSDLString("_UI_ACTION_DELETE")); //$NON-NLS-1$
- list = new Vector();
- list.add(object);
- }
-
- public DeleteAction(List deleteList) {
- setText(WSDLEditorPlugin.getWSDLString("_UI_ACTION_DELETE")); //$NON-NLS-1$
- list = deleteList;
- }
-
- private Vector getReferencedMessages(Operation operation) {
- Vector messages = new Vector();
- messages.addAll(getMessages(operation.getEFaults()));
-
- if (operation.getEInput() != null && operation.getEInput().getEMessage() != null)
- messages.addElement(operation.getEInput().getEMessage());
- if (operation.getEOutput() != null && operation.getEOutput().getEMessage() != null)
- messages.addElement(operation.getEOutput().getEMessage());
-
- return messages;
- }
-
- public void run() {
- // We want to delete Operations first. So we need to sort the list
- List sortedList = new ArrayList(list.size());
- Iterator listIterator = list.iterator();
-
- while (listIterator.hasNext()) {
- Object unsortedObject = listIterator.next();
- if (unsortedObject instanceof Operation) {
- sortedList.add(0, unsortedObject);
- }
- else {
- sortedList.add(unsortedObject);
- }
- }
-
- Node recordingNode = null;
- if (sortedList.size() > 1) {
- recordingNode = getElement(sortedList.get(0));
- beginRecording(recordingNode, WSDLEditorPlugin.getWSDLString("_UI_ACTION_MULTIPLE_DELETE"));
- }
-
- Iterator iterator = sortedList.iterator();
- while (iterator.hasNext()) {
- Object object = iterator.next();
-
- if (object instanceof Operation) {
- deleteOperation((Operation) object);
- }
- else if (object instanceof Part) {
- deletePart((Part) object);
- }
- else {
- DeleteNodeAction deleteNodeAction = new DeleteNodeAction(getElement(object));
- deleteNodeAction.run();
- }
- }
-
- if (recordingNode != null) {
- endRecording(recordingNode);
- }
- }
-
- private Vector getMessages(List faults) {
- Vector v = new Vector();
- Iterator it = faults.iterator();
-
- while (it.hasNext()) {
- Fault fault = (Fault) it.next();
- if (fault.getEMessage() != null) {
- v.addElement(fault.getEMessage());
- }
- }
-
- return v;
- }
-
- private Vector getParts(Vector messages) {
- Vector parts = new Vector();
- Iterator it = messages.iterator();
-
- while (it.hasNext()) {
- Message message = (Message) it.next();
-
- if (message.getEParts() != null) {
- parts.addAll(message.getEParts());
- }
- }
-
- return parts;
- }
-
- public Node getNode()
- {
- return list.size() > 0 ? (Node) getElement(list.get(0)) : null;
- }
-
- public String getUndoDescription()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_ACTION_DELETE"); //$NON-NLS-1$
- }
-
- private void deleteOperation(Operation operation) {
- DeleteOperationDialog dialog = new DeleteOperationDialog(WSDLEditorPlugin.getShell(), operation.getName());
- int returnCode = dialog.createAndOpen();
-
- if (returnCode == IDialogConstants.OK_ID) {
- if (dialog.deleteMessagesAndParts()) {
- // Get all associated messages
- Vector messages = getReferencedMessages(operation);
-
- // Determine which Messages are referenced from 'outside' this operation
- Vector referencedMessages = new Vector();
- if (operation.getEnclosingDefinition().getEPortTypes() != null) {
- Iterator portTypeIterator = operation.getEnclosingDefinition().getEPortTypes().iterator();
- Vector operations = new Vector();
-
- while (portTypeIterator.hasNext()) {
- PortType portType = (PortType) portTypeIterator.next();
-
- if (portType.getEOperations() != null) {
- Iterator operationIterator = portType.getEOperations().iterator();
- while (operationIterator.hasNext()) {
- Operation nextOperation = (Operation) operationIterator.next();
- if (!nextOperation.equals(operation))
- operations.add(nextOperation);
- }
- }
- }
-
- for (int index = 0; index < operations.size(); index++) {
- referencedMessages.addAll(getReferencedMessages((Operation) operations.elementAt(index)));
- }
-
- // Filter which Messages need to be deleted
- for (int index = 0; index < messages.size(); index++) {
- int foundIndex = referencedMessages.indexOf(messages.elementAt(index));
-
- if (foundIndex != -1) {
- // Message is referenced elsewhere. Do not delete
- messages.remove(index);
- }
- }
- }
-
- // Get all associated parts
- Vector parts = getParts(messages);
-
- // Remove our list of Messages and Parts
- PortType portType = (PortType) operation.eContainer();
- Node recordingNode = portType.getEnclosingDefinition().getElement();
- beginRecording(recordingNode, deleteString + WSDLEditorPlugin.getWSDLString("_UI_LABEL_OPERATION"));
-
- for (int index = 0; index < messages.size(); index++) {
- Message message = (Message) messages.elementAt(index);
- Definition definition = (Definition) message.eContainer();
- definition.getEMessages().remove(message);
- }
-
- for (int index = 0; index < parts.size(); index++) {
- Part part = (Part) parts.elementAt(index);
- Message message = (Message) part.eContainer();
- message.getEParts().remove(part);
- }
-
- // Delete the Operation
- portType.getEOperations().remove(operation);
-
- endRecording(recordingNode);
- }
- else {
- // Only delete the Operation
- PortType portType = (PortType) operation.eContainer();
- Node recordingNode = portType.getElement();
-
- beginRecording(recordingNode, deleteString + WSDLEditorPlugin.getWSDLString("_UI_LABEL_OPERATION")); // Translate this!!!
- portType.getEOperations().remove(operation);
- endRecording(recordingNode);
- }
- }
- }
-
- private void deletePart(Part part) {
- Message message = (Message) part.eContainer();
- if (message != null) {
- beginRecording(message.getElement(), deleteString + WSDLEditorPlugin.getWSDLString("_UI_LABEL_PART"));
- message.getEParts().remove(part);
- endRecording(message.getElement());
- }
- }
-
- private Element getElement(Object object) {
- Element element = null;
- if (object instanceof WSDLElement) {
- element = ((WSDLElement) object).getElement();
- }
- else if (object instanceof XSDSchema) {
- element = ((XSDSchema) object).getElement();
- }
-
- return element;
- }
-
- /*
- * The following method should be used to begin recording changes.
- * This should eventually replace BaseNodeAction.beginRecording()
- * when all deletes are model driven.
- */
- private void beginRecording(Node node, String undoDescription)
- {
- if (node instanceof XMLNode)
- {
- ((XMLNode)node).getModel().beginRecording(this, undoDescription);
- }
- }
-
- /*
- * The following method should be used to begin recording changes.
- * This should eventually replace BaseNodeAction.beginRecording()
- * when all deletes are model driven.
- */
- public void endRecording(Node node)
- {
- if (node instanceof XMLNode)
- {
- ((XMLNode)node).getModel().endRecording(this);
- }
- }
-
- private class DeleteOperationDialog extends Dialog implements SelectionListener{
- private Button checkButton = null;
- private boolean deleteMessagesAndParts = true;
- private String operationName;
-
- public DeleteOperationDialog(Shell shell, String name) {
- super(shell);
- operationName = name;
- }
-
- protected Control createDialogArea(Composite parent)
- {
- Composite dialogArea = (Composite)super.createDialogArea(parent);
-
- Composite composite = new Composite(dialogArea, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 0;
-
- composite.setLayout(layout);
-
- GridData gdFill= new GridData();
- gdFill.horizontalAlignment= GridData.FILL;
- gdFill.grabExcessHorizontalSpace= true;
- gdFill.verticalAlignment= GridData.FILL;
- gdFill.grabExcessVerticalSpace= true;
- composite.setLayoutData(gdFill);
-
- Label label = new Label(composite, SWT.NONE);
- label.setText(operationName);
-// label.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_OPERATION") + " " + operationName);
- GridData labelData = new GridData();
- labelData.horizontalSpan = 2;
-
- label.setLayoutData(labelData);
-
- Label emptyLabel = new Label(composite, SWT.NONE);
- GridData emptyData = new GridData();
- emptyData.horizontalSpan = 2;
- emptyLabel.setLayoutData(emptyData);
-
- checkButton = new Button(composite, SWT.CHECK);
- checkButton.setSelection(deleteMessagesAndParts);
- checkButton.addSelectionListener(this);
- Label nameLabel = new Label(composite, SWT.NONE);
- nameLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_DELETE_ASSOCIATED_MSG_AND_PARTS"));
-
- return dialogArea;
- }
-
- public boolean deleteMessagesAndParts() {
- return deleteMessagesAndParts;
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == checkButton) {
- if (checkButton.getSelection()) {
- deleteMessagesAndParts = true;
- }
- else {
- deleteMessagesAndParts = false;
- }
- }
- }
-
- public int createAndOpen() {
- create();
- getShell().setText(WSDLEditorPlugin.getWSDLString("_UI_DELETE_OPERATION_TITLE"));
- setBlockOnOpen(true);
- return open();
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteInterfaceAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteInterfaceAction.java
deleted file mode 100644
index 1764287..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteInterfaceAction.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.List;
-
-public interface DeleteInterfaceAction {
-
- public void setDeleteList(List list);
-
- public void run();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteNodeAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteNodeAction.java
deleted file mode 100644
index 1a1681e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteNodeAction.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-
-public class DeleteNodeAction extends BaseNodeAction
-{
- protected List list;
-
- public DeleteNodeAction(Node node)
- {
- setText(WSDLEditorPlugin.getWSDLString("_UI_ACTION_DELETE")); //$NON-NLS-1$
- list = new Vector();
- list.add(node);
- }
-
- public DeleteNodeAction(List nodeList)
- {
- setText(WSDLEditorPlugin.getWSDLString("_UI_ACTION_DELETE")); //$NON-NLS-1$
- list = new Vector();
- Iterator it = nodeList.iterator();
- while (it.hasNext()) {
- list.add(it.next());
- }
- }
-
- public void run()
- {
- beginRecording();
-
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Node node = (Node)i.next();
- if (node.getNodeType() == Node.ATTRIBUTE_NODE)
- {
- Attr attr = (Attr)node;
- attr.getOwnerElement().removeAttributeNode(attr);
- }
- else
- {
- Node parent = node.getParentNode();
- if (parent != null)
- {
- Node previousSibling = node.getPreviousSibling();
- if (previousSibling != null && isWhitespaceTextNode(previousSibling))
- {
- parent.removeChild(previousSibling);
- }
- parent.removeChild(node);
- }
- }
- }
-
- endRecording();
- }
-
- protected boolean isWhitespaceTextNode(Node node)
- {
- return (node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().trim().length() == 0);
- }
-
- public Node getNode()
- {
- return list.size() > 0 ? (Node)list.get(0) : null;
- }
-
- public String getUndoDescription()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_ACTION_DELETE"); //$NON-NLS-1$
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteWSDLAndXSDAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteWSDLAndXSDAction.java
deleted file mode 100644
index 1f84c92..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/DeleteWSDLAndXSDAction.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtensionRegistry;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Node;
-
-
-/**
- * This class handles delete with the WSDL Editor's graph view. the object for
- * deletion could be a WSDL 'object' or an XSD 'object'. We need to make this
- * distinction because we have two different Delete classes. One to handle
- * WSDL and another to handle XSD.
- */
-public class DeleteWSDLAndXSDAction extends BaseNodeAction {
- List list;
- Node recordingNode;
- WSDLEditor wsdlEditor;
-
- public DeleteWSDLAndXSDAction(List deleteList, Node recordingNode, WSDLEditor wsdlEditor) {
- setText(WSDLEditorPlugin.getWSDLString("_UI_ACTION_DELETE"));
- list = deleteList;
- this.recordingNode = recordingNode;
- this.wsdlEditor = wsdlEditor;
- }
-
- public void run() {
- Iterator it = list.iterator();
- List wsdlDeleteList = new ArrayList();
- List xsdDeleteList = new ArrayList();
-
- while (it.hasNext()) {
- Object object = it.next();
-
- if (object instanceof WSDLElement || object instanceof XSDSchema) {
- wsdlDeleteList.add(object);
- }
- else {
- xsdDeleteList.add(object);
- }
- }
-
- Object newSelection = null;
- Object topLevelObject = null;
- if (wsdlDeleteList.size() > 0 || xsdDeleteList.size() > 0)
- {
- try
- {
- beginRecording();
-
-
- // Delete WSDL objects
- if (wsdlDeleteList.size() > 0) {
- Object wsdlObject = wsdlDeleteList.get(0);
- if (wsdlObject instanceof WSDLElement) {
- newSelection = ((WSDLElement) wsdlObject).eContainer();
- topLevelObject = getTopLevelWSDLObject((WSDLElement) wsdlObject);
- }
-
- DeleteAction wsdlDelete = new DeleteAction(wsdlDeleteList);
- wsdlDelete.run();
- }
-
- // Delete XSD objects
- if (xsdDeleteList.size() > 0) {
- Object xsdObject = xsdDeleteList.get(0);
- if (xsdObject instanceof XSDConcreteComponent) {
- newSelection = ((XSDConcreteComponent) xsdObject).getContainer();
- topLevelObject = getTopLevelXSDObject((XSDConcreteComponent) xsdObject);
- }
-
- DeleteInterfaceAction xsdDelete = (DeleteInterfaceAction) getXSDDelete();
- xsdDelete.setDeleteList(xsdDeleteList);
- xsdDelete.run();
- // Hack to force a refresh of all components of the Graph View. This is needed
- // for the case where we delete a XSD Element (View input == Definition). The XSD
- // Element EditPart visual would not be removed from the view.
- wsdlEditor.getDefinition().setQName(wsdlEditor.getDefinition().getQName());
- }
- }
- finally
- {
- endRecording();
- }
- // Make our selection after our Deletions
- ISelectionProvider selectionProvider = (ISelectionProvider)wsdlEditor.getSelectionManager();
- if (selectionProvider != null)
- {
- if (newSelection instanceof XSDParticle)
- {
- newSelection = ((XSDParticle) newSelection).getContainer();
- }
-
- if (newSelection == null) {
- newSelection = getNewSelection();
- }
- if (newSelection != null) {
- // We have a newSelection, but it may also be deleted by the user. In this case, select the top level object
- if (list.contains(newSelection) && topLevelObject != null) {
- newSelection = topLevelObject;
- }
-
- selectionProvider.setSelection(new StructuredSelection(newSelection));
- }
- }
- }
- }
-
- public Node getNode()
- {
- return recordingNode;
- }
-
- public String getUndoDescription()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_ACTION_DELETE"); //$NON-NLS-1$
- }
-
- private Object getXSDDelete() {
- WSDLEditorExtensionRegistry registry = WSDLEditorPlugin.getInstance().getWSDLEditorExtensionRegistry();
- WSDLEditorExtension[] extensions = registry.getRegisteredExtensions(WSDLEditorExtension.MENU_ACTION_CONTRIBUTOR);
- Object xsdDelete = null;
-
- for (int i = 0; i < extensions.length; i++)
- {
-// xsdDelete = extensions[i].createExtensionObject(WSDLEditorExtension.XSD_DELETE_ACTION, wsdlEditor);
- xsdDelete = extensions[i].createExtensionObject(WSDLEditorExtension.XSD_DELETE_ACTION, null);
- if (xsdDelete != null) {
- break;
- }
- }
-
- return xsdDelete;
- }
-
- private Object getNewSelection() {
- // Hack using wsdleditor.... This situation occurs when we delete the Schema from the Types group.... We
- // usually get the container of the object being deleted... however, in this situation, the container would
- // be null because the object being deleted is a Schema......
- Object selection;
- try {
- selection = wsdlEditor.getGraphViewer().getComponentViewer().getInput();
- if (selection == null) {
- selection = wsdlEditor.getDefinition();
- }
- }
- catch (Exception e) {
- selection = wsdlEditor.getDefinition();
- }
-
- return selection;
- }
-
- private WSDLElement getTopLevelWSDLObject(WSDLElement element) {
- WSDLElement topObject = (WSDLElement) element.eContainer();
-
- while (topObject != null && !(topObject instanceof Definition)) {
- topObject = (WSDLElement) topObject.eContainer();
- }
-
- return topObject;
- }
-
- private XSDConcreteComponent getTopLevelXSDObject(XSDConcreteComponent component) {
- XSDConcreteComponent topObject = component.getContainer();
-
- while (topObject != null && !(topObject instanceof XSDSchema)) {
- topObject = (XSDConcreteComponent) topObject.eContainer();
- }
-
- return topObject;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/EditNamespacesAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/EditNamespacesAction.java
deleted file mode 100644
index 571b346..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/EditNamespacesAction.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.wst.common.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.common.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.nsedit.EditNamespacesDialog;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-
-public class EditNamespacesAction extends Action
-{
- protected Definition definition;
-
- public EditNamespacesAction(Definition definition)
- {
- setText(WSDLEditorPlugin.getWSDLString("_UI_EDIT_NAMESPACES"));
- this.definition = definition;
- }
-
- public void run()
- {
- DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
- Element element = WSDLEditorUtil.getInstance().getElementForObject(definition);
- if (element != null)
- {
- List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
- List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
-
- // here we store a copy of the old info for each NamespaceInfo
- // this info will be used in createPrefixMapping() to figure out how to update the document
- // in response to these changes
- for (Iterator i = namespaceInfoList.iterator(); i.hasNext();)
- {
- NamespaceInfo info = (NamespaceInfo) i.next();
- NamespaceInfo oldCopy = new NamespaceInfo(info);
- info.setProperty("oldCopy", oldCopy);
- }
-
- IPath path = new Path(definition.getDocumentBaseURI());
- EditNamespacesDialog dialog = new EditNamespacesDialog(WSDLEditorPlugin.getShell(), path, WSDLEditorPlugin.getWSDLString("_UI_EDIT_NAMESPACES_DIALOG_TITLE"), definition.getTargetNamespace(), namespaceInfoList);
- int rc = dialog.createAndOpen();
- if (rc == IDialogConstants.OK_ID)
- {
- element.setAttribute("targetNamespace", dialog.getTargetNamespace());
-
- List newInfoList = dialog.getNamespaceInfoList();
- namespaceInfoManager.removeNamespaceInfo(element);
- namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
-
-/*
- // see if we need to rename any prefixes
- Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
- if (prefixMapping.size() > 0)
- {
- //manager.getModel().aboutToChangeModel();
- ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(element, prefixMapping);
- replacePrefixAction.run();
- //manager.getModel().changedModel();
- }
-*/
- }
- }
- }
-
- protected Map createPrefixMapping(List oldList, List newList)
- {
- Map map = new Hashtable();
-
- Hashtable oldURIToPrefixTable = new Hashtable();
- for (Iterator i = oldList.iterator(); i.hasNext();)
- {
- NamespaceInfo oldInfo = (NamespaceInfo) i.next();
- oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
- }
-
- for (Iterator i = newList.iterator(); i.hasNext();)
- {
- NamespaceInfo newInfo = (NamespaceInfo) i.next();
- NamespaceInfo oldInfo = (NamespaceInfo) oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : "");
-
- // if oldInfo is non null ... there's a matching URI in the old set
- // we can use its prefix to detemine out mapping
- //
- // if oldInfo is null ... we use the 'oldCopy' we stashed away
- // assuming that the user changed the URI and the prefix
- if (oldInfo == null)
- {
- oldInfo = (NamespaceInfo) newInfo.getProperty("oldCopy");
- }
-
- if (oldInfo != null)
- {
- String newPrefix = newInfo.prefix != null ? newInfo.prefix : "";
- String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : "";
- if (!oldPrefix.equals(newPrefix))
- {
- map.put(oldPrefix, newPrefix);
- }
- }
- }
- return map;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/ExtensibleMenuActionContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/ExtensibleMenuActionContributor.java
deleted file mode 100644
index 7020db6..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/ExtensibleMenuActionContributor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.IMenuActionContributor;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtensionRegistry;
-import org.w3c.dom.Node;
-
-
-public class ExtensibleMenuActionContributor implements IMenuActionContributor
-{
- protected WSDLEditor wsdlEditor;
- protected IMenuActionContributor[] menuActionContributors;
-
- public ExtensibleMenuActionContributor(WSDLEditor wsdlEditor)
- {
- this.wsdlEditor = wsdlEditor;
-
- WSDLEditorExtensionRegistry registry = WSDLEditorPlugin.getInstance().getWSDLEditorExtensionRegistry();
-
- WSDLEditorExtension[] extensions = registry.getRegisteredExtensions(WSDLEditorExtension.MENU_ACTION_CONTRIBUTOR);
- menuActionContributors = new IMenuActionContributor[extensions.length];
-
- for (int i = 0; i < menuActionContributors.length; i++)
- {
- menuActionContributors[i] = (IMenuActionContributor)extensions[i].createExtensionObject(WSDLEditorExtension.MENU_ACTION_CONTRIBUTOR, wsdlEditor);
- }
- }
-
- public void contributeMenuActions(IMenuManager manager, Node node, Object object)
- {
- for (int i = 0; i < menuActionContributors.length; i++)
- {
- if (menuActionContributors[i] != null)
- {
- menuActionContributors[i].contributeMenuActions(manager, node, object);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/IDesignViewerActionBarContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/IDesignViewerActionBarContributor.java
deleted file mode 100644
index 09cab42..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/IDesignViewerActionBarContributor.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.wst.sse.ui.ISourceViewerActionBarContributor;
-
-public interface IDesignViewerActionBarContributor extends ISourceViewerActionBarContributor {
- public void initViewerSpecificContributions(IActionBars bars);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/PasteGlobalAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/PasteGlobalAction.java
deleted file mode 100644
index ef249c5..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/PasteGlobalAction.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.w3c.dom.Node;
-
-public class PasteGlobalAction extends Action {
- private IEditorPart editor;
- private WSDLElement selection;
- private Node selectionNode;
-
- public PasteGlobalAction(WSDLElement selection, IEditorPart editor) {
- setText(WSDLEditorPlugin.getWSDLString("_UI_ACTION_PASTE")); // Translate This
- this.selection = selection;
- this.editor = editor;
- selectionNode = selection.getElement();
- setEnabledState();
- }
-
- public void run() {
- if (editor instanceof WSDLEditor) {
- WSDLEditor wsdlEditor = (WSDLEditor) editor;
- CopyWSDLElementAction copyAction = new CopyWSDLElementAction(wsdlEditor.getGraphViewer().getComponentViewer(), wsdlEditor.getClipboardContents(), selection, selectionNode);
- copyAction.run();
- }
- }
-
- public void setSelection(WSDLElement newSelection) {
- selection = newSelection;
- setEnabledState();
- }
-
- protected void setEnabledState() {
- WSDLElement parentElement = null;
- if ((parentElement = showPasteAction((WSDLElement) selection, editor)) != null) {
- selection = parentElement;
- setEnabled(true);
- }
- else {
- setEnabled(false);
- }
- }
-
- private WSDLElement showPasteAction(WSDLElement element, IEditorPart ePart) {
- WSDLElement parentElement = null;
-
- if (ePart instanceof WSDLEditor) {
- WSDLElement clipboardElement = ((WSDLEditor) ePart).getClipboardContents();
-
- if (element instanceof PortType) {
- if (clipboardElement instanceof Operation) {
- parentElement = element;
- }
- }
- if (element instanceof Operation) {
- if (clipboardElement instanceof Operation) {
- parentElement = (WSDLElement) ((Operation) element).eContainer();
- }
- }
- }
-
- return parentElement;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/ReloadDependenciesActionDelegate.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/ReloadDependenciesActionDelegate.java
deleted file mode 100644
index 6a04631..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/ReloadDependenciesActionDelegate.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.actions.ActionDelegate;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-
-public class ReloadDependenciesActionDelegate extends ActionDelegate implements IEditorActionDelegate
-{
- private WSDLEditor wsdlEditor;
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor)
- {
- wsdlEditor = (targetEditor instanceof WSDLEditor) ? (WSDLEditor)targetEditor : null;
- }
-
- public void run(IAction action)
- {
- if (wsdlEditor != null)
- {
- try
- {
- wsdlEditor.reloadDependencies();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/RenameAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/RenameAction.java
deleted file mode 100644
index d04b992..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/RenameAction.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.ui.internal.visitor.BindingRenamer;
-import org.eclipse.wst.wsdl.ui.internal.visitor.MessageRenamer;
-import org.eclipse.wst.wsdl.ui.internal.visitor.PortTypeRenamer;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-//import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class RenameAction //extends BaseNodeAction implements Runnable
-{
- protected Object modelObject;
- protected String newName;
- protected Node node;
-
- public RenameAction(Object modelObject, String newName)
- {
- this.modelObject = modelObject;
- this.newName = newName;
- this.node = WSDLEditorUtil.getInstance().getNodeForObject(modelObject);
- }
-
- /*
- public Node getNode()
- {
- return node;
- }
- */
-
- /*
- public String getUndoDescription()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_ACTION_RENAME"); //$NON-NLS-1$
- }
- */
-
- public void run()
- {
- String oldName = "";
-
- if (modelObject instanceof Operation)
- {
- renameOperationHelper((Operation)modelObject);
- }
- else if (modelObject instanceof Input ||
- modelObject instanceof Output ||
- modelObject instanceof Fault)
- {
- renameIOFHelper((WSDLElement)modelObject);
- }
- else
- {
- renameModelObjectHelper(modelObject, newName);
- }
- }
-
- protected void renameModelObjectHelper(Object modelObject, String theNewName)
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(modelObject);
- if (element != null)
- {
- element.setAttribute("name", theNewName);
- }
-
- if (modelObject instanceof Message)
- {
- MessageRenamer renamer = new MessageRenamer((Message)modelObject, theNewName);
- renamer.visitBindings();
- }
- else if (modelObject instanceof PortType)
- {
- PortTypeRenamer renamer = new PortTypeRenamer((PortType)modelObject, theNewName);
- renamer.visitBindings();
- }
- else if (modelObject instanceof Binding)
- {
- BindingRenamer renamer = new BindingRenamer((Binding)modelObject, theNewName);
- renamer.visitServices();
- }
- }
-
- protected void renameOperationHelper(Operation operation)
- {
- // find binding operations with a matching signature
- Definition definition = operation.getEnclosingDefinition();
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
-
- for (Iterator i = util.getBindingOperations(operation).iterator(); i.hasNext(); )
- {
- BindingOperation bindingOperation = (BindingOperation)i.next();
- renameModelObjectHelper(bindingOperation, newName);
- }
-
- renameModelObjectHelper(operation, newName);
- }
-
-
- protected void renameIOFHelper(WSDLElement object)
- {
- Definition definition = object.getEnclosingDefinition();
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
-
- List list = null;
-
- if (object instanceof Input)
- {
- list = util.getBindingInputs((Input)object);
- }
- else if (object instanceof Output)
- {
- list = util.getBindingOutputs((Output)object);
- }
- else // fault
- {
- list = util.getBindingFaults((Fault)object);
- }
-
- if (list != null)
- {
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Object bindingObject = i.next();
- renameModelObjectHelper(bindingObject, newName);
- }
- }
-
- renameModelObjectHelper(object, newName);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/SmartRenameAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/SmartRenameAction.java
deleted file mode 100644
index 4d35fe8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/SmartRenameAction.java
+++ /dev/null
@@ -1,551 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import javax.xml.namespace.QName;
-
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.w3c.dom.Node;
-
-
-/*
- * This class renames 'related' WSDLElements. The scenario is as follows:
- * The user renames a WSDLElement in the editor, say a Message. This class
- * will find the 'related' elements to this Message and rename them as well.
- * It will only rename a 'related' element if the element name (or part of it)
- * is generated.
- *
- * See NameUtil.java
- */
-public class SmartRenameAction extends BaseNodeAction implements Runnable {
- protected Object element;
- protected String newName;
- private List messageReferences; // This variable should be accessed by method getAllMessageReferences()
- protected Node node;
-
- public SmartRenameAction(Object element, String newName) {
- setText("Smart Rename Action"); // Do not translate
- this.element = element;
- this.newName = newName;
- this.node = WSDLEditorUtil.getInstance().getNodeForObject(element);
- }
-
- public Node getNode() {
- return node;
- }
-
- public String getUndoDescription() {
- return WSDLEditorPlugin.getWSDLString("_UI_ACTION_RENAME"); //$NON-NLS-1$
- }
-
- public void run() {
- RenameAction renamer;
- String oldName;
-
- beginRecording();
- if (element instanceof Operation) {
- Operation operation = (Operation) element;
- oldName = operation.getName();
-
- if (oldName.equals(newName)) {
- return;
- }
-
- // Rename Operation
- renamer = new RenameAction(operation, newName);
- renamer.run();
-
- // Rename Input
- Input input = operation.getEInput();
- /*
- if (input != null && isInputOutputNameGenerated(oldName, input.getName())) {
- renamer = new RenameAction(input, newName);
- renamer.run();
- }
- */
-
- // Rename Output
- Output output = operation.getEOutput();
- /*
- if (output != null && isInputOutputNameGenerated(oldName, output.getName())) {
- renamer = new RenameAction(output, newName);
- renamer.run();
- }
- */
-
- // Rename Messages and Parts
- Message msg;
-
- // Input
- if (input != null && input.getEMessage() != null) {
- msg = input.getEMessage();
- String oldMessageName = "";
-
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
-
- if (isMessageNameGenerated(oldMessageName, oldName, "Request")) {
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
- }
- }
-
- // Output
- if (output != null && output.getMessage() != null) {
- msg = output.getEMessage();
- String oldMessageName = "";
-
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
-
- if (isMessageNameGenerated(oldMessageName, oldName, "Response")) {
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
-
- }
- }
-
- // Faults
- List faults = operation.getEFaults();
- if (faults != null) {
- Iterator it = faults.iterator();
- while (it.hasNext()) {
- Fault fault = (Fault) it.next();
- msg = fault.getEMessage();
- String oldMessageName = "";
-
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
-
- if (isMessageNameGenerated(oldMessageName, oldName, fault.getName())) {
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
- }
- }
- }
- }
- else if (element instanceof Input) {
- Input input = (Input) element;
- oldName = input.getName();
- if (oldName == null) {
- oldName = "";
- }
-
- if (oldName.equals(newName)) {
- return;
- }
-
- input.setName(newName);
-
-// Rename Messages and Parts
- Message msg;
-
- // Input
- if (input != null && input.getEMessage() != null) {
- msg = input.getEMessage();
- String oldMessageName = "";
-
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
-
- if (isMessageNameGenerated(oldMessageName, oldName, "Request")) {
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
- }
- }
- }
- else if (element instanceof Output) {
- Output output = (Output) element;
- oldName = output.getName();
- if (oldName == null) {
- oldName = "";
- }
-
- if (oldName.equals(newName)) {
- return;
- }
-
- output.setName(newName);
-
-// Rename Messages and Parts
- Message msg;
-
- // Output
- if (output != null && output.getMessage() != null) {
- msg = output.getEMessage();
- String oldMessageName = "";
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
- if (isMessageNameGenerated(oldMessageName, oldName, "Response")) {
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
- }
- }
- }
- else if (element instanceof Fault) {
- Fault fault = (Fault) element;
- Message msg = fault.getEMessage();
- String oldMessageName = "";
- oldName = fault.getName();
-
- if (oldName.equals(newName)) {
- return;
- }
-
- // Rename the Fault
- renamer = new RenameAction(fault, newName);
- renamer.run();
-
- // Rename the Message and Parts
- if (msg != null) {
- oldMessageName = msg.getQName().getLocalPart();
-
- Operation op = (Operation) fault.eContainer();
- if (isMessageNameGenerated(oldMessageName, op.getName(), oldName)) {
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renameFaultParts(msg.getEParts(), op.getName(), oldName, newName);
- }
- }
- }
- else if (element instanceof Message) {
- Message msg = (Message) element;
- oldName = msg.getQName().getLocalPart();
- String oldMessageName = msg.getQName().getLocalPart();
-
- if (oldName.equals(newName)) {
- return;
- }
-
- renameMessageHelper(msg, computeNewMessageName(msg, oldName, newName));
-
- if (msg.getEParts() != null)
- renamePartsHelper(msg.getEParts(), oldMessageName, msg.getQName().getLocalPart(), true);
- }
- else if (element instanceof Part) {
- Part part = (Part) element;
- String oldPartName = part.getName();
-
- if (oldPartName.equals(newName)) {
- return;
- }
-
- renamer = new RenameAction(element, newName);
- renamer.run();
-
-// Rename Elements
- renameXSDElement(part, oldPartName, newName);
- }
- else if (element instanceof Port) {
- Port port = (Port) element;
- String oldPortName = port.getName();
-
- renamer = new RenameAction(element, newName);
- renamer.run();
-
-// Rename Binding
- Binding binding = port.getEBinding();
- if (binding != null && binding.getQName().getLocalPart().equals(oldPortName)) {
- renamer = new RenameAction(binding, newName);
- renamer.run();
- }
- }
- endRecording();
- }
-
- // boolean isInputOutput should be set to true if the part is an Input or Output.
- // Set false if the part is a Fault.
- private void renamePartsHelper(List partsList, String oldSubString, String newSubString, boolean isInputOutput) {
- RenameAction renamer;
-
- if (partsList != null) {
- Iterator pIt = partsList.iterator();
- while (pIt.hasNext()) {
- Part part = (Part) pIt.next();
- String oldPartName = part.getName();
-
- if (isPartNameGenerated(oldPartName, oldSubString)) {
- String newPartName;
- if (isInputOutput) {
- newPartName = computeNewPartName(part, oldSubString, newSubString);
- }
- else {
- newPartName = computeNewFaultPartName(part, oldSubString, newSubString);
- }
-
- renamer = new RenameAction(part, newPartName);
- renamer.run();
-
- // Rename Elements
- renameXSDElement(part, oldPartName, newPartName);
- }
- }
- }
- }
-
- // This method is used to update the Part name when the Fault name is changed. Only
- // change the Part name if the part name is a generated name.
- // Compare to renamePartsHelper(). The renamePartsHelper() method is called when a Fault
- // has NOT been renamed, rather, it is triggered by some other naming (ex. Operation
- // renaming). It will updat Input/Output, AND Fault Parts.
- private void renameFaultParts(List partsList, String baseName, String oldSubString, String newSubString) {
- RenameAction renamer;
-
- if (partsList != null) {
- Iterator pIt = partsList.iterator();
- while (pIt.hasNext()) {
- Part part = (Part) pIt.next();
- String oldPartName = part.getName();
-
- if (isPartNameGenerated(oldPartName, baseName, oldSubString)) {
- String newPartName;
- newPartName = computeNewFaultPartName(part, oldSubString, newSubString);
- renamer = new RenameAction(part, newPartName);
- renamer.run();
-
- // Rename Elements
- renameXSDElement(part, oldPartName, newPartName);
- }
- }
- }
- }
-
- private String computeNewMessageName(Message message, String oldSubString, String newSubString) {
- String string = message.getQName().getLocalPart();
- return replaceSectionWithSubString(string, oldSubString, newSubString, 0);
- }
-
- private String computeNewFaultMessageName(Message message, String oldSubString, String newSubString) {
- String string = message.getQName().getLocalPart();
- return replaceSectionWithSubString(string, oldSubString, newSubString, 1);
- }
-
- // Method for Input, Output, and Fault Parts
- // See computeNewFaultPartName() for comparison
- private String computeNewPartName(Part part, String oldSubString, String newSubString) {
- String string = part.getName();
- return replaceSectionWithSubString(string, oldSubString, newSubString, 0);
- }
-
- // Method for Fault Parts
- // This method behaves in the exact same way as computeNewPartName() except it starts searching for a match
- // after the first character. This method is intended for users who wish to rename a generated (Fault) part
- // where the Fault name has changed. We start our search after the first character because the generated name
- // of the part is built by appending the Fault name after the Operation name.
- private String computeNewFaultPartName(Part part, String oldSubString, String newSubString) {
- String string = part.getName();
- return replaceSectionWithSubString(string, oldSubString, newSubString, 1);
- }
-
- private String replaceSectionWithSubString(String fullString, String oldSubString, String newSubString, int startSearchIndex) {
- StringBuffer fullSB = new StringBuffer(fullString);
- int index = fullSB.indexOf(oldSubString, startSearchIndex);
- if (index >= 0) {
- return fullSB.replace(index, index + oldSubString.length(), newSubString).toString();
- }
-
- return "";
- }
-
- ////////////////////////////////////////////////////////////////////////////////////////
-
- private static boolean commonNameGeneratorCheck(String targetName, String baseName, String appendName) {
- // First criteria is targetName must start with the baseName
- if (!targetName.startsWith(baseName))
- return false;
-
- if (appendName.trim().length() > 0) {
- // Second criteria. The appended name must be in the targetName and begin right
- // after the baseName location
- if (!targetName.startsWith(appendName, baseName.length()))
- return false;
- }
-
- // Third criteria (if necessary). If baseName + appendName is shorter than targetName,
- // then there must be 'extra' characters at the end of targetName. These characters must
- // make up an integer. If not, it is not a generated string.
- int subLength = baseName.length() + appendName.length();
- if (targetName.length() > subLength) {
- // We have 'extra' characters
- String extras = targetName.substring(subLength);
-
- if(!isDigit(extras))
- return false;
- }
-
- return true;
- }
-
- public static boolean isOperationNameGenerated(String opName, String name) {
- return opName.equals(name);
- }
-
- public static boolean isMessageNameGenerated(String msgName, String baseName, String appendName) {
- return commonNameGeneratorCheck(msgName, baseName, appendName);
- }
-
- public static boolean isInputOutputNameGenerated(String inOutName, String name) {
- return inOutName.equals(name);
- }
-
- public static boolean isFaultNameGenerated(String faultName, String name) {
- return faultName.equals(name);
- }
-
- public static boolean isPartNameGenerated(String partName, String baseName) {
- return commonNameGeneratorCheck(partName, baseName, "");
- }
-
- private boolean isPartNameGenerated(String partName, String baseName, String appendName) {
- return commonNameGeneratorCheck(partName, baseName, appendName);
- }
-
- private static boolean isDigit(String string) {
- boolean rValue = true;
- char[] chars = string.toCharArray();
-
- for (int index = 0; index < chars.length; index++) {
- if (!Character.isDigit(chars[index])) {
- rValue = false;
- break;
- }
- }
-
- return rValue;
- }
-
- /*
- * The following classes aid in renaming a message
- */
- private void renameMessageHelper(Message msg, String newName) {
- List messageRefs = getReferencingMessageReferences(msg, getAllMessageReferences());
-
- RenameAction renamer = new RenameAction(msg, newName);
- renamer.run();
-
- Iterator iterator = messageRefs.iterator();
- while (iterator.hasNext()) {
- MessageReference messageReference = (MessageReference) iterator.next();
- messageReference.setEMessage(msg);
- }
- }
-
- private List getReferencingMessageReferences(Message msg, List messageRefs) {
- Vector referencesVector = new Vector();
- QName messageQName = msg.getQName();
- Iterator iterator = messageRefs.iterator();
-
- while (iterator.hasNext()) {
- MessageReference messageReference = (MessageReference) iterator.next();
- if (messageReference.getEMessage() != null && messageQName.equals(messageReference.getEMessage().getQName())) {
- referencesVector.addElement(messageReference);
- }
- }
-
- return referencesVector;
- }
-
- private List getAllMessageReferences() {
- if (messageReferences == null) {
- messageReferences = new Vector();
- Definition definition = ((WSDLElement) element).getEnclosingDefinition();
- List portTypes = definition.getEPortTypes();
-
- if (portTypes != null) {
- Iterator portTypeIterator = portTypes.iterator();
- while (portTypeIterator.hasNext()) {
- List operationsList = ((PortType) portTypeIterator.next()).getEOperations();
-
- if (operationsList != null) {
- Iterator operationsIterator = operationsList.iterator();
- while (operationsIterator.hasNext()) {
- messageReferences.addAll(getAllMessageReferences((Operation) operationsIterator.next()));
- }
- }
- }
- }
- }
-
- return messageReferences;
- }
-
- private Vector getAllMessageReferences(Operation operation) {
- Vector iofs = new Vector();
- Iterator it = operation.getEFaults().iterator();
- while (it.hasNext()) {
- iofs.addElement(it.next());
- }
-
- if (iofs == null)
- iofs = new Vector();
-
- if (operation.getEInput() != null)
- iofs.addElement(operation.getEInput());
-
- if (operation.getEOutput() != null)
- iofs.addElement(operation.getEOutput());
-
- return iofs;
- }
-
- private void renameXSDElement(Part part, String oldXSDName, String newXSDName) {
- XSDElementDeclaration elementDeclaration = part.getElementDeclaration();
- if (elementDeclaration != null && oldXSDName.equals(elementDeclaration.getName())) {
- renameElementDeclarationHelper(elementDeclaration, oldXSDName, newXSDName);
-
- // Here we rename the element reference.
- //
- QName qname = new QName(part.getElementName().getNamespaceURI(), newXSDName);
- part.setElementName(qname);
- }
- }
-
- private void renameElementDeclarationHelper(XSDElementDeclaration elementDeclaration, String oldXSDName, String newXSDName) {
- if (elementDeclaration != null && elementDeclaration.getName().equals(oldXSDName)) {
- elementDeclaration.setName(newXSDName);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/SourceEditorActionBarContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/SourceEditorActionBarContributor.java
deleted file mode 100644
index f98c651..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/SourceEditorActionBarContributor.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.wst.sse.ui.ISourceViewerActionBarContributor;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder;
-import org.eclipse.wst.sse.ui.extension.IExtendedContributor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLMultiPageEditorPart;
-
-public class SourceEditorActionBarContributor extends MultiPageEditorActionBarContributor implements IExtendedContributor {
-
- protected IEditorActionBarContributor designViewerActionBarContributor = null;
- protected IEditorActionBarContributor sourceViewerActionContributor = null;
- protected WSDLMultiPageEditorPart multiPageEditor = null;
-
- // EditorExtension
- private static final String EDITOR_ID = "org.eclipse.wst.wsdl.ui.internal.actions.XMLMultiPageEditorPart"; //$NON-NLS-1$
- private IExtendedContributor extendedContributor;
-
- public SourceEditorActionBarContributor() {
- super();
-
- sourceViewerActionContributor = new SourcePageActionContributor();
-
- // Read action extensions.
- ExtendedEditorActionBuilder builder = new ExtendedEditorActionBuilder();
- extendedContributor = builder.readActionExtensions(EDITOR_ID);
- }
-
- public void init(IActionBars actionBars) {
- super.init(actionBars);
-
- if (actionBars != null) {
- initDesignViewerActionBarContributor(actionBars);
- initSourceViewerActionContributor(actionBars);
- }
- }
-
- protected void initDesignViewerActionBarContributor(IActionBars actionBars) {
- if (designViewerActionBarContributor != null)
- designViewerActionBarContributor.init(actionBars, getPage());
- }
-
- protected void initSourceViewerActionContributor(IActionBars actionBars) {
- if (sourceViewerActionContributor != null)
- sourceViewerActionContributor.init(actionBars, getPage());
- }
-
- public void dispose() {
- super.dispose();
-
- if (designViewerActionBarContributor != null)
- designViewerActionBarContributor.dispose();
-
- if (sourceViewerActionContributor != null)
- sourceViewerActionContributor.dispose();
-
- if (extendedContributor != null)
- extendedContributor.dispose();
- }
-
- /**
- * @see EditorActionBarContributor#contributeToMenu(IMenuManager)
- */
- public final void contributeToMenu(IMenuManager menu) {
- super.contributeToMenu(menu);
-
- addToMenu(menu);
-
- if (extendedContributor != null)
- extendedContributor.contributeToMenu(menu);
- }
-
- protected void addToMenu(IMenuManager menu) {
- }
-
- /**
- * @see IExtendedContributor#contributeToPopupMenu(IMenuManager)
- */
- public final void contributeToPopupMenu(IMenuManager menu) {
-
- addToPopupMenu(menu);
-
- if (extendedContributor != null)
- extendedContributor.contributeToPopupMenu(menu);
- }
-
- protected void addToPopupMenu(IMenuManager menu) {
- }
-
- /**
- * @see EditorActionBarContributor#contributeToToolBar(IToolBarManager)
- */
- public final void contributeToToolBar(IToolBarManager toolBarManager) {
- super.contributeToToolBar(toolBarManager);
-
- addToToolBar(toolBarManager);
-
- if (extendedContributor != null)
- extendedContributor.contributeToToolBar(toolBarManager);
- }
-
- protected void addToToolBar(IToolBarManager toolBarManager) {
- }
-
- /**
- * @see EditorActionBarContributor#contributeToStatusLine(IStatusLineManager)
- */
- public final void contributeToStatusLine(IStatusLineManager manager) {
- super.contributeToStatusLine(manager);
-
- addToStatusLine(manager);
-
- if (extendedContributor != null)
- extendedContributor.contributeToStatusLine(manager);
- }
-
- protected void addToStatusLine(IStatusLineManager manager) {
- }
-
- /**
- * @see IExtendedContributor#updateToolbarActions()
- */
- public void updateToolbarActions() {
- if (extendedContributor != null)
- extendedContributor.updateToolbarActions();
- }
-
- public void setActiveEditor(IEditorPart targetEditor) {
- // save multiPageEditor before calling super.setActiveEditor(targetEditor)
- // super.setActiveEditor will call setActivePage(IEditorPart activeEditor)
- // multiPageEditor is needed in setActivePage(IEditorPart activeEditor)
- if (targetEditor instanceof WSDLMultiPageEditorPart)
- multiPageEditor = (WSDLMultiPageEditorPart) targetEditor;
-
- super.setActiveEditor(targetEditor);
-
- updateToolbarActions();
-
- if (extendedContributor != null)
- extendedContributor.setActiveEditor(targetEditor);
- }
-
- public void setActivePage(IEditorPart activeEditor) {
- // This contributor is designed for StructuredTextMultiPageEditorPart.
- // To safe-guard this from problems caused by unexpected usage by other editors, the following
- // check is added.
- if (multiPageEditor != null) {
- if (activeEditor != null && activeEditor instanceof StructuredTextEditor)
- activateSourcePage(activeEditor);
- else
- activateDesignPage(activeEditor);
- }
-
- updateToolbarActions();
-
- IActionBars actionBars = getActionBars();
- if (actionBars != null) {
- // update menu bar and tool bar
- actionBars.updateActionBars();
- }
- }
-
- protected void activateDesignPage(IEditorPart activeEditor) {
- if (designViewerActionBarContributor != null && designViewerActionBarContributor instanceof IDesignViewerActionBarContributor) {
- designViewerActionBarContributor.setActiveEditor(multiPageEditor);
- }
-
- if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor) {
- // if design page is not really an IEditorPart, activeEditor == null, so pass in multiPageEditor instead (d282414)
- if (activeEditor == null) {
- sourceViewerActionContributor.setActiveEditor(multiPageEditor);
- }
- else {
- sourceViewerActionContributor.setActiveEditor(activeEditor);
- }
- ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(false);
- }
- }
-
- protected void activateSourcePage(IEditorPart activeEditor) {
- if (designViewerActionBarContributor != null && designViewerActionBarContributor instanceof IDesignViewerActionBarContributor) {
- designViewerActionBarContributor.setActiveEditor(multiPageEditor);
- }
-
- if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor) {
- sourceViewerActionContributor.setActiveEditor(activeEditor);
- ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(true);
- }
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/SourcePageActionContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/SourcePageActionContributor.java
deleted file mode 100644
index e322f43..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/SourcePageActionContributor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.wst.xml.ui.actions.ActionContributorXML;
-
-
-/**
- * SourcePageActionContributor
- *
- * This class is for multi page editor's source page contributor.
- *
- * Use WSDLEditorActionContributor for single page editor
- * */
-public class SourcePageActionContributor extends ActionContributorXML {
-
- private IActionBars fBars;
-
- /**
- * This method calls:
- * <ul>
- * <li><code>contributeToMenu</code> with <code>bars</code>' menu manager</li>
- * <li><code>contributeToToolBar</code> with <code>bars</code>' tool bar
- * manager</li>
- * <li><code>contributeToStatusLine</code> with <code>bars</code>' status line
- * manager</li>
- * </ul>
- * The given action bars are also remembered and made accessible via
- * <code>getActionBars</code>.
- *
- * @param bars the action bars
- *
- */
- public void init(IActionBars bars) {
- fBars = bars;
- contributeToMenu(bars.getMenuManager());
- contributeToToolBar(bars.getToolBarManager());
- contributeToStatusLine(bars.getStatusLineManager());
- }
-
- /**
- * Returns this contributor's action bars.
- *
- * @return the action bars
- */
- public IActionBars getActionBars() {
- return fBars;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLActionBarContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLActionBarContributor.java
deleted file mode 100644
index 8b2a645..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLActionBarContributor.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLTextEditor;
-
-public class WSDLActionBarContributor extends SourceEditorActionBarContributor
-{
- protected WSDLTextEditor textEditor;
-
- /**
- * Constructor for WSDLActionBarContributor.
- */
- public WSDLActionBarContributor()
- {
- super();
- }
-
- public void setActivePage(IEditorPart activeEditor)
- {
- super.setActivePage(activeEditor);
-
- // always enable undo/redo regardless of which page we're on. The undo/redo comes from the editor
- //
- updateAction(IWorkbenchActionConstants.UNDO, ITextEditorActionConstants.UNDO, true);
- updateAction(IWorkbenchActionConstants.REDO, ITextEditorActionConstants.REDO, true);
-
- // turn these off so that the actionhandler will handle it for us
- //
- //updateAction(IWorkbenchActionConstants.CUT, ITextEditorActionConstants.CUT, false);
- //updateAction(IWorkbenchActionConstants.COPY, ITextEditorActionConstants.COPY, false);
- //updateAction(IWorkbenchActionConstants.PASTE, ITextEditorActionConstants.PASTE, false);
-
- getActionBars().updateActionBars();
- }
-
- protected void updateAction(String globalActionId, String textEditorActionId, boolean enable)
- {
- getActionBars().setGlobalActionHandler(globalActionId, enable ? getAction(textEditor, textEditorActionId) : null);
- }
-
- /**
- * Returns the action registed with the given text editor.
- * @return IAction or null if editor is null.
- */
- protected IAction getAction(ITextEditor editor, String actionID)
- {
- try
- {
- return (editor == null ? null : editor.getAction(actionID));
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- /**
- * @see EditorActionBarContributor#contributeToToolBar(IToolBarManager)
- */
- public void addToToolBar(IToolBarManager toolBarManager)
- {
- super.addToToolBar(toolBarManager);
- toolBarManager.add(new GroupMarker("WSDLEditor"));
- }
-
-
- public void setActiveEditor(IEditorPart activeEditor)
- {
- super.setActiveEditor(activeEditor);
- textEditor = null;
- if (activeEditor instanceof WSDLEditor)
- {
- textEditor = ((WSDLEditor) activeEditor).getWSDLTextEditor();
- }
-
- updateAction(IWorkbenchActionConstants.UNDO, ITextEditorActionConstants.UNDO, true);
- updateAction(IWorkbenchActionConstants.REDO, ITextEditorActionConstants.REDO, true);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLDragAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLDragAction.java
deleted file mode 100644
index 9583c2d..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLDragAction.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.WSDLTreeNodeEditPart;
-import org.w3c.dom.Node;
-
-public abstract class WSDLDragAction extends BaseNodeAction {
- protected WSDLTreeNodeEditPart movingChildEditPart;
- protected Point pointerLocation;
-
- /*
- * Sub-classes should override this method.
- */
- public boolean canExecute() {
- return false;
- }
-
- public void execute() {
- run();
- }
-
- /*
- * Sub-classes should override this method.
- */
- public String getUndoDescription() {
- return "";
- }
-
- /*
- * Sub-classes should override this method.
- */
- public Node getNode() {
- return null;
- }
-
- /*
- * Sub-classes should override this method.
- */
- public IFigure getFeedbackFigure() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLDragReorderAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLDragReorderAction.java
deleted file mode 100644
index 4c1d9b2..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLDragReorderAction.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import javax.wsdl.OperationType;
-
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Polyline;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.actions.WSDLDragAction;
-import org.eclipse.wst.wsdl.ui.internal.graph.WSDLComponentViewer;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.WSDLTreeNodeEditPart;
-import org.eclipse.wst.wsdl.internal.impl.OperationImpl;
-import org.eclipse.gef.EditPart;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class WSDLDragReorderAction extends WSDLDragAction
-{
- protected WSDLEditor wsdlEditor;
- protected WSDLElement movingChild;
- protected WSDLElement newParent;
- protected WSDLTreeNodeEditPart leftSiblingEditPart;
- protected WSDLTreeNodeEditPart rightSiblingEditPart;
- protected WSDLElement leftSibElement;
- protected WSDLElement rightSibElement;
- protected boolean canNeverExecute = false;
-
- public WSDLDragReorderAction(WSDLTreeNodeEditPart movingChildEditPart, EditPart pointerEditPart, Point pointerLocation) {
- this.movingChildEditPart = movingChildEditPart;
- this.pointerLocation = pointerLocation;
-
- EditPart possibleParent = getParentEditPart(pointerEditPart);
-
- if (!(possibleParent instanceof WSDLTreeNodeEditPart)) {
- canNeverExecute = true;
- return;
- }
-
- WSDLTreeNodeEditPart targetParentEditPart = (WSDLTreeNodeEditPart) possibleParent;
- wsdlEditor = ((WSDLComponentViewer) possibleParent.getViewer()).getWSDLEditor();
-
- if (pointerEditPart.getParent() != null) {
- // Sort the siblings (and itself)
- List targetEditPartSiblings = pointerEditPart.getParent().getChildren();
- Collections.sort(targetEditPartSiblings, new VerticalEditPartComparator());
-
- // Get 'left' and 'right' siblings
- leftSiblingEditPart = getVerticalLeftSibling(targetEditPartSiblings, movingChildEditPart, pointerLocation);
- rightSiblingEditPart = getVerticalRightSibling(targetEditPartSiblings, movingChildEditPart, pointerLocation);
-
- if (movingChildEditPart != null)
- movingChild = (WSDLElement) movingChildEditPart.getModel();
- if (leftSiblingEditPart != null)
- leftSibElement = (WSDLElement) leftSiblingEditPart.getModel();
- if (rightSiblingEditPart != null)
- rightSibElement = (WSDLElement) rightSiblingEditPart.getModel();
-
- newParent = (WSDLElement) targetParentEditPart.getModel();
- }
- else {
- newParent = (WSDLElement) targetParentEditPart.getModel();
- leftSibElement = null;
- rightSibElement= null;
- }
- }
-
- public boolean canExecute()
- {
- boolean result = false;
-
- if (canNeverExecute || newParent == null || movingChild == null) {
- return false;
- }
-
- if (movingChild instanceof Input) {
- if (!(leftSibElement instanceof Fault) && newParent.equals(movingChild.eContainer())) {
- result = true;
- }
- }
- else if (movingChild instanceof Output) {
- if (!(leftSibElement instanceof Fault) && newParent.equals(movingChild.eContainer())) {
- result = true;
- }
- }
- else if (movingChild instanceof Part) {
- if (newParent instanceof Message && newParent.equals(movingChild.eContainer())) {
- result = true;
- }
- }
-
- return result;
- }
-
-
- /*
- * @see IAction#run()
- */
- public void run()
- {
-// beginRecording();
- if (canExecute()) {
- if (movingChild instanceof Input) {
- Input input = (Input) movingChild;
- OperationImpl operation = (OperationImpl) input.eContainer();
-
- if (leftSiblingEditPart == null) {
- // Input/Output style
- setInputOutputOrder(operation, true);
- }
- else {
- // Output/Input style
- setInputOutputOrder(operation, false);
- }
- }
- else if (movingChild instanceof Output) {
- Output output = (Output) movingChild;
- OperationImpl operation = (OperationImpl) output.eContainer();
-
- if (leftSiblingEditPart == null) {
- // Output/Input style
- setInputOutputOrder(operation, false);
- }
- else {
- // Input/Output style
- setInputOutputOrder(operation, true);
- }
- }
- else if (movingChild instanceof Part) {
- Message message = (Message) newParent;
- List parts = message.getEParts();
-
- parts.remove(movingChild);
-
- int leftIndex = -1, rightIndex = -1;
- if (leftSibElement != null) {
- leftIndex = parts.indexOf(leftSibElement);
- }
- if (rightSibElement != null) {
- rightIndex = parts.indexOf(rightSibElement);
- }
-
- if (leftIndex == -1) {
- // Add moving child to the front
- parts.add(0, movingChild);
- }
- else if (rightIndex == -1) {
- // Add moving child to the end
- parts.add(movingChild);
- }
- else {
- // Add moving child after the occurence of the left sibling
- parts.add(leftIndex + 1, movingChild);
- }
- }
- wsdlEditor.getSelectionManager().setSelection(new StructuredSelection(movingChild));
- }
-// endRecording();
- }
-
- public IFigure getFeedbackFigure() {
- IFigure feedbackFigure = null;
- if (feedbackFigure == null && movingChildEditPart instanceof WSDLTreeNodeEditPart)
- {
- feedbackFigure = new Polyline();
-// polyLine.setLineStyle(Graphics.LINE_DASHDOT);
- ((Polyline)feedbackFigure).setLineWidth(2);
- drawLines((Polyline) feedbackFigure);
- }
-
- return feedbackFigure;
- }
-
- /* Return a PointList which will be used to add a feedback figure. The feedback figure will be a
- * Polyline composed of the Points in the PointList
- */
- private PointList drawLines(Polyline polyLine) {
- PointList pointList = new PointList();
-
- if (leftSiblingEditPart != null) {
- Rectangle leftRectangle = leftSiblingEditPart.getFigure().getBounds();
- int xCoord = leftRectangle.x + 15;
- int yCoord = leftRectangle.y;
- int height = leftRectangle.height;
- int width = leftRectangle.width - 15;
-
- // Draw left end line
- addLineToPolyline(polyLine, xCoord, yCoord + height + 3, xCoord, yCoord + height - 3);
- addLineToPolyline(polyLine, xCoord, yCoord + height - 3, xCoord, yCoord + height);
-
- // Draw horizontal line
- addLineToPolyline(polyLine, xCoord, yCoord + height, xCoord + width, yCoord + height);
-
- // Draw right end line
- addLineToPolyline(polyLine, xCoord + width, yCoord + height, xCoord + width, yCoord + height - 3);
- addLineToPolyline(polyLine, xCoord + width, yCoord + height, xCoord + width, yCoord + height + 3);
- }
- else if (rightSiblingEditPart != null) {
- Rectangle rightRectangle = rightSiblingEditPart.getFigure().getBounds();
- int xCoord = rightRectangle.x + 15;
- int yCoord = rightRectangle.y;
- int height = rightRectangle.height;
- int width = rightRectangle.width - 15;
-
- // Draw left end line
- addLineToPolyline(polyLine, xCoord, yCoord + 3, xCoord, yCoord - 3);
- addLineToPolyline(polyLine, xCoord, yCoord - 3, xCoord, yCoord);
-
- // Draw horizontal line
- addLineToPolyline(polyLine, xCoord, yCoord, xCoord + width, yCoord);
-
- // Draw right end line
- addLineToPolyline(polyLine, xCoord + width, yCoord, xCoord + width, yCoord - 3);
- addLineToPolyline(polyLine, xCoord + width, yCoord, xCoord + width, yCoord + 3);
- }
-
- return pointList;
- }
-
- protected Polyline addLineToPolyline(Polyline polyline, int x1, int y1, int x2, int y2) {
- polyline.addPoint(new Point(x1, y1));
- polyline.addPoint(new Point(x2, y2));
-
- return polyline;
- }
-
- /*
- * Pre-condition: The List siblings should be sorted by it's y-coordinate
- */
- private WSDLTreeNodeEditPart getVerticalRightSibling(List siblings, WSDLTreeNodeEditPart movingEditPart, Point pointerLocation) {
- WSDLTreeNodeEditPart rightSibling = null;
- int pointerYLocation = pointerLocation.y;
-
- for (int index = 0; index < siblings.size(); index++) {
- WSDLTreeNodeEditPart sibling = (WSDLTreeNodeEditPart) siblings.get(index);
- int siblingYLocation = sibling.getSelectionFigure().getBounds().getCenter().y;
-
- if (siblingYLocation > pointerYLocation) {
- rightSibling = sibling;
- break;
- }
- }
-
- return rightSibling;
- }
-
- /*
- * Pre-condition: The List siblings should be sorted by it's y-coordinate
- */
- private WSDLTreeNodeEditPart getVerticalLeftSibling(List siblings, WSDLTreeNodeEditPart movingEditPart, Point pointerLocation) {
- WSDLTreeNodeEditPart leftSibling = null;
- int pointerYLocation = pointerLocation.y;
-
- int index;
- for (index = 0; index < siblings.size(); index++) {
- WSDLTreeNodeEditPart sibling = (WSDLTreeNodeEditPart) siblings.get(index);
- int siblingYLocation = sibling.getSelectionFigure().getBounds().getCenter().y;
-
- if (siblingYLocation > pointerYLocation) {
- if (index > 0) {
- leftSibling = (WSDLTreeNodeEditPart) siblings.get(index - 1);
- }
-
- break;
- }
- }
-
- if (index == siblings.size()) {
- leftSibling = (WSDLTreeNodeEditPart) siblings.get(index - 1);
- }
-
- return leftSibling;
- }
-
- protected EditPart getParentEditPart(EditPart target)
- {
- return target.getParent();
- }
-
- // boolean inputFirst = true if the Input is the first in the order of Input and Output
- private void setInputOutputOrder(OperationImpl operation, boolean inputFirst) {
- // We need to determine more info before we can set the style
- if (inputFirst && operation.getEInput() != null) {
- // Check if there is an Output
- if (operation.getEOutput() != null) {
- // Order is: Input, Output
-/*
- Node operationNode = operation.getElement();
- NodeList childNodeList = operationNode.getChildNodes();
-
- Node inputNode = operation.getEInput().getElement();
- Node outputNode = operation.getEOutput().getElement();
-
- Node inputTextNode = inputNode.getNextSibling();
- Node outputTextNode = outputNode.getNextSibling();
-
- int inputNodeIndex = getNodeIndex(childNodeList, inputNode);
- int outputNodeIndex = getNodeIndex(childNodeList, outputNode);
-
- if (inputNodeIndex > outputNodeIndex) {
- // We need to swap Input and Output
- operationNode.removeChild(inputNode);
- operationNode.removeChild(outputNode);
-
- operationNode.insertBefore(inputNode, outputTextNode);
- operationNode.insertBefore(outputNode, inputTextNode);
- }
-*/
-
- setOperationStyle(operation, OperationType.REQUEST_RESPONSE);
- }
- /*
- else {
- // Order is: Input
- setOperationStyle(operation, OperationType.ONE_WAY);
- }
- */
- }
- else if (operation.getEOutput() != null) {
- // Check if there is an Input
- if (operation.getEInput() != null) {
- // Order is: Output, Input
-/*
- Node operationNode = operation.getElement();
- NodeList childNodeList = operationNode.getChildNodes();
-
- Node inputNode = operation.getEInput().getElement();
- Node outputNode = operation.getEOutput().getElement();
-
- Node inputTextNode = inputNode.getNextSibling();
- Node outputTextNode = outputNode.getNextSibling();
-
- int inputNodeIndex = getNodeIndex(childNodeList, inputNode);
- int outputNodeIndex = getNodeIndex(childNodeList, outputNode);
-
- if (outputNodeIndex > inputNodeIndex) {
- // We need to swap Input and Output
- operationNode.removeChild(inputNode);
- operationNode.removeChild(outputNode);
-
- operationNode.insertBefore(inputNode, outputTextNode);
- operationNode.insertBefore(outputNode, inputTextNode);
- }
-*/
- setOperationStyle(operation, OperationType.SOLICIT_RESPONSE);
- }
- /*
- else {
- // Order is: Output
- setOperationStyle(operation, OperationType.NOTIFICATION);
- }
- */
- }
- }
-
-/*
- * return -1 if node is not found in the given nodeList
- */
- private int getNodeIndex(NodeList nodeList, Node node) {
- int index = 0;
- while (index < nodeList.getLength() && !(nodeList.item(index).equals(node))) {
- index++;
- }
-
- if (index >= nodeList.getLength()) {
- index = -1;
- }
-
- return index;
- }
-
- private void setOperationStyle(OperationImpl operation, OperationType operationType) {
- // If there is no style to begin with, don't set one now
- if (operation.getStyle() == null) {
- return;
- }
-
- operation.setStyle(operationType);
- }
-
- private class VerticalEditPartComparator implements Comparator {
-
- public VerticalEditPartComparator() {
- }
-
- public int compare(Object part1, Object part2) {
- int compareValue = 0;
-
- if (part1 instanceof WSDLTreeNodeEditPart && part2 instanceof WSDLTreeNodeEditPart) {
- WSDLTreeNodeEditPart editPart1 = (WSDLTreeNodeEditPart) part1;
- WSDLTreeNodeEditPart editPart2 = (WSDLTreeNodeEditPart) part2;
-
- int editPart1Y = editPart1.getSelectionFigure().getBounds().getCenter().y;
- int editPart2Y = editPart2.getSelectionFigure().getBounds().getCenter().y;
-
- Integer integerPart1 = new Integer(editPart1Y);
- Integer integerPart2 = new Integer(editPart2Y);
-
- compareValue = integerPart1.compareTo(integerPart2);
- }
-
- return compareValue;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLDragSetMessageAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLDragSetMessageAction.java
deleted file mode 100644
index 2af9e84..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLDragSetMessageAction.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Polyline;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.IConnectedFigure;
-import org.eclipse.wst.wsdl.ui.internal.graph.WSDLComponentViewer;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.GroupEditPart;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.WSDLTreeNodeEditPart;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-
-public class WSDLDragSetMessageAction extends WSDLDragAction {
- protected EditPart pointerEditPart;
- protected WSDLElement movingChild;
- protected WSDLElement pointerModelElement;
-
- public WSDLDragSetMessageAction(WSDLTreeNodeEditPart movingChildEditPart, EditPart pointerEditPart, Point pointerLocation) {
- this.movingChildEditPart = movingChildEditPart;
- this.pointerEditPart = pointerEditPart;
- this.pointerLocation = pointerLocation;
-
- movingChild = (WSDLElement) movingChildEditPart.getModel();
- pointerModelElement = (WSDLElement) pointerEditPart.getModel();
-
- // Allow the user to hover over a Part (of a Message) to set the Message
- if (pointerModelElement instanceof Part) {
- this.pointerEditPart = pointerEditPart.getParent();
- pointerModelElement = (WSDLElement) this.pointerEditPart.getModel();
- }
- }
-
- public boolean canExecute() {
- boolean result = false;
-
- if (pointerModelElement == null || movingChild == null) {
- return false;
- }
-
- if (movingChild instanceof Input || movingChild instanceof Output || movingChild instanceof Fault) {
- if (pointerModelElement instanceof Message) {
- result = true;
- }
- }
-
- return result;
- }
-
- public void run() {
- if (canExecute()) {
- MessageReference messageReference = (MessageReference) movingChild;
- messageReference.setEMessage((Message) pointerModelElement);
- ((WSDLElementImpl) messageReference).updateElement(true);
-
- WSDLEditor wsdlEditor = ((WSDLComponentViewer) pointerEditPart.getViewer()).getWSDLEditor();
- wsdlEditor.getSelectionManager().setSelection(new StructuredSelection(movingChild));
- }
- }
-
- public IFigure getFeedbackFigure() {
- Polyline polyfigure = new Polyline();
- GroupEditPart leftGroupEditPart = getGroupEditPart(movingChildEditPart);
- GroupEditPart rightGroupEditPart = getGroupEditPart(pointerEditPart);
- int mx = rightGroupEditPart.getFigure().getBounds().x - 5;
-
- drawLine(polyfigure, leftGroupEditPart.outputConnection.getFigure(), ((AbstractGraphicalEditPart) pointerEditPart).getFigure(), mx);
-
- return polyfigure;
- }
-
- protected void drawLine(Polyline feedbackFigure, IFigure a, IFigure b, int mx)
- {
- Rectangle r1 = getConnectionBounds(a);
- Rectangle r2 = getConnectionBounds(b);
- int x1 = r1.x + r1.width;
- int y1 = r1.y + r1.height / 2;
- int x2 = r2.x - 1;
- int y2 = r2.y + 8;
-
- // draw horizontal line
- addLineToPolyline(feedbackFigure, x1, y1, mx, y1);
-
- // draw horizontal line
- addLineToPolyline(feedbackFigure, mx, y2, x2 - 1, y2);
-
- // draw the arrow head
- addLineToPolyline(feedbackFigure, x2 - 1, y2, x2 - 4, y2 - 3);
- addLineToPolyline(feedbackFigure, x2 - 1, y2, x2 - 4, y2 + 3);
- }
-
- protected Rectangle getConnectionBounds(IFigure figure)
- {
- Rectangle r = null;
- if (figure instanceof IConnectedFigure)
- {
- IConnectedFigure connectedFigure = (IConnectedFigure)figure;
- r = connectedFigure.getConnectionFigure().getBounds();
- }
- else
- {
- r = figure.getBounds();
- }
- return r;
- }
-
- protected Polyline addLineToPolyline(Polyline polyline, int x1, int y1, int x2, int y2) {
- polyline.addPoint(new Point(x1, y1));
- polyline.addPoint(new Point(x2, y2));
- polyline.setLineWidth(1);
- //polyline.setLineStyle(Graphics.LINE_DOT);
-
- return polyline;
- }
-
- private GroupEditPart getGroupEditPart(EditPart editPart) {
- EditPart parentPart = editPart.getParent();
-
- if (parentPart == null) {
- return null;
- }
- if (!(parentPart instanceof GroupEditPart)) {
- parentPart = getGroupEditPart(parentPart);
- }
-
- return (GroupEditPart) parentPart;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLElementAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLElementAction.java
deleted file mode 100644
index 7a62afe..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLElementAction.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-import org.eclipse.ui.IEditorPart;
-
-
-import org.w3c.dom.Node;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.commands.WSDLElementCommand;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.widgets.NewComponentDialog;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.format.FormatProcessorXML;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-
-public abstract class WSDLElementAction extends Action
-{
- protected WSDLElementCommand modelCommand;
- private String undoDescription;
- private IEditorPart editorPart;
-
- public WSDLElementAction
- (WSDLElementCommand command,
- String undoDescription,
- String label,
- ImageDescriptor image)
- {
- super(label,image);
- modelCommand = command;
- this.undoDescription = undoDescription;
- }
-
- public void setEditorPart(IEditorPart editorPart)
- {
- this.editorPart = editorPart;
- }
-
- private String getUndoDescription()
- {
- return undoDescription;
- }
-
- abstract protected WSDLElement getOwner();
-
- abstract protected boolean showDialog();
-
- public void run()
- {
- boolean ok = showDialog();
- if (ok)
- {
- preRun();
- modelCommand.run();
- format();
- selectObject();
- postRun();
- }
- }
-
- protected void preRun()
- {
- }
-
- protected void postRun()
- {
- }
-
- private void beginRecording()
- {
- Node node = null;
- if (getOwner() != null)
- node = getOwner().getElement();
-
- if (node instanceof XMLNode)
- {
- ((XMLNode)node).getModel().beginRecording(this, getUndoDescription());
- }
- }
-
- private void endRecording()
- {
- Node node = null;
- if (getOwner() != null)
- node = getOwner().getElement();
-
- if (node instanceof XMLNode)
- {
- ((XMLNode)node).getModel().endRecording(this);
- }
- }
-
- protected WSDLElement getWSDLElement()
- {
- return modelCommand.getWSDLElement();
- }
-
- private void format()
- {
- Node parentNode = null;
- if (getOwner() != null)
- parentNode = getOwner().getElement();
-
- if (parentNode instanceof XMLNode)
- {
- // format selected node
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((XMLNode)parentNode);
- }
- }
-
- private void selectObject()
- {
- if (editorPart != null && getOwner() != null)
- {
- Object object = getWSDLElement();
- if (object != null)
- {
- ISelectionProvider selectionProvider = (ISelectionProvider)editorPart.getAdapter(ISelectionProvider.class);
- if (selectionProvider != null)
- {
- selectionProvider.setSelection(new StructuredSelection(object));
- }
- }
- }
- }
-
- protected String showDialogHelper(String title, String defaultName)
- {
- String result = defaultName;
- NewComponentDialog dialog = new NewComponentDialog(WSDLEditorPlugin.getShell(), title, defaultName);
- int rc = dialog.createAndOpen();
- if (rc == IDialogConstants.OK_ID)
- {
- result = dialog.getName();
- }
- else
- {
- result = null;
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLElementUIAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLElementUIAction.java
deleted file mode 100644
index 8169e5e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLElementUIAction.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-import org.eclipse.ui.IEditorPart;
-
-
-import org.w3c.dom.Node;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.commands.WSDLElementCommand;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.format.FormatProcessorXML;
-
-public abstract class WSDLElementUIAction extends Action
-{
- protected WSDLElementCommand modelAction;
- private String undoDescription;
- private IEditorPart editorPart;
-
- public WSDLElementUIAction
- (WSDLElementCommand action,
- String undoDescription,
- String label,
- ImageDescriptor image)
- {
- super(label,image);
- modelAction = action;
- this.undoDescription = undoDescription;
- }
-
- public void setEditorPart(IEditorPart editorPart)
- {
- this.editorPart = editorPart;
- }
-
- private String getUndoDescription()
- {
- return undoDescription;
- }
-
- private Node getOwnerNode()
- {
- if (getOwner() != null)
- return getOwner().getElement();
- else
- return null;
- }
-
- abstract protected WSDLElement getOwner();
-
- abstract protected boolean showDialog();
-
- public void run()
- {
- boolean ok = showDialog();
- if (ok)
- {
- preRun();
- modelAction.run();
- format();
- selectObject();
- postRun();
- }
- }
-
- protected void preRun()
- {
- }
-
- protected void postRun()
- {
- }
-
- private void beginRecording()
- {
- Node node = getOwnerNode();
- if (node instanceof XMLNode)
- {
- ((XMLNode)node).getModel().beginRecording(this, getUndoDescription());
- }
- }
-
- private void endRecording()
- {
- Node node = getOwnerNode();
- if (node instanceof XMLNode)
- {
- ((XMLNode)node).getModel().endRecording(this);
- }
- }
-
- protected WSDLElement getWSDLElement()
- {
- return modelAction.getWSDLElement();
- }
-
- private void format()
- {
- Node parentNode = getOwnerNode();
- if (parentNode instanceof XMLNode)
- {
- // format selected node
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((XMLNode)parentNode);
- }
- }
-
- private void selectObject()
- {
- if (editorPart != null && getOwner() != null)
- {
- Object object = getWSDLElement();
- if (object != null)
- {
- ISelectionProvider selectionProvider = (ISelectionProvider)editorPart.getAdapter(ISelectionProvider.class);
- if (selectionProvider != null)
- {
- selectionProvider.setSelection(new StructuredSelection(object));
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLMenuActionContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLMenuActionContributor.java
deleted file mode 100644
index 01df382..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLMenuActionContributor.java
+++ /dev/null
@@ -1,1199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddInputCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddMessageCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOperationCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOutputCommand;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.IMenuActionContributor;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.WSDLTreeNodeEditPart;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.CreateWSDLElementHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.ui.internal.widgets.NewComponentDialog;
-import org.eclipse.wst.wsdl.ui.internal.widgets.NewComponentWithChildDialog;
-import org.eclipse.wst.wsdl.ui.internal.wizards.BindingWizard;
-import org.eclipse.wst.wsdl.ui.internal.wizards.PortWizard;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-import org.eclipse.wst.xml.core.document.XMLNode;
-
-
-public class WSDLMenuActionContributor implements IMenuActionContributor
-{
- protected AddEEMenuActionContributor addEEMenuActionContributor;
- IEditorPart editorPart;
-
- public WSDLMenuActionContributor(IEditorPart editorPart)
- {
- addEEMenuActionContributor = new AddEEMenuActionContributor();
- this.editorPart = editorPart;
- }
-
- protected static List createList(Action action)
- {
- List list = new ArrayList();
- list.add(action);
- return list;
- }
-
- private class OpenSchemaOnSelectionHelper extends Action {
- Object object;
-
- public OpenSchemaOnSelectionHelper(Object object) {
- setText(WSDLEditorPlugin.getWSDLString("_UI_OPEN_IMPORT"));
- this.object = object;
-
- if (object instanceof Import) {
- String location = ((Import) object).getLocationURI();
-
- if (location == null || location.trim().equals(""))
- setEnabled(false);
- }
- }
-
- public void run() {
- Definition definition = ((WSDLElement) object).getEnclosingDefinition();
- org.eclipse.wst.wsdl.ui.internal.util.OpenOnSelectionHelper helper = new org.eclipse.wst.wsdl.ui.internal.util.OpenOnSelectionHelper(definition);
- helper.openEditor((org.eclipse.emf.ecore.EObject) object);
- }
- }
-
- public void contributeMenuActions(final IMenuManager menu, final Node node, Object object)
- {
- final IMenuManager addMenu;
- boolean addEditAction = false;
- final boolean isEditable = (node instanceof XMLNode);
- if (object instanceof WSDLElement && node != null && isEditable)
- {
- addEditAction = true;
- addMenu = new MenuManager(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_CHILD"), "addchild"); //$NON-NLS-1$ //$NON-NLS-2$
- menu.add(addMenu);
- Definition definition = ((WSDLElement) object).getEnclosingDefinition();
-
- final String prefix = definition.getPrefix(WSDLConstants.WSDL_NAMESPACE_URI);
-
- if (object instanceof Import) {
- menu.add(new OpenSchemaOnSelectionHelper(object));
- }
-
- WSDLSwitch wsdlSwitch = new WSDLSwitch()
- {
- public Object caseBinding(Binding binding)
- {
- if (isEditable)
- {
- menu.add(new AddBindingOperationAction(node, "NewBindingOperation", prefix)); //$NON-NLS-1$
- menu.add(new Separator());
- }
- menu.add(createSetPortTypeMenu(binding, isEditable));
- menu.add(new GenerateBindingContentAction(binding, isEditable));
- return null;
- }
-
- public Object caseBindingOperation(BindingOperation bindingOperation)
- {
- if (isEditable)
- {
- menu.add(new AddBindingInputAction(editorPart, node, prefix));
- menu.add(new AddBindingOutputAction(editorPart, node, prefix));
- menu.add(new AddBindingFaultAction(node, prefix));
- }
- return null;
- }
-
- public Object caseDefinition(Definition definition)
- {
- menu.add(new EditNamespacesAction(definition));
- menu.add(new Separator());
-
- if (isEditable)
- {
- menu.add(new AddMessageAction(definition, null, node, prefix, ((WSDLEditor) editorPart).getXMLDocument()));
- menu.add(new AddServiceAction(definition, null, node, prefix, ((WSDLEditor) editorPart).getXMLDocument()));
- menu.add(new AddPortTypeAction(definition, null, node, prefix, ((WSDLEditor) editorPart).getXMLDocument()));
- menu.add(new AddBindingAction(definition, ((WSDLEditor) editorPart).getXMLDocument()));//, null, node, prefix));
- menu.add(new AddImportAction(editorPart, definition, node, prefix));
- }
- return null;
- }
-
- public Object caseFault(Fault fault)
- {
- menu.add(createSetMessageMenu(fault, isEditable));
- //menu.add(createAddBindingMenuForIOF(fault));
- return null;
- }
-
- public Object caseInput(Input input)
- {
- menu.add(createSetMessageMenu(input, isEditable));
- //menu.add(createAddBindingMenuForIOF(input));
- return null;
- }
-
- public Object caseOutput(Output output)
- {
- menu.add(createSetMessageMenu(output, isEditable));
- //menu.add(createAddBindingMenuForIOF(output));
- return null;
- }
-
- public Object caseMessage(Message message)
- {
- if (isEditable)
- {
- menu.add(new AddPartAction(editorPart, message, node, prefix));
- }
- return null;
- }
-
- public Object caseOperation(Operation operation)
- {
- if (isEditable)
- {
- menu.add(new AddInputAction(editorPart, node, operation, prefix));
- menu.add(new AddOutputAction(editorPart, node, operation, prefix));
- menu.add(new AddFaultAction(editorPart, node, operation, prefix));
- }
- //menu.add(createAddBindingMenuForOperation(operation));
- return null;
- }
-
- public Object casePart(Part part)
- {
- menu.add(createSetPartMenu(part, (Element) node, "element", isEditable)); //$NON-NLS-1$
- menu.add(createSetPartMenu(part, (Element) node, "type", isEditable)); //$NON-NLS-1$
- return null;
- }
-
- public Object casePort(Port port)
- {
- if (node instanceof Element)
- {
- menu.add(createSetBindingMenu(port, (Element) node, isEditable));
- if (port.getEBinding() != null)
- {
- menu.add(createSetPortTypeMenu(port.getEBinding(), isEditable));
- }
- }
- return null;
- }
-
- public Object casePortType(PortType portType)
- {
- if (isEditable)
- {
- menu.add(new AddOperationAction(editorPart, portType, node, prefix));
- }
- return null;
- }
-
- public Object caseService(Service service)
- {
- if (isEditable)
- {
- menu.add(new AddPortAction(service));
- }
- return null;
- }
-
- //public Object caseTypes(Types types)
- //{
- // return createTypesAdapter();
- // }
- };
- wsdlSwitch.doSwitch((WSDLElement) object);
- }
- else if (object instanceof WSDLGroupObject)
- {
- addMenu = new MenuManager(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_CHILD"), "addchild"); //$NON-NLS-1$ //$NON-NLS-2$
- menu.add(addMenu);
-
- WSDLGroupObject groupObject = (WSDLGroupObject) object;
- Definition definition = groupObject.getDefinition();
-
- final String prefix = definition.getPrefix(WSDLConstants.WSDL_NAMESPACE_URI);
-
- //for (Iterator i = actionList.iterator(); i.hasNext(); )
- //{
- // Action action = (Action)i.next();
- // manager.add(action);
- //}
-
- switch (groupObject.getType())
- {
- case WSDLGroupObject.MESSAGES_GROUP :
- {
- menu.add(new AddMessageAction(groupObject.getDefinition(), null, node, prefix, ((WSDLEditor) editorPart).getXMLDocument()));
- break;
- }
- case WSDLGroupObject.SERVICES_GROUP :
- {
- menu.add(new AddServiceAction(groupObject.getDefinition(), null, node, prefix, ((WSDLEditor) editorPart).getXMLDocument()));
- break;
- }
- case WSDLGroupObject.PORT_TYPES_GROUP :
- {
- menu.add(new AddPortTypeAction(groupObject.getDefinition(), null, node, prefix, ((WSDLEditor) editorPart).getXMLDocument()));
- break;
- }
- case WSDLGroupObject.BINDINGS_GROUP :
- {
- menu.add(new AddBindingAction(groupObject.getDefinition(), ((WSDLEditor) editorPart).getXMLDocument()));//, null, node, prefix));
- break;
- }
- case WSDLGroupObject.IMPORTS_GROUP :
- {
- menu.add(new AddImportAction(editorPart, groupObject.getDefinition(), node, prefix));
- break;
- }
- }
- }
-
- menu.add(new Separator());
-
- addEEMenuActionContributor.contributeMenuActions(menu, node, object);
-
- menu.add(new Separator());
-
- if (object instanceof WSDLElement && node != null && addEditAction && node != null && isEditable)
- {
- //////////////////////////////////////// Currently, only allow Copy and Paste on Operations
- if (object instanceof Operation) {
- // Add Cut, Copy Actions
- // Note: The Cut, Copy, Paste Actions are Model Driven. The Delete Action is still
- // currently DOM driven.
- // menu.add(new CutAction((WSDLElement) object, editorPart));
- menu.add(new CopyGlobalAction((WSDLElement) object, editorPart));
- }
-
- Action pasteAction = new PasteGlobalAction((WSDLElement) object, editorPart);
- if (pasteAction.isEnabled()) {
- menu.add(pasteAction);
- }
-
- menu.add(new Separator());
- //////////////////////////////////////// Currently, only allow Copy and Paste on Operations
-
- // Get the list of selected elements. Use this list for the DeleteAction.
- IStructuredSelection selectionList = (IStructuredSelection) ((WSDLEditor) editorPart).getSelectionManager().getSelection();
- Action deleteAtion = new DeleteWSDLAndXSDAction(selectionList.toList(), node, (WSDLEditor) editorPart);
- menu.add(deleteAtion);
- deleteAtion.setEnabled(isEditable);
- }
-
- // Allow Rename through a dialog mechanism..... This should be changed when
- // direct editing is ready
- if (object instanceof WSDLElement && isEditable) {
- RenameDialogAction renameDialog = new RenameDialogAction((WSDLElement) object);
- if (renameDialog.showRenameDialog())
- menu.add(renameDialog);
- }
- }
-
- /*
- protected MenuManager createAddBindingMenuForOperation(Operation operation)
- {
- MenuManager subMenu = new MenuManager("Add Binding");
-
- Definition definition = operation.getEnclosingDefinition();
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
-
- String operationName = operation.getName();
- if (operationName != null)
- {
- for (Iterator i = util.getBindings(operation).iterator(); i.hasNext(); )
- {
- Binding binding = (Binding)i.next();
-
- BindingOperation matchingBindingOperation = null;
-
- for (Iterator j = binding.getBindingOperations().iterator(); j.hasNext(); )
- {
- BindingOperation bindingOperation = (BindingOperation)j.next();
- if (operationName.equals(bindingOperation.getName()))
- {
- matchingBindingOperation = bindingOperation;
- break;
- }
- }
-
- if (matchingBindingOperation == null)
- {
- Element bindingElement = WSDLUtil.getInstance().getElementForObject(binding);
- subMenu.add(new AddBindingOperationAction(bindingElement, operation, prefix));
- }
- }
- }
- return subMenu;
- }*/
-
- /*
- protected MenuManager createAddBindingMenuForIOF(WSDLElement iof)
- {
- MenuManager subMenu = new MenuManager("Add Binding");
-
- Definition definition = iof.getEnclosingDefinition();
- Operation operation = (Operation)iof.eContainer();
-
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
-
- String operationName = operation.getName();
- if (operationName != null)
- {
- for (Iterator i = util.getBindings(operation).iterator(); i.hasNext(); )
- {
- Binding binding = (Binding)i.next();
-
- boolean hasName = false;
- for (Iterator j = binding.getBindingOperations().iterator(); j.hasNext(); )
- {
- BindingOperation bindingOperation = (BindingOperation)j.next();
- if (operationName.equals(bindingOperation.getName()))
- {
- hasName = true;
- break;
- }
- }
-
- if (!hasName)
- {
- // TODO... should we add the operation to all of the bindings?
- //
- Element bindingElement = WSDLUtil.getInstance().getElementForObject(binding);
- subMenu.add(new AddBindingOperationAction(bindingElement, operationName));
- }
- }
- }
- return subMenu;
- }
- */
-
- protected AddNewComponentAction createSetBindingMenu(Port port, Element portElement, boolean isEditable)
- {
- Definition definition = port.getEnclosingDefinition();
- String prefix = definition.getPrefix(WSDLConstants.WSDL_NAMESPACE_URI);
- Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
-
- AddNewComponentAction action = new AddNewComponentAction(WSDLEditorPlugin.getWSDLString("_UI_ACTION_SET_BINDIG"), definitionElement, prefix, "binding", port);
- action.setEditor(editorPart);
- action.setEnabled(isEditable);
- return action;
- }
-
- protected AddNewComponentAction createSetPortTypeMenu(Binding binding, boolean isEditable)
- {
- if (binding != null)
- {
- Definition definition = binding.getEnclosingDefinition();
- Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- String prefix = definition.getPrefix(WSDLConstants.WSDL_NAMESPACE_URI);
-
- AddNewComponentAction action = new AddNewComponentAction(WSDLEditorPlugin.getWSDLString("_UI_ACTION_SET_PORTTYPE"), definitionElement, prefix, "portType", binding);
- action.setEditor(editorPart);
- action.setEnabled(isEditable);
- return action;
- }
- return null;
- }
-
- protected AddNewComponentAction createSetMessageMenu(WSDLElement wsdlElement, boolean isEditable)
- {
- Definition definition = wsdlElement.getEnclosingDefinition();
- Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- Element referencingElement = WSDLEditorUtil.getInstance().getElementForObject(wsdlElement);
-
- if (definitionElement != null && referencingElement != null)
- {
- String prefix = definition.getPrefix(WSDLConstants.WSDL_NAMESPACE_URI);
- AddNewComponentAction action = new AddNewComponentAction(WSDLEditorPlugin.getWSDLString("_UI_ACTION_SET_MESSAGE"), definitionElement, prefix, "message", wsdlElement);
- action.setEditor(editorPart);
- action.setEnabled(isEditable);
- return action;
- }
- return null;
- }
-
- protected AddNewComponentAction createSetPartMenu(Part part, Element portElement, String referenceKind, boolean isEditable)
- {
- Definition definition = part.getEnclosingDefinition();
- String prefix = definition.getPrefix(WSDLConstants.WSDL_NAMESPACE_URI);
- Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
-
- String actionName;
- if (referenceKind.equals("element")) // NON NLS
- {
- actionName = WSDLEditorPlugin.getWSDLString("_UI_ACTION_SET_ELEMENT");
- }
- else
- {
- actionName = WSDLEditorPlugin.getWSDLString("_UI_ACTION_SET_TYPE");
- }
-
- AddNewComponentAction action = new AddNewComponentAction(actionName, definitionElement, prefix, actionName, part);
- action.setReferenceKind(referenceKind);
- action.setEditor(editorPart);
- action.setEnabled(isEditable);
- return action;
- }
-
- private WSDLElement showPasteAction(WSDLElement element, IEditorPart ePart) {
- WSDLElement parentElement = null;
-
- if (ePart instanceof WSDLEditor) {
- WSDLElement clipboardElement = ((WSDLEditor) ePart).getClipboardContents();
-
- if (element instanceof PortType) {
- if (clipboardElement instanceof Operation) {
- parentElement = element;
- }
- }
- if (element instanceof Operation) {
- if (clipboardElement instanceof Operation) {
- parentElement = (WSDLElement) ((Operation) element).eContainer();
- }
- }
- }
-
- return parentElement;
- }
-}
-
-class AddBindingOperationAction extends AddElementAction
-{
- protected String name;
- protected Operation operation;
-
- public AddBindingOperationAction(Node parentNode, String name, String prefix)
- {
- // super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD") + " " + WSDLEditorPlugin.getWSDLString("_UI_LABEL_BINDING_OPERATION"), "icons/operationbinding_obj.gif", parentNode, prefix, "operation");
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_BINDING_OPERATION"), "icons/operationbinding_obj.gif", parentNode, prefix, "operation");
- this.name = name;
- }
-
- public AddBindingOperationAction(Node parentNode, Operation operation, String prefix)
- {
- this(parentNode, operation.getName(), prefix);
- this.operation = operation;
- }
-
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("name", name);
- }
-
- protected void performAddElement()
- {
- super.performAddElement();
-
- if (operation != null)
- {
- if (operation.getInput() != null)
- {
- new AddBindingInputAction(editorPart, newElement, prefix).run();
- }
- if (operation.getOutput() != null)
- {
- new AddBindingOutputAction(editorPart, newElement, prefix).run();
- }
- for (Iterator i = operation.getEFaults().iterator(); i.hasNext();)
- {
- Fault fault = (Fault) i.next();
- new AddBindingFaultAction(newElement, fault, prefix).run();
- }
- format(operation.getElement());
- }
- }
-}
-
-
-class AddOperationAction extends AddElementAction
-{
- protected String name = "NewOperation";
- protected PortType portType;
- protected boolean createSubComponents = false;
-
- public AddOperationAction(IEditorPart editorPart, PortType portType, Node parentNode, String prefix)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_OPERATION"), "icons/operation_obj.gif", parentNode, prefix, "operation");
- setEditorPart(editorPart);
- setDefinition(portType.getEnclosingDefinition());
- this.portType = portType;
- }
-
- public boolean showDialog()
- {
- name = NameUtil.buildUniqueOperationName(portType);
- name = showDialogHelper(WSDLEditorPlugin.getWSDLString("_UI_ACTION_NEW_OPERATION"), name, NameUtil.getUsedOperationNames(portType));
- return name != null;
- }
-
-// protected void addAttributes(Element newElement)
-// {
-// newElement.setAttribute("name", name);
-// }
-
- protected void performAddElement()
- {
- if (createSubComponents) {
- CreateWSDLElementHelper.operationName = name;
- CreateWSDLElementHelper.PART_TYPE_OR_DEFINITION = CreateWSDLElementHelper.getPartInfo(portType);
- Operation operation = CreateWSDLElementHelper.createOperation(portType);
- format(operation.getElement());
- selectObject(operation);
- expandEditParts(operation,true);
- }
- else {
- Definition def = portType.getEnclosingDefinition();
-
- // Add Operation
- AddOperationCommand opAction = new AddOperationCommand(portType, name);
- opAction.run();
- Operation operation = (Operation) opAction.getWSDLElement();
-
- // Add Output
- AddOutputCommand outAction = new AddOutputCommand(operation, NameUtil.buildUniqueInputName(portType, operation.getName(), ""));
- outAction.run();
-
- // Add Input
- AddInputCommand inAction = new AddInputCommand(operation, NameUtil.buildUniqueOutputName(portType, operation.getName(), ""));
- inAction.run();
-
- format(operation.getElement());
-
- selectObject(operation);
- expandEditParts(operation, true);
- }
- }
-
- private void expandEditParts(Object element, boolean expandChildren) {
- if (element != null) {
- EditPartViewer editPartViewer = ((WSDLEditor) editorPart).getGraphViewer().getComponentViewer();
- Map editPartMap = editPartViewer.getEditPartRegistry();
- WSDLTreeNodeEditPart wsdlEditPart = (WSDLTreeNodeEditPart) editPartMap.get(element);
- wsdlEditPart.setExpanded(true);
-
- if (expandChildren) {
- Iterator iterator = WSDLEditorUtil.getModelGraphViewChildren(element).iterator();
-
- while (iterator.hasNext()) {
- expandEditParts(iterator.next(), expandChildren);
- }
- }
- }
- }
-
- public String showDialogHelper(String title, String defaultName, List usedNames)
- {
- String result = defaultName;
- NewComponentWithChildDialog dialog = new NewComponentWithChildDialog(WSDLEditorPlugin.getShell(), title, defaultName, usedNames);
- int rc = dialog.createAndOpen();
- if (rc == IDialogConstants.OK_ID)
- {
- result = dialog.getName();
- createSubComponents = dialog.createSubComponents();
- }
- else
- {
- result = null;
- }
- return result;
- }
-}
-
-abstract class AddIOFAction extends AddElementAction
-{
- protected Operation operation;
-
- public AddIOFAction(IEditorPart editorPart, String text, String imageDescriptorKey, Node parentNode, String prefix, String localName, Operation operation)
- {
- super(text, imageDescriptorKey, parentNode, prefix, localName);
- this.operation = operation;
- setEditorPart(editorPart);
- setDefinition(operation.getEnclosingDefinition());
- }
-
- abstract protected void performAddElementToBindingOperation(BindingOperation bindingOperation, Element bindingOperationElement);
-
- /*
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("message", "");
- }
- */
-
- protected void performAddElement()
- {
- if (operation != null)
- {
- Definition definition = operation.getEnclosingDefinition();
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
-
- for (Iterator i = util.getBindingOperations(operation).iterator(); i.hasNext();)
- {
- BindingOperation bindingOperation = (BindingOperation) i.next();
- Element bindingOperationElement = WSDLEditorUtil.getInstance().getElementForObject(bindingOperation);
- if (bindingOperationElement != null)
- {
- performAddElementToBindingOperation(bindingOperation, bindingOperationElement);
- }
- }
- format(operation.getElement());
- }
- }
-}
-
-class AddInputAction extends AddIOFAction
-{
- public AddInputAction(IEditorPart editorPart, Node parentNode, Operation operation, String prefix)
- {
- super(editorPart, WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_INPUT"), "icons/input_obj.gif", parentNode, prefix, "input", operation);
- }
-
- protected void performAddElementToBindingOperation(BindingOperation bindingOperation, Element bindingOperationElement)
- {
- if (bindingOperation.getBindingInput() == null)
- {
- new AddBindingInputAction(editorPart, bindingOperationElement, prefix).run();
- }
- }
-
- protected void performAddElement() {
- PortType portType = (PortType) ((WSDLElementImpl) operation).getContainer();
- CreateWSDLElementHelper.PART_TYPE_OR_DEFINITION = CreateWSDLElementHelper.getPartInfo(portType);
- Input input = CreateWSDLElementHelper.createInput(portType, operation, null);
- format(input.getElement());
- selectObject(input);
- }
-}
-
-class AddOutputAction extends AddIOFAction
-{
- public AddOutputAction(IEditorPart editorPart, Node parentNode, Operation operation, String prefix)
- {
- super(editorPart, WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_OUTPUT"), "icons/output_obj.gif", parentNode, prefix, "output", operation);
- }
-
- protected void performAddElementToBindingOperation(BindingOperation bindingOperation, Element bindingOperationElement)
- {
- if (bindingOperation.getBindingOutput() == null)
- {
- new AddBindingOutputAction(editorPart, bindingOperationElement, prefix).run();
- }
- }
-
- protected void performAddElement() {
- // Determine Part info
- PortType portType = (PortType) ((WSDLElementImpl) operation).getContainer();
- CreateWSDLElementHelper.PART_TYPE_OR_DEFINITION = CreateWSDLElementHelper.getPartInfo(portType);
- Output output = CreateWSDLElementHelper.createOutput(portType, operation);
- format(output.getElement());
- selectObject(output);
- }
-}
-
-class AddFaultAction extends AddIOFAction
-{
- protected String name = "NewFault";
- public AddFaultAction(IEditorPart editorPart, Node parentNode, Operation operation, String prefix)
- {
- super(editorPart, WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_FAULT"), "icons/fault_obj.gif", parentNode, prefix, "fault", operation);
- name = NameUtil.buildUniqueFaultName(operation);
- }
-
- public boolean showDialog()
- {
- name = NameUtil.buildUniqueFaultName(operation);
- name = showDialogHelper(WSDLEditorPlugin.getWSDLString("_UI_ACTION_NEW_FAULT"), name, NameUtil.getUsedFaultNames(operation));
- return name != null;
- }
-
- /*
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("message", "");
- newElement.setAttribute("name", name);
- }
- */
-
- protected void performAddElementToBindingOperation(BindingOperation bindingOperation, Element bindingOperationElement)
- {
- if (bindingOperation.getBindingFault(name) == null)
- {
- new AddBindingFaultAction(bindingOperationElement, prefix).run();
- }
- }
-
- protected void performAddElement() {
- CreateWSDLElementHelper.faultName = name;
- CreateWSDLElementHelper.PART_TYPE_OR_DEFINITION = CreateWSDLElementHelper.getPartInfo(operation);
- Fault fault = CreateWSDLElementHelper.createFault(operation);
- format(fault.getElement());
- selectObject(fault);
- }
-}
-
-class AddBindingInputAction extends AddElementAction
-{
- public AddBindingInputAction(IEditorPart editorPart, Node parentNode, String prefix)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_INPUT"), "icons/input_obj.gif", parentNode, prefix, "input");
- setEditorPart(editorPart);
- }
-}
-
-class AddBindingOutputAction extends AddElementAction
-{
- public AddBindingOutputAction(IEditorPart editorPart, Node parentNode, String prefix)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_OUTPUT"), "icons/output_obj.gif", parentNode, prefix, "output");
- setEditorPart(editorPart);
- }
-}
-
-class AddBindingFaultAction extends AddElementAction
-{
- protected Fault fault;
-
- public AddBindingFaultAction(Node parentNode, String prefix)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_FAULT"), "icons/fault_obj.gif", parentNode, prefix, "fault");
- }
-
- public AddBindingFaultAction(Node parentNode, Fault fault, String prefix)
- {
- this(parentNode, prefix);
- this.fault = fault;
- }
-
- protected void addAttributes(Element newElement)
- {
- if (fault == null)
- {
- newElement.setAttribute("name", "NewFault");
- }
- else
- {
- newElement.setAttribute("name", fault.getName());
- }
- }
-}
-
-class AddMessageAction extends AddElementAction
-{
- protected Definition definition;
- protected String name;
-
- public AddMessageAction(Definition definition, String name, Node parentNode, String prefix)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_MESSAGE"), "icons/message_obj.gif", parentNode, prefix, "message");
- this.definition = definition;
- this.name = name;
- setComputeTopLevelRefChild(true);
- }
-
- public AddMessageAction(Definition definition, String name, Node parentNode, String prefix, Document document)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_MESSAGE"), "icons/message_obj.gif", parentNode, prefix, "message");
- this.definition = definition;
- this.name = name;
- this.setDefinition(definition);
- this.document = document;
- setComputeTopLevelRefChild(true);
- }
-
- public boolean showDialog()
- {
- name = NameUtil.buildUniqueMessageName(definition, name);
- name = showDialogHelper(WSDLEditorPlugin.getWSDLString("_UI_ACTION_NEW_MESSAGE"), name, NameUtil.getUsedMessageNames(definition));
- return name != null;
- }
-
-// protected void addAttributes(Element newElement)
-// {
-// newElement.setAttribute("name", name);
-// }
-
- protected void performAddElement() {
- NodeList list = document.getChildNodes();
- if (parentNode == null|| list.getLength() == 0) {
- createDefinitionStub();
- }
-
- AddMessageCommand action = new AddMessageCommand(definition, name);
- action.run();
- Message message = (Message) action.getWSDLElement();
- CreateWSDLElementHelper.createPart(message);
- format(message.getElement());
- selectObject(message);
- }
-
- public String getName()
- {
- return name;
- }
-}
-
-class AddPartAction extends AddElementAction
-{
- protected Message message;
- protected String name;
-
- public AddPartAction(IEditorPart editorPart, Message message, Node parentNode, String prefix)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_PART"), "icons/part_obj.gif", parentNode, prefix, "part");
- this.message = message;
- setEditorPart(editorPart);
- setDefinition(message.getEnclosingDefinition());
- }
-
- public boolean showDialog()
- {
- name = NameUtil.buildUniquePartName(message, message.getQName().getLocalPart());
- name = showDialogHelper(WSDLEditorPlugin.getWSDLString("_UI_ACTION_NEW_PART"), name, NameUtil.getUsedPartNames(message));
- return name != null;
- }
-
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("name", name);
- String xsdPrefix = message.getEnclosingDefinition().getPrefix(WSDLConstants.XSD_NAMESPACE_URI);
- if (xsdPrefix == null)
- {
- Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(message.getEnclosingDefinition());
- new AddNamespaceDeclarationsAction(definitionElement, WSDLConstants.XSD_NAMESPACE_URI, "xsd").run();
- xsdPrefix = message.getEnclosingDefinition().getPrefix(WSDLConstants.XSD_NAMESPACE_URI);
- }
-
- String defaultTypeName = "string";
- if (xsdPrefix != null && xsdPrefix.length() > 0)
- {
- defaultTypeName = xsdPrefix + ":" + defaultTypeName;
- }
- newElement.setAttribute("type", defaultTypeName);
- }
-}
-
-class AddServiceAction extends AddElementAction
-{
- protected String name;
- protected Definition definition;
-
- public AddServiceAction(Definition definition, String name, Node parentNode, String prefix)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_SERVICE"), "icons/service_obj.gif", parentNode, prefix, "service");
- this.definition = definition;
- this.name = name;
- setComputeTopLevelRefChild(true);
- }
-
- public AddServiceAction(Definition definition, String name, Node parentNode, String prefix, Document document)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_SERVICE"), "icons/service_obj.gif", parentNode, prefix, "service");
- this.definition = definition;
- this.name = name;
- this.setDefinition(definition);
- this.document = document;
- setComputeTopLevelRefChild(true);
- }
-
- public boolean showDialog()
- {
- if (name == null)
- {
- name = NameUtil.buildUniqueServiceName(definition);
- }
- name = showDialogHelper(WSDLEditorPlugin.getWSDLString("_UI_ACTION_NEW_SERVICE"), name, NameUtil.getUsedServiceNames(definition));
- return name != null;
- }
-
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("name", name);
- }
-
- protected void performAddElement() {
- NodeList list = document.getChildNodes();
- if (parentNode == null || list.getLength() == 0) {
- createDefinitionStub();
- }
-
- super.performAddElement();
- }
-}
-
-class AddPortTypeAction extends AddElementAction
-{
- protected String name;
- protected Definition definition;
-
- public AddPortTypeAction(Definition definition, String name, Node parentNode, String prefix)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_PORTTYPE"), "icons/porttype_obj.gif", parentNode, prefix, "portType");
- this.definition = definition;
- this.name = name;
- setComputeTopLevelRefChild(true);
- }
-
- public AddPortTypeAction(Definition definition, String name, Node parentNode, String prefix, Document document)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_PORTTYPE"), "icons/porttype_obj.gif", parentNode, prefix, "portType");
- this.definition = definition;
- this.name = name;
- this.setDefinition(definition);
- this.document = document;
- setComputeTopLevelRefChild(true);
- }
-
- public boolean showDialog()
- {
- name = NameUtil.buildUniquePortTypeName(definition, name);
- name = showDialogHelper(WSDLEditorPlugin.getWSDLString("_UI_ACTION_NEW_PORTTYPE"), name, NameUtil.getUsedPortTypeNames(definition));
- return name != null;
- }
-
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("name", name);
- }
-
- public String getPortTypeName()
- {
- return name;
- }
-
- protected void performAddElement() {
- NodeList list = document.getChildNodes();
- if (parentNode == null || list.getLength() == 0) {
- createDefinitionStub();
- }
-
- super.performAddElement();
- }
-}
-
-class AddBindingAction extends Action
-{
- protected Definition definition;
- protected Document document;
-
- public AddBindingAction(Definition definition, Document document)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_BINDING"), ImageDescriptor.createFromFile(WSDLEditorPlugin.class, "icons/binding_obj.gif")); //$NON-NLS-1$
- //setToolTipText(WSDLEditorPlugin.getInstance().getWSDLString("_UI_LABEL_BINDING_WIZARD")); //$NON-NLS-1$
- this.definition = definition;
- this.document = document;
- }
-
- public void run()
- {
- BindingWizard wizard = new BindingWizard(definition, document);
- WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
- wizardDialog.create();
-
- int result = wizardDialog.open();
-
- if (result == Window.OK)
- {
- //todo...
- }
- }
-}
-
-class AddPortAction extends Action
-{
- protected Service service;
-
- public AddPortAction(Service service)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_PORT"), ImageDescriptor.createFromFile(WSDLEditorPlugin.class, "icons/binding_obj.gif")); //$NON-NLS-1$
- //setToolTipText(WSDLEditorPlugin.getInstance().getWSDLString("_UI_LABEL_BINDING_WIZARD")); //$NON-NLS-1$
- this.service = service;
- }
-
- public void run()
- {
- PortWizard wizard = new PortWizard(service);
- WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
- wizardDialog.create();
-
- int result = wizardDialog.open();
- if (result == Window.OK)
- {
- //todo...
- }
- }
-}
-
-class GenerateBindingContentAction extends Action
-{
- protected Binding binding;
- public GenerateBindingContentAction(Binding binding, boolean isEditable)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_GENERATE_BINDING_CONTENT"));
- this.binding = binding;
- setEnabled(isEditable);
- }
-
- public void run()
- {
- BindingWizard wizard = new BindingWizard(binding.getEnclosingDefinition(), BindingWizard.KIND_REGENERATE_BINDING);
- wizard.setBindingName(ComponentReferenceUtil.getName(binding));
- wizard.setPortTypeName(ComponentReferenceUtil.getPortTypeReference(binding));
- WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
- wizardDialog.create();
- wizardDialog.open();
- }
-}
-
-//This is a temporary class to allow renaming. This should be replaced when direct
-//renaming is ready
-class RenameDialogAction extends Action {
- private WSDLElement element;
- private String defaultName = "NewName";
- private List usedNames = new ArrayList();
- private boolean useSmartRename = false;
- private boolean showDialog = false;
-
- public RenameDialogAction(WSDLElement selection) {
- setText(WSDLEditorPlugin.getWSDLString("_UI_ACTION_RENAME"));
- element = selection;
- initialize();
- }
-
- public void run() {
- String result;
-
- NewComponentDialog dialog = new NewComponentDialog(WSDLEditorPlugin.getShell(), WSDLEditorPlugin.getWSDLString("_UI_ACTION_RENAME"), defaultName, usedNames);
- int rc = dialog.createAndOpen();
- if (rc == IDialogConstants.OK_ID)
- {
- result = dialog.getName();
- if (useSmartRename) {
- SmartRenameAction smartRename = new SmartRenameAction(element, result);
- smartRename.run();
- }
- else {
- RenameAction rename = new RenameAction(element, result);
- rename.run();
- }
- }
- }
-
- public void initialize() {
- if (element instanceof Fault) {
- usedNames = NameUtil.getUsedFaultNames((Operation) ((Fault) element).eContainer());
- defaultName = ((Fault) element).getName();
-
- showDialog = true;
- useSmartRename = true;
- }
- else if (element instanceof Message) {
- usedNames = NameUtil.getUsedMessageNames(element.getEnclosingDefinition());
- defaultName = ((Message) element).getQName().getLocalPart();
-
- showDialog = true;
- useSmartRename = true;
- }
- else if (element instanceof Operation) {
- usedNames = NameUtil.getUsedOperationNames((PortType) ((Operation) element).eContainer());
- defaultName = ((Operation) element).getName();
-
- showDialog = true;
- useSmartRename = true;
- }
- else if (element instanceof Part) {
- usedNames = NameUtil.getUsedPartNames((Message) ((Part) element).eContainer());
- defaultName = ((Part) element).getName();
-
- showDialog = true;
- useSmartRename = true;
- }
- else if (element instanceof PortType) {
- usedNames = NameUtil.getUsedPortTypeNames(element.getEnclosingDefinition());
- defaultName = ((PortType) element).getQName().getLocalPart();
-
- showDialog = true;
- useSmartRename = false;
- }
- else if (element instanceof Port) {
- usedNames = NameUtil.getUsedPortNames((Service) ((Port) element).eContainer());
- defaultName = ((Port) element).getName();
-
- showDialog = true;
- useSmartRename = true;
- }
- else if (element instanceof Binding) {
- usedNames = NameUtil.getUsedBindingNames(element.getEnclosingDefinition());
- defaultName = ((Binding) element).getQName().getLocalPart();
-
- showDialog = true;
- useSmartRename = false;
- }
- else if (element instanceof Service) {
- usedNames = NameUtil.getUsedServiceNames(element.getEnclosingDefinition());
- defaultName = ((Service) element).getQName().getLocalPart();
-
- showDialog = true;
- useSmartRename = false;
- }
- usedNames.remove(defaultName);
- }
-
- public boolean showRenameDialog() {
- return showDialog;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLMenuListener.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLMenuListener.java
deleted file mode 100644
index a71c238..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/actions/WSDLMenuListener.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.actions;
-
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.w3c.dom.Node;
-
-
-public class WSDLMenuListener implements IMenuListener
-{
- protected ISelectionProvider selectionProvider;
- protected ExtensibleMenuActionContributor extensibleMenuActionContributor;
-
- public WSDLMenuListener(WSDLEditor editor, ISelectionProvider selectionProvider)
- {
- super();
- this.extensibleMenuActionContributor = new ExtensibleMenuActionContributor(editor);
- this.selectionProvider = selectionProvider;
- }
-
- protected Object getSelectedObject()
- {
- ISelection selection = selectionProvider.getSelection();
- return selection.isEmpty() ? null : ((IStructuredSelection)selection).getFirstElement();
- }
-
- public void menuAboutToShow(IMenuManager manager)
- {
- Object object = getSelectedObject();
- Node node = null;
- if (object instanceof Node)
- {
- node = (Node)object;
- }
- else if (object instanceof WSDLElement)
- {
- node = ((WSDLElement)object).getElement();
- }
- else if (object instanceof WSDLGroupObject)
- {
- node = ((WSDLGroupObject)object).getDefinition().getElement();
- }
- extensibleMenuActionContributor.contributeMenuActions(manager, node, object);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingCommand.java
deleted file mode 100644
index 899817a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingCommand.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-
-public final class AddBindingCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String localName;
- private Binding binding;
-
- public AddBindingCommand
- (Definition definition,
- String localName)
- {
- this.definition = definition;
- this.localName = localName;
- }
-
- public WSDLElement getWSDLElement()
- {
- return binding;
- }
-
- public void run()
- {
- binding = WSDLFactory.eINSTANCE.createBinding();
- binding.setQName(new QName(definition.getTargetNamespace(),localName));
- binding.setEnclosingDefinition(definition);
- definition.addBinding(binding);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingFaultCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingFaultCommand.java
deleted file mode 100644
index c8e02ae..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingFaultCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddBindingFaultCommand extends WSDLElementCommand
-{
- BindingFault bindingFault;
- BindingOperation bindingOperation;
- String name;
-
- public AddBindingFaultCommand(BindingOperation bindingOperation, String name)
- {
- this.bindingOperation = bindingOperation;
- this.name = name;
- }
-
- public void run()
- {
- bindingFault = WSDLFactory.eINSTANCE.createBindingFault();
- bindingFault.setName(name);
- bindingFault.setEnclosingDefinition(bindingOperation.getEnclosingDefinition());
- bindingOperation.addBindingFault((BindingFault)bindingFault);
- }
-
- public WSDLElement getWSDLElement()
- {
- return bindingFault;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingInputCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingInputCommand.java
deleted file mode 100644
index 5303b44..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingInputCommand.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddBindingInputCommand extends WSDLElementCommand
-{
- BindingInput bindingInput;
- BindingOperation bindingOperation;
- String name;
-
- public AddBindingInputCommand(BindingOperation bindingOperation, String name)
- {
- this.bindingOperation = bindingOperation;
- this.name = name;
- }
-
- public void run()
- {
- bindingInput = WSDLFactory.eINSTANCE.createBindingInput();
- bindingInput.setName(name);
- bindingInput.setEnclosingDefinition(bindingOperation.getEnclosingDefinition());
- bindingOperation.setBindingInput((BindingInput)bindingInput);
- }
-
- public WSDLElement getWSDLElement()
- {
- return bindingInput;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOperationCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOperationCommand.java
deleted file mode 100644
index 45e0f96..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOperationCommand.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddBindingOperationCommand extends WSDLElementCommand
-{
- private Binding binding;
-
- private String name;
- private String bindingInputName = "";
- private String bindingOutputName = "";
- private String bindingFaultName ="";
-
- private BindingOperation bindingOperation;
-
- private boolean createBindingInput = false;
- private boolean createBindingOutput = false;
- private boolean createBindingFault = false;
-
- public AddBindingOperationCommand(Binding binding,String name)
- {
- this.binding = binding;
- this.name = name;
- }
-
- public AddBindingOperationCommand
- (Binding binding,
- String name,
- boolean createBindingInput,
- boolean createBindingOutput,
- boolean createBindingFault)
- {
- this.binding = binding;
- this.name = name;
- this.createBindingInput = createBindingInput;
- this.createBindingOutput = createBindingOutput;
- this.createBindingFault = createBindingFault;
- }
-
- public void run()
- {
- bindingOperation = WSDLFactory.eINSTANCE.createBindingOperation();
- bindingOperation.setName(name);
- bindingOperation.setEnclosingDefinition(binding.getEnclosingDefinition());
- binding.addBindingOperation(bindingOperation);
-
- WSDLElementCommand command = null;
- if (createBindingInput)
- {
- command = new AddBindingInputCommand(bindingOperation,bindingInputName);
- command.run();
- }
-
- if (createBindingOutput)
- {
- command = new AddBindingOutputCommand(bindingOperation,bindingOutputName);
- command.run();
- }
-
- if (createBindingFault)
- {
- command = new AddBindingFaultCommand(bindingOperation,bindingFaultName);
- command.run();
- }
- }
-
- public WSDLElement getWSDLElement()
- {
- return bindingOperation;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public void setBindingInputName(String name)
- {
- this.bindingInputName = name;
- }
-
- public void setBindingOutputName(String name)
- {
- this.bindingOutputName = name;
- }
-
- public void setBindingFaultName(String name)
- {
- this.bindingFaultName = name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOutputCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOutputCommand.java
deleted file mode 100644
index 4286b6c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddBindingOutputCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddBindingOutputCommand extends WSDLElementCommand
-{
- BindingOutput bindingOutput;
- BindingOperation bindingOperation;
- String name;
-
- public AddBindingOutputCommand(BindingOperation bindingOperation, String name)
- {
- this.bindingOperation = bindingOperation;
- this.name = name;
- }
-
- public void run()
- {
- bindingOutput = WSDLFactory.eINSTANCE.createBindingOutput();
- bindingOutput.setName(name);
- bindingOutput.setEnclosingDefinition(bindingOperation.getEnclosingDefinition());
- bindingOperation.setBindingOutput((BindingOutput)bindingOutput);
- }
-
- public WSDLElement getWSDLElement()
- {
- return bindingOutput;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddFaultCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddFaultCommand.java
deleted file mode 100644
index c1a06b6..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddFaultCommand.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.ui.internal.actions.SmartRenameAction;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-
-public final class AddFaultCommand extends AddMessageReferenceCommand
-{
- private Fault originalFault;
-
- public AddFaultCommand(Operation operation, String name)
- {
- super(operation,name);
- }
-
- public AddFaultCommand(Operation operation, String name, boolean createMessage)
- {
- super(operation,name,createMessage);
- }
-
- /*
- * Constructor used to create a Fault based on the given Fault. In essence, this will
- * create a copy of the given Fault.
- */
- public AddFaultCommand(Operation operation, Fault originalFault, String name) {
- super(operation, name, false);
-
- this.originalFault = originalFault;
- }
-
- public void run()
- {
- messageReference = WSDLFactory.eINSTANCE.createFault();
- messageReference.setName(name);
- messageReference.setEnclosingDefinition(operation.getEnclosingDefinition());
- operation.addFault((Fault)messageReference);
-
- // TBD - add binding fault
-
- if (originalFault == null) {
- if (createMessage)
- createMessage();
- }
- else {
- // Do necessary copying of data from original Fault to new Fault
- if (originalFault.getEMessage() != null) {
- String originalMsgName = originalFault.getEMessage().getQName().getLocalPart();
-
- boolean gened = false;
- if (originalFault.eContainer() instanceof Operation)
- gened = SmartRenameAction.isMessageNameGenerated(originalMsgName, ((Operation) originalFault.eContainer()).getName(), "");
-
- String newMsgName = "";
- if (gened) {
- newMsgName = NameUtil.buildUniqueMessageName(operation.getEnclosingDefinition(), messageReference);
- }
- else {
- Definition definition = operation.getEnclosingDefinition();
- Message tMessage = originalFault.getEMessage();
- newMsgName = NameUtil.buildUniqueMessageName(definition, tMessage.getQName().getLocalPart());
- }
-
- createMessage(originalFault, NameUtil.buildUniqueMessageName(operation.getEnclosingDefinition(), messageReference));
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddImportCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddImportCommand.java
deleted file mode 100644
index 7fc4eb6..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddImportCommand.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddImportCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String namespace;
- private String location;
- private Import importElement;
-
- public AddImportCommand
- (Definition definition,
- String namespace,
- String location)
- {
- this.definition = definition;
- this.namespace = namespace;
- this.location = location;
- }
-
- public WSDLElement getWSDLElement()
- {
- return importElement;
- }
-
- public void run()
- {
- importElement = WSDLFactory.eINSTANCE.createImport();
- importElement.setNamespaceURI(namespace);
- importElement.setLocationURI(location);
- importElement.setEnclosingDefinition(definition);
- definition.addImport(importElement);
- }
-
- public void setNamespaceURI(String namespace)
- {
- this.namespace = namespace;
- }
-
- public void setLocationURI(String location)
- {
- this.location = location;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddInputCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddInputCommand.java
deleted file mode 100644
index 0e33b71..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddInputCommand.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.ui.internal.actions.SmartRenameAction;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-
-public final class AddInputCommand extends AddMessageReferenceCommand
-{
- private Input originalInput;
-
- public AddInputCommand(Operation operation, String name)
- {
- super(operation,name);
- }
-
- public AddInputCommand(Operation operation, String name, boolean createMessage)
- {
- super(operation,name,createMessage);
- }
-
- /*
- * Constructor used to create an Input based on the given Input. In essence, this will
- * create a copy of the given Input.
- */
- public AddInputCommand(Operation operation, Input originalInput, String name) {
- super(operation, name, false);
-
- this.originalInput = originalInput;
- }
-
- public void run()
- {
- messageReference = WSDLFactory.eINSTANCE.createInput();
- // messageReference.setName(name);
- messageReference.setEnclosingDefinition(operation.getEnclosingDefinition());
- operation.setInput((Input)messageReference);
-
- // TBD - add binding input
-
- if (originalInput == null) {
- if (createMessage)
- createMessage();
- }
- else {
- // Do necessary copying of data from original Input to new Input
- if (originalInput.getEMessage() != null) {
- String originalMsgName = originalInput.getEMessage().getQName().getLocalPart();
-
- boolean gened = false;
- if (originalInput.eContainer() instanceof Operation)
- gened = SmartRenameAction.isMessageNameGenerated(originalMsgName, ((Operation) originalInput.eContainer()).getName(), "Request");
-
- String newMsgName = "";
- if (gened) {
- newMsgName = NameUtil.buildUniqueMessageName(operation.getEnclosingDefinition(), messageReference);
- }
- else {
- Definition definition = operation.getEnclosingDefinition();
- Message tMessage = originalInput.getEMessage();
- newMsgName = NameUtil.buildUniqueMessageName(definition, tMessage.getQName().getLocalPart());
- }
-
- createMessage(originalInput, newMsgName);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageCommand.java
deleted file mode 100644
index c7fd6f8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageCommand.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import java.util.Iterator;
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.ui.internal.actions.SmartRenameAction;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-
-
-public final class AddMessageCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String localName;
- private Message message;
- private Message originalMessage;
-
- private boolean createPart = false;
- private final String DEFAULT_PART_NAME = "NewPart";
-
- public AddMessageCommand
- (Definition definition,
- String localName)
- {
- this.definition = definition;
- this.localName = localName;
- }
-
- public AddMessageCommand
- (Definition definition,
- String localName,
- boolean createPart)
- {
- this.definition = definition;
- this.localName = localName;
- this.createPart = createPart;
- }
-
- /*
- * Constructor used to create a Message based on the given Message. In essence, this will
- * create a copy of the given Message.
- */
- public AddMessageCommand(Definition definition, Message originalMessage, String localName, boolean copyPart) {
- this.definition = definition;
- this.localName = localName;
- this.createPart = copyPart;
- this.originalMessage = originalMessage;
- }
-
- public void run()
- {
- message = WSDLFactory.eINSTANCE.createMessage();
- message.setQName(new QName(definition.getTargetNamespace(),localName));
- message.setEnclosingDefinition(definition);
- definition.addMessage(message);
-
- if (originalMessage == null) {
- if (createPart)
- {
- AddPartCommand command =
- new AddPartCommand(message,DEFAULT_PART_NAME,WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001,"string",true);
- command.run();
- }
- }
- else {
- if (originalMessage.getEParts() != null) {
- Iterator it = originalMessage.getEParts().iterator();
-
- while (it.hasNext()) {
- Part part = (Part) it.next();
- AddPartCommand command;
- if (SmartRenameAction.isPartNameGenerated(part.getName(), originalMessage.getQName().getLocalPart()))
- command = new AddPartCommand(message, part, NameUtil.buildUniquePartName(message, message.getQName().getLocalPart()));
- else
- command = new AddPartCommand(message, part, part.getName());
-
-
- command.run();
- }
- }
- }
- }
-
- public void setLocalName(String name)
- {
- this.localName = name;
- }
-
- public WSDLElement getWSDLElement()
- {
- return message;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageReferenceCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageReferenceCommand.java
deleted file mode 100644
index 1ec11ea..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddMessageReferenceCommand.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.WSDLElement;
-
-abstract public class AddMessageReferenceCommand extends WSDLElementCommand
-{
- protected String name;
- protected MessageReference messageReference;
- protected Operation operation;
- protected boolean createMessage = false;
- private final String DEFAULT_MESSAGE_NAME = "NewMessage";
-
- public AddMessageReferenceCommand(Operation operation, String name)
- {
- this.operation = operation;
- this.name = name;
- }
-
- public AddMessageReferenceCommand(Operation operation, String name, boolean createMessage)
- {
- this.operation = operation;
- this.name = name;
- this.createMessage = createMessage;
- }
-
- protected void createMessage()
- {
- Definition definition = operation.getEnclosingDefinition();
- AddMessageCommand command =
- new AddMessageCommand(definition,DEFAULT_MESSAGE_NAME,createMessage);
- command.run();
- messageReference.setEMessage((Message)command.getWSDLElement());
- }
-
- /*
- * Overloaded createMessage(arg) method. Similar to to createMessage() but takes in a MessageReference.
- * Method used to create a copy of the original Message (contained in the passed in MessageReference).
- */
- protected void createMessage(MessageReference originalMRef, String newMessageRefName) {
- Definition definition = operation.getEnclosingDefinition();
- Message tMessage = originalMRef.getEMessage();
- AddMessageCommand command =
- new AddMessageCommand(definition, tMessage, newMessageRefName, true);
- command.run();
- messageReference.setEMessage((Message)command.getWSDLElement());
- }
-
- public WSDLElement getWSDLElement()
- {
- return messageReference;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddOperationCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddOperationCommand.java
deleted file mode 100644
index 8059fc2..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddOperationCommand.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-
-public final class AddOperationCommand extends WSDLElementCommand
-{
- private PortType portType;
- private String name;
- private Operation operation;
- private Operation originalOperation;
- private boolean copyInOutFault;
-
- private boolean createInput = false;
- private boolean createOutput = false;
- private boolean createFault = false;
-
- private final String DEFAULT_INPUT_NAME = "";
- private final String DEFAULT_OUTPUT_NAME = "";
- private final String DEFAULT_FAULT_NAME = "";
-
- public AddOperationCommand
- (PortType portType,
- String name)
- {
- this.portType = portType;
- this.name = name;
- }
-
- public AddOperationCommand
- (PortType portType,
- String name,
- boolean createInput,
- boolean createOutput,
- boolean createFault)
- {
- this.portType = portType;
- this.name = name;
- this.createInput = createInput;
- this.createOutput = createOutput;
- this.createFault = createFault;
- }
-
- /*
- * Constructor used to create an Operation based on the given Operation. In essence, this will
- * create a copy of the given Operation.
- */
- public AddOperationCommand(PortType portType, Operation originalOperation, String name, boolean copyInOutFault) {
- this.portType = portType;
- this.originalOperation = originalOperation;
- this.name = name;
- this.copyInOutFault = copyInOutFault;
- }
-
- public void run()
- {
- operation = WSDLFactory.eINSTANCE.createOperation();
- operation.setName(name);
- operation.setEnclosingDefinition(portType.getEnclosingDefinition());
- portType.addOperation(operation);
-
- if (originalOperation == null) {
- WSDLElementCommand command = null;
- if (createInput)
- {
- command = new AddInputCommand(operation,DEFAULT_INPUT_NAME,true);
- command.run();
- }
-
- if (createOutput)
- {
- command = new AddOutputCommand(operation,DEFAULT_OUTPUT_NAME,true);
- command.run();
- }
-
- if (createFault)
- {
- command = new AddFaultCommand(operation,DEFAULT_FAULT_NAME,true);
- command.run();
- }
- }
- else {
- // Do necessary copying of data from original operation to new operation
- // Paramater ordering? Documentation? This part still needs to be worked on
- // Copy 'kids' if necessary
- if (copyInOutFault) {
- WSDLElementCommand command = null;
-
- if (originalOperation.getEOutput() != null)
- {
- Output output = originalOperation.getEOutput();
- command = new AddOutputCommand(operation, output, NameUtil.buildUniqueOutputName(portType, operation.getName(), ""));
- command.run();
- }
-
- if (originalOperation.getEInput() != null)
- {
- Input input = originalOperation.getEInput();
- command = new AddInputCommand(operation, input, NameUtil.buildUniqueInputName(portType, operation.getName(), ""));
- command.run();
- }
-
- if (originalOperation.getEFaults() != null)
- {
- Iterator it = originalOperation.getEFaults().iterator();
- while (it.hasNext()) {
- Fault fault = (Fault) it.next();
- command = new AddFaultCommand(operation, fault, NameUtil.buildUniqueFaultName(originalOperation, fault.getName()));
- command.run();
- }
- }
-
- }
- }
- }
-
- public WSDLElement getWSDLElement()
- {
- return operation;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddOutputCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddOutputCommand.java
deleted file mode 100644
index 5c57c58..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddOutputCommand.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.ui.internal.actions.SmartRenameAction;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-
-public final class AddOutputCommand extends AddMessageReferenceCommand
-{
- private Output originalOutput;
-
- public AddOutputCommand(Operation operation, String name)
- {
- super(operation,name);
- }
-
- public AddOutputCommand(Operation operation, String name, boolean createMessage)
- {
- super(operation,name,createMessage);
- }
-
- /*
- * Constructor used to create an Output based on the given Output. In essence, this will
- * create a copy of the given Output.
- */
- public AddOutputCommand(Operation operation, Output originalOutput, String name) {
- super(operation, name, false);
-
- this.originalOutput = originalOutput;
- }
-
- public void run()
- {
- messageReference = WSDLFactory.eINSTANCE.createOutput();
-// messageReference.setName(name);
- messageReference.setEnclosingDefinition(operation.getEnclosingDefinition());
- operation.setOutput((Output)messageReference);
-
- // TBD - add binding output
-
- if (originalOutput == null) {
- if (createMessage)
- createMessage();
- }
- else {
- // Do necessary copying of data from original Output to new Output
- if (originalOutput.getEMessage() != null) {
- String originalMsgName = originalOutput.getEMessage().getQName().getLocalPart();
-
- boolean gened = false;
- if (originalOutput.eContainer() instanceof Operation)
- gened = SmartRenameAction.isMessageNameGenerated(originalMsgName, ((Operation) originalOutput.eContainer()).getName(), "Response");
-
- String newMsgName = "";
- if (gened) {
- newMsgName = NameUtil.buildUniqueMessageName(operation.getEnclosingDefinition(), messageReference);
- }
- else {
- Definition definition = operation.getEnclosingDefinition();
- Message tMessage = originalOutput.getEMessage();
- newMsgName = NameUtil.buildUniqueMessageName(definition, tMessage.getQName().getLocalPart());
- }
-
- createMessage(originalOutput, newMsgName);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddPartCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddPartCommand.java
deleted file mode 100644
index 11a461e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddPartCommand.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.internal.impl.PartImpl;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-
-public final class AddPartCommand extends WSDLElementCommand
-{
- private Message message;
- private String name;
- private Part part;
- private Part originalPart;
-
- private QName typeOrElementName;
- private boolean useType = true;
-
- public AddPartCommand
- (Message message,
- String name)
- {
- this.message = message;
- this.name = name;
- }
-
- public AddPartCommand
- (Message message,
- String name,
- String namespace,
- String localName,
- boolean useType)
- {
- this.message = message;
- this.name = name;
- this.useType = useType;
- typeOrElementName = new QName(namespace,localName);
- }
-
- /*
- * Constructor used to create a Part based on the given Part. In essence, this will
- * create a copy of the given Part.
- */
- public AddPartCommand
- (Message message,
- Part originalPart,
- String name)
- {
- this.message = message;
- this.name = name;
- this.originalPart = originalPart;
- }
-
- /**
- * @deprecated
- */
- public AddPartCommand
- (Message message,
- String name,
- String namespace,
- String localName)
- {
- this.message = message;
- this.name = name;
- typeOrElementName = new QName(namespace,localName);
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public WSDLElement getWSDLElement()
- {
- return part;
- }
-
- public void run()
- {
- if (typeOrElementName == null)
- typeOrElementName = createDefaultTypeName();
-
- // Add namespace to the Definitions if it is not there yet.
- addNamespaceDeclaration();
-
- part = WSDLFactory.eINSTANCE.createPart();
- part.setName(name);
-
- if (originalPart == null) {
- if (useType)
- part.setTypeName(typeOrElementName);
- else
- part.setElementName(typeOrElementName);
- }
- else {
- if (originalPart.getTypeName() != null)
- part.setTypeName(originalPart.getTypeName());
-
- String newElementName = null;
- if (originalPart.getElementName() != null) {
-
- boolean createNewElement = true;
- if (originalPart.getElementDeclaration() != null && originalPart.getElementDeclaration().getElement() != null) {
- if (!(originalPart.getElementDeclaration().getElement() instanceof XMLNode)) {
- createNewElement = false;
- }
- }
-
- if (createNewElement) {
- newElementName = getNewNameHelper(name, originalPart.getEnclosingDefinition(), false);
- part.setElementName(new QName(originalPart.getElementName().getNamespaceURI(), newElementName));
-
- if (originalPart.getEnclosingDefinition() != null) {
- if (newElementName == null) {
- newElementName = getNewNameHelper(name, originalPart.getEnclosingDefinition(), false);
- }
-
- AddXSDElementDeclarationCommand elementAction = new AddXSDElementDeclarationCommand(originalPart.getEnclosingDefinition(), newElementName);
- elementAction.run();
- }
- }
- else {
- part.setElementName(new QName(originalPart.getElementName().getNamespaceURI(), originalPart.getElementName().getLocalPart()));
- }
- }
- }
-
- part.setEnclosingDefinition(message.getEnclosingDefinition());
- ((PartImpl)part).reconcileReferences(false);
- message.addPart(part);
- }
-
- private void addNamespaceDeclaration()
- {
- Definition definition = message.getEnclosingDefinition();
- if (!definition.getNamespaces().containsValue(typeOrElementName.getNamespaceURI()))
- {
- definition.addNamespace("p",typeOrElementName.getNamespaceURI());
- ((WSDLElementImpl)definition).updateElement(false);
- }
- }
-
- private QName createDefaultTypeName()
- {
- QName qname = new QName(WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001,"string");
- return qname;
- }
-
- private String getNewNameHelper(String base, Definition def, boolean isType)
- {
- String name = base;
- int count = 0;
-
- // Ugly.... Redo this...
- // Get a list of Elements...
- List elementList = null;
- if (def.getETypes() != null) {
- List xsdsList = def.getETypes().getEExtensibilityElements();
- if (xsdsList != null) {
- Iterator xsdsIterator = xsdsList.iterator();
- XSDSchemaExtensibilityElement xsdElement = (XSDSchemaExtensibilityElement) xsdsIterator.next();
- XSDSchema schema = xsdElement.getSchema();
- if (schema != null) {
- elementList = schema.getElementDeclarations();
- }
- }
- }
-
- if (elementList != null) {
- int index = 0;
- while (index < elementList.size()) {
- XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) elementList.get(index);
-
- if (name.equals(elementDeclaration.getName())) {
- count++;
- name = name + count;
- index = 0;
- }
- else {
- index++;
- }
- }
- }
-
- return name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddPortCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddPortCommand.java
deleted file mode 100644
index a647c52..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddPortCommand.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-public final class AddPortCommand extends WSDLElementCommand
-{
- private Service service;
- private String name;
- private Port port;
-
- public AddPortCommand
- (Service service,
- String name)
- {
- this.service = service;
- this.name = name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public WSDLElement getWSDLElement()
- {
- return port;
- }
-
- public void run()
- {
- port = WSDLFactory.eINSTANCE.createPort();
- port.setName(name);
- port.setEnclosingDefinition(service.getEnclosingDefinition());
- service.addPort(port);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddPortTypeCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddPortTypeCommand.java
deleted file mode 100644
index 5eb4d5a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddPortTypeCommand.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-
-public final class AddPortTypeCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String localName;
- private PortType portType;
-
- private boolean createOperation = false;
- private final String DEFAULT_OPERATION_NAME = "NewOperation";
-
- public AddPortTypeCommand
- (Definition definition,
- String localName)
- {
- this.definition = definition;
- this.localName = localName;
- }
-
- public AddPortTypeCommand
- (Definition definition,
- String localName,
- boolean createOperation)
- {
- this.definition = definition;
- this.localName = localName;
- this.createOperation = createOperation;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.ui.internal.commands.WSDLElementAction#getWSDLElement()
- */
- public WSDLElement getWSDLElement()
- {
- return portType;
- }
-
- public void run()
- {
- portType = WSDLFactory.eINSTANCE.createPortType();
- portType.setQName(new QName(definition.getTargetNamespace(),localName));
- portType.setEnclosingDefinition(definition);
- definition.addPortType(portType);
-
- if (createOperation)
- {
- AddOperationCommand command =
- new AddOperationCommand(portType,DEFAULT_OPERATION_NAME,true,true,false);
- command.run();
- }
- }
-
- public void setLocalName(String name)
- {
- localName = name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddServiceCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddServiceCommand.java
deleted file mode 100644
index d9fed45..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddServiceCommand.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-
-public final class AddServiceCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String localName;
- private Service service;
-
- private boolean createPort = false;
- private final String DEFAULT_PORT_NAME = "NewPort";
-
- public AddServiceCommand
- (Definition definition,
- String localName)
- {
- this.definition = definition;
- this.localName = localName;
- }
-
- public AddServiceCommand
- (Definition definition,
- String localName,
- boolean createPort)
- {
- this.definition = definition;
- this.localName = localName;
- this.createPort = createPort;
- }
-
- public WSDLElement getWSDLElement()
- {
- return service;
- }
-
- public void run()
- {
- service = WSDLFactory.eINSTANCE.createService();
- service.setQName(new QName(definition.getTargetNamespace(),localName));
- service.setEnclosingDefinition(definition);
- definition.addService(service);
-
- if (createPort)
- {
- AddPortCommand command =
- new AddPortCommand(service,DEFAULT_PORT_NAME);
- command.run();
- }
- }
-
- public void setLocalName(String name)
- {
- localName = name;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddTypesCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddTypesCommand.java
deleted file mode 100644
index b568fd1..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddTypesCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-
-// Definition must not have "types" element to run this command.
-public final class AddTypesCommand extends WSDLElementCommand
-{
- private Definition definition;
- private Types types;
-
- public AddTypesCommand(Definition definition)
- {
- this.definition = definition;
- }
-
- public void run()
- {
- if ((types = definition.getETypes()) != null)
- return; // "types" already exists.
-
- types = WSDLFactory.eINSTANCE.createTypes();
- types.setEnclosingDefinition(definition);
- definition.setTypes(types);
- }
-
- public WSDLElement getWSDLElement()
- {
- return types;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddUnknownExtensibilityElementCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddUnknownExtensibilityElementCommand.java
deleted file mode 100644
index 828b442..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddUnknownExtensibilityElementCommand.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.ExtensibleElement;
-import org.eclipse.wst.wsdl.UnknownExtensibilityElement;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.internal.impl.UnknownExtensibilityElementImpl;
-
-
-import java.util.Map;
-import java.util.Iterator;
-
-public final class AddUnknownExtensibilityElementCommand extends WSDLElementCommand
-{
- private ExtensibleElement extensibleElement;
- private String namespaceURI;
- private String localName;
- private UnknownExtensibilityElement extensibilityElement;
- private Map properties;
-
- public AddUnknownExtensibilityElementCommand
- (ExtensibleElement extensibleElement,
- String namespaceURI,
- String localName)
- {
- this.extensibleElement = extensibleElement;
- this.namespaceURI = namespaceURI;
- this.localName = localName;
- }
-
- public AddUnknownExtensibilityElementCommand
- (ExtensibleElement extensibleElement,
- String namespaceURI,
- String localName,
- Map properties)
- {
- this.extensibleElement = extensibleElement;
- this.namespaceURI = namespaceURI;
- this.localName = localName;
- this.properties = properties;
- }
-
- public WSDLElement getWSDLElement()
- {
- return extensibilityElement;
- }
-
- public void run()
- {
- extensibilityElement = WSDLFactory.eINSTANCE.createUnknownExtensibilityElement();
- extensibilityElement.setElementType(new QName(namespaceURI,localName));
-
- if (properties != null)
- {
- Iterator iterator = properties.entrySet().iterator();
- Map.Entry entry = null;
- while (iterator.hasNext())
- {
- entry = (Map.Entry)iterator.next();
- String attribute = (String)entry.getKey();
- String value = (String)entry.getValue();
- ((UnknownExtensibilityElementImpl)extensibilityElement).setProperty(attribute,value);
- }
- }
-
- extensibilityElement.setEnclosingDefinition(extensibleElement.getEnclosingDefinition());
- extensibleElement.addExtensibilityElement(extensibilityElement);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDElementDeclarationCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDElementDeclarationCommand.java
deleted file mode 100644
index ea9f169..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDElementDeclarationCommand.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-
-// This class is used to create a new XSDElementDeclaration in the targetNamespace.
-public final class AddXSDElementDeclarationCommand extends WSDLElementCommand
-{
- private Definition definition;
- private String targetNamespace;
- private String elementName;
- private XSDSchema schema;
-
- /**
- * TODO:
- * We have a potential problem here.... What if the definition targetnamespace is null....
- */
- public AddXSDElementDeclarationCommand(Definition definition, String elementName)
- {
- this.definition = definition;
- this.targetNamespace = definition.getTargetNamespace();
- this.elementName = elementName;
- }
-
- /**
- * @deprecated
- * Use AddXSDElementDeclarationCommand(Definition definition, String typeName)
- */
- public AddXSDElementDeclarationCommand
- (Definition definition,
- String targetNamespace,
- String elementName)
- {
- this.definition = definition;
- this.targetNamespace = targetNamespace;
- this.elementName = elementName;
- }
-
- public void run()
- {
- XSDSchema xsdSchema = getSchema();
- XSDElementDeclaration elementDecl =
- XSDFactory.eINSTANCE.createXSDElementDeclaration();
- elementDecl.setName(elementName);
-
- XSDSimpleTypeDefinition simpleTypeDefinition = getXSDStringType(xsdSchema);
- elementDecl.setTypeDefinition(simpleTypeDefinition);
- xsdSchema.getContents().add(elementDecl);
- }
-
- public void run(String newElementName) {
- elementName = newElementName;
- run();
- }
-
- /*
- * Specify which Schema to use when creating the Type.
- * Call this method before calling run(). Otherwise it will use the first
- * Schema it finds.
- */
- public void setSchema(XSDSchema schema) {
- this.schema = schema;
- }
-
- /*
- * Return the Schema used to create the Type
- */
- public XSDSchema getSchema() {
- if (schema == null) {
- return getXSDSchema(targetNamespace);
- }
- else {
- return schema;
- }
- }
-
- private XSDSimpleTypeDefinition getXSDStringType(XSDSchema schema)
- {
- return schema.getSchemaForSchema().resolveSimpleTypeDefinition("string");
- }
-
- private XSDSchema getXSDSchema(String targetNamespace)
- {
- XSDSchema xsdSchema;
-
- // Do we have a schema already?
- Iterator iterator = getTypes().getSchemas(targetNamespace).iterator();
- if (iterator.hasNext())
- {
- xsdSchema = (XSDSchema)iterator.next(); // Get the first one.
- return xsdSchema;
- }
- else
- {
- // Create a new schema because there's none.
- AddXSDSchemaCommand command = new AddXSDSchemaCommand(definition,targetNamespace);
- command.run();
- return ((XSDSchemaExtensibilityElement)command.getWSDLElement()).getSchema();
- }
- }
-
- private Types getTypes()
- {
- // Types is created if it does not exist yet.
- Types types = (Types)definition.getTypes();
- if (types != null)
- return types;
- else
- {
- AddTypesCommand command = new AddTypesCommand(definition);
- command.run();
- return (Types)command.getWSDLElement();
- }
- }
-
- public WSDLElement getWSDLElement()
- {
- return null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDSchemaCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDSchemaCommand.java
deleted file mode 100644
index 73bd1fd..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDSchemaCommand.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-
-
-
-public final class AddXSDSchemaCommand extends WSDLElementCommand
-{
- private Definition definition;
- private XSDSchemaExtensibilityElement extensibilityElement;
- private String targetNamespace;
-
- public AddXSDSchemaCommand(Definition definition)
- {
- this.definition = definition;
- this.targetNamespace = definition.getTargetNamespace();
- }
-
- public AddXSDSchemaCommand(Definition definition, String targetNamespace)
- {
- this.definition = definition;
- this.targetNamespace = targetNamespace;
- }
-
- public void run()
- {
- extensibilityElement = WSDLFactory.eINSTANCE.createXSDSchemaExtensibilityElement();
- extensibilityElement.setEnclosingDefinition(definition);
-
- XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema();
- xsdSchema.setSchemaForSchemaQNamePrefix("xsd");
- xsdSchema.setTargetNamespace(targetNamespace);
- // Choose the prefix Choose the prefix used for this schema's namespace and the schema for schema's namespace.
- //
- java.util.Map qNamePrefixToNamespaceMap = xsdSchema.getQNamePrefixToNamespaceMap();
-// qNamePrefixToNamespaceMap.put("p", xsdSchema.getTargetNamespace());
- qNamePrefixToNamespaceMap.put
- (xsdSchema.getSchemaForSchemaQNamePrefix(),org.eclipse.xsd.util.XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- extensibilityElement.setSchema(xsdSchema);
-
- // TBD - Check if multiple schemas with the same targetNamespace can co-exist.
- Types types = getTypes();
- types.addExtensibilityElement(extensibilityElement);
- }
-
- private Types getTypes()
- {
- // Types is created if it does not exist.
- Types types = (Types)definition.getTypes();
- if (types != null)
- return types;
- else
- {
- AddTypesCommand command = new AddTypesCommand(definition);
- command.run();
- return (Types)command.getWSDLElement();
- }
- }
-
- public WSDLElement getWSDLElement()
- {
- return extensibilityElement;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDTypeDefinitionCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDTypeDefinitionCommand.java
deleted file mode 100644
index b292243..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/AddXSDTypeDefinitionCommand.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-
-// This class is used to create a new XSDTypeDefinition in the targetNamespace.
-public final class AddXSDTypeDefinitionCommand extends WSDLElementCommand
-{
- private Definition definition;
- private XSDSchemaExtensibilityElement extensibilityElement;
- private String targetNamespace;
- private String typeName;
- private XSDSchema schema;
- private boolean isComplexType = true;
-
- /**
- * TODO:
- * We have a potential problem here.... What if the definition targetnamespace is null....
- */
- public AddXSDTypeDefinitionCommand(Definition definition, String typeName)
- {
- this.definition = definition;
- this.targetNamespace = definition.getTargetNamespace();
- this.typeName = typeName;
- }
-
- public AddXSDTypeDefinitionCommand(Definition definition, String typeName, boolean isComplexType)
- {
- this(definition, typeName);
- this.isComplexType = isComplexType;
- }
-
- /**
- * @deprecated
- * Use AddXSDTypeDefinitionCommand(Definition definition, String typeName)
- */
- public AddXSDTypeDefinitionCommand
- (Definition definition,
- String targetNamespace,
- String typeName)
- {
- this.definition = definition;
- this.targetNamespace = targetNamespace;
- this.typeName = typeName;
- }
-
- public void run()
- {
- XSDSchema xsdSchema = getSchema();
- XSDNamedComponent typeDef;
-
- if (isComplexType) {
- typeDef = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
- }
- else {
- typeDef = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
- }
-
- typeDef.setName(typeName);
- xsdSchema.getContents().add(typeDef);
- }
-
- public void run(String newTypeName) {
- typeName = newTypeName;
- run();
- }
-
- /*
- * Specifiy if we should create a complex or simple type. This should should be
- * called before run().
- * Overrides the value set when the constructor
- * AddXSDTypeDefinitionCommand(Definition definition, String typeName, boolean isComplexType)
- * is used.
- */
- public void isComplexType(boolean isComplexType) {
- this.isComplexType = isComplexType;
- }
-
- /*
- * Specify which Schema to use when creating the Type.
- * Call this method before calling run(). Otherwise it will use the first
- * Schema it finds.
- */
- public void setSchema(XSDSchema schema) {
- this.schema = schema;
- }
-
- /*
- * Return the Schema used to create the Type
- */
- public XSDSchema getSchema() {
- if (schema == null) {
- return getXSDSchema(targetNamespace);
- }
- else {
- return schema;
- }
- }
-
- private XSDSchema getXSDSchema(String targetNamespace)
- {
- XSDSchema xsdSchema;
-
- // Do we have a schema already?
- Iterator iterator = getTypes().getSchemas(targetNamespace).iterator();
- if (iterator.hasNext())
- {
- xsdSchema = (XSDSchema)iterator.next(); // Get the first one.
- return xsdSchema;
- }
- else
- {
- // Create a new schema because there's none.
- AddXSDSchemaCommand command = new AddXSDSchemaCommand(definition,targetNamespace);
- command.run();
- return ((XSDSchemaExtensibilityElement)command.getWSDLElement()).getSchema();
- }
- }
-
- private Types getTypes()
- {
- // Types is created if it does not exist yet.
- Types types = (Types)definition.getTypes();
- if (types != null)
- return types;
- else
- {
- AddTypesCommand command = new AddTypesCommand(definition);
- command.run();
- return (Types)command.getWSDLElement();
- }
- }
-
- public WSDLElement getWSDLElement()
- {
- return null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/WSDLElementCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/WSDLElementCommand.java
deleted file mode 100644
index 3fc9c24..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/commands/WSDLElementCommand.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.commands;
-
-import org.eclipse.wst.wsdl.WSDLElement;
-
-public abstract class WSDLElementCommand
-{
- public abstract WSDLElement getWSDLElement();
- public abstract void run();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/AbstractGenerator.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/AbstractGenerator.java
deleted file mode 100644
index cf2d9bf..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/AbstractGenerator.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddNamespaceDeclarationsAction;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.format.FormatProcessorXML;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public abstract class AbstractGenerator
-{
- //public static final String UNSPECIFIED = "(unspecified)"; //WSDLEditorPlugin.getInstance().getWSDLString("_UI_LABEL_NONE");
- public static final int BINDING_GENERATOR = 1;
- public static final int PORT_GENERATOR = 2;
-
- protected ContentGenerator bindingContentGenerator;
- protected String name;
- protected String protocol;
- protected boolean overwrite;
- protected Object[] options;
- protected WSDLElement newComponent;
-
- public abstract int getType();
-
- public abstract Definition getDefinition();
-
- public abstract Node getParentNode();
-
- public abstract void generateContent();
-
- protected abstract String getUndoDescription();
-
- public WSDLElement getNewComponent()
- {
- return newComponent;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getName()
- {
- return name;
- }
-
- public abstract void setRefName(String refName);
- public abstract String getRefName();
-
-
- public void generate()
- {
- try
- {
- beginRecording();
-
- ContentGeneratorExtension extension = WSDLEditorPlugin.getInstance().getContentGeneratorExtensionRegistry().getContentGeneratorExtension(protocol);
- if (extension != null)
- {
- bindingContentGenerator = extension.createBindingContentGenerator();
- }
-
- if (bindingContentGenerator == null)
- {
- bindingContentGenerator = new EmptyBindingContentGenerator();
- }
-
- bindingContentGenerator.init(getDefinition(), this, options);
-
- Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(getDefinition());
- if (definitionElement != null)
- {
- AddNamespaceDeclarationsAction action =
- new AddNamespaceDeclarationsAction(definitionElement, bindingContentGenerator.getRequiredNamespaces(), bindingContentGenerator.getPreferredNamespacePrefixes());
- action.run();
- }
-
- generateContent();
- format();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- endRecording();
- }
- }
-
- public void setProtocol(String protocol)
- {
- this.protocol = protocol;
- }
-
- public void setOptions(Object[] options)
- {
- this.options = options;
- }
-
- public String getProtocol()
- {
- return protocol;
- }
-
- public void setOverwrite(boolean overwrite)
- {
- this.overwrite = overwrite;
- }
-
- public boolean getOverwrite()
- {
- return overwrite;
- }
-
- class EmptyBindingContentGenerator implements ContentGenerator
- {
- public void init(Definition definition, Object generator, Object[] options)
- {
- }
-
- public String[] getRequiredNamespaces()
- {
- return new String[0];
- }
-
- public String[] getPreferredNamespacePrefixes()
- {
- return new String[0];
- }
-
- public void generatePortContent(Element portElement, Port port)
- {
- }
-
- public void generateBindingContent(Element bindingElement, PortType portType)
- {
- }
-
- public void generateBindingOperationContent(Element bindingOperationElement, Operation operation)
- {
- }
-
- public void generateBindingInputContent(Element bindingInputElement, Input input)
- {
- }
-
- public void generateBindingOutputContent(Element bindingOutputElement, Output output)
- {
- }
-
- public void generateBindingFaultContent(Element bindingFaultElement, Fault fault)
- {
- }
- }
-
- public void beginRecording()
- {
- Node node = getParentNode();
- if (node instanceof XMLNode)
- {
- ((XMLNode) node).getModel().beginRecording(this, getUndoDescription());
- }
- }
-
- public void endRecording()
- {
- Node node = getParentNode();
- if (node instanceof XMLNode)
- {
- ((XMLNode) node).getModel().endRecording(this);
- }
- }
-
- protected void format()
- {
- Node node = getParentNode();
- if (node instanceof XMLNode)
- {
- // tell the model that we are about to make a big model change
- //model.aboutToChangeModel();
-
- // format selected node
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((XMLNode)node);
-
- // tell the model that we are done with the big model change
- //model.changedModel();
- }
- }
-
- protected Element createWSDLElement(Element parentElement, String elementName)
- {
- String prefix = parentElement.getPrefix();
- String name = prefix != null ? (prefix + ":" + elementName) : elementName;
- Element result = parentElement.getOwnerDocument().createElementNS(WSDLConstants.WSDL_NAMESPACE_URI ,name);
- parentElement.appendChild(result);
- return result;
- }
-
- protected Element createElement(Element parentElement, String prefix, String elementName)
- {
- String name = prefix != null ? (prefix + ":" + elementName) : elementName;
- // TODO... consider createElementNS for these elements too
- //
- Element result = parentElement.getOwnerDocument().createElement(name);
- parentElement.appendChild(result);
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/BindingGenerator.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/BindingGenerator.java
deleted file mode 100644
index c90c778..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/BindingGenerator.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddElementAction;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class BindingGenerator extends AbstractGenerator
-{
- protected Definition definition;
- protected String portTypeName;
- protected boolean generateBindingBody = true;
-
- public BindingGenerator(Definition definition)
- {
- this.definition = definition;
- }
-
- public void setGenerateBindingBody(boolean generateBindingBody)
- {
- this.generateBindingBody = generateBindingBody;
- }
-
- public int getType()
- {
- return BINDING_GENERATOR;
- }
-
- public Definition getDefinition()
- {
- return this.definition;
- }
-
- protected String getUndoDescription()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_MENUBAR_GENERATE_BINDING");
- }
-
- public void setRefName(String refName)
- {
- setPortTypeName(refName);
- }
-
- public String getRefName()
- {
- return portTypeName;
- }
-
- public void setPortTypeName(String portTypeName)
- {
- this.portTypeName = portTypeName;
- }
-
- public String getPortTypeName()
- {
- return portTypeName;
- }
-
- class BindingOperationTable
- {
- HashMap map = new HashMap();
-
- public void addBinding(Binding binding)
- {
- for (Iterator i = binding.getEBindingOperations().iterator(); i.hasNext();)
- {
- putBindingOperation((BindingOperation) i.next());
- }
- }
-
- public void putBindingOperation(BindingOperation bindingOperation)
- {
- String key = bindingOperation.getName();
- List list = (List) map.get(key);
- if (list == null)
- {
- list = new ArrayList();
- map.put(key, list);
- }
- if (!list.contains(bindingOperation))
- {
- list.add(bindingOperation);
- }
- }
-
- public BindingOperation lookupBindingOperation(Operation operation)
- {
- BindingOperation bindingOperation = null;
-
- List list = (List) map.get(operation.getName());
- if (list != null && list.size() > 0)
- {
- bindingOperation = (BindingOperation) list.get(0);
- }
-
- return bindingOperation;
- }
- }
-
- public void generateContent()
- {
- Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
-
- Binding binding = getOrCreateBinding(name, definitionElement);
- newComponent = binding;
- if (binding != null)
- {
- ComponentReferenceUtil.setPortTypeReference(binding, portTypeName != null ? portTypeName : "");
- }
-
- Element bindingElement = binding != null ? WSDLEditorUtil.getInstance().getElementForObject(binding) : null;
-
- if (bindingElement != null)
- {
- if (overwrite)
- {
- List nodes = new ArrayList();
- for (Node node = bindingElement.getFirstChild(); node != null; node = node.getNextSibling())
- {
- nodes.add(node);
- }
- for (Iterator i = nodes.iterator(); i.hasNext();)
- {
- Node node = (Node) i.next();
- bindingElement.removeChild(node);
- }
- }
-
- generatePortContent(binding);
- PortType portType = binding.getEPortType();
-
- if (binding.getEExtensibilityElements().size() == 0)
- {
- bindingContentGenerator.generateBindingContent(bindingElement, portType);
- }
-
- if (portType != null && generateBindingBody)
- {
- BindingOperationTable table = new BindingOperationTable();
- table.addBinding(binding);
-
- for (Iterator i = portType.getEOperations().iterator(); i.hasNext();)
- {
- Operation operation = (Operation) i.next();
- BindingOperation bindingOperation = table.lookupBindingOperation(operation);
- if (bindingOperation == null)
- {
- generateBindingOperation(binding, bindingElement, operation);
- }
- }
- }
-
- }
- }
-
- protected void generatePortContent(Binding binding)
- {
- for (Iterator i = definition.getEServices().iterator(); i.hasNext();)
- {
- Service service = (Service) i.next();
- /*
- for (Iterator j = service.getEPorts().iterator(); j.hasNext();)
- {
- Port port = (Port) j.next();
- if (port.getBinding() == binding)
- {
- if (port.getEExtensibilityElements().size() == 0)
- {
- Element portElement = WSDLUtil.getInstance().getElementForObject(port);
- bindingContentGenerator.generatePortContent(portElement, port);
- }
- }
- }*/
- }
- }
-
- protected void generateBindingOperation(Binding binding, Element bindingElement, Operation operation)
- {
- Element bindingOperationElement = createWSDLElement(bindingElement, "operation");
- bindingOperationElement.setAttribute("name", operation.getName());
- bindingContentGenerator.generateBindingOperationContent(bindingOperationElement, operation);
-
- Input input = operation.getEInput();
- if (input != null)
- {
- Element bindingInputElement = createWSDLElement(bindingOperationElement, "input");
- if (input.getName() != null)
- {
- bindingInputElement.setAttribute("name", input.getName());
- }
- bindingContentGenerator.generateBindingInputContent(bindingInputElement, input);
- }
-
- Output output = operation.getEOutput();
- if (output != null)
- {
- Element bindingOutputElement = createWSDLElement(bindingOperationElement, "output");
- if (output.getName() != null)
- {
- bindingOutputElement.setAttribute("name", output.getName());
- }
- bindingContentGenerator.generateBindingOutputContent(bindingOutputElement, output);
- }
-
- for (Iterator i = operation.getEFaults().iterator(); i.hasNext();)
- {
- Fault fault = (Fault) i.next();
-
- Element bindingFaultElement = createWSDLElement(bindingOperationElement, "fault");
- if (fault.getName() != null)
- {
- bindingFaultElement.setAttribute("name", fault.getName());
- }
- bindingContentGenerator.generateBindingFaultContent(bindingFaultElement, fault);
- }
- }
-
- protected Binding getOrCreateBindingHelper(String name)
- {
- Binding result = null;
- if (name != null)
- {
- for (Iterator i = getDefinition().getEBindings().iterator(); i.hasNext();)
- {
- Binding binding = (Binding) i.next();
- String bindingName = binding.getQName().getLocalPart();
- if (name.equals(bindingName))
- {
- result = binding;
- break;
- }
- }
- }
- return result;
- }
-
- protected Binding getOrCreateBinding(String name, Element definitionElement)
- {
- Binding result = getOrCreateBindingHelper(name);
- if (result == null)
- {
- String prefix = definition.getPrefix(WSDLConstants.WSDL_NAMESPACE_URI);
- AddBindingAction action = new AddBindingAction(definition, name, definitionElement, prefix);
- action.run();
- result = getOrCreateBindingHelper(name);
- }
- return result;
- }
-
- public Node getParentNode()
- {
- return WSDLEditorUtil.getInstance().getElementForObject(definition);
- }
-}
-
-class AddBindingAction extends AddElementAction
-{
- protected String name;
- protected Definition definition;
-
- public AddBindingAction(Definition definition, String name, Node parentNode, String prefix)
- {
- super("binding", "icons/binding_obj.gif", parentNode, prefix, "binding");
- this.definition = definition;
- this.name = name;
- setComputeTopLevelRefChild(true);
- }
-
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("name", name);
- newElement.setAttribute("type", "");
- }
-
- public String getBindingName()
- {
- return name;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGenerator.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGenerator.java
deleted file mode 100644
index ff3bfc7..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGenerator.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.w3c.dom.Element;
-
-
-
-public interface ContentGenerator
-{
-
- public static String ADDRESS_LOCATION = "http://tempuri.org/";
- public void init(Definition definition, Object generator, Object[] options);
-
- public String[] getRequiredNamespaces();
-
- public String[] getPreferredNamespacePrefixes();
-
- // generates the 'address' extensiblity element for a port
- //
- public void generatePortContent(Element portElement, Port port);
-
- public void generateBindingContent(Element bindingElement, PortType portType);
-
- public void generateBindingOperationContent(Element bindingOperationElement, Operation operation);
-
- public void generateBindingInputContent(Element bindingInputElement, Input input);
-
- public void generateBindingOutputContent(Element bindingOutputElement, Output output);
-
- public void generateBindingFaultContent(Element bindingFaultElement, Fault fault);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorExtension.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorExtension.java
deleted file mode 100644
index bd3eafc..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorExtension.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator;
-
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.ContentGeneratorOptionsPage;
-
-public class ContentGeneratorExtension
-{
- protected String name;
- protected String namespace;
- protected ClassLoader classLoader;
- protected String contentGeneratorClassName;
- protected String portOptionsPageClassName;
- protected String bindingOptionsPageClassName;
-
- public ContentGeneratorExtension(String name, String contentGeneratorClassName)
- {
- this.name = name;
- this.contentGeneratorClassName = contentGeneratorClassName;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setClassLoader(ClassLoader classLoader)
- {
- this.classLoader = classLoader;
- }
-
- public ContentGenerator createBindingContentGenerator()
- {
- ContentGenerator result = null;
- if (contentGeneratorClassName != null)
- {
- try
- {
- Class theClass = classLoader != null ? classLoader.loadClass(contentGeneratorClassName) : Class.forName(contentGeneratorClassName);
- result = (ContentGenerator) theClass.newInstance();
- }
- catch (Exception e)
- {
- }
- }
- return result;
- }
-
- public ContentGeneratorOptionsPage createBindingContentGeneratorOptionsPage()
- {
- ContentGeneratorOptionsPage result = null;
- if (bindingOptionsPageClassName != null)
- {
- try
- {
- Class theClass = classLoader != null ? classLoader.loadClass(bindingOptionsPageClassName) : Class.forName(bindingOptionsPageClassName);
- result = (ContentGeneratorOptionsPage) theClass.newInstance();
- }
- catch (Exception e)
- {
- }
- }
- return result;
- }
-
- public ContentGeneratorOptionsPage createPortContentGeneratorOptionsPage()
- {
- ContentGeneratorOptionsPage result = null;
- if (portOptionsPageClassName != null)
- {
- try
- {
- Class theClass = classLoader != null ? classLoader.loadClass(portOptionsPageClassName) : Class.forName(portOptionsPageClassName);
- result = (ContentGeneratorOptionsPage) theClass.newInstance();
- }
- catch (Exception e)
- {
- }
- }
- return result;
- }
-
- public void setBindingOptionsPageClassName(String string)
- {
- bindingOptionsPageClassName = string;
- }
-
- public void setPortOptionsPageClassName(String string)
- {
- portOptionsPageClassName = string;
- }
-
- public String getNamespace()
- {
- return namespace;
- }
-
- public void setNamespace(String string)
- {
- namespace = string;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorExtensionRegistry.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorExtensionRegistry.java
deleted file mode 100644
index 7a45bac..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorExtensionRegistry.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-public class ContentGeneratorExtensionRegistry
-{
- protected List staticExtensionList = new ArrayList();
- protected List dynamicExtensionList = new ArrayList();
-
- public void add(ContentGeneratorExtension extension)
- {
- staticExtensionList.add(extension);
- }
-
- public void add(ContentGeneratorProviderExtension extension)
- {
- dynamicExtensionList.add(extension);
- }
-
- public List getRegisteredExtensionList()
- {
- List list = new ArrayList();
- list.addAll(staticExtensionList);
- for (Iterator i = dynamicExtensionList.iterator(); i.hasNext();)
- {
- try
- {
- ContentGeneratorProviderExtension dynamicExtension = (ContentGeneratorProviderExtension) i.next();
- ContentGeneratorProvider provider = dynamicExtension.createContentGeneratorProvider();
- List dynamicallyContributedExtensions = provider.getContentGeneratorExtensions();
- if (dynamicallyContributedExtensions != null)
- {
- list.addAll(dynamicallyContributedExtensions);
- }
- }
- catch (Exception e)
- {
- }
- }
- return list;
- }
-
- public List getBindingExtensionNames()
- {
- List list = new ArrayList();
- for (Iterator i = getRegisteredExtensionList().iterator(); i.hasNext();)
- {
- ContentGeneratorExtension extension = (ContentGeneratorExtension) i.next();
- list.add(extension.getName());
- }
- return list;
- }
-
- public ContentGeneratorExtension getExtensionForNamespace(String namespace)
- {
- ContentGeneratorExtension result = null;
- if (namespace != null)
- {
- for (Iterator i = getRegisteredExtensionList().iterator(); i.hasNext();)
- {
- ContentGeneratorExtension extension = (ContentGeneratorExtension) i.next();
- if (namespace.equals(extension.getNamespace()))
- {
- result = extension;
- break;
- }
- }
- }
- return result;
- }
-
- public ContentGeneratorExtension getExtensionForName(String name)
- {
- ContentGeneratorExtension result = null;
- if (name != null)
- {
- for (Iterator i = getRegisteredExtensionList().iterator(); i.hasNext();)
- {
- ContentGeneratorExtension extension = (ContentGeneratorExtension) i.next();
- if (name.equals(extension.getName()))
- {
- result = extension;
- break;
- }
- }
- }
- return result;
- }
-
- /*
- * @deprecated - use getExtensionForName
- */
- public ContentGeneratorExtension getContentGeneratorExtension(String name)
- {
- return getExtensionForName(name);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorProvider.java
deleted file mode 100644
index fadfb59..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorProvider.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator;
-
-import java.util.List;
-
-public interface ContentGeneratorProvider
-{
- public List getContentGeneratorExtensions();
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorProviderExtension.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorProviderExtension.java
deleted file mode 100644
index cc02f92..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ContentGeneratorProviderExtension.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator;
-
-public class ContentGeneratorProviderExtension
-{
- protected String className;
- protected ClassLoader classLoader;
-
- public ContentGeneratorProviderExtension(String className)
- {
- this.className = className;
- }
-
- public void setClassLoader(ClassLoader classLoader)
- {
- this.classLoader = classLoader;
- }
-
- public ContentGeneratorProvider createContentGeneratorProvider()
- {
- ContentGeneratorProvider result = null;
- if (className != null)
- {
- try
- {
- Class theClass = classLoader != null ? classLoader.loadClass(className) : Class.forName(className);
- result = (ContentGeneratorProvider) theClass.newInstance();
- }
- catch (Exception e)
- {
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/HttpContentGenerator.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/HttpContentGenerator.java
deleted file mode 100644
index 198f78a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/HttpContentGenerator.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.w3c.dom.Element;
-
-
-public class HttpContentGenerator implements ContentGenerator
-{
- protected Definition definition;
- protected boolean isPost;
- protected String addressLocation = ContentGenerator.ADDRESS_LOCATION;
-
- protected final static String[] requiredNamespaces = { "http://schemas.xmlsoap.org/wsdl/mime/", "http://schemas.xmlsoap.org/wsdl/http/" };
- protected final static String[] preferredNamespacePrefixes = { "mime", "http" };
-
- public void init(Definition definition, Object generator, Object[] options)
- {
- this.definition = definition;
-
- if (options != null)
- {
- if (options.length > 0 && options[0] != null)
- {
- Boolean isPostOption = (Boolean) options[0];
- isPost = isPostOption.booleanValue();
- }
- if (options.length > 1 && options[1] != null)
- {
- addressLocation = (String) options[1];
- }
- }
- }
-
- public String[] getRequiredNamespaces()
- {
- return requiredNamespaces;
- }
-
- public String[] getPreferredNamespacePrefixes()
- {
- return preferredNamespacePrefixes;
- }
-
- public void generatePortContent(Element portElement, Port port)
- {
- Element element = createElement(portElement, "http", "address");
- element.setAttribute("location", addressLocation);
- }
-
- public void generateBindingContent(Element bindingElement, PortType portType)
- {
- Element element = createElement(bindingElement, "http", "binding");
- element.setAttribute("verb", isPost ? "POST" : "GET");
- }
-
- public void generateBindingOperationContent(Element bindingOperationElement, Operation operation)
- {
- Element element = createElement(bindingOperationElement, "http", "operation");
- element.setAttribute("location", "/" + operation.getName());
- }
-
- public void generateBindingInputContent(Element bindingInputElement, Input input)
- {
- if (isPost)
- {
- Element element = createElement(bindingInputElement, "mime", "content");
- element.setAttribute("type", "application/x-www-form-urlencoded");
- }
- else
- {
- Element element = createElement(bindingInputElement, "http", "urlEncoded");
- }
- }
-
- public void generateBindingOutputContent(Element bindingOutputElement, Output output)
- {
- Element element = createElement(bindingOutputElement, "mime", "content");
- element.setAttribute("type", "text/xml");
- }
-
- public void generateBindingFaultContent(Element bindingFaultElement, Fault fault)
- {
- //TODO!!
- }
-
- protected Element createElement(Element parentElement, String prefix, String elementName)
- {
- String name = prefix != null ? (prefix + ":" + elementName) : elementName;
- Element result = parentElement.getOwnerDocument().createElement(name);
- parentElement.appendChild(result);
- return result;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/PortGenerator.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/PortGenerator.java
deleted file mode 100644
index 98ef341..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/PortGenerator.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class PortGenerator extends AbstractGenerator
-{
- protected Service service;
- protected String bindingName;
-
- public PortGenerator(Service service)
- {
- this.service = service;
- }
-
- public int getType()
- {
- return PORT_GENERATOR;
- }
-
- public Definition getDefinition()
- {
- return service.getEnclosingDefinition();
- }
-
- public Service getService()
- {
- return service;
- }
-
- public Node getParentNode()
- {
- return WSDLEditorUtil.getInstance().getElementForObject(service);
- }
-
- protected String getUndoDescription()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_PORT");
- }
-
- public void setRefName(String refName)
- {
- setBindingName(refName);
- }
-
- public String getRefName()
- {
- return bindingName;
- }
-
- public void setBindingName(String bindingName)
- {
- this.bindingName = bindingName;
- }
-
- public void generateContent()
- {
- Element portElement = null;
- for (Iterator i = service.getEPorts().iterator(); i.hasNext();)
- {
- Port port = (Port) i.next();
- if (port.getName().equals(name))
- {
- portElement = WSDLEditorUtil.getInstance().getElementForObject(port);
- }
- }
-
- boolean doGenerateContent = false;
- if (portElement == null)
- {
- Element serviceElement = WSDLEditorUtil.getInstance().getElementForObject(service);
- portElement = createWSDLElement(serviceElement, "port");
- portElement.setAttribute("name", name);
- doGenerateContent = true;
- }
- else
- {
- doGenerateContent = overwrite;
- }
-
- portElement.setAttribute("binding", bindingName != null ? bindingName : "");
- Port port = (Port) WSDLEditorUtil.getInstance().findModelObjectForElement(getDefinition(), portElement);
- newComponent = port;
-
- //portElement.
- bindingContentGenerator.generatePortContent(portElement, port);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/SoapContentGenerator.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/SoapContentGenerator.java
deleted file mode 100644
index eebf52f..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/SoapContentGenerator.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.w3c.dom.Element;
-
-
-public class SoapContentGenerator implements ContentGenerator
-{
- private final int DOCUMENT_LITERAL = 1;
- private final int RPC_LITERAL = 2;
- private final int RPC_ENCODED = 3;
-
- protected int bindingOption = DOCUMENT_LITERAL;
- protected String namespaceValue = "";
- protected String addressLocation = ContentGenerator.ADDRESS_LOCATION;
- protected Definition definition;
-
- protected final static String[] requiredNamespaces = {"http://schemas.xmlsoap.org/wsdl/soap/"};
- protected final static String[] preferredNamespacePrefixes = {"soap"};
-
-
- public void init(Definition definition, Object generator, Object[] options)
- {
- this.definition = definition;
-
- if (options != null)
- {
- bindingOption = computeBindingOption(options);
-
- if (options.length > 1 && options[1] != null)
- {
- addressLocation = (String)options[1];
- }
- }
- if (definition.getTargetNamespace() != null)
- {
- namespaceValue = definition.getTargetNamespace();
- }
- }
-
- private int computeBindingOption(Object[] options) {
- int option = DOCUMENT_LITERAL;
- if (options.length > 0 && options[0] != null)
- {
- boolean isDocumentLiteralOption = ((Boolean)options[0]).booleanValue();
- if (isDocumentLiteralOption)
- option = DOCUMENT_LITERAL;
- else
- option = RPC_ENCODED;
-
- if (options.length >= 3 && options[2] != null) {
- // Extra info sent in
- if (((Boolean)options[2]).booleanValue())
- option = RPC_LITERAL;
- }
- }
-
- return option;
- }
-
- public String[] getRequiredNamespaces()
- {
- return requiredNamespaces;
- }
-
- public String[] getPreferredNamespacePrefixes()
- {
- return preferredNamespacePrefixes;
- }
-
- public void generatePortContent(Element portElement, Port port)
- {
- Element element = createElement(portElement, "soap", "address");
- element.setAttribute("location", addressLocation);
- }
-
- public void generateBindingContent(Element bindingElement, PortType portType)
- {
- Element element = createElement(bindingElement, "soap", "binding");
- element.setAttribute("style", (bindingOption == DOCUMENT_LITERAL) ? "document" : "rpc");
- element.setAttribute("transport", "http://schemas.xmlsoap.org/soap/http");
- }
-
- public void generateBindingOperationContent(Element bindingOperationElement, Operation operation)
- {
- Element element = createElement(bindingOperationElement, "soap", "operation");
-
- String soapActionValue = namespaceValue;
- if (!soapActionValue.endsWith("/"))
- {
- soapActionValue += "/";
- }
- soapActionValue += operation.getName();
- element.setAttribute("soapAction", soapActionValue);
- }
-
- public void generateBindingInputContent(Element bindingInputElement, Input input)
- {
- generateSoapBody(bindingInputElement);
- }
-
- public void generateBindingOutputContent(Element bindingOutputElement, Output output)
- {
- generateSoapBody(bindingOutputElement);
- }
-
- public void generateBindingFaultContent(Element bindingFaultElement, Fault fault)
- {
- Element element = createElement(bindingFaultElement, "soap", "fault");
- element.setAttribute("name", fault.getName());
- element.setAttribute("use", (bindingOption == RPC_ENCODED) ? "encoded" : "literal");
- if (bindingOption == RPC_ENCODED)
- {
- element.setAttribute("encodingStyle", "http://schemas.xmlsoap.org/soap/encoding/");
- element.setAttribute("namespace", namespaceValue);
- }
- else if (bindingOption == RPC_LITERAL) {
- element.setAttribute("namespace", namespaceValue);
- }
- }
-
- protected void generateSoapBody(Element parentElement)
- {
- String soapActionValue = "";
- if (definition.getTargetNamespace() != null)
- {
- soapActionValue = definition.getTargetNamespace();
- }
-
- Element element = createElement(parentElement, "soap", "body");
- element.setAttribute("use", (bindingOption == RPC_ENCODED) ? "encoded" : "literal");
- if (bindingOption == RPC_ENCODED)
- {
- element.setAttribute("encodingStyle", "http://schemas.xmlsoap.org/soap/encoding/");
- element.setAttribute("namespace", namespaceValue);
- }
- else if (bindingOption == RPC_LITERAL) {
- element.setAttribute("namespace", namespaceValue);
- }
- }
-
- protected Element createElement(Element parentElement, String prefix, String elementName)
- {
- String name = prefix != null ? (prefix + ":" + elementName) : elementName;
- Element result = parentElement.getOwnerDocument().createElement(name);
- parentElement.appendChild(result);
- return result;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/ContentGeneratorOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/ContentGeneratorOptionsPage.java
deleted file mode 100644
index ac83097..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/ContentGeneratorOptionsPage.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.AbstractGenerator;
-
-
-public interface ContentGeneratorOptionsPage
-{
- public void init(AbstractGenerator abstractGenerator);
- public Composite createControl(Composite parent);
- public boolean isOverwriteApplicable();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/HttpBindingOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/HttpBindingOptionsPage.java
deleted file mode 100644
index 1586ad4..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/HttpBindingOptionsPage.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-
-import org.eclipse.swt.SWT;
-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.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.AbstractGenerator;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-
-public class HttpBindingOptionsPage implements ContentGeneratorOptionsPage, SelectionListener
-{
- protected Button getButton;
- protected Button postButton;
- protected Composite control;
- protected AbstractGenerator generator;
-
- public HttpBindingOptionsPage()
- {
- }
-
- public void init(AbstractGenerator generator)
- {
- this.generator = generator;
- }
-
- public Composite createControl(Composite parent)
- {
- control = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- control.setLayout(layout);
-
- Label separator = new Label(control, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
-
- separator.setLayoutData(gd);
-
- Label optionsHeading = new Label(control, SWT.NONE);
- optionsHeading.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_HTTP_BINDING_OPTIONS"));
-
- getButton = new Button(control, SWT.RADIO);
- getButton.setText("HTTP GET");
- getButton.setSelection(true);
-
- postButton = new Button(control, SWT.RADIO);
- postButton.setText("HTTP POST");
-
- if (generator.getName() != null)
- {
- Definition definition = generator.getDefinition();
- QName qname = new QName(definition.getTargetNamespace(), generator.getName());
- Binding binding = (Binding) definition.getBinding(qname);
- if (binding != null)
- {
- List eeList = binding.getEExtensibilityElements();
- if (eeList.size() > 0)
- {
- ExtensibilityElement ee = (ExtensibilityElement) eeList.get(0);
- Element element = WSDLEditorUtil.getInstance().getElementForObject(ee);
- String verb = element.getAttribute("verb");
- if ("POST".equals(verb))
- {
- getButton.setSelection(false);
- postButton.setSelection(true);
- }
- }
- }
- }
-
- postButton.addSelectionListener(this);
- getButton.addSelectionListener(this);
- computeOptions();
-
- return control;
- }
-
- public boolean isOverwriteApplicable()
- {
- return true;
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- computeOptions();
- }
-
- protected void computeOptions()
- {
- Object[] options = new Object[1];
- options[0] = new Boolean(postButton.getSelection());
- generator.setOptions(options);
- }
-
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/HttpPortOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/HttpPortOptionsPage.java
deleted file mode 100644
index 5d893cd..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/HttpPortOptionsPage.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.AbstractGenerator;
-
-
-public class HttpPortOptionsPage implements ContentGeneratorOptionsPage, ModifyListener
-{
- protected Text addressField;
- protected Composite control;
- protected AbstractGenerator generator;
-
- public HttpPortOptionsPage()
- {
- }
-
- public void init(AbstractGenerator generator)
- {
- this.generator = generator;
- }
-
- public Composite createControl(Composite parent)
- {
- control = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- control.setLayout(layout);
- control.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label separator = new Label(control, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
- separator.setLayoutData(gd);
-
- Label optionsHeading = new Label(control, SWT.NONE);
- optionsHeading.setText(WSDLEditorPlugin.getWSDLString("_UI_HTTP_PORT_DETAILS"));
-
- Composite nameValueGroup = new Composite(control, SWT.NONE);
- nameValueGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout layout2 = new GridLayout(2, false);
- layout2.marginWidth = 0;
- nameValueGroup.setLayout(layout2);
-
- Label addressLabel = new Label(nameValueGroup, SWT.NONE);
- addressLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LOCATION") + " ");
- addressField = new Text(nameValueGroup, SWT.BORDER);
- addressField.setText("http://example.com/");
- addressField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- addressField.addModifyListener(this);
-
- return control;
- }
-
- public boolean isOverwriteApplicable()
- {
- return false;
- }
-
- public void modifyText(ModifyEvent e)
- {
- Object[] options = new Object[2];
- options[1] = addressField.getText();
- generator.setOptions(options);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/SoapBindingOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/SoapBindingOptionsPage.java
deleted file mode 100644
index 09bf020..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/SoapBindingOptionsPage.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-
-import org.eclipse.swt.SWT;
-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.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.AbstractGenerator;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-
-public class SoapBindingOptionsPage implements ContentGeneratorOptionsPage, SelectionListener
-{
- protected Button docLiteral;
- protected Button rpcLiteral;
- protected Button rpcEncoded;
- protected Composite control;
- protected AbstractGenerator generator;
-
- public SoapBindingOptionsPage()
- {
- }
-
- public void init(AbstractGenerator generator)
- {
- this.generator = generator;
- }
-
- public Composite createControl(Composite parent)
- {
- control = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- control.setLayout(layout);
-
- Label separator = new Label(control, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
- separator.setLayoutData(gd);
-
- Label optionsHeading = new Label(control, SWT.NONE);
- optionsHeading.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_SOAP_BINDING_OPTIONS"));
-
- docLiteral = new Button(control, SWT.RADIO);
- docLiteral.setText(WSDLEditorPlugin.getWSDLString("_UI_RADIO_DOCUMENT_LITERAL"));
- docLiteral.setSelection(true);
-
- rpcLiteral = new Button(control, SWT.RADIO);
- rpcLiteral.setText(WSDLEditorPlugin.getWSDLString("_UI_RADIO_RPC_LITERAL"));
-
- rpcEncoded = new Button(control, SWT.RADIO);
- rpcEncoded.setText(WSDLEditorPlugin.getWSDLString("_UI_RADIO_RPC_ENCODED"));
-
- if (generator.getName() != null)
- {
- Definition definition = generator.getDefinition();
- QName qname = new QName(definition.getTargetNamespace(), generator.getName());
- Binding binding = (Binding) definition.getBinding(qname);
- if (binding != null)
- {
- List eeList = binding.getEExtensibilityElements();
- if (eeList.size() > 0)
- {
- ExtensibilityElement ee = (ExtensibilityElement) eeList.get(0);
-
- Element element = WSDLEditorUtil.getInstance().getElementForObject(ee);
- String style = element.getAttribute("style");
-
- if ("rpc".equals(style))
- {
- // Try to determine if it's RPC Literal or RPC Encoded
- String use = "encoded";
- List operations = binding.getEBindingOperations();
- if (operations.size() > 0) {
- element = null;
- BindingOperation operation = (BindingOperation) operations.get(0);
- if (operation.getEBindingInput() != null && operation.getEBindingInput().getEExtensibilityElements().size() > 0) {
- Object object = operation.getEBindingInput().getEExtensibilityElements().get(0);
- element = WSDLEditorUtil.getInstance().getElementForObject(object);
- }
- else if (operation.getEBindingOutput() != null && operation.getEBindingOutput().getEExtensibilityElements().size() > 0) {
- Object object = operation.getEBindingOutput().getEExtensibilityElements().get(0);
- element = WSDLEditorUtil.getInstance().getElementForObject(object);
- }
- else if (operation.getEBindingFaults().size() > 0) {
- BindingFault fault = (BindingFault) operation.getEBindingFaults().get(0);
- List faultEE = fault.getExtensibilityElements();
-
- if (faultEE.size() > 0) {
- element = WSDLEditorUtil.getInstance().getElementForObject(faultEE.get(0));
- }
- }
-
- if (element != null) {
- use = element.getAttribute("use");
- }
- }
-
- if (use != null && "literal".equals(use)) {
- docLiteral.setSelection(false);
- rpcLiteral.setSelection(true);
- rpcEncoded.setSelection(false);
- }
- else {
- docLiteral.setSelection(false);
- rpcLiteral.setSelection(false);
- rpcEncoded.setSelection(true);
- }
- }
- }
- }
- }
-
- docLiteral.addSelectionListener(this);
- rpcLiteral.addSelectionListener(this);
- rpcEncoded.addSelectionListener(this);
- computeOptions();
-
- return control;
- }
-
- public boolean isOverwriteApplicable()
- {
- return true;
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- computeOptions();
- }
-
- protected void computeOptions()
- {
- Object[] options = new Object[3];
- options[0] = new Boolean(docLiteral.getSelection());
- options[2] = new Boolean(rpcLiteral.getSelection());
- generator.setOptions(options);
- }
-
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/SoapPortOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/SoapPortOptionsPage.java
deleted file mode 100644
index 58bc607..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/contentgenerator/ui/SoapPortOptionsPage.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.AbstractGenerator;
-
-
-public class SoapPortOptionsPage implements ContentGeneratorOptionsPage, ModifyListener
-{
- protected Text addressField;
- protected Composite control;
- protected AbstractGenerator generator;
-
- public SoapPortOptionsPage()
- {
- }
-
- public void init(AbstractGenerator generator)
- {
- this.generator = generator;
- }
-
- public Composite createControl(Composite parent)
- {
- control = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- control.setLayout(layout);
- control.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label separator = new Label(control, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
- separator.setLayoutData(gd);
-
- Label optionsHeading = new Label(control, SWT.NONE);
- optionsHeading.setText(WSDLEditorPlugin.getWSDLString("_UI_SOAP_PORT_DETAILS"));
-
- Composite nameValueGroup = new Composite(control, SWT.NONE);
- nameValueGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout layout2 = new GridLayout(2, false);
- layout2.marginWidth = 0;
- nameValueGroup.setLayout(layout2);
-
- Label addressLabel = new Label(nameValueGroup, SWT.NONE);
- addressLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LOCATION") + " ");
- addressField = new Text(nameValueGroup, SWT.BORDER);
- addressField.setText("http://example.com/");
- addressField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- addressField.addModifyListener(this);
-
- return control;
- }
-
- public boolean isOverwriteApplicable()
- {
- return false;
- }
-
- public void modifyText(ModifyEvent e)
- {
- Object[] options = new Object[2];
- options[1] = addressField.getText();
- generator.setOptions(options);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/dialogs/ImportAddResourceListener.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/dialogs/ImportAddResourceListener.java
deleted file mode 100644
index b696cad..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/dialogs/ImportAddResourceListener.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.dialogs;
-
-import java.util.Collection;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-
-public class ImportAddResourceListener implements IResourceChangeListener, IResourceDeltaVisitor
-{
- Vector importedFiles;
-
- ImportAddResourceListener()
- {
- importedFiles = new Vector();
- }
-
- public void resourceChanged(IResourceChangeEvent event)
- {
- IResourceDelta resourceDelta = event.getDelta();
-
- try
- {
- if (resourceDelta != null)
- {
- resourceDelta.accept(this);
- }
- }
- catch (Exception e)
- {
-// B2BGUIPlugin.getPlugin().getMsgLogger().write("Exception caught during resource change" + e);
-// B2BGUIPlugin.getPlugin().getMsgLogger().writeCurrentThread();
- }
- }
-
- public boolean visit(IResourceDelta delta)
- {
- if (delta.getKind() == IResourceDelta.ADDED)
- {
- if (delta.getResource() instanceof IFile)
- importedFiles.add(delta.getResource());
- }
- return true;
- }
-
- public Collection getImportedFiles()
- {
- return importedFiles;
- }
-
- // This returns the first imported file in the list of imported files
- public IFile getImportedFile()
- {
- if (importedFiles.isEmpty() == false)
- return (IFile)importedFiles.firstElement();
-
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/dialogs/InvokeSetDialog.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/dialogs/InvokeSetDialog.java
deleted file mode 100644
index ec30109..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/dialogs/InvokeSetDialog.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.dialogs;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.wizards.SetBindingWizard;
-import org.eclipse.wst.wsdl.ui.internal.wizards.SetComponentWizard;
-import org.eclipse.wst.wsdl.ui.internal.wizards.SetMessageWizard;
-import org.eclipse.wst.wsdl.ui.internal.wizards.SetPortTypeWizard;
-
-public class InvokeSetDialog
-{
- String kind;
- String newValue = "";
-
- public void setReferenceKind(String kind)
- {
- this.kind = kind;
- }
-
- public String getValue()
- {
- return newValue;
- }
-
- public void run(Object input, IEditorPart editorPart)
- {
- if (input instanceof Binding)
- {
- SetPortTypeWizard wiz = new SetPortTypeWizard(input, editorPart);
- SetXWizardDialog dialog = new SetXWizardDialog(WSDLEditorPlugin.getShell(), wiz);
- dialog.setBlockOnOpen(true);
- dialog.create();
- dialog.open();
- }
- else if (input instanceof Port)
- {
- SetBindingWizard wiz = new SetBindingWizard(input, editorPart);
- SetXWizardDialog dialog = new SetXWizardDialog(WSDLEditorPlugin.getShell(), wiz);
- dialog.create();
- dialog.open();
- }
- else if (input instanceof Part)
- {
- boolean booleanSwitch = true;
- if (booleanSwitch == true) {
- SetComponentWizard wiz = new SetComponentWizard((Part)input, editorPart);
- SetXWizardDialog dialog = new SetXWizardDialog(WSDLEditorPlugin.getShell(), wiz);
- wiz.setReferenceKind(kind);
- dialog.create();
- dialog.open();
- }
- else {
-// WSDLSetTypeDialog typeDialog = new WSDLSetTypeDialog(WSDLEditorPlugin.getShell(), (Part) input, editorPart, WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_TYPE"), kind);
-// typeDialog.setBlockOnOpen(true);
-// typeDialog.create();
-// int result = typeDialog.open();
- }
- }
- else if (input instanceof Input || input instanceof Output || input instanceof Fault)
- {
- SetMessageWizard wiz = new SetMessageWizard(input, editorPart);
- SetXWizardDialog dialog = new SetXWizardDialog(WSDLEditorPlugin.getShell(), wiz);
- dialog.create();
- dialog.open();
- }
- else if (input == null)
- {
- //error
- }
- }
-
- class SetXWizardDialog extends WizardDialog
- {
- public SetXWizardDialog(Shell parentShell, IWizard newWizard)
- {
- super(parentShell, newWizard);
- setShellStyle(SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL | SWT.RESIZE);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/ExtensibilityItemTreeProviderRegistry.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/ExtensibilityItemTreeProviderRegistry.java
deleted file mode 100644
index 326428b..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/ExtensibilityItemTreeProviderRegistry.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-
-/**
- * This class reads the plugin manifests and registers each extensibility item tree provider
- */
-public class ExtensibilityItemTreeProviderRegistry extends NSKeyedExtensionRegistry
-{
- protected static final String LABEL_PROVIDER_PROPERTY = "labelProviderClass";
- protected static final String CONTENT_PROVIDER_PROPERTY = "contentProviderClass";
- protected static final String[] ATT_NAMES = { "labelProviderClass", "contentProviderClass" };
-
- public ILabelProvider getLabelProvider(String namespace)
- {
- return (ILabelProvider) getProperty(namespace, LABEL_PROVIDER_PROPERTY);
- }
-
- public ITreeChildProvider getContentProvider(String namespace)
- {
- return (ITreeChildProvider) getProperty(namespace, CONTENT_PROVIDER_PROPERTY);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IDetailsViewerProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IDetailsViewerProvider.java
deleted file mode 100644
index d1f474f..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IDetailsViewerProvider.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-
-public interface IDetailsViewerProvider
-{
- public Object getViewerKey(Object modelObject);
- public Viewer createViewer(Object modelObject, Composite parent, IEditorPart editorPart);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IEditPartProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IEditPartProvider.java
deleted file mode 100644
index 01c8237..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IEditPartProvider.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.w3c.dom.Node;
-
-public interface IEditPartProvider
-{
- public void contributeMenuActions(IMenuManager manager, Node node, Object object);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IMenuActionContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IMenuActionContributor.java
deleted file mode 100644
index a1ff915..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IMenuActionContributor.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.w3c.dom.Node;
-
-public interface IMenuActionContributor
-{
- public void contributeMenuActions(IMenuManager manager, Node node, Object object);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IModelQueryContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IModelQueryContributor.java
deleted file mode 100644
index 1d4d80a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/IModelQueryContributor.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-import org.eclipse.wst.xml.core.document.XMLModel;
-
-// Note this class will likely be removed in the future when the ModelQuery's extension mechanism is updated
-//
-public interface IModelQueryContributor
-{
- public void setModel(XMLModel xmlModel);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/INodeAssociationProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/INodeAssociationProvider.java
deleted file mode 100644
index ee956ce..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/INodeAssociationProvider.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public interface INodeAssociationProvider
-{
- public Object getModelObject(Object parentModelObject, Element[] elementChain, int start, int[] end);
- public Node getNode(Object modelObject);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/INodeReconciler.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/INodeReconciler.java
deleted file mode 100644
index 86cfebb..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/INodeReconciler.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-import org.w3c.dom.Element;
-
-
-public interface INodeReconciler
-{
- public void notifyChanged(Object modelObject, Element element, int eventType, Object feature, Object oldValue, Object newValue, int index);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/ITreeChildProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/ITreeChildProvider.java
deleted file mode 100644
index aac380e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/ITreeChildProvider.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-/**
- * This class allows extension writers to provide specialize tree content behaviour.
- * It is intended to behave similar to the org.eclipse.jface.viewers.ITreeContentProvider.
- * The major difference is that this class is simplified so that only one method is involved.
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
-public interface ITreeChildProvider
-{
- public Object[] getChildren(Object object);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/ITypeSystemProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/ITypeSystemProvider.java
deleted file mode 100644
index 4700ede..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/ITypeSystemProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.xsd.XSDSchema;
-
-public interface ITypeSystemProvider
-{
- public static final int UNKNOWN_TYPE = 0x0;
- public static final int BUILT_IN_TYPE = 0x1;
- public static final int USER_DEFINED_SIMPLE_TYPE = 0x2;
- public static final int USER_DEFINED_COMPLEX_TYPE = 0x4;
-
- public List getAvailableTypeNames(Definition definition, int typeNameCategory);
- public List getAvailableElementNames(Definition definition);
- public List getAvailableTypes(Definition definition, XSDSchema schema, int typeNameCategory);
- public int getCategoryForTypeName(Definition definition, String typeName);
- public List getPrefixedNames(Definition definition, String namespace, String localName);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/NSKeyedExtensionRegistry.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/NSKeyedExtensionRegistry.java
deleted file mode 100644
index 03b7ea4..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/NSKeyedExtensionRegistry.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-import java.util.HashMap;
-
-public class NSKeyedExtensionRegistry
-{
- protected HashMap map = new HashMap();
- private static final String PLUGIN_LOADING_ERROR = "PLUGIN_LOADING_ERROR";
-
- public NSKeyedExtensionRegistry()
- {
- }
-
- public void put(String namespaceURI, String className, ClassLoader classLoader)
- {
- ExtensionInfo info = (ExtensionInfo) map.get(namespaceURI);
- if (info == null)
- {
- info = new SinglePropertyExtensionInfo(className, classLoader);
- map.put(namespaceURI, info);
- }
- }
-
- public void put(String namespaceURI, HashMap propertyToClassNameMap, ClassLoader classLoader)
- {
- ExtensionInfo info = (ExtensionInfo) map.get(namespaceURI);
- if (info == null)
- {
- info = new MultiPropertyExtensionInfo(propertyToClassNameMap, classLoader);
- map.put(namespaceURI, info);
- }
- }
-
- /**
- *
- * @deprecated
- */
- public Object get(String namespaceURI)
- {
- ExtensionInfo info = (ExtensionInfo) map.get(namespaceURI);
- return info != null ? info.getObject("") : null;
- }
-
- public Object getProperty(String namespaceURI, String property)
- {
- ExtensionInfo info = (ExtensionInfo) map.get(namespaceURI);
- return info != null ? info.getObject(property) : null;
- }
-
- private abstract class ExtensionInfo
- {
- protected ClassLoader classLoader;
-
- public ExtensionInfo(ClassLoader classLoader)
- {
- this.classLoader = classLoader;
- }
-
- public abstract Object getObject(String property);
- }
-
- private class SinglePropertyExtensionInfo extends ExtensionInfo
- {
- protected String className;
- protected Object object;
- protected boolean error;
-
- public SinglePropertyExtensionInfo(String className, ClassLoader classLoader)
- {
- super(classLoader);
- this.className = className;
- }
-
- public Object getObject(String property)
- {
- if (object == null)
- {
- try
- {
- Class theClass = classLoader != null ? classLoader.loadClass(className) : Class.forName(className);
- object = theClass.newInstance();
- }
- catch (Exception e)
- {
- object = PLUGIN_LOADING_ERROR;
- e.printStackTrace();
- }
- }
- return object != PLUGIN_LOADING_ERROR ? object : null;
- }
- }
-
- private class MultiPropertyExtensionInfo extends ExtensionInfo
- {
- protected HashMap propertyToClassNameTable;
- protected HashMap propertyToObjectTable = new HashMap();
-
- public MultiPropertyExtensionInfo(HashMap propertToClassNameTable, ClassLoader classLoader)
- {
- super(classLoader);
- this.propertyToClassNameTable = propertToClassNameTable;
- }
-
- public Object getObject(String property)
- {
- Object result = null;
- String className = (String) propertyToClassNameTable.get(property);
- if (className != null)
- {
- result = propertyToObjectTable.get(property);
- if (result == null)
- {
- try
- {
- Class theClass = classLoader != null ? classLoader.loadClass(className) : Class.forName(className);
- result = theClass.newInstance();
- propertyToObjectTable.put(property, result);
- }
- catch (Exception e)
- {
- propertyToObjectTable.put(property, PLUGIN_LOADING_ERROR);
- result = PLUGIN_LOADING_ERROR;
- e.printStackTrace();
- }
- }
- }
- return result != PLUGIN_LOADING_ERROR ? result : null;
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/WSDLEditorExtension.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/WSDLEditorExtension.java
deleted file mode 100644
index 5bbaf6c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/WSDLEditorExtension.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-
-public interface WSDLEditorExtension
-{
- public static final int OUTLINE_TREE_CONTENT_PROVIDER = 1; // req'd for model based ext
- public static final int OUTLINE_LABEL_PROVIDER = 2; // req'd for model based ext
-
- public static final int MENU_ACTION_CONTRIBUTOR = 3; // node
- public static final int DETAILS_VIEWER_PROVIDER = 4; // node
-
- public static final int EDIT_PART_FACTORY = 5; // req'd for model based ext
- public static final int TYPE_SYSTEM_PROVIDER = 6; // req'd for type system ext
- public static final int NODE_RECONCILER = 7; // req'd for model based ext
- public static final int NODE_ASSOCIATION_PROVIDER = 8; // req'd for model based ext
- public static final int MODEL_QUERY_CONTRIBUTOR = 9; // req'd for model based ext
-
- public static final int PROPERTY_SOURCE_PROVIDER = 10; // req'd for model based ext
- public static final int PROPERTY_SECTION_DESCRIPTOR_PROVIDER = 11; // req'd for model based ext
- public static final int XSD_DELETE_ACTION = 12;
-
- boolean isExtensionTypeSupported(int type);
- boolean isApplicable(Object modelObject);
- Object createExtensionObject(int type, WSDLEditor wsdlEditor);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/WSDLEditorExtensionRegistry.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/WSDLEditorExtensionRegistry.java
deleted file mode 100644
index f8e2435..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/extension/WSDLEditorExtensionRegistry.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.extension;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-
-public class WSDLEditorExtensionRegistry
-{
- //protected List classNameClassLoaderPairList = new ArrayList();
- //protected HashMap treeProviderMap = new HashMap();
- protected List registeredExtensionList = new ArrayList();
-
- public WSDLEditorExtensionRegistry()
- {
- add(new WSDLEditor.BuiltInWSDLEditorExtension());
- }
-
- //public ExtensibilityItemTreeProvider getExtensibilityItemTreeProvider(String namespaceURI)
- //{
- // return (ExtensibilityItemTreeProvider)treeProviderMap.get(namespaceURI);
- //}
-
- //public void putExtensibilityItemTreeProvider(String namespaceURI, ExtensibilityItemTreeProvider treeProvider)
- //{
- // treeProviderMap.put(namespaceURI, treeProvider);
- //}
-
- public List getRegisteredExtensions()
- {
- return registeredExtensionList;
- }
-
- public WSDLEditorExtension getApplicableExtension(int type, Object object)
- {
- WSDLEditorExtension result = null;
- for (Iterator i = getRegisteredExtensions().iterator(); i.hasNext(); )
- {
- WSDLEditorExtension extension = (WSDLEditorExtension)i.next();
- if (extension.isExtensionTypeSupported(type) && extension.isApplicable(object))
- {
- result = extension;
- break;
- }
- }
- return result;
- }
-
- public WSDLEditorExtension[] getRegisteredExtensions(int type)
- {
- List list = new ArrayList();
- for (Iterator i = getRegisteredExtensions().iterator(); i.hasNext(); )
- {
- WSDLEditorExtension extension = (WSDLEditorExtension)i.next();
- if (extension.isExtensionTypeSupported(type))
- {
- list.add(extension);
- }
- }
-
- WSDLEditorExtension[] result = new WSDLEditorExtension[list.size()];
- int count = 0;
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- WSDLEditorExtension extension = (WSDLEditorExtension)i.next();
- result[count] = extension;
- count++;
- }
- return result;
- }
-
- public void addAsFirst(WSDLEditorExtension extension)
- {
- getRegisteredExtensions().add(0, extension);
- }
-
- public void add(WSDLEditorExtension extension)
- {
- getRegisteredExtensions().add(extension);
- }
-
- public void add(ClassLoader classLoader, String className)
- {
- // TODO... consider defered instantiation of WSDLEditorExtensions
- try
- {
- Class theClass = classLoader != null ? classLoader.loadClass(className) : Class.forName(className);
- WSDLEditorExtension extension = (WSDLEditorExtension)theClass.newInstance();
- registeredExtensionList.add(extension);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/ExtensiblityElementFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/ExtensiblityElementFilter.java
deleted file mode 100644
index 61bf0d2..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/ExtensiblityElementFilter.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.filter;
-
-import org.w3c.dom.Element;
-
-public interface ExtensiblityElementFilter
-{
- public boolean isValidContext(Element parentElement, String localName);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/HttpExtensiblityElementFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/HttpExtensiblityElementFilter.java
deleted file mode 100644
index 859259c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/HttpExtensiblityElementFilter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.filter;
-
-import org.w3c.dom.Element;
-
-
-public class HttpExtensiblityElementFilter implements ExtensiblityElementFilter
-{
- public HttpExtensiblityElementFilter()
- {
- }
-
- public boolean isValidContext(Element parentElement, String localName)
- {
- boolean result = false;
-
- String parentElementName = parentElement.getLocalName();
- if (parentElementName.equals("binding"))
- {
- result = localName.equals("binding");
- }
- else if (parentElementName.equals("operation"))
- {
- result = localName.equals("operation");
- }
- else if (parentElementName.equals("input") ||
- parentElementName.equals("output"))
- {
- result = localName.equals("body") ||
- localName.equals("header");
- }
- else if (parentElementName.equals("fault"))
- {
- result = localName.equals("fault");
- }
- else if (parentElementName.equals("port"))
- {
- result = localName.equals("address");
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/MimeExtensiblityElementFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/MimeExtensiblityElementFilter.java
deleted file mode 100644
index 9053650..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/MimeExtensiblityElementFilter.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.filter;
-
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.w3c.dom.Element;
-
-
-public class MimeExtensiblityElementFilter implements ExtensiblityElementFilter
-{
- private static final String MIME_NAMESPACE_URI="http://schemas.xmlsoap.org/wsdl/mime/";
- public MimeExtensiblityElementFilter()
- {
- }
-
- public boolean isValidContext(Element parentElement, String localName)
- {
- boolean result = false;
-
- String parentElementName = parentElement.getLocalName();
- String parentElementNamespace = parentElement.getNamespaceURI();
-
- if (WSDLConstants.WSDL_NAMESPACE_URI.equals(parentElementNamespace))
- {
- if (parentElementName.equals("input") || parentElementName.equals("output"))
- {
- result = localName.equals("content") ||
- localName.equals("multipartRelated") ||
- localName.equals("mimeXml");
- }
- }
- else if (MIME_NAMESPACE_URI.equals(parentElementNamespace))
- {
- result = true;
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/SoapExtensiblityElementFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/SoapExtensiblityElementFilter.java
deleted file mode 100644
index fbfe95c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/SoapExtensiblityElementFilter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.filter;
-
-import org.w3c.dom.Element;
-
-public class SoapExtensiblityElementFilter implements ExtensiblityElementFilter
-{
- public SoapExtensiblityElementFilter()
- {
- }
-
- public boolean isValidContext(Element parentElement, String localName)
- {
- boolean result = false;
-
- String parentElementName = parentElement.getLocalName();
- if (parentElementName.equals("binding"))
- {
- result = localName.equals("binding");
- }
- else if (parentElementName.equals("operation"))
- {
- result = localName.equals("operation");
- }
- else if (parentElementName.equals("input") ||
- parentElementName.equals("output"))
- {
- result = localName.equals("body") ||
- localName.equals("header");
- }
- else if (parentElementName.equals("fault"))
- {
- result = localName.equals("fault");
- }
- else if (parentElementName.equals("port"))
- {
- result = localName.equals("address");
- }
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/XSDExtensiblityElementFilter.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/XSDExtensiblityElementFilter.java
deleted file mode 100644
index c9d3aec..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/filter/XSDExtensiblityElementFilter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.filter;
-
-import org.w3c.dom.Element;
-
-public class XSDExtensiblityElementFilter implements ExtensiblityElementFilter
-{
- public XSDExtensiblityElementFilter()
- {
- }
-
- public boolean isValidContext(Element parentElement, String localName)
- {
- boolean result = false;
- String parentElementName = parentElement.getLocalName();
- if (parentElementName.equals("types"))
- {
- result = localName.equals("schema");
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editparts/InteractorHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editparts/InteractorHelper.java
deleted file mode 100644
index 83606c4..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editparts/InteractorHelper.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.gef.util.editparts;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.MouseEvent;
-import org.eclipse.draw2d.MouseListener;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.IExpandable;
-import org.eclipse.wst.wsdl.ui.internal.gef.util.figures.Interactor;
-
-
-// hooks up an interactor with an edit part and the figure that needs to be expanded and collapsed
-//
-public class InteractorHelper implements MouseListener
-{
- protected boolean needToPerformDefaultExpansion = true;
- protected EditPart editPart;
- protected Interactor interactor;
- protected IExpandable expandable;
-
- public InteractorHelper(EditPart editPart, Interactor interactor, IExpandable expandable)
- {
- this.editPart = editPart;
- this.interactor = interactor;
- this.expandable = expandable;
- interactor.addMouseListener(this);
- expandable.setExpanded(interactor.isExpanded());
- }
-
- public void setExpanded(boolean isExpanded)
- {
- interactor.setExpanded(isExpanded);
- interactorExpansionChanged(isExpanded);
- }
-
- protected void interactorExpansionChanged(boolean isInteractorExpanded)
- {
- expandable.setExpanded(isInteractorExpanded);
- expandable.setVisible(isInteractorExpanded);
-
- editPart.refresh();
-
- EditPart root = editPart.getRoot();
- if (root instanceof AbstractGraphicalEditPart)
- {
- IFigure rootFigure = ((AbstractGraphicalEditPart)root).getFigure();
- invalidateAll(rootFigure);
- rootFigure.validate();
- rootFigure.repaint();
- }
- }
-
-
- protected void invalidateAll(IFigure figure)
- {
- figure.invalidate();
- LayoutManager manager = figure.getLayoutManager();
- if (manager != null)
- {
- manager.invalidate();
- }
- for (Iterator i = figure.getChildren().iterator(); i.hasNext(); )
- {
- IFigure child = (IFigure)i.next();
- invalidateAll(child);
- }
- }
-
-
- // implements MouseListener
- //
- public void mouseDoubleClicked(MouseEvent me)
- {
- }
-
- public void mousePressed(MouseEvent me)
- {
- boolean newExpansionState = !interactor.isExpanded();
- interactor.setExpanded(newExpansionState);
- interactorExpansionChanged(newExpansionState);
- }
-
- public void mouseReleased(MouseEvent me)
- {
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editparts/MultiContentPaneEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editparts/MultiContentPaneEditPart.java
deleted file mode 100644
index b76a20b..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editparts/MultiContentPaneEditPart.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.gef.util.editparts;
-
-import org.eclipse.draw2d.*;
-import org.eclipse.gef.*;
-import org.eclipse.gef.editparts.*;
-
-import java.util.*;
-
-
-public abstract class MultiContentPaneEditPart extends AbstractGraphicalEditPart
-{
- protected IFigure[] contentPanes;
- protected int[] contentPaneIndexAdjustment;
-
- protected IFigure[] initContentPanes()
- {
- return null;
- }
-
- protected int getContentPane(Object model)
- {
- return 0;
- }
-
- protected List sortByContentPane(List list)
- {
- return list;
- }
-
-
- protected void setFigure(IFigure figure)
- {
- super.setFigure(figure);
- contentPanes = initContentPanes();
- if (contentPanes != null)
- {
- contentPaneIndexAdjustment = new int[contentPanes.length];
- }
- }
-
-
- protected void updateContentPaneInfoIndexAdjustment(List list)
- {
- int index = 0;
- int listSize = list.size();
-
- for (int j = 0; j < contentPanes.length; j++)
- {
- contentPaneIndexAdjustment[j] = index;
- while (index < listSize)
- {
- Object model = list.get(index);
- if (getContentPane(model) != j)
- {
- break;
- }
- index++;
- }
- }
- }
-
-
- protected void refreshChildren()
- {
- if (contentPanes != null)
- {
- List sortedList = sortByContentPane(getModelChildren());
- updateContentPaneInfoIndexAdjustment(sortedList);
- }
- super.refreshChildren();
- }
-
-
- protected void addChildVisual(EditPart childEditPart, int index)
- {
- if (contentPanes != null)
- {
- int j = getContentPane(childEditPart.getModel());
- if (contentPaneIndexAdjustment.length > j)
- {
- int adjustedIndex = index - contentPaneIndexAdjustment[j];
- if (adjustedIndex >= 0)
- {
- IFigure child = ((GraphicalEditPart)childEditPart).getFigure();
- contentPanes[j].add(child, adjustedIndex);
- }
- }
- }
- else
- {
- super.addChildVisual(childEditPart, index);
- }
- }
-
-
- protected void removeChildVisual(EditPart childEditPart)
- {
- if (contentPanes != null)
- {
- int j = getContentPane(childEditPart.getModel());
- IFigure child = ((GraphicalEditPart)childEditPart).getFigure();
- contentPanes[j].remove(child);
- }
- else
- {
- super.removeChildVisual(childEditPart);
- }
- }
-
- protected void reorderChild(EditPart editpart, int index)
- {
- removeChildVisual(editpart);
- List children = getChildren();
- children.remove(editpart);
- children.add(index, editpart);
- addChildVisual(editpart, index);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editpolicies/IDirectEditPolicyDelegate.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editpolicies/IDirectEditPolicyDelegate.java
deleted file mode 100644
index e2a84e8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editpolicies/IDirectEditPolicyDelegate.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.gef.util.editpolicies;
-
-import org.eclipse.jface.viewers.CellEditor;
-
-public interface IDirectEditPolicyDelegate
-{
- public void performEdit(CellEditor cellEditor);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editpolicies/TextCellEditorManager.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editpolicies/TextCellEditorManager.java
deleted file mode 100644
index b1c680e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/editpolicies/TextCellEditorManager.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.gef.util.editpolicies;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.*;
-import org.eclipse.gef.tools.*;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.graphics.Point;
-
-public abstract class TextCellEditorManager extends DirectEditManager implements IDirectEditPolicyDelegate
-{
- protected Label label;
-
- public TextCellEditorManager(GraphicalEditPart source, Label label)
- {
- super(source, TextCellEditor.class, new InternalCellEditorLocator(label));
- this.label = label;
- }
-
- protected void initCellEditor()
- {
- String initialLabelText = label.getText();
- getCellEditor().setValue(initialLabelText);
- Text text = (Text)getCellEditor().getControl();
- text.setFont(label.getFont());
- text.setForeground(label.getForegroundColor());
- text.setBackground(label.getBackgroundColor());
- text.selectAll();
- }
-
- protected abstract void performModify(String value);
-
- public static class InternalCellEditorLocator implements CellEditorLocator
- {
- protected Label label;
-
- public InternalCellEditorLocator(Label label)
- {
- this.label = label;
- }
-
- public void relocate(CellEditor celleditor)
- {
- Text text = (Text)celleditor.getControl();
- Point sel = text.getSelection();
- Point pref = text.computeSize(-1, -1);
- Rectangle rect = label.getTextBounds().getCopy();
- label.translateToAbsolute(rect);
- text.setBounds(rect.x-4, rect.y-1, pref.x+1, pref.y+1);
- text.setSelection(0);
- text.setSelection(sel);
- }
- }
-
- // implements DirectEditPolicyDelegate
- //
- public void performEdit(CellEditor cellEditor)
- {
- performModify((String)cellEditor.getValue());
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/CenterLayout.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/CenterLayout.java
deleted file mode 100644
index 267c3a5..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/CenterLayout.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.gef.util.figures;
-
-import org.eclipse.draw2d.*;
-import org.eclipse.draw2d.geometry.*;
-import java.util.*;
-
-
-/**
- * Figures using the StackLayout as their layout manager have
- * their children placed on top of one another. Order of
- * placement is determined by the order in which the children
- * were added, first child added placed on the bottom.
- */
-public class CenterLayout extends AbstractLayout
-{
- public static final int ALIGNMENT_TOP = 1;
- public static final int ALIGNMENT_CENTER = 2;
- public static final int ALIGNMENT_BOTTOM = 3;
-
- protected int spacing;
- protected int verticalAlignment = ALIGNMENT_CENTER;
-
- public CenterLayout(){}
- public CenterLayout(int spacing){ this.spacing = spacing; }
-
-
- /**
- * Calculates and returns the preferred size of the input container.
- * This is the size of the largest child of the container, as all
- * other children fit into this size.
- *
- * @param figure Container figure for which preferred size is required.
- * @return The preferred size of the input figure.
- * @since 2.0
- */
-// protected Dimension calculatePreferredSize(IFigure figure)
- protected Dimension calculatePreferredSize(IFigure figure, int width, int height)
- {
- Dimension d = calculatePreferredClientAreaSize(figure);
-// d.expand(figure.getInsets().getWidth(),
-// figure.getInsets().getHeight());
- d.expand(width, height);
- d.union(getBorderPreferredSize(figure));
- return d;
- }
-
- protected Dimension calculatePreferredClientAreaSize(IFigure figure)
- {
- Dimension d = new Dimension();
- List children = figure.getChildren();
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- IFigure child = (IFigure)i.next();
- Dimension childSize = child.getPreferredSize();
- d.height += childSize.height;
- d.width = Math.max(childSize.width, d.width);
- }
- int childrenSize = children.size();
- if (childrenSize > 0)
- {
- d.height += spacing * children.size() - 1;
- }
- return d;
- }
-
- /*
- * Returns the minimum size required by the input container.
- * This is the size of the largest child of the container, as all
- * other children fit into this size.
- */
- // TODO GEF PORT
- public Dimension getMinimumSize(IFigure figure, int width, int height)
- {
- Dimension d = new Dimension();
- List children = figure.getChildren();
- IFigure child;
- for (int i=0; i < children.size(); i++)
- {
- child = (IFigure)children.get(i);
- d.union(child.getMinimumSize());
- }
- d.expand(figure.getInsets().getWidth(), figure.getInsets().getHeight());
- return d;
- }
- // TODO GEF PORT
- public Dimension getPreferredSize(IFigure figure, int width, int height)
- {
- return calculatePreferredSize(figure, figure.getInsets().getWidth(), figure.getInsets().getHeight());
- }
-
-
- public void layout(IFigure figure)
- {
- Rectangle r = figure.getClientArea();
- List children = figure.getChildren();
-
- Dimension preferredClientAreaSize = calculatePreferredClientAreaSize(figure);
-
- int x = r.x + (r.width - preferredClientAreaSize.width) / 2;
- int y = 0;
-
- switch (getVerticalAlignment())
- {
- case ALIGNMENT_TOP :
- {
- y = r.y;
- break;
- }
- case ALIGNMENT_CENTER :
- {
- y = r.y + (r.height - preferredClientAreaSize.height) / 2;
- break;
- }
- case ALIGNMENT_BOTTOM :
- {
- y = r.y + (r.height - preferredClientAreaSize.height);
- break;
- }
- }
-
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- IFigure child = (IFigure)i.next();
- Dimension childSize = child.getPreferredSize();
- child.setBounds(new Rectangle(x, y, childSize.width, childSize.height));
- y += childSize.height + spacing;
- }
- }
-
- /**
- * @param verticalAlignment The verticalAlignment to set.
- */
- public void setVerticalAlignment(int verticalAlignment)
- {
- this.verticalAlignment = verticalAlignment;
- }
-
- protected int getVerticalAlignment()
- {
- return verticalAlignment;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/IGraphNodeFigure.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/IGraphNodeFigure.java
deleted file mode 100644
index f1529b3..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/IGraphNodeFigure.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.gef.util.figures;
-
-import org.eclipse.draw2d.*;
-import java.util.*;
-
-public interface IGraphNodeFigure extends IFigure
-{
- public static final int UP_CONNECTION = 1;
- public static final int DOWN_CONNECTION = 2;
- public static final int LEFT_CONNECTION = 3;
- public static final int RIGHT_CONNECTION = 4;
-
- public IFigure getSelectionFigure();
- public IFigure getConnectionFigure();
- public List getConnectedFigures(int type);
- public int getConnectionType();
- public void addConnectedFigure(IGraphNodeFigure figure);
- public void removeConnectedFigure(IGraphNodeFigure figure);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/Interactor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/Interactor.java
deleted file mode 100644
index aaf1978..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/Interactor.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.gef.util.figures;
-
-import org.eclipse.draw2d.*;
-import org.eclipse.draw2d.geometry.*;
-
-/**
- * Interactor the +/- control commonly found in trees
- */
-public class Interactor extends RectangleFigure
-{
- protected boolean isExpanded;
-
- public Interactor()
- {
- super();
- setPreferredSize(new Dimension(9, 9));
- }
-
- public void setExpanded(boolean isExpanded)
- {
- this.isExpanded = isExpanded;
- repaint();
- }
-
- public boolean isExpanded()
- {
- return isExpanded;
- }
-
- protected void fillShape(Graphics g)
- {
- super.fillShape(g);
- Rectangle r = getBounds();
- int mx = r.x + r.width / 2;
- int my = r.y + r.height / 2;
- int s = 2;
- g.drawLine(r.x + s, my, r.x + r.width - s - 1, my);
- if (!isExpanded)
- {
- g.drawLine(mx, r.y + s, mx, r.y + r.height - s -1);
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/RoundedLineBorder.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/RoundedLineBorder.java
deleted file mode 100644
index 6ebcb14..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/gef/util/figures/RoundedLineBorder.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.gef.util.figures;
-
-import org.eclipse.draw2d.*;
-import org.eclipse.draw2d.geometry.*;
-import org.eclipse.swt.graphics.Color;
-
-public class RoundedLineBorder extends LineBorder
-{
- protected int arcLength;
- protected int lineStyle = Graphics.LINE_SOLID;
-
- public RoundedLineBorder(Color c, int width, int arcLength)
- {
- super(c, width);
- this.arcLength = arcLength;
- }
-
- public RoundedLineBorder(int width, int arcLength)
- {
- super(width);
- this.arcLength = arcLength;
- }
-
- public RoundedLineBorder(Color c, int width, int arcLength, int lineStyle)
- {
- super(c, width);
- this.arcLength = arcLength;
- this.lineStyle = lineStyle;
- }
-
- public RoundedLineBorder(int width, int arcLength, int lineStyle)
- {
- super(width);
- this.arcLength = arcLength;
- this.lineStyle = lineStyle;
- }
-
- public void paint(IFigure figure, Graphics graphics, Insets insets)
- {
- tempRect.setBounds(getPaintRectangle(figure, insets));
- int width = getWidth();
- Color color = getColor();
- if (width%2 == 1)
- {
- tempRect.width--;
- tempRect.height--;
- }
- tempRect.shrink(width/2,width/2);
- graphics.setLineWidth(width);
- graphics.setLineStyle(lineStyle);
- if (color != null)
- graphics.setForegroundColor(color);
- graphics.drawRoundRectangle(tempRect, arcLength, arcLength);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/FigureCanvasKeyboardHandler.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/FigureCanvasKeyboardHandler.java
deleted file mode 100644
index e861ddf..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/FigureCanvasKeyboardHandler.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.RangeModel;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Widget;
-
-public class FigureCanvasKeyboardHandler extends KeyAdapter
-{
- public static final int H_SCROLL_INCREMENT = 5;
- public static final int V_SCROLL_INCREMENT = 30;
-
- /**
- * Constructor for FigureCanvasKeyboardHandler.
- */
- public FigureCanvasKeyboardHandler()
- {
- super();
- }
-
- public void keyPressed(KeyEvent e)
- {
- Widget w = e.widget;
- if (w instanceof FigureCanvas)
- {
- processKey(e.keyCode, (FigureCanvas)w);
- }
- }
-
- private void processKey(int keyCode, FigureCanvas figureCanvas)
- {
- switch (keyCode)
- {
- case SWT.ARROW_DOWN :
- scrollVertical(figureCanvas, false);
- break;
- case SWT.ARROW_UP :
- scrollVertical(figureCanvas, true);
- break;
- case SWT.ARROW_LEFT :
- scrollHorizontal(figureCanvas, true);
- break;
- case SWT.ARROW_RIGHT :
- scrollHorizontal(figureCanvas, false);
- break;
- case SWT.PAGE_UP :
- scrollPage(figureCanvas, true);
- break;
- case SWT.PAGE_DOWN :
- scrollPage(figureCanvas, false);
- break;
- }
- }
-
- private int verifyScrollBarOffset(RangeModel model, int value)
- {
- value = Math.max(model.getMinimum(), value);
- return Math.min(model.getMaximum() - model.getExtent(), value);
- }
-
- private void scrollVertical(FigureCanvas figureCanvas, boolean up)
- {
- Point location = figureCanvas.getViewport().getViewLocation();
- int vOffset = up ? -V_SCROLL_INCREMENT : V_SCROLL_INCREMENT;
- int x = verifyScrollBarOffset(figureCanvas.getViewport().getHorizontalRangeModel(), location.x);
- int y = verifyScrollBarOffset(figureCanvas.getViewport().getVerticalRangeModel(), location.y + vOffset);
- figureCanvas.scrollSmoothTo(x, y);
- }
-
- private void scrollHorizontal(FigureCanvas figureCanvas, boolean left)
- {
- Point location = figureCanvas.getViewport().getViewLocation();
- int hOffset = left ? -H_SCROLL_INCREMENT : H_SCROLL_INCREMENT;
- int x = verifyScrollBarOffset(figureCanvas.getViewport().getHorizontalRangeModel(), location.x + hOffset);
- int y = verifyScrollBarOffset(figureCanvas.getViewport().getVerticalRangeModel(), location.y);
- figureCanvas.scrollSmoothTo(x, y);
- }
-
- private void scrollPage(FigureCanvas figureCanvas, boolean up)
- {
- Rectangle clientArea = figureCanvas.getClientArea();
- int increment = up ? -clientArea.height : clientArea.height;
- Point location = figureCanvas.getViewport().getViewLocation();
- int x = verifyScrollBarOffset(figureCanvas.getViewport().getHorizontalRangeModel(), location.x);
- int y = verifyScrollBarOffset(figureCanvas.getViewport().getVerticalRangeModel(), location.y + increment);
- figureCanvas.scrollSmoothTo(x, y);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/GraphViewToolBar.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/GraphViewToolBar.java
deleted file mode 100644
index a0ec2e8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/GraphViewToolBar.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph;
-
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ViewForm;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.graph.model.WSDLGraphModelAdapterFactory;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-
-
-public class GraphViewToolBar extends ViewForm
-{
- ToolBar graphToolBar; // the toolbar at the top of the graph view
- //ToolItem toolItem; // the view tool item
- Composite frameBar; // The composite that contains the toolbar
- WSDLEditor editor;
-
- ToolItem showBindingsButton; // the view tool item
- ToolItem backButton;
-
- public GraphViewToolBar(WSDLEditor wsdlEditor, Composite c, int style)
- {
- super(c, style);
- this.editor = wsdlEditor;
- frameBar = new Composite(this, SWT.NONE);
- /*
- CLabel label = new CLabel(frameBar, SWT.NONE);
- label.setText("View :");
- */
- org.eclipse.swt.layout.GridLayout frameLayout = new org.eclipse.swt.layout.GridLayout();
- frameLayout.numColumns = 3;
- frameLayout.horizontalSpacing = 0;
- frameLayout.marginWidth = 0;
- frameLayout.marginHeight = 0;
-
- frameBar.setLayout(frameLayout);
-
- graphToolBar = new ToolBar(frameBar, SWT.FLAT);
- graphToolBar.addTraverseListener(new TraverseListener()
- {
- public void keyTraversed(TraverseEvent e)
- {
- if (e.detail == SWT.TRAVERSE_MNEMONIC)
- e.doit = false;
- }
- });
-
-
- backButton = new ToolItem(graphToolBar, SWT.PUSH);
- backButton.setImage(WSDLEditorPlugin.getInstance().getImage("icons/back.gif"));
- // backButton.setToolTipText(WSDLEditorPlugin.getWSDLString("_UI_BACK_TO", "Definition"));
- backButton.setToolTipText(WSDLEditorPlugin.getWSDLString("_UI_BACK"));
- backButton.setEnabled(false);
- backButton.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- Object object = editor.getGraphViewer().getComponentViewer().getInput();
- if (object instanceof XSDSchema)
- {
- editor.getGraphViewer().setInput(editor.getDefinition());
- }
- else if (object instanceof XSDConcreteComponent)
- {
- // Need to common this up with xsdeditor's BackAction code
- XSDSchema xsdSchema = ((XSDConcreteComponent)object).getSchema();
- boolean flag = true;
- while (flag)
- {
- List list = xsdSchema.getReferencingDirectives();
- if (list.size() > 0)
- {
- XSDSchemaDirective xsdSchemaDirective = (XSDSchemaDirective)list.get(0);
- if (xsdSchemaDirective.getSchema() != null)
- {
- xsdSchema = xsdSchemaDirective.getSchema();
- }
- else
- {
- flag = false;
- }
- }
- else
- {
- flag = false;
- }
- }
-
- editor.getGraphViewer().setInput(xsdSchema);
- }
- else
- {
- editor.getGraphViewer().setInput(editor.getDefinition());
- }
- }
- });
-
- // hack to make the button look like a toggle button. SWT.TOGGLE is not an allowed style
- // for a ToolItem, but SWT.RADIO is. SWT.RADIO makes it look like a toggle.......
- showBindingsButton = new ToolItem(graphToolBar, SWT.RADIO);
- showBindingsButton.setImage(WSDLEditorPlugin.getInstance().getImage("icons/hidebinding.gif"));
- showBindingsButton.setToolTipText(WSDLEditorPlugin.getWSDLString("_UI_HIDE_BINDINGS"));
- showBindingsButton.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter()
- {
- private boolean currentlySelected = false;
-
- public void widgetSelected(SelectionEvent e)
- {
- ViewMode vm = WSDLGraphModelAdapterFactory.getWSDLGraphModelAdapterFactory().getViewMode((Definition)editor.getDefinition());
- vm.setBindingVisible(!vm.isBindingVisible());
-
- // hack to make the button look like a toggle button
- ToolItem item = (ToolItem) e.widget;
- if (currentlySelected) {
- item.setSelection(false);
- currentlySelected = false;
- }
- else {
- currentlySelected = true;
- }
- }
- });
-
- setTopLeft(frameBar);
- }
-
- public void setBackButtonEnabled(boolean state)
- {
- backButton.setEnabled(state);
- }
-
-
-// public void updateHoverHelp(Object object)
-// {
-// if (object instanceof XSDSchema)
-// {
-// backButton.setToolTipText(WSDLEditorPlugin.getWSDLString("_UI_BACK_TO", "Definition"));
-// }
-// else if (object instanceof XSDConcreteComponent)
-// {
-// backButton.setToolTipText(WSDLEditorPlugin.getWSDLString("_UI_BACK_TO", "XML Schema"));
-// }
-// }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/GraphicsConstants.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/GraphicsConstants.java
deleted file mode 100644
index 8170eba..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/GraphicsConstants.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * A collection of color and font related constants.
- */
-public interface GraphicsConstants
-{
- public final static Display display = Display.getDefault();
-
- public final static Color groupBorderColor = new Color(null, 118, 134, 164);
- public final static Color groupHeaderColor = new Color(null, 232, 240, 248);
-
- public final static Color elementBorderColor = new Color(null, 120, 152, 184);
- public final static Color elementBackgroundColor = new Color(null, 232, 240, 248);
- public final static Color elementLabelColor = new Color(null, 80, 102, 144);
- public final static Color readOnlyBorderColor = new Color(null, 164, 164, 164);
- public final static Color red = new Color(null, 255, 0, 0);
-
- public final static Color readOnlyBackgroundColor = ColorConstants.white;
-
- public final static Font smallBoldFont = new Font(Display.getCurrent(), "Tahoma", 8, SWT.BOLD);
- public final static Font mediumFont = new Font(Display.getCurrent(), "Tahoma", 10, SWT.NONE);
- public final static Font mediumBoldFont = new Font(Display.getCurrent(), "Tahoma", 10, SWT.BOLD);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/ViewMode.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/ViewMode.java
deleted file mode 100644
index 6275daf..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/ViewMode.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class ViewMode
-{
- public static final int BINDING = 1;
- public static final int MESSAGE = 2;
- public static final int PORT_TYPE = 3;
- public static final int SERVICE = 4;
- public static final int TYPES = 5;
-
- public static final String BINDING_DESCRIPTION = WSDLEditorPlugin.getWSDLString("_UI_LABEL_BINDING");
- public static final String MESSAGE_DESCRIPTION = WSDLEditorPlugin.getWSDLString("_UI_LABEL_MESSAGE");
- public static final String PORT_TYPE_DESCRIPTION = WSDLEditorPlugin.getWSDLString("_UI_LABEL_PORTTYPE");
- public static final String SERVICE_DESCRIPTION = WSDLEditorPlugin.getWSDLString("_UI_LABEL_SERVICE");
- public static final String TYPES_DESCRIPTION = WSDLEditorPlugin.getWSDLString("_UI_LABEL_TYPES");
-
-
- protected boolean isBindingVisible = true;
- protected int mode = SERVICE;
- protected List listenerList = new ArrayList();
-
- public ViewMode()
- {
- }
-
- public void setBindingVisible(boolean isVisible)
- {
- if (isBindingVisible != isVisible)
- {
- isBindingVisible = isVisible;
- fireChangeNotification();
- }
- }
-
- public boolean isBindingVisible()
- {
- return isBindingVisible;
- }
-
- public static int getModeForDescription(String description)
- {
- int result = SERVICE;
- if (description.equals(BINDING_DESCRIPTION))
- {
- result = BINDING;
- }
- else if (description.equals(MESSAGE_DESCRIPTION))
- {
- result = MESSAGE;
- }
- else if (description.equals(PORT_TYPE_DESCRIPTION))
- {
- result = PORT_TYPE;
- }
- else if (description.equals(SERVICE_DESCRIPTION))
- {
- result = SERVICE;
- }
- else if (description.equals(TYPES_DESCRIPTION))
- {
- result = TYPES;
- }
- return result;
- }
-
- public static String getDescriptionForMode(int mode)
- {
- String result = SERVICE_DESCRIPTION;
- switch (mode)
- {
- case BINDING :
- {
- result = BINDING_DESCRIPTION;
- break;
- }
- case MESSAGE :
- {
- result = MESSAGE_DESCRIPTION;
- break;
- }
- case PORT_TYPE :
- {
- result = PORT_TYPE_DESCRIPTION;
- break;
- }
- case SERVICE :
- {
- result = SERVICE_DESCRIPTION;
- break;
- }
- case TYPES :
- {
- result = TYPES_DESCRIPTION;
- break;
- }
- }
- return result;
- }
-
- public interface Listener
- {
- public void viewModeChanged(ViewMode mode);
- }
-
- public void setMode(int mode)
- {
- this.mode = mode;
- fireChangeNotification();
- }
-
- public void setMode(String description)
- {
- this.mode = getModeForDescription(description);
- fireChangeNotification();
- }
-
- public int getMode()
- {
- return mode;
- }
-
- public String getModeDescription()
- {
- return getDescriptionForMode(mode);
- }
-
- public void addListener(Listener listener)
- {
- if (!listenerList.contains(listener))
- {
- listenerList.add(listener);
- }
- }
-
- public void removeListener(Listener listener)
- {
- listenerList.remove(listener);
- }
-
- public void fireChangeNotification()
- {
- for (Iterator i = listenerList.iterator(); i.hasNext(); )
- {
- Listener listener = (Listener)i.next();
- listener.viewModeChanged(this);
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/WSDLComponentViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/WSDLComponentViewer.java
deleted file mode 100644
index 5eb6d0d..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/WSDLComponentViewer.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph;
-
-import java.util.List;
-
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.ContextMenuProvider;
-import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.EditDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.gef.tools.SelectionTool;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.actions.ExtensibleMenuActionContributor;
-import org.eclipse.wst.wsdl.ui.internal.gef.util.figures.CenterLayout;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.ComponentViewerRootEditPart;
-import org.eclipse.wst.wsdl.ui.internal.graph.figures.MyConnectionRenderingHelper;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.wst.wsdl.ui.internal.util.OpenOnSelectionHelper;
-import org.w3c.dom.Node;
-
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ConnectionRenderingFigure;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.IConnectionRenderingViewer;
-
-public class WSDLComponentViewer extends ScrollingGraphicalViewer implements IConnectionRenderingViewer
-{
- protected EditDomain editDomain;
- protected WSDLEditor editor;
- protected ISelectionProvider menuSelectionProvider;
- protected ComponentViewerRootEditPart componentViewerRootEditPart;
- protected ConnectionRenderingFigure connectionRenderingFigure;
- protected boolean isPreserveExpansionEnabled;
-
- public WSDLComponentViewer(WSDLEditor editor, ISelectionProvider menuSelectionProvider)
- {
- super();
- this.editor = editor;
- this.menuSelectionProvider = menuSelectionProvider;
- }
-
- public void setPreserveExpansionEnabled(boolean isPreserveExpansionEnabled)
- {
- this.isPreserveExpansionEnabled = isPreserveExpansionEnabled;
- }
-
- public boolean isPreserveExpansionEnabled()
- {
- return isPreserveExpansionEnabled;
- }
-
- public ConnectionRenderingFigure getConnectionRenderingFigure()
- {
- return connectionRenderingFigure;
- }
-
- public Object getInput()
- {
- return componentViewerRootEditPart.getModel();
- }
-
- public void setInput(Object object)
- {
- componentViewerRootEditPart.setInput(object);
-
- if (object instanceof Definition)
- {
- editor.getGraphViewer().setBackButtonEnabled(false);
- }
- else
- {
- editor.getGraphViewer().setBackButtonEnabled(true);
- }
-
- // todo.. revisit this to understand why we don't get a set input
- // when drilling down into a schema element or type
- //
- int layoutAlignment = (object instanceof Definition) ?
- CenterLayout.ALIGNMENT_TOP :
- CenterLayout.ALIGNMENT_CENTER;
-
- ScalableRootEditPart graphicalRootEditPart = (ScalableRootEditPart)getRootEditPart();
- CenterLayout centerLayout = (CenterLayout)graphicalRootEditPart.getLayer(LayerConstants.PRIMARY_LAYER).getLayoutManager();
- centerLayout.setVerticalAlignment(layoutAlignment);
- }
-
- //public void setSelection(Object object)
- //{
- //}
-
- protected void hookControl()
- {
- super.hookControl();
-
- getControl().setBackground(ColorConstants.white);
-
- editDomain = new DefaultEditDomain(null);
- ((DefaultEditDomain)editDomain).setDefaultTool(new SelectionTool());
- editDomain.loadDefaultTool();
- editDomain.addViewer(this);
-
- componentViewerRootEditPart = new ComponentViewerRootEditPart();
-
- KeyAdapter keyListener = new KeyAdapter()
- {
- public void keyReleased(KeyEvent e)
- {
- if (e.keyCode == SWT.F3)
- {
- ISelection selection = editor.getSelectionManager().getSelection();
- if (selection instanceof IStructuredSelection)
- {
- Object object = ((IStructuredSelection)selection).getFirstElement();
- if (object instanceof EObject)
- {
- OpenOnSelectionHelper helper = new OpenOnSelectionHelper(editor.getDefinition());
- helper.openEditor((EObject)object);
- }
- }
-
- }
- }
- };
- getControl().addKeyListener(keyListener);
-
- setContents(componentViewerRootEditPart);
- //getFigureCanvas().addKeyListener(new FigureCanvasKeyboardHandler(editor));
- getRootEditPart().activate();
-
- componentViewerRootEditPart.setInput(editor.getDefinition());
-
- ScalableRootEditPart graphicalRootEditPart = (ScalableRootEditPart)getRootEditPart();
-
- // set the layout for the primary layer so that the children are always centered
- //
- CenterLayout centerLayout = new CenterLayout();
- centerLayout.setVerticalAlignment(CenterLayout.ALIGNMENT_TOP);
- graphicalRootEditPart.getLayer(LayerConstants.PRIMARY_LAYER).setLayoutManager(centerLayout); //new ContainerLayout());//
-
- setContextMenu(new InternalContextMenuProvider(this, editor));
-
- // add the ConnectionFigure which is responsible for drawing all of the lines in the view
- //
- IFigure figure = graphicalRootEditPart.getLayer(LayerConstants.CONNECTION_LAYER);
- figure.setLayoutManager(new StackLayout());
-
- final MyConnectionRenderingHelper connectionRenderingHelper = new MyConnectionRenderingHelper(this);
-
- connectionRenderingFigure = new ConnectionRenderingFigure(graphicalRootEditPart.getLayer(LayerConstants.PRIMARY_LAYER))
- {
- protected void fillShape(Graphics graphics)
- {
- super.fillShape(graphics);
- connectionRenderingHelper.fillShapeHelper(graphics);
- }
- };
- figure.add(connectionRenderingFigure);
- figure.validate();
- }
-
- public WSDLEditor getWSDLEditor() {
- return editor;
- }
-
- public class InternalContextMenuProvider extends ContextMenuProvider
- {
- protected EditPartViewer viewer;
- protected ExtensibleMenuActionContributor extensibleMenuActionContributor;
-
- public InternalContextMenuProvider(EditPartViewer viewer, WSDLEditor editor)
- {
- super(viewer);
- this.viewer = viewer;
- extensibleMenuActionContributor = new ExtensibleMenuActionContributor(editor);
- }
-
- public void buildContextMenu(IMenuManager menu)
- {
- List list = getSelectedEditParts();
- if (list.size() > 0)
- {
- EditPart editPart = (EditPart)list.get(0);
- Object object = editPart.getModel();
-
- //if (editPart instanceof PropertyEditPart)
- //{
- // object = ((PropertyEditPart)editPart).getOwnerModel();
- //}
-
- if (object != null)
- {
- Node node = null;
- if (object instanceof Node)
- {
- node = (Node)object;
- }
- else if (object instanceof WSDLElement)
- {
- node = ((WSDLElement)object).getElement();
- }
- else if (object instanceof WSDLGroupObject)
- {
- node = ((WSDLGroupObject)object).getDefinition().getElement();
- }
- extensibleMenuActionContributor.contributeMenuActions(menu, node, object);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/WSDLGraphViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/WSDLGraphViewer.java
deleted file mode 100644
index 1937cd4..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/WSDLGraphViewer.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLTextEditor;
-import org.eclipse.wst.wsdl.ui.internal.actions.CopyGlobalAction;
-import org.eclipse.wst.wsdl.ui.internal.actions.DeleteWSDLAndXSDAction;
-import org.eclipse.wst.wsdl.ui.internal.actions.PasteGlobalAction;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.ComponentViewerRootEditPart;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.GroupEditPart;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.TreeNodeEditPart;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.wst.wsdl.ui.internal.util.SelectionAdapter;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class WSDLGraphViewer implements ISelectionChangedListener
-{
- protected Control componentViewerControl;
- protected WSDLComponentViewer componentViewer;
- protected Definition definition;
- protected WSDLEditor editor;
- protected InternalSelectionAdapter internalSelectionAdapter = new InternalSelectionAdapter();
-
- GraphViewToolBar form; // Tool bar view form
-
- public WSDLGraphViewer(WSDLEditor editor)
- {
- super();
- this.editor = editor;
- }
-
- public void setDefinition(Definition definition)
- {
- this.definition = definition;
- }
-
- public ISelectionProvider getSelectionProvider()
- {
- return internalSelectionAdapter;
- }
-
- public Control createControl(Composite parent)
- {
- componentViewer = new WSDLComponentViewer(editor, null);
-
- componentViewer.addSelectionChangedListener(internalSelectionAdapter);
- internalSelectionAdapter.addSelectionChangedListener(editor.getSelectionManager());
-
- form = new GraphViewToolBar(editor, parent, SWT.NONE);
-
- componentViewerControl = componentViewer.createControl(form);
- form.setContent(componentViewerControl);
-
- editor.getSelectionManager().addSelectionChangedListener(this);
-
- componentViewerControl.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if (e.character == SWT.DEL) {
- List selections = ((IStructuredSelection) editor.getSelectionManager().getSelection()).toList();
- DeleteWSDLAndXSDAction deleteAction = new DeleteWSDLAndXSDAction(selections, editor.getDefinition().getElement(), editor);
- deleteAction.run();
- }
- }
- });
-
- return componentViewerControl;
- }
-
- public WSDLComponentViewer getComponentViewer()
- {
- return componentViewer;
- }
-
-
- Node inputNode;
- public void setInput(Object object)
- {
- componentViewer.setInput(object);
- }
-
- public void setBackButtonEnabled(boolean state)
- {
- form.setBackButtonEnabled(state);
- }
-
- //protected boolean isDeleted(Object object)
- //}
-
-
- // this is called when selection changes in the selection manager
- //
-
-
-
- protected Object getInputComponentForNode(Node node)
- {
- // TODO... logic to get WSDLElement or other object (e.g. XSD or extension for the Node)
- // TODO... consider case where the model is simply a chunk of DOM
- return null;
- }
-
- protected Object getSelectionComponentForNode(Node node)
- {
- // TODO... logic to get WSDLElement or other object (e.g. XSD or extension for the Node)
- // TODO... consider case where the model is simply a chunk of DOM
- return null;
- }
-
- protected class InternalSelectionAdapter extends SelectionAdapter implements ISelectionChangedListener
- {
- public Object getObjectForOtherModel(Object object)
- {
- Object result = null;
- if (object instanceof EditPart)
- {
- // fix for defect 4294 ... this test prevents selection from changing
- // when a component is renamed which indirectly causes it to be removed and
- // re-added from the 'sorted' list
- //
- if (!(object instanceof ComponentViewerRootEditPart))
- {
- EditPart editPart = (EditPart)object;
- result = editPart.getModel();
- }
- }
- return result;
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- setSelection(event.getSelection());
- }
- }
-
- // this gets called when the selection changes within the selection manager
- //
- public void selectionChanged(SelectionChangedEvent event)
- {
- //System.out.println("WSDLGraphViewer.selectionChanged( " + event.getSource() + ")");
-
- IStructuredSelection selectionObject = (IStructuredSelection)event.getSelection();
- Object modelObject = selectionObject.getFirstElement();
- if (modelObject instanceof WSDLElement) {
- Element node = ((WSDLElement) modelObject).getElement();
- boolean isEditable = (node instanceof XMLNode);
-
- Action copyAction = new CopyGlobalAction((WSDLElement) modelObject, editor);
- Action pasteAction = new PasteGlobalAction((WSDLElement) modelObject, editor);
-
- IActionBars actionBars = editor.getEditorSite().getActionBars();
- actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
- actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
- actionBars.updateActionBars();
-
- if (!isEditable) {
- copyAction.setEnabled(false);
- pasteAction.setEnabled(false);
- }
- }
-
- if (event.getSource() != internalSelectionAdapter && event.getSource() != ((WSDLTextEditor)editor.getTextEditor()).getInternalSelectionProvider())
- {
- boolean isEmptySelectionRequired = true;
- if (event.getSelection() instanceof IStructuredSelection)
- {
- IStructuredSelection selection = (IStructuredSelection)event.getSelection();
- Object model = selection.getFirstElement();
-
- if (model != null)
- {
- EditPart editPart = getEditPart(componentViewer.getRootEditPart(), model);
- if (editPart == null)
- {
- editPart = expandToReveal(componentViewer.getRootEditPart(), model);
- }
- if (editPart == null)
- {
- if (model instanceof XSDConcreteComponent) {
- model = getTopLevelComponent((XSDConcreteComponent) model);
-
- if (model instanceof XSDElementDeclaration ||
- model instanceof XSDComplexTypeDefinition ||
- model instanceof XSDModelGroupDefinition ||
- model instanceof XSDSchema) {
- componentViewer.setInput(model);
- }
- }
- else if (model instanceof WSDLElement || model instanceof WSDLGroupObject) {
- // We need to switch the output to Definition
- componentViewer.setInput(editor.getDefinition());
- editPart = getEditPart(componentViewer.getRootEditPart(), model);
- if (editPart == null)
- {
- editPart = expandToReveal(componentViewer.getRootEditPart(), model);
- }
- }
- else
- {
- // bad hack to convert xsd editor category to xsd object
- // see also WSDLTabbedPropertySheetPage
- Node node = WSDLEditorUtil.getInstance().getNodeForObject(model);
- Object o = WSDLEditorUtil.getInstance().findModelObjectForElement(editor.getDefinition(), (Element)node);
- if (o instanceof XSDSchemaExtensibilityElement)
- {
- Object obj = ((XSDSchemaExtensibilityElement)o).getSchema();
- componentViewer.setInput(obj);
- }
- }
- }
- if (editPart != null)
- {
- isEmptySelectionRequired = false;
- componentViewer.setSelection(new StructuredSelection(editPart));
- scrollIntoView(editPart);
- }
- }
- }
- if (isEmptySelectionRequired)
- {
- componentViewer.setSelection(new StructuredSelection());
- }
- }
- }
-
- protected XSDConcreteComponent getTopLevelComponent(XSDConcreteComponent component)
- {
- XSDConcreteComponent prev = component;
- XSDConcreteComponent container = component;
- while ( container != null && !(container instanceof XSDSchema))
- {
- prev = container;
- container = container.getContainer();
- }
- return container != null ? prev : null;
- }
-
- protected EditPart getEditPart(EditPart editPart, Object model)
- {
- EditPart result = null;
- if (editPart.getModel() == model)
- {
- result = editPart;
- }
- else
- {
- for (Iterator i = editPart.getChildren().iterator(); i.hasNext(); )
- {
- result = getEditPart((EditPart)i.next(), model);
- if (result != null)
- {
- break;
- }
- }
- }
- return result;
- }
-
-
- public EditPart expandToReveal(EditPart editPart, Object model)
- {
- // here we create the parent list
- //
- List parentList = new ArrayList();
- for (Object o = model; o != null; o = getParent(o))
- {
- parentList.add(0, o);
- }
- EditPart result = expandToRevealHelper(editPart, parentList, 0);
-
- return result;
- }
-
-
- public EditPart expandToRevealHelper(EditPart editPart, List parentList, int index)
- {
- EditPart result = null;
- int parentListSize = parentList.size();
- Object model = index < parentListSize ? parentList.get(index) : null;
- if (model != null && editPart != null)
- {
- // search editpart and its descendants to find a match for this model object
- //
- result = getEditPart(editPart, model);
- //System.out.println("getEditPart(" + index + ", " + model + ") = " + result);
- }
-
- if (result != null)
- {
- if (index < (parentListSize - 1))
- {
- // we've found the editPart for the item in the parentList
- // now we need to find the next item
- if (result instanceof TreeNodeEditPart)
- {
- ((TreeNodeEditPart)result).setExpanded(true);
- }
- result = expandToRevealHelper(result, parentList, index + 1);
- }
- }
- return result;
- }
-
-
- protected Object getParent(Object model)
- {
- Object parent = null;
- if (model instanceof EObject)
- {
- parent = ((EObject)model).eContainer();
- }
- return parent;
- }
-
-
- public void scrollIntoView(EditPart editPart)
- {
- for (EditPart parent = editPart.getParent(); parent != null; parent = parent.getParent())
- {
- if (parent instanceof GroupEditPart)
- {
- GroupEditPart groupEditPart = (GroupEditPart)parent;
- groupEditPart.scrollToRevealEditPart(editPart);
- break;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/AbstractConnectionManager.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/AbstractConnectionManager.java
deleted file mode 100644
index c2acef3..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/AbstractConnectionManager.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class AbstractConnectionManager implements IConnectionManager
-{
- public static final int PROPAGATE_FORWARD = 0;
- public static final int PROPAGATE_BACK = 1;
- public static final int SELECTED = 2;
-
- protected GroupEditPart groupEditPart;
-
- public AbstractConnectionManager(GroupEditPart groupEditPart)
- {
- this.groupEditPart = groupEditPart;
- }
-
- protected WSDLSwitch createSwitch(int selectionType)
- {
- return new WSDLSwitch();
- }
-
- public void propagateForward(Object model)
- {
- if (model instanceof WSDLElement)
- {
- WSDLSwitch theSwitch = createSwitch(PROPAGATE_FORWARD);
- theSwitch.doSwitch((EObject)model);
- groupEditPart.scrollToRevealInputConnection();
- }
- else
- {
- removeConnections();
- }
- propagateForwardToNext(model);
- }
-
- public void propagateBack(Object model)
- {
- if (model instanceof WSDLElement)
- {
- WSDLSwitch theSwitch = createSwitch(PROPAGATE_BACK);
- theSwitch.doSwitch((EObject)model);
- groupEditPart.scrollToRevealOutputConnection();
- }
- else
- {
- removeConnections();
- }
- propagateBackToPrevious(model);
- }
-
- public void setSelectedModelObject(Object model)
- {
- if (model instanceof Node)
- {
- Node node = (Node)model;
- //Definition definition = groupEditPart.getDefinition();
- while(node != null)
- {
- if (WSDLConstants.WSDL_NAMESPACE_URI.equals(node.getNamespaceURI()))
- {
- break;
- }
- else
- {
- node = node.getParentNode();
- }
- }
- if (node instanceof Element)
- {
- model = WSDLEditorUtil.getInstance().findModelObjectForElement( groupEditPart.getDefinition(), (Element)node);
- }
- }
-
- if (model instanceof WSDLElement)
- {
- WSDLSwitch theSwitch = createSwitch(SELECTED);
- theSwitch.doSwitch((EObject)model);
- }
- else
- {
- removeConnections();
- }
- propagateForwardToNext(model);
- propagateBackToPrevious(model);
- }
-
-
- protected void removeConnections()
- {
- groupEditPart.setEmphasizedModelObject(null);
- groupEditPart.setInputConnectionModelObject(null);
- groupEditPart.setOutputConnectionModelObject(null);
- }
-
- protected void propagateForwardToNext(Object model)
- {
- GroupEditPart group = groupEditPart.getNext();
- if (group != null)
- {
- IConnectionManager connectionManager = group.getConnectionManager();
- if (connectionManager != null)
- {
- connectionManager.propagateForward(model);
- }
- }
- }
-
- protected void propagateBackToPrevious(Object model)
- {
- GroupEditPart group = groupEditPart.getPrevious();
- if (group != null)
- {
- IConnectionManager connectionManager = group.getConnectionManager();
- if (connectionManager != null)
- {
- connectionManager.propagateBack(model);
- }
- }
- }
-
- protected Binding getEnclosingBinding(EObject object)
- {
- Binding binding = null;
- if (object instanceof Binding)
- {
- binding = (Binding)object;
- }
- else if (object instanceof BindingOperation)
- {
- binding = (Binding)object.eContainer();
- }
- else if (object instanceof BindingInput ||
- object instanceof BindingOutput ||
- object instanceof BindingFault)
- {
- binding = (Binding)object.eContainer().eContainer();
- }
- return binding;
- }
-
- protected PortType getEnclosingPortType(EObject object)
- {
- PortType portType = null;
- if (object instanceof Operation)
- {
- portType = (PortType)object.eContainer();
- }
- else if (object instanceof Input ||
- object instanceof Output ||
- object instanceof Fault)
- {
-
- portType = object.eContainer() != null ? (PortType)object.eContainer().eContainer() : null;
- }
- else if (object instanceof PortType)
- {
- portType = (PortType)object;
- }
- return portType;
- }
-
- protected Operation getEnclosingOperation(EObject object)
- {
- Operation operation = null;
- if (object instanceof Operation)
- {
- operation = (Operation)object;
- }
- else if (object instanceof Input ||
- object instanceof Output ||
- object instanceof Fault)
- {
- operation = (Operation)object.eContainer();
- }
- return operation;
- }
-
- protected EObject getMessageReference(EObject object)
- {
- return (object instanceof Input ||
- object instanceof Output ||
- object instanceof Fault) ? object : null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/BindingsGroupConnectionManager.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/BindingsGroupConnectionManager.java
deleted file mode 100644
index 65e1eaa..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/BindingsGroupConnectionManager.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-
-
-public class BindingsGroupConnectionManager extends AbstractConnectionManager
-{
- public BindingsGroupConnectionManager(GroupEditPart groupEditPart)
- {
- super(groupEditPart);
- }
-
-
- class InternalWSDLSwitch extends WSDLSwitch
- {
- protected ComponentReferenceUtil util = new ComponentReferenceUtil(groupEditPart.getDefinition());
-
- public Object caseBinding(Binding binding)
- {
- groupEditPart.setEmphasizedModelObject(binding);
- groupEditPart.setInputConnectionModelObject(binding);
- groupEditPart.setOutputConnectionModelObject(binding);
- return Boolean.TRUE;
- }
-
- public Object caseBindingFault(BindingFault bindingFault)
- {
- groupEditPart.setEmphasizedModelObject(getEnclosingBinding(bindingFault));
- groupEditPart.setInputConnectionModelObject(getEnclosingBinding(bindingFault));
- groupEditPart.setOutputConnectionModelObject(bindingFault);
- return Boolean.TRUE;
- }
-
- public Object caseBindingInput(BindingInput bindingInput)
- {
- groupEditPart.setEmphasizedModelObject(getEnclosingBinding(bindingInput));
- groupEditPart.setInputConnectionModelObject(getEnclosingBinding(bindingInput));
- groupEditPart.setOutputConnectionModelObject(bindingInput);
- return Boolean.TRUE;
- }
-
- public Object caseBindingOperation(BindingOperation bindingOperation)
- {
- groupEditPart.setEmphasizedModelObject(getEnclosingBinding(bindingOperation));
- groupEditPart.setInputConnectionModelObject(getEnclosingBinding(bindingOperation));
- groupEditPart.setOutputConnectionModelObject(bindingOperation);
- return Boolean.TRUE;
- }
-
- public Object caseBindingOutput(BindingOutput bindingOutput)
- {
- groupEditPart.setEmphasizedModelObject(getEnclosingBinding(bindingOutput));
- groupEditPart.setInputConnectionModelObject(getEnclosingBinding(bindingOutput));
- groupEditPart.setOutputConnectionModelObject(bindingOutput);
- return Boolean.TRUE;
- }
-
- public Object caseFault(Fault fault)
- {
- handleInterfaceHelper(fault);
- return Boolean.TRUE;
- }
-
- public Object caseInput(Input input)
- {
-
- handleInterfaceHelper(input);
- return Boolean.TRUE;
- }
-
- public Object caseOperation(Operation operation)
- {
- handleInterfaceHelper(operation);
- return Boolean.TRUE;
- }
-
- public Object caseOutput(Output output)
- {
- handleInterfaceHelper(output);
- return Boolean.TRUE;
- }
-
- public Object casePortType(PortType portType)
- {
- handleInterfaceHelper(portType);
- return Boolean.TRUE;
- }
-
- public Object casePort(Port port)
- {
- Binding binding = port.getEBinding();
- groupEditPart.setEmphasizedModelObject(binding);
- groupEditPart.setInputConnectionModelObject(binding);
- groupEditPart.setOutputConnectionModelObject(binding);
- return Boolean.TRUE;
- }
-
- public Object defaultCase(EObject object)
- {
- groupEditPart.setEmphasizedModelObject(null);
- groupEditPart.setInputConnectionModelObject(null);
- groupEditPart.setOutputConnectionModelObject(null);
- return Boolean.TRUE;
- }
-
- protected Binding getPreviousMatchingBinding(PortType portType)
- {
- Binding result = null;
- Object previousContext = groupEditPart.getOutputConnectionModelObject();
- if (previousContext == null)
- {
- previousContext = groupEditPart.getEmphasizedModelObject();
- }
- if (previousContext instanceof EObject)
- {
- Binding binding = getEnclosingBinding((EObject)previousContext);
- if (binding.getEPortType() == portType)
- {
- result = binding;
- }
- }
- return result;
- }
-
- protected void handleInterfaceHelper(EObject interfaceObject)
- {
- Binding binding = null;
- PortType portType = getEnclosingPortType(interfaceObject);
- if (portType != null)
- {
- binding = getPreviousMatchingBinding(portType);
- if (binding == null)
- {
- List list = util.getBindings(portType);
- binding = list.size() > 0 ? (Binding)list.get(0) : null;
- }
- if (binding != null)
- {
- groupEditPart.setEmphasizedModelObject(binding);
- groupEditPart.setInputConnectionModelObject(binding);
- EObject bindingObject = util.getBindingObject(interfaceObject, binding);
- groupEditPart.setOutputConnectionModelObject(bindingObject);
- }
- }
- if (binding == null)
- {
- defaultCase(null);
- }
- }
- }
-
- protected WSDLSwitch createSwitch(int selectionType)
- {
- return new InternalWSDLSwitch();
- }
-
- protected void propagateBackToPrevious(Object model)
- {
- super.propagateBackToPrevious(groupEditPart.getInputConnectionModelObject());
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/ComponentViewerRootEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/ComponentViewerRootEditPart.java
deleted file mode 100644
index b0e0863..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/ComponentViewerRootEditPart.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.ui.internal.gef.util.editparts.AbstractComponentViewerRootEditPart;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerLayout;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-
-
-public class ComponentViewerRootEditPart extends AbstractComponentViewerRootEditPart
-{
- protected final static String MESSAGE_PLACE_HOLDER = "MESSAGE_PLACE_HOLDER";
- protected Object input;
-
- public void setInput(Object newInput)
- {
- input = newInput;
- setModel(input);
- refreshChildren();
- }
-
- protected IFigure createFigure()
- {
- Panel panel = new Panel();
- panel.setBorder(new MarginBorder(30, 30, 30, 30));
- //panel.setBackgroundColor(GraphicsConstants.red);
-
- ContainerLayout layout = new ContainerLayout();
- layout.setHorizontal(false);
- panel.setLayoutManager(layout);
- return panel;
- }
-
-
- protected EditPart createChild(Object model)
- {
- EditPart editPart = null;
- if (model == MESSAGE_PLACE_HOLDER)
- {
- editPart = new NotAvailableMessageEditPart();
- editPart.setModel(model);
- }
- else
- {
- editPart = ExtensibleEditPartFactory.getInstance().createEditPart(this, model);
- }
- return editPart;
- }
-
-
- protected List getModelChildren()
- {
- List result = new ArrayList();
-
- if (input != null)
- {
- result.add(input);
- }
- else
- {
- result.add(MESSAGE_PLACE_HOLDER);
- }
-
- return result;
- }
-
-
- public void propertyChanged(Object object, String property)
- {
- if (property == ModelAdapter.CHILDREN_PROPERTY)
- {
- refreshChildren();
- }
- else if (property == ModelAdapter.DETAIL_PROPERTY)
- {
- refreshVisuals();
- }
- else
- {
- refreshChildren();
- refreshVisuals();
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/DefinitionEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/DefinitionEditPart.java
deleted file mode 100644
index bfdd830..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/DefinitionEditPart.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.gef.util.figures.RoundedLineBorder;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.wst.wsdl.ui.internal.util.OpenOnSelectionHelper;
-
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerLayout;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.FillLayout;
-
-public class DefinitionEditPart extends WSDLEditPart implements ISelectionChangedListener //, ModelAdapterListener
-{
- protected Label label;
- protected ContainerFigure outlined;
-
- protected ContainerFigure rightContentPane;
- protected ContainerFigure topContentPane;
- protected ContainerFigure middleContentPane;
- protected ContainerFigure bottomContentPane;
- protected static final String SELECTED_EDIT_PART_REFERENCE = "SELECTED_EDIT_PART_REFERENCE";
-
- public void activate()
- {
- super.activate();
- getViewer().addSelectionChangedListener(this);
- }
- /**
- * Apart from the deactivation done in super, the source
- * and target connections are deactivated, and the visual
- * part of the this is removed.
- *
- * @see #activate()
- */
- public void deactivate()
- {
- getViewer().removeSelectionChangedListener(this);
- super.deactivate();
- }
-
- protected IFigure[] initContentPanes()
- {
- IFigure[] contentPanes = new IFigure[4];
- contentPanes[0] = rightContentPane;
- contentPanes[1] = topContentPane;
- contentPanes[2] = middleContentPane;
- contentPanes[3] = bottomContentPane;
- return contentPanes;
- }
-
- protected int getContentPane(Object model)
- {
- int result = 0;
-
- if (model == SELECTED_EDIT_PART_REFERENCE)
- {
- result = 0;
- }
- else if (model instanceof WSDLGroupObject)
- {
- WSDLGroupObject groupObject = (WSDLGroupObject)model;
- switch (groupObject.getType())
- {
- case WSDLGroupObject.IMPORTS_GROUP :
- case WSDLGroupObject.TYPES_GROUP :
- //case WSDLGroupObject.EXTENSIBILITY_ELEMENTS_GROUP :
- {
- result = 1;
- break;
- }
- case WSDLGroupObject.BINDINGS_GROUP :
- case WSDLGroupObject.MESSAGES_GROUP :
- case WSDLGroupObject.PORT_TYPES_GROUP :
- case WSDLGroupObject.SERVICES_GROUP :
- {
- result = 2;
- break;
- }
- case WSDLGroupObject.EXTENSIBILITY_ELEMENTS_GROUP :
- {
- result = 3;
- break;
- }
- }
- }
- return result;
- }
-
- protected EditPart createChild(Object model)
- {
- EditPart editPart = null;
- if (model == SELECTED_EDIT_PART_REFERENCE)
- {
- editPart = new PartReferenceSectionEditPart();
- editPart.setModel(model);
- editPart.setParent(this);
- }
- else
- {
- editPart = super.createChild(model);
- }
- return editPart;
- }
-
- protected IFigure createFigure()
- {
- ContainerFigure outer = new ContainerFigure();
- ContainerLayout anchoredLayout = new ContainerLayout()
- {
- protected int alignFigure(IFigure parent, IFigure child)
- {
- return (child == outlined) ? 0 : -1;
- }
- };
- outer.setLayoutManager(anchoredLayout);
- /*
- ContainerFigure outer = new ConnectedEditPartFigure(this)
- {
- public IFigure getConnectionFigure()
- {
- return selectedPartEditPart != null ? selectedPartEditPart.getFigure() : this;
- }
- };*/
- outer.getContainerLayout().setHorizontal(true);
- //outer.setBorder(new MarginBorder(0, 20, 0, 0));
-
- outlined = new ContainerFigure();
- outer.add(outlined);
- //outlined.getContainerLayout().setHorizontal(false);
- outlined.setLayoutManager(new FillLayout());
- outlined.setBorder(new RoundedLineBorder(1, 6));
- outlined.setForegroundColor(groupBorderColor);
-
- ContainerFigure rightPane = new ContainerFigure();
- rightPane.setBorder(new MarginBorder(0, 0, 0, 300));
- rightPane.getContainerLayout().setHorizontal(false);
- outer.add(rightPane);
-
- //RectangleFigure spacer = new RectangleFigure();
- //rightPane.add(spacer);
- //spacer.setPreferredSize(new Dimension(450, 200));
-
- rightContentPane = new ContainerFigure();
- rightPane.add(rightContentPane);
- rightContentPane.setBorder(new MarginBorder(15, 20, 15, 15));
-
- ContainerFigure labelHolder = new ContainerFigure();
- outlined.add(labelHolder);
-
- label = new Label();
- labelHolder.add(label);
- label.setBorder(new MarginBorder(2, 5, 0, 5));
- label.setFont(mediumFont);
- label.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_DEFINITION"));
- label.setForegroundColor(ColorConstants.black);
-
- topContentPane = new ContainerFigure();
- outlined.add(topContentPane);
-
- FillLayout fillLayout = new FillLayout(15);
- fillLayout.setHorizontal(true);
- topContentPane.setLayoutManager(fillLayout);
- topContentPane.setBorder(new MarginBorder(10, 10, 10, 10));
-
- middleContentPane = new ContainerFigure();
- outlined.add(middleContentPane);
- fillLayout = new FillLayout(15);
- fillLayout.setHorizontal(true);
- middleContentPane.setLayoutManager(fillLayout);
- middleContentPane.setBorder(new MarginBorder(0, 10, 10, 10));
-
- bottomContentPane = new ContainerFigure();
- outlined.add(bottomContentPane);
- bottomContentPane.setLayoutManager(new FillLayout());
- bottomContentPane.setBorder(new MarginBorder(0, 10, 10, 10));
-
- return outer;
- }
-
- //public IFigure getContentPane()
- //{
- // return contentPane;
- //}
- public PartReferenceSectionEditPart getPartReferenceSectionEditPart()
- {
- PartReferenceSectionEditPart result = null;
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- EditPart editPart = (EditPart)i.next();
- if (editPart.getModel() == SELECTED_EDIT_PART_REFERENCE)
- {
- result = (PartReferenceSectionEditPart)editPart;
- break;
- }
- }
- return result;
- }
-
- public GroupEditPart getGroupEditPart(int type)
- {
- GroupEditPart result = null;
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof GroupEditPart)
- {
- GroupEditPart groupEditPart = (GroupEditPart)o;
- if (groupEditPart.getType() == type)
- {
- result = groupEditPart;
- break;
- }
- }
- }
- return result;
- }
-
- public List getModelChildren()
- {
- List list = new ArrayList();
- list.add(SELECTED_EDIT_PART_REFERENCE);
- list.addAll(super.getModelChildren());
- return list;
- }
-
- public void handleOpenRequest(EditPart editPart)
- {
- GroupEditPart groupEditPart = null;
- if (editPart.getModel() instanceof Import)
- {
- Import theImport = (Import)editPart.getModel();
- Definition definition = (Definition)getModel();
- OpenOnSelectionHelper helper = new OpenOnSelectionHelper(definition);
- helper.openEditor(theImport);
- }
- else
- {
- for (EditPart parent = (EditPart)editPart.getParent(); parent != null; parent = parent.getParent())
- {
- if (parent instanceof GroupEditPart)
- {
- groupEditPart = (GroupEditPart)parent;
- break;
- }
- }
-
- if (groupEditPart != null)
- {
- GroupEditPart nextGroupEditPart = groupEditPart.getNext();
- if (nextGroupEditPart != null)
- {
- if (nextGroupEditPart.inputConnection instanceof TreeNodeEditPart)
- {
- ((TreeNodeEditPart) (nextGroupEditPart.inputConnection)).setExpanded(true);
- }
- }
- GroupEditPart prevGroupEditPart = groupEditPart.getPrevious();
- if (prevGroupEditPart != null)
- {
- if (prevGroupEditPart.outputConnection instanceof TreeNodeEditPart)
- {
- ((TreeNodeEditPart) (prevGroupEditPart.outputConnection)).setExpanded(true);
- }
- }
- }
- updateConnections();
- }
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- updateConnections();
- }
-
- public void updateConnections()
- {
- // todo
- if (isActive())
- {
- try
- {
- final AbstractGraphicalEditPart selectedEditPart = getSelectedEditPart(getViewer().getSelection());
- GroupEditPart group = getContainingGroup(selectedEditPart);
- if (group != null && group.getConnectionManager() != null)
- {
- group.getConnectionManager().setSelectedModelObject(selectedEditPart.getModel());
- }
- else if (!isAncestor(getPartReferenceSectionEditPart(), selectedEditPart))
- {
- group = getGroupEditPart(WSDLGroupObject.PORT_TYPES_GROUP);
- group.getConnectionManager().setSelectedModelObject(null);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-
- public GroupEditPart getContainingGroup(AbstractGraphicalEditPart editPart)
- {
- GroupEditPart result = null;
- for (EditPart parent = editPart.getParent(); parent != null; parent = parent.getParent())
- {
- if (parent instanceof GroupEditPart)
- {
- result = (GroupEditPart)parent;
- break;
- }
- }
- return result;
- }
-
- public GroupEditPart getNextGroupEditPart(GroupEditPart groupEditPart)
- {
- GroupEditPart result = null;
- GroupEditPart prev = null;
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof GroupEditPart)
- {
- GroupEditPart editPart = (GroupEditPart)o;
- if (prev == groupEditPart)
- {
- result = editPart;
- break;
- }
- prev = editPart;
- }
- }
- return result;
- }
-
- public GroupEditPart getPreviousGroupEditPart(GroupEditPart groupEditPart)
- {
- GroupEditPart prev = null;
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof GroupEditPart)
- {
- GroupEditPart editPart = (GroupEditPart)o;
- if (editPart == groupEditPart)
- {
- break;
- }
- prev = editPart;
- }
- }
- return prev;
- }
-
- protected AbstractGraphicalEditPart getSelectedEditPart(ISelection selection)
- {
- AbstractGraphicalEditPart editPart = null;
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection s = (IStructuredSelection)selection;
- Object first = s.getFirstElement();
- if (first instanceof AbstractGraphicalEditPart)
- {
- editPart = (AbstractGraphicalEditPart)first;
- }
- }
- return editPart;
- }
-
- public void refreshChildren()
- {
- super.refreshChildren();
- updateConnections();
- }
-
- public boolean isAncestor(EditPart ancestor, EditPart child)
- {
- boolean result = false;
- if (ancestor != null && child != null)
- {
- for (EditPart editPart = child; editPart != null; editPart = editPart.getParent())
- {
- if (editPart == ancestor)
- {
- result = true;
- break;
- }
- }
- }
- return result;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/DrillDownEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/DrillDownEditPart.java
deleted file mode 100644
index d53e775..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/DrillDownEditPart.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.handles.MoveHandleLocator;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.graph.WSDLComponentViewer;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerFigure;
-
-public class DrillDownEditPart extends AbstractGraphicalEditPart
-{
- protected Label drillDownButtonLabel;
- protected Label label;
-
- protected IFigure createFigure()
- {
- ContainerFigure figure = new ContainerFigure();
- drillDownButtonLabel = new Label();
- drillDownButtonLabel.setIcon(WSDLEditorPlugin.getInstance().getImage("icons/forward.gif"));
- figure.add(drillDownButtonLabel);
- label = new Label();
- label.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_UNKNOWN"));
-
-// evil hack to provide underlines
- boolean isLinux = java.io.File.separator.equals("/");
- if (!isLinux)
- {
- Font underlineFont = new Font(Display.getCurrent(), "Tahoma", 8, SWT.NONE);
- FontData oldData = underlineFont.getFontData()[0];
- FontData fontData = new FontData(oldData.getName(), oldData.getHeight(), SWT.NONE);
- try
- {
- // TODO... clean this awful code up... we seem to be leaking here too
- // we can't call this directly since the methods are OS dependant
- // fontData.data.lfUnderline = 1
- // so instead we use reflection
- Object data = fontData.getClass().getField("data").get(fontData);
- System.out.println("data" + data.getClass());
- data.getClass().getField("lfUnderline").setByte(data, (byte)1);
- Font font = new Font(Display.getCurrent(), fontData);
- label.setFont(font);
- }
- catch (Exception e)
- {
- }
- }
- figure.add(label);
-
- return figure;
- }
-
-
- protected void createEditPolicies()
- {
- DrillDownEditPartSelectionHandlesEditPolicy policy = new DrillDownEditPartSelectionHandlesEditPolicy();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);
- }
-
- public void performRequest(Request request)
- {
- if (request.getType() == RequestConstants.REQ_DIRECT_EDIT ||
- request.getType() == RequestConstants.REQ_OPEN)
- {
- if (request instanceof LocationRequest)
- {
- LocationRequest locationRequest = (LocationRequest)request;
- Point p = locationRequest.getLocation();
-
- if (hitTest(drillDownButtonLabel, p) || hitTest(label, p))
- {
- performDrillDownAction();
- }
- }
- }
- }
-
- protected EditPart createChild(Object model)
- {
- return null;
- }
-
- protected List getModelChildren()
- {
- return Collections.EMPTY_LIST;
- }
-
- public boolean hitTest(IFigure target, Point location)
- {
- Rectangle b = target.getBounds().getCopy();
- target.translateToAbsolute(b);
- return b.contains(location);
- }
-
- protected void performDrillDownAction()
- {
- Runnable runnable = new Runnable()
- {
- public void run()
- {
- ((WSDLComponentViewer)getViewer()).setInput(getModel());
- }
- };
- Display.getCurrent().asyncExec(runnable);
- }
-
- private class DrillDownEditPartSelectionHandlesEditPolicy extends SelectionHandlesEditPolicy {
- protected List createSelectionHandles()
- {
- List list = new ArrayList();
- EditPart editPart = getHost();
-
- if (editPart instanceof GraphicalEditPart)
- {
- GraphicalEditPart graphicalEditPart = (GraphicalEditPart)editPart;
- IFigure figure = graphicalEditPart.getFigure();
-
- MoveHandleLocator loc = new MoveHandleLocator(figure);
- MoveHandle moveHandle = new MoveHandle(graphicalEditPart, loc);
- list.add(moveHandle);
- }
-
- return list;
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/ExtensibleEditPartFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/ExtensibleEditPartFactory.java
deleted file mode 100644
index 4caaf08..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/ExtensibleEditPartFactory.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtensionRegistry;
-
-public class ExtensibleEditPartFactory implements EditPartFactory
-{
- protected WSDLEditorExtension[] extensions;
- protected EditPartFactory[] editPartFactories;
-
- protected static ExtensibleEditPartFactory instance;
-
- public static ExtensibleEditPartFactory getInstance()
- {
- if (instance == null)
- {
- instance = new ExtensibleEditPartFactory();
- }
- return instance;
- }
-
- public ExtensibleEditPartFactory()
- {
- WSDLEditorExtensionRegistry registry = WSDLEditorPlugin.getInstance().getWSDLEditorExtensionRegistry();
-
- extensions = registry.getRegisteredExtensions(WSDLEditorExtension.EDIT_PART_FACTORY);
- editPartFactories = new EditPartFactory[extensions.length];
- for (int i = 0; i < extensions.length; i++)
- {
- editPartFactories[i] = (EditPartFactory)extensions[i].createExtensionObject(WSDLEditorExtension.EDIT_PART_FACTORY, null);
- }
- }
-
- protected EditPartFactory getApplicableEditPartFactory(Object object)
- {
- EditPartFactory result = null;
- for (int i = 0; i < extensions.length; i++)
- {
- if (extensions[i].isApplicable(object))
- {
- result = editPartFactories[i];
- if (result != null)
- {
- break;
- }
- }
- }
-
- if (result == null) {
- boolean b = true;
- }
- return result;
- }
-
- public EditPart createEditPart(EditPart parent, Object model)
- {
- EditPart result = null;
- EditPartFactory factory = getApplicableEditPartFactory(model);
- if (factory != null)
- {
- result = factory.createEditPart(parent, model);
- }
- else
- {
- result = new UnknownObjectEditPart();
- result.setModel(model);
- result.setParent(parent);
- }
- return result;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/GroupEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/GroupEditPart.java
deleted file mode 100644
index c9b6ed1..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/GroupEditPart.java
+++ /dev/null
@@ -1,481 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ScrollPane;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.ViewportLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.gef.util.figures.RoundedLineBorder;
-import org.eclipse.wst.wsdl.ui.internal.graph.WSDLComponentViewer;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerLayout;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.FillLayout;
-
-public class GroupEditPart extends WSDLEditPart
-{
- protected ScrollPane scrollpane;
- protected Label label;
-
- protected Object emphasizedModelObject;
- protected Object inputConnectionModelObject;
- protected Object outputConnectionModelObject;
-
- public WSDLTreeNodeEditPart emphasizedEditPart;
- public AbstractGraphicalEditPart inputConnection;
- public AbstractGraphicalEditPart outputConnection;
-
- public GroupEditPart nextGroupEditPart;
- public IConnectionManager connectionManager;
-
- protected InternalFigureListener figureListener = new InternalFigureListener();
-
- class InternalFigureListener implements FigureListener
- {
- public void figureMoved(IFigure source)
- {
- ScalableRootEditPart root = (ScalableRootEditPart)getViewer().getRootEditPart();
- root.getLayer(LayerConstants.CONNECTION_LAYER).repaint();
- }
- }
-
- public Object getEmphasizedModelObject()
- {
- return emphasizedModelObject;
- }
-
- public Definition getDefinition()
- {
- return ((WSDLGroupObject)getModel()).getDefinition();
- }
-
- //protected void setEmphasizedObject(EditPart editPart)
- //{
- // UnknownObjectEditPart ep = null;
- // if (editPart instanceof UnknownObjectEditPart)
- // {
- // ep = (UnknownObjectEditPart)editPart;
- // }
- //
- // if (emphasizedEditPart != null)
- // {
- // emphasizedEditPart.setEmphasized(false);
- // }
- // if (ep != null)
- // {
- // emphasizedEditPart = ep;
- // emphasizedEditPart.setEmphasized(true);
- // }
- //}
-
- public void setEmphasizedModelObject(Object model)
- {
- emphasizedModelObject = model;
-
- if (emphasizedEditPart != null)
- {
- emphasizedEditPart.setEmphasized(false);
- }
-
- EditPart editPart = getMatchingChildEditPart(model);
- emphasizedEditPart = (editPart instanceof WSDLTreeNodeEditPart) ? (WSDLTreeNodeEditPart)editPart : null;
-
- if (emphasizedEditPart != null)
- {
- emphasizedEditPart.setEmphasized(true);
- }
- }
-
- public void scrollToRevealEditPart(EditPart editPart)
- {
- if (editPart instanceof AbstractGraphicalEditPart)
- {
- scrollToEditPart((AbstractGraphicalEditPart)editPart);
- }
- }
-
- public void scrollToRevealInputConnection()
- {
- if (inputConnection != null)
- {
- scrollToEditPart(inputConnection);
- }
- }
-
- public void scrollToRevealOutputConnection()
- {
- if (outputConnection != null)
- {
- scrollToEditPart(outputConnection);
- }
- }
-
- public void setInputConnectionModelObject(Object model)
- {
- inputConnection = getMatchingChildEditPart(model);
- inputConnectionModelObject = model;
- }
-
- public Object getInputConnectionModelObject()
- {
- return inputConnectionModelObject;
- }
-
- public Object getOutputConnectionModelObject()
- {
- return outputConnectionModelObject;
- }
-
- public void setOutputConnectionModelObject(Object model)
- {
- outputConnection = getMatchingChildEditPart(model);
- outputConnectionModelObject = model;
- }
-
- protected void createConnectionManager()
- {
- switch (getType())
- {
- case WSDLGroupObject.MESSAGES_GROUP :
- {
- connectionManager = new MessagesGroupConnectionManager(this);
- break;
- }
- case WSDLGroupObject.SERVICES_GROUP :
- {
- connectionManager = new ServicesGroupConnectionManager(this);
- break;
- }
- case WSDLGroupObject.BINDINGS_GROUP :
- {
- connectionManager = new BindingsGroupConnectionManager(this);
- break;
- }
- case WSDLGroupObject.PORT_TYPES_GROUP :
- {
- connectionManager = new PortTypesGroupConnectionManager(this);
- break;
- }
- }
- }
-
- public IConnectionManager getConnectionManager()
- {
- return connectionManager;
- }
-
- public ContainerFigure outerPane;
-
- public IFigure createFigure()
- {
- createConnectionManager();
-
- outerPane = new ContainerFigure();
- outerPane.setBorder(new RoundedLineBorder(1, 6));
- outerPane.setForegroundColor(groupBorderColor);
-
- ContainerFigure r = new ContainerFigure();
- //r.setCornerDimensions(new Dimension(4, 4));
- r.setOutline(false);
- r.setMinimumSize(new Dimension(0, 0));
-
- r.setFill(true);
-
- r.setBackgroundColor(groupHeaderColor);
- outerPane.add(r);
-
- //ContainerFigure labelHolder = new ContainerFigure();
- //labelHolder.add(label);
- label = new Label();
- label.setForegroundColor(ColorConstants.black);
- label.setBorder(new MarginBorder(2, 4, 2, 4));
- r.add(label); //Holder);
-
- RectangleFigure line = new RectangleFigure();
- line.setPreferredSize(20, 1);
- outerPane.add(line);
-
- int minHeight = 250;
- switch (getType())
- {
- case WSDLGroupObject.IMPORTS_GROUP :
- case WSDLGroupObject.TYPES_GROUP :
- {
- minHeight = 50;
- break;
- }
- case WSDLGroupObject.EXTENSIBILITY_ELEMENTS_GROUP :
- {
- minHeight = 150;
- break;
- }
- }
-
- final int theMinHeight = minHeight;
- FillLayout outerLayout = new FillLayout()
- {
- protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
- {
- Dimension d = super.calculatePreferredSize(parent, width, height);
- d.union(new Dimension(100, theMinHeight));
- return d;
- }
- };
- outerLayout.setHorizontal(false);
- //layout.setSpacing(5);
- outerPane.setLayoutManager(outerLayout);
-
- scrollpane = new ScrollPane();
- scrollpane.setForegroundColor(ColorConstants.black);
- scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC); //ScrollPane.ALWAYS);
- outerPane.add(scrollpane);
-
- ContainerFigure pane = new ContainerFigure();
- pane.setBorder(new MarginBorder(5, 8, 5, 8));
- ContainerLayout layout = new ContainerLayout();
- layout.setHorizontal(false);
- layout.setSpacing(0);
- pane.setLayoutManager(layout);
-
- Viewport viewport = new Viewport();
- viewport.setContentsTracksHeight(true);
- ViewportLayout viewportLayout = new ViewportLayout()
- {
- protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
- {
- Dimension d = super.calculatePreferredSize(parent, width, height);
- d.height = Math.min(d.height, theMinHeight - 25); //getViewer().getControl().getBounds().height);
- return d;
- }
- };
- viewport.setLayoutManager(viewportLayout);
-
- scrollpane.setViewport(viewport);
- scrollpane.setContents(pane);
- pane.addFigureListener(figureListener);
-
- return outerPane;
- }
-
- protected void refreshVisuals()
- {
- ModelAdapter adapter = getModelAdapter(getModel());
- if (adapter != null)
- {
- label.setText((String)adapter.getProperty(getModel(), ModelAdapter.LABEL_PROPERTY));
- //label.setIcon((Image)adapter.getProperty(getModel(), ModelAdapter.IMAGE_PROPERTY));
- }
- super.refreshVisuals();
- }
-
- protected void createEditPolicies()
- {
- }
-
- public IFigure getContentPane()
- {
- return scrollpane.getContents();
- }
-
- protected void scrollToEditPart(final AbstractGraphicalEditPart targetEditPart)
- {
- Runnable r = new Runnable()
- {
- public void run()
- {
- scrollToEditPartHelper(targetEditPart);
- }
- };
- Display.getCurrent().asyncExec(r);
- }
-
- protected void scrollToEditPartHelper(AbstractGraphicalEditPart targetEditPart)
- {
- if (targetEditPart != null)
- {
- Rectangle r1 = targetEditPart.getFigure().getBounds();
- Rectangle r2 = getContentPane().getBounds();
- scrollpane.scrollVerticalTo((r1.y - r2.y) - scrollpane.getBounds().height / 2);
- }
- }
-
- public AbstractGraphicalEditPart getMatchingChildEditPart(Object model)
- {
- List list = new ArrayList();
- Definition definition = getDefinition();
- for (Object o = model; o != null && !(o instanceof Definition); o = getParent(o))
- {
- list.add(0, o);
- }
- return getMatchingChildEditPart(this, list, 0, true);
- }
-
- protected Object getParent(Object model)
- {
- Object parent = null;
- if (model instanceof EObject)
- {
- parent = ((EObject)model).eContainer();
- }
- return parent;
- }
-
- protected AbstractGraphicalEditPart getMatchingChildEditPart(AbstractGraphicalEditPart editPart, List list, int index, boolean getUnexpandedParent)
- {
- AbstractGraphicalEditPart result = (getUnexpandedParent && editPart != this) ? editPart : null;
- Object model = list.size() > index ? list.get(index) : null;
- if (model != null && editPart != null)
- {
- for (Iterator i = editPart.getChildren().iterator(); i.hasNext();)
- {
- AbstractGraphicalEditPart child = (AbstractGraphicalEditPart)i.next();
- if (child.getModel() == model)
- {
- result = child;
- break;
- }
- }
- index++;
- if (index < list.size())
- {
- result = getMatchingChildEditPart(result, list, index, getUnexpandedParent);
- }
- }
- return result;
- }
-
- public int getType()
- {
- return ((WSDLGroupObject)getModel()).getType();
- }
-
- public GroupEditPart getNext()
- {
- return ((DefinitionEditPart)getParent()).getNextGroupEditPart(this);
- }
-
- public GroupEditPart getPrevious()
- {
- return ((DefinitionEditPart)getParent()).getPreviousGroupEditPart(this);
- }
-
- private void _refreshChildren()
- {
- int i;
- EditPart editPart;
- Object model;
-
- Map modelToEditPart = new HashMap();
- List children = getChildren();
-
- for (i = 0; i < children.size(); i++)
- {
- editPart = (EditPart)children.get(i);
- modelToEditPart.put(editPart.getModel(), editPart);
- }
-
- List modelObjects = getModelChildren();
-
- for (i = 0; i < modelObjects.size(); i++)
- {
- model = modelObjects.get(i);
-
- //Do a quick check to see if editPart[i] == model[i]
- if (i < children.size())
- {
- editPart = (EditPart)children.get(i);
- Object editPartModel = editPart.getModel();
- if (editPartModel == model)
- {
- continue;
- }
- else if (editPartModel.getClass() == model.getClass())
- {
- modelToEditPart.remove(editPartModel);
-
- if (isActive())
- editPart.deactivate();
-
- editPart.setModel(model);
-
- if (isActive())
- {
- editPart.activate();
- editPart.refresh();
- }
- continue;
- }
- }
-
- //Look to see if the EditPart is already around but in the wrong location
- editPart = (EditPart)modelToEditPart.get(model);
-
- if (editPart != null)
- reorderChild(editPart, i);
- else
- {
- //An editpart for this model doesn't exist yet. Create and insert one.
- editPart = createChild(model);
- addChild(editPart, i);
- }
- }
- List trash = new ArrayList();
- for (; i < children.size(); i++)
- trash.add(children.get(i));
- for (i = 0; i < trash.size(); i++)
- {
- EditPart ep = (EditPart)trash.get(i);
- removeChild(ep);
- }
- }
-
- public void refreshChildren()
- {
- boolean reuseChildren = false;
- if (getViewer() instanceof WSDLComponentViewer)
- {
- WSDLComponentViewer wsdlComponentViewer = (WSDLComponentViewer)getViewer();
- reuseChildren = wsdlComponentViewer.isPreserveExpansionEnabled();
- }
-
- if (reuseChildren)
- {
- _refreshChildren();
- }
- else
- {
- super.refreshChildren();
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/IConnectionManager.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/IConnectionManager.java
deleted file mode 100644
index bd0d0a8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/IConnectionManager.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-public interface IConnectionManager
-{
- public void propagateForward(Object model);
- public void propagateBack(Object model);
- public void setSelectedModelObject(Object model);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/IFeedbackHandler.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/IFeedbackHandler.java
deleted file mode 100644
index b6ac2b5..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/IFeedbackHandler.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-public interface IFeedbackHandler
-{
- public void addFeedback();
- public void removeFeedback();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/MessagesGroupConnectionManager.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/MessagesGroupConnectionManager.java
deleted file mode 100644
index 231455d..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/MessagesGroupConnectionManager.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-
-
-public class MessagesGroupConnectionManager extends AbstractConnectionManager
-{
- public MessagesGroupConnectionManager(GroupEditPart groupEditPart)
- {
- super(groupEditPart);
- }
-
- class InternalWSDLSwitch extends WSDLSwitch
- {
- public Object caseFault(Fault fault)
- {
- groupEditPart.setEmphasizedModelObject(fault.getEMessage());
- groupEditPart.setInputConnectionModelObject(fault.getEMessage());
- groupEditPart.setOutputConnectionModelObject(getFirstPart(fault.getEMessage()));
- return Boolean.TRUE;
- }
-
- public Object caseInput(Input input)
- {
- groupEditPart.setEmphasizedModelObject(input.getEMessage());
- groupEditPart.setInputConnectionModelObject(input.getEMessage());
- groupEditPart.setOutputConnectionModelObject(getFirstPart(input.getEMessage()));
- return Boolean.TRUE;
- }
-
- public Object caseMessage(Message message)
- {
- groupEditPart.setEmphasizedModelObject(message);
- groupEditPart.setInputConnectionModelObject(message);
- groupEditPart.setOutputConnectionModelObject(getFirstPart(message));
- return Boolean.TRUE;
- }
-
- public Object caseOutput(Output output)
- {
- groupEditPart.setEmphasizedModelObject(output.getEMessage());
- groupEditPart.setInputConnectionModelObject(output.getEMessage());
- groupEditPart.setOutputConnectionModelObject(getFirstPart(output.getEMessage()));
- return Boolean.TRUE;
- }
-
- public Object casePart(Part part)
- {
- groupEditPart.setEmphasizedModelObject(part.eContainer());
- groupEditPart.setInputConnectionModelObject(part.eContainer());
- groupEditPart.setOutputConnectionModelObject(part);
- return Boolean.TRUE;
- }
-
- public Object defaultCase(EObject object)
- {
- groupEditPart.setEmphasizedModelObject(null);
- groupEditPart.setInputConnectionModelObject(null);
- groupEditPart.setOutputConnectionModelObject(null);
- return Boolean.TRUE;
- }
-
- public Object doSwitch(EObject theEObject)
- {
- Object result = super.doSwitch(theEObject);
- ((DefinitionEditPart)groupEditPart.getParent()).getPartReferenceSectionEditPart().setInput(groupEditPart.getOutputConnectionModelObject());
- return result;
- }
- }
-
- protected WSDLSwitch createSwitch(int selectionType)
- {
- return new InternalWSDLSwitch();
- }
-
- protected Part getFirstPart(Message message)
- {
- Part result = null;
- if (message != null)
- {
- List parts = message.getEParts();
- result = (parts.size() > 0) ? (Part)parts.get(0) : null;
- }
- return result;
- }
-
- protected void propagateBackToPrevious(Object model)
- {
- model = (model instanceof Part) ?((Part)model).eContainer() : model;
- super.propagateBackToPrevious(model);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/NotAvailableMessageEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/NotAvailableMessageEditPart.java
deleted file mode 100644
index 6a4a500..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/NotAvailableMessageEditPart.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-
-
-public class NotAvailableMessageEditPart extends AbstractGraphicalEditPart
-{
- public NotAvailableMessageEditPart()
- {
- }
-
- protected IFigure createFigure()
- {
- Label label = new Label(WSDLEditorPlugin.getWSDLString("_UI_LABEL_VIEW_NOT_AVAILABLE"));
- return label;
- }
-
- protected List getModelChildren()
- {
- return Collections.EMPTY_LIST;
- }
-
- protected EditPart createChild(Object model)
- {
- return null;
- }
-
- protected void createEditPolicies()
- {
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/PartReferenceSectionEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/PartReferenceSectionEditPart.java
deleted file mode 100644
index 5d0293c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/PartReferenceSectionEditPart.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerFigure;
-import org.eclipse.wst.wsdl.ui.internal.graph.model.WSDLGraphModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
-import org.eclipse.xsd.XSDElementDeclaration;
-
-
-public class PartReferenceSectionEditPart extends AbstractGraphicalEditPart implements ModelAdapterListener
-{
- protected Object input;
- protected Definition definition;
-
- protected IFigure createFigure()
- {
- ContainerFigure outer = new ContainerFigure();
- return outer;
- }
-
- protected void setInput(Object object)
- {
- if (input != null)
- {
- removeModelAdapterListener(input, this);
- removeModelAdapterListener(definition, this);
- }
- input = object;
- if (input != null)
- {
- addModelAdapterListener(input, this);
- definition = getParent() != null ? (Definition)getParent().getModel() : null;
- addModelAdapterListener(definition, this);
- }
- refresh();
- getFigure().repaint();
- }
-
- public void deactivate()
- {
- if (input != null)
- {
- removeModelAdapterListener(input, this);
- removeModelAdapterListener(definition, this);
- }
- super.deactivate();
- }
-
- protected List getModelChildren()
- {
- List list = new ArrayList();
- if (input instanceof Part)
- {
- Part part = (Part)input;
- Object component = part.getTypeDefinition();
- if (component != null)
- {
- // TODO... i'm pulling a fast one here.... we should call the extension
- // to see if he wants to show a child here
- if (component instanceof org.eclipse.xsd.XSDComplexTypeDefinition)
- {
- list.add(component);
- }
- }
- else
- {
- // This is before the new org.eclipse.wst.wsdl model
- // where it handled DOM nodes
- // component = part.getElement();
- XSDElementDeclaration ed = part.getElementDeclaration();
- if (ed != null && ed.getContainer() != null)
- {
- list.add(ed);
- }
- }
- }
- return list;
- }
-
- protected void createEditPolicies()
- {
- }
-
- protected EditPart createChild(Object model)
- {
- return getEditPartFactory().createEditPart(this, model);
- }
-
- protected EditPartFactory getEditPartFactory()
- {
- return ExtensibleEditPartFactory.getInstance();
- }
-
- public void propertyChanged(Object object, String property)
- {
- refreshChildren();
- }
-
- protected ModelAdapter getModelAdapter(Object modelObject)
- {
- return WSDLGraphModelAdapterFactory.getWSDLGraphModelAdapterFactory().getAdapter(modelObject);
- }
-
- protected void addModelAdapterListener(Object modelObject, ModelAdapterListener listener)
- {
- ModelAdapter adapter = getModelAdapter(modelObject);
- if (adapter != null)
- {
- adapter.addListener(listener);
- }
- }
-
- protected void removeModelAdapterListener(Object modelObject, ModelAdapterListener listener)
- {
- ModelAdapter adapter = getModelAdapter(modelObject);
- if (adapter != null)
- {
- adapter.removeListener(listener);
- }
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/PortTypesGroupConnectionManager.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/PortTypesGroupConnectionManager.java
deleted file mode 100644
index 6a17def..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/PortTypesGroupConnectionManager.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-
-
-public class PortTypesGroupConnectionManager extends AbstractConnectionManager
-{
- public PortTypesGroupConnectionManager(GroupEditPart groupEditPart)
- {
- super(groupEditPart);
- }
-
-
- class InternalWSDLSwitch extends WSDLSwitch
- {
- public boolean isBindingGroupShowing()
- {
- GroupEditPart prevGroupEditPart = groupEditPart.getPrevious();
- return prevGroupEditPart != null && prevGroupEditPart.getType() == WSDLGroupObject.BINDINGS_GROUP;
- }
-
- public Object caseBinding(Binding binding)
- {
- Object portType = getPortTypeForBindingObject(binding);
- groupEditPart.setEmphasizedModelObject(portType);
- groupEditPart.setInputConnectionModelObject(portType);
- groupEditPart.setOutputConnectionModelObject(null);
- return Boolean.TRUE;
- }
-
- public Object caseBindingFault(BindingFault bindingFault)
- {
- groupEditPart.setEmphasizedModelObject(getPortTypeForBindingObject(bindingFault));
- Fault fault = ComponentReferenceUtil.computeFault(bindingFault);
- groupEditPart.setInputConnectionModelObject(fault);
- groupEditPart.setOutputConnectionModelObject(fault);
- return Boolean.TRUE;
- }
-
- public Object caseBindingInput(BindingInput bindingInput)
- {
- groupEditPart.setEmphasizedModelObject(getPortTypeForBindingObject(bindingInput));
- Input input = ComponentReferenceUtil.computeInput(bindingInput);
- groupEditPart.setInputConnectionModelObject(input);
- groupEditPart.setOutputConnectionModelObject(input);
- return Boolean.TRUE;
- }
-
- public Object caseBindingOperation(BindingOperation bindingOperation)
- {
- groupEditPart.setEmphasizedModelObject(getPortTypeForBindingObject(bindingOperation));
- groupEditPart.setInputConnectionModelObject(ComponentReferenceUtil.computeOperation(bindingOperation));
- groupEditPart.setOutputConnectionModelObject(null);
- return Boolean.TRUE;
- }
-
- public Object caseBindingOutput(BindingOutput bindingOutput)
- {
- groupEditPart.setEmphasizedModelObject(getPortTypeForBindingObject(bindingOutput));
- Output output = ComponentReferenceUtil.computeOutput(bindingOutput);
- groupEditPart.setInputConnectionModelObject(output);
- groupEditPart.setOutputConnectionModelObject(output);
- return Boolean.TRUE;
- }
-
- public Object caseFault(Fault fault)
- {
- groupEditPart.setEmphasizedModelObject(getEnclosingPortType(fault));
- if (isBindingGroupShowing())
- {
- groupEditPart.setInputConnectionModelObject(fault);
- }
- else
- {
- groupEditPart.setInputConnectionModelObject(getEnclosingPortType(fault));
- }
- groupEditPart.setOutputConnectionModelObject(fault);
- return Boolean.TRUE;
- }
-
- public Object caseInput(Input input)
- {
- groupEditPart.setEmphasizedModelObject(getEnclosingPortType(input));
- if (isBindingGroupShowing())
- {
- groupEditPart.setInputConnectionModelObject(input);
- }
- else
- {
- groupEditPart.setInputConnectionModelObject(getEnclosingPortType(input));
- }
- groupEditPart.setOutputConnectionModelObject(input);
- return Boolean.TRUE;
- }
-
- public Object caseMessage(Message message)
- {
- Object previousContext = groupEditPart.getOutputConnectionModelObject();
- if (previousContext == null)
- {
- previousContext = groupEditPart.getEmphasizedModelObject();
- }
-
- EObject messageReference = null;
- if (previousContext == null || previousContext instanceof EObject)
- {
- messageReference = getMessageReference(message, (EObject)previousContext);
- }
-
- if (messageReference != null)
- {
- doSwitch(messageReference);
- }
- else
- {
- defaultCase(null);
- }
- return Boolean.TRUE;
- }
-
- public Object caseOperation(Operation operation)
- {
- groupEditPart.setEmphasizedModelObject(getEnclosingPortType(operation));
- if (isBindingGroupShowing())
- {
- groupEditPart.setInputConnectionModelObject(operation);
- }
- else
- {
- groupEditPart.setInputConnectionModelObject(getEnclosingPortType(operation));
- }
- groupEditPart.setOutputConnectionModelObject(null);
- return Boolean.TRUE;
- }
-
- public Object caseOutput(Output output)
- {
- groupEditPart.setEmphasizedModelObject(getEnclosingPortType(output));
- if (isBindingGroupShowing())
- {
- groupEditPart.setInputConnectionModelObject(output);
- }
- else
- {
- groupEditPart.setInputConnectionModelObject(getEnclosingPortType(output));
- }
- groupEditPart.setOutputConnectionModelObject(output);
- return Boolean.TRUE;
- }
-
- public Object casePortType(PortType portType)
- {
- groupEditPart.setEmphasizedModelObject(portType);
- groupEditPart.setInputConnectionModelObject(portType);
- groupEditPart.setOutputConnectionModelObject(null);
- return Boolean.TRUE;
- }
-
- public Object casePort(Port port)
- {
- Binding binding = port.getEBinding();
- PortType portType = binding != null ? binding.getEPortType() : null;
- groupEditPart.setEmphasizedModelObject(portType);
- groupEditPart.setInputConnectionModelObject(portType);
- groupEditPart.setOutputConnectionModelObject(null);
- return Boolean.TRUE;
- }
-
- public Object defaultCase(EObject object)
- {
- groupEditPart.setEmphasizedModelObject(null);
- groupEditPart.setInputConnectionModelObject(null);
- groupEditPart.setOutputConnectionModelObject(null);
- return Boolean.TRUE;
- }
- }
-
- protected WSDLSwitch createSwitch(int selectionType)
- {
- return new InternalWSDLSwitch();
- }
-
- protected PortType getPortTypeForBindingObject(EObject object)
- {
- Binding binding = getEnclosingBinding(object);
- return binding.getEPortType();
- }
-
- public void propagateForward(Object model)
- {
- if (model instanceof WSDLElement)
- {
- WSDLSwitch theSwitch = createSwitch(PROPAGATE_FORWARD);
- theSwitch.doSwitch((EObject)model);
- groupEditPart.scrollToRevealInputConnection();
- }
- else
- {
- removeConnections();
- }
-
- Object o = groupEditPart.getOutputConnectionModelObject();
- propagateForwardToNext(o != null ? o : model);
- }
-
- protected void propagateBackToPrevious(Object model)
- {
- model = (model instanceof Message) ? groupEditPart.getInputConnectionModelObject() : model;
- super.propagateBackToPrevious(model);
- }
-
-
- protected Message getReferencedMessage(EObject o)
- {
- Message result = null;
- if (o instanceof Input)
- {
- result = ((Input)o).getEMessage();
- }
- else if (o instanceof Output)
- {
- result = ((Output)o).getEMessage();
- }
- else if (o instanceof Fault)
- {
- result = ((Fault)o).getEMessage();
- }
- return result;
- }
-
- protected boolean isMatchingMessageReference(EObject messageReference, Message message)
- {
- Message m = getReferencedMessage(messageReference);
- return (m != null) && (m == messageReference);
- }
-
- public EObject getMessageReference(Message message, EObject prevContext)
- {
- EObject result = null;
-
- PortType prevPortType = getEnclosingPortType(prevContext);
- Operation prevOperation = getEnclosingOperation(prevContext);
- EObject prevMessageReference = getMessageReference(prevContext);
-
- if (prevPortType != null)
- {
- result = getMessageReference(message, prevPortType, prevOperation, prevMessageReference);
- }
- if (result == null)
- {
- Definition definition = groupEditPart.getDefinition();
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
- for (Iterator i = util.getPortTypes().iterator(); i.hasNext(); )
- {
- PortType portType = (PortType)i.next();
- result = getMessageReference(message, portType, null, null);
-
- if (result != null)
- {
- break;
- }
- }
- }
- return result;
- }
-
- public EObject getMessageReference(Message message, PortType portType, Operation prevOperation, EObject prevMessageReference)
- {
- EObject result = null;
- if (prevMessageReference != null && isMatchingMessageReference(prevMessageReference, message))
- {
- result = prevMessageReference;
- }
-
- if (result == null && prevOperation != null)
- {
- result = getMessageReference(message, prevOperation);
- }
-
- if (result == null)
- {
- for (Iterator i = portType.getOperations().iterator(); i.hasNext();)
- {
- Operation operation = (Operation)i.next();
- result = getMessageReference(message, operation);
- if (result != null)
- {
- break;
- }
- }
- }
- return result;
- }
-
- public EObject getMessageReference(Message message, Operation operation)
- {
- EObject result = null;
- Input input = operation.getEInput();
- Output output = operation.getEOutput();
- if (input != null && input.getMessage() == message)
- {
- result = input;
- }
- else if (output != null && output.getMessage() == message)
- {
- result = output;
- }
- if (result == null)
- {
- for (Iterator i = operation.getEFaults().iterator(); i.hasNext();)
- {
- Fault fault = (Fault)i.next();
- if (fault.getMessage() == message)
- {
- result = fault;
- break;
- }
- }
- }
- return result;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/ServicesGroupConnectionManager.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/ServicesGroupConnectionManager.java
deleted file mode 100644
index d5d35b7..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/ServicesGroupConnectionManager.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-
-
-public class ServicesGroupConnectionManager extends AbstractConnectionManager
-{
- public ServicesGroupConnectionManager(GroupEditPart groupEditPart)
- {
- super(groupEditPart);
- }
-
- protected class InternalWSDLSwitch extends WSDLSwitch
- {
- public Object caseBinding(Binding binding)
- {
- handleBindingHelper(binding);
- return Boolean.TRUE;
- }
-
- public Object caseBindingFault(BindingFault bindingFault)
- {
- handleBindingHelper(getEnclosingBinding(bindingFault));
- return Boolean.TRUE;
- }
-
- public Object caseBindingInput(BindingInput bindingInput)
- {
- handleBindingHelper(getEnclosingBinding(bindingInput));
- return Boolean.TRUE;
- }
-
- public Object caseBindingOperation(BindingOperation bindingOperation)
- {
- handleBindingHelper(getEnclosingBinding(bindingOperation));
- return Boolean.TRUE;
- }
-
- public Object caseBindingOutput(BindingOutput bindingOutput)
- {
- handleBindingHelper(getEnclosingBinding(bindingOutput));
- return Boolean.TRUE;
- }
-
- public Object caseFault(Fault fault)
- {
- handlePortTypeHelper(getEnclosingPortType(fault));
- return Boolean.TRUE;
- }
-
- public Object caseInput(Input input)
- {
- handlePortTypeHelper(getEnclosingPortType(input));
- return Boolean.TRUE;
- }
-
- public Object caseOperation(Operation operation)
- {
- handlePortTypeHelper(getEnclosingPortType(operation));
- return Boolean.TRUE;
- }
-
- public Object caseOutput(Output output)
- {
- handlePortTypeHelper(getEnclosingPortType(output));
- return Boolean.TRUE;
- }
-
- public Object casePort(Port port)
- {
- groupEditPart.setEmphasizedModelObject(port);
- groupEditPart.setOutputConnectionModelObject(port);
- return Boolean.TRUE;
- }
-
- public Object casePortType(PortType portType)
- {
- handlePortTypeHelper(portType);
- return Boolean.TRUE;
- }
-
- public Object defaultCase(EObject object)
- {
- groupEditPart.setEmphasizedModelObject(null);
- groupEditPart.setOutputConnectionModelObject(null);
- return Boolean.TRUE;
- }
-
- //
- protected void handlePortTypeHelper(PortType portType)
- {
- if (portType != null)
- {
- Port port = null;
- Object previousContext = groupEditPart.getOutputConnectionModelObject();
- if (previousContext == null)
- {
- previousContext = groupEditPart.getEmphasizedModelObject();
- }
- if (previousContext instanceof Port)
- {
- Port previousPort = (Port)previousContext;
- if (previousPort.getEBinding() != null && previousPort.getEBinding().getEPortType() == portType)
- {
- port = previousPort;
- }
- }
-
- if (port == null)
- {
- ComponentReferenceUtil util = new ComponentReferenceUtil(groupEditPart.getDefinition());
- List list = util.getPortsForPortType(portType);
- if (list.size() > 0)
- {
- port = (Port)list.get(0);
- }
- }
-
- groupEditPart.setEmphasizedModelObject(port);
- groupEditPart.setOutputConnectionModelObject(port);
- }
- }
-
- protected void handleBindingHelper(Binding binding)
- {
- if (binding != null)
- {
- ComponentReferenceUtil util = new ComponentReferenceUtil(groupEditPart.getDefinition());
- List list = util.getPortsForBinding(binding);
- Port port = null;
- if (list.size() > 0)
- {
- port = (Port)list.get(0);
- }
- groupEditPart.setEmphasizedModelObject(port);
- groupEditPart.setOutputConnectionModelObject(port);
- }
- }
- }
-
- protected WSDLSwitch createSwitch(int selectionType)
- {
- return new InternalWSDLSwitch();
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/TreeNodeEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/TreeNodeEditPart.java
deleted file mode 100644
index de799bd..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/TreeNodeEditPart.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.gef.util.editparts.InteractorHelper;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerFigure;
-import org.eclipse.wst.wsdl.ui.internal.graph.GraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.graph.WSDLComponentViewer;
-import org.eclipse.wst.wsdl.ui.internal.graph.editpolicies.WSDLSelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.wsdl.ui.internal.graph.figures.TreeNodeContentFigure;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
-
-public abstract class TreeNodeEditPart extends AbstractGraphicalEditPart implements ModelAdapterListener, GraphicsConstants, IFeedbackHandler
-{
- protected Label label;
- protected Label label2;
- protected ContainerFigure labelHolder = new ContainerFigure();
- protected TreeNodeContentFigure contentFigure;
- protected InteractorHelper interactorHelper;
- protected boolean isSelected = false;
- protected boolean isReadOnly = false;
-
- public void activate()
- {
- super.activate();
- addModelAdapterListener(getModel(), this);
- //viewer = getViewer();
- }
-
- int removeNotifyCount = 0;
-
- public void removeNotify()
- {
- removeNotifyCount++;
- if (removeNotifyCount == 1)
- {
- super.removeNotify();
- }
- }
-
- /**
- * Apart from the deactivation done in super, the source
- * and target connections are deactivated, and the visual
- * part of the this is removed.
- *
- * @see #activate()
- */
- public void deactivate()
- {
- removeModelAdapterListener(getModel(), this);
- super.deactivate();
- }
-
- protected void createEditPolicies()
- {
- //SelectionHandlesEditPolicyImpl policy = new SelectionHandlesEditPolicyImpl();
- //installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);
-
- SelectionEditPolicy feedBackSelectionEditPolicy = new WSDLSelectionHandlesEditPolicyImpl();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, feedBackSelectionEditPolicy);
- }
-
- protected EditPart createChild(Object model)
- {
- return getEditPartFactory().createEditPart(this, model);
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (property == ModelAdapter.CHILDREN_PROPERTY)
- {
- refreshChildren();
- }
- else if (property == ModelAdapter.DETAIL_PROPERTY)
- {
- refreshVisuals();
- }
- else
- {
- refreshChildren();
- refreshVisuals();
- }
- }
-
- protected IFigure createFigure()
- {
- createContentFigure();
- createFigureContent();
- return contentFigure;
- }
-
- protected void createContentFigure()
- {
- contentFigure = new TreeNodeContentFigure();
- }
-
- protected void createFigureContent()
- {
- // add a bit of space between the interactor and icon
- //
- RectangleFigure space = new RectangleFigure();
- space.setVisible(false);
- space.setPreferredSize(new Dimension(3, 3));
- contentFigure.getIconArea().add(space);
-
- labelHolder = new ContainerFigure();
- labelHolder.setFill(true);
- contentFigure.getIconArea().add(labelHolder);
-
- label = new Label(WSDLEditorPlugin.getWSDLString("_UI_LABEL_UNKNOWN_OBJECT"));
- label.setForegroundColor(ColorConstants.black);
- labelHolder.add(label);
-
- interactorHelper = new InteractorHelper(this, contentFigure.getInteractor(), contentFigure.getInnerContentArea());
- }
-
- public IFigure getContentPane()
- {
- return contentFigure.getInnerContentArea();
- }
-
- public Color computeLabelColor()
- {
- Color color = ColorConstants.black;
- if (isSelected)
- {
- color = ColorConstants.white;
- }
- else if (isReadOnly)
- {
- color = ColorConstants.gray;
- }
- return color;
- }
-
- public void refreshVisuals()
- {
- ModelAdapter adapter = getModelAdapter(getModel());
- if (adapter != null)
- {
- isReadOnly = Boolean.TRUE.equals(adapter.getProperty(getModel(), "isReadOnly"));
- label.setForegroundColor(computeLabelColor());
- label.setText((String)adapter.getProperty(getModel(), ModelAdapter.LABEL_PROPERTY));
- label.setIcon((Image)adapter.getProperty(getModel(), ModelAdapter.IMAGE_PROPERTY));
- }
- else
- {
- label.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_UNKNOWN_NODE") + getModel().getClass().getName());
- }
- }
-
- private void _refreshChildren()
- {
- int i;
- EditPart editPart;
- Object model;
-
- Map modelToEditPart = new HashMap();
- List children = getChildren();
-
- for (i = 0; i < children.size(); i++)
- {
- editPart = (EditPart)children.get(i);
- modelToEditPart.put(editPart.getModel(), editPart);
- }
-
- List modelObjects = getModelChildren();
-
- for (i = 0; i < modelObjects.size(); i++)
- {
- model = modelObjects.get(i);
-
- //Do a quick check to see if editPart[i] == model[i]
- if (i < children.size())
- {
- editPart = (EditPart)children.get(i);
- Object editPartModel = editPart.getModel();
- if (editPartModel == model)
- {
- continue;
- }
- else if (editPartModel.getClass() == model.getClass())
- {
- modelToEditPart.remove(editPartModel);
-
- if (isActive())
- editPart.deactivate();
-
- editPart.setModel(model);
-
- if (isActive())
- {
- editPart.activate();
- editPart.refresh();
- }
- continue;
- }
- }
-
- //Look to see if the EditPart is already around but in the wrong location
- editPart = (EditPart)modelToEditPart.get(model);
-
- if (editPart != null)
- reorderChild(editPart, i);
- else
- {
- //An editpart for this model doesn't exist yet. Create and insert one.
- editPart = createChild(model);
- addChild(editPart, i);
- }
- }
- List trash = new ArrayList();
- for (; i < children.size(); i++)
- trash.add(children.get(i));
- for (i = 0; i < trash.size(); i++)
- {
- EditPart ep = (EditPart)trash.get(i);
- removeChild(ep);
- }
- }
-
- public void refreshChildren()
- {
-
- boolean reuseChildren = false;
- if (getViewer() instanceof WSDLComponentViewer)
- {
- WSDLComponentViewer wsdlComponentViewer = (WSDLComponentViewer)getViewer();
- reuseChildren = wsdlComponentViewer.isPreserveExpansionEnabled();
- }
-
- if (reuseChildren)
- {
- _refreshChildren();
- }
- else
- {
- super.refreshChildren();
- }
-
- contentFigure.getInteractor().setVisible(hasChildren());
- }
-
- public List getModelChildren()
- {
- return contentFigure.getInteractor().isExpanded() ? getModelChildrenHelper() : Collections.EMPTY_LIST;
- }
-
- protected List getModelChildrenHelper()
- {
- List result = null;
- ModelAdapter modelAdapter = getModelAdapter(getModel());
- if (modelAdapter != null)
- {
- result = (List)modelAdapter.getProperty(getModel(), ModelAdapter.CHILDREN_PROPERTY);
- }
- return result != null ? result : Collections.EMPTY_LIST;
- }
-
- protected boolean hasChildren()
- {
- return getModelChildrenHelper().size() > 0;
- }
-
- protected abstract ModelAdapter getModelAdapter(Object model);
-
- protected EditPartFactory getEditPartFactory()
- {
- return ExtensibleEditPartFactory.getInstance();
- }
-
- protected void addModelAdapterListener(Object modelObject, ModelAdapterListener listener)
- {
- ModelAdapter adapter = getModelAdapter(modelObject);
- if (adapter != null)
- {
- adapter.addListener(listener);
- }
- }
-
- protected void removeModelAdapterListener(Object modelObject, ModelAdapterListener listener)
- {
- ModelAdapter adapter = getModelAdapter(modelObject);
- if (adapter != null)
- {
- adapter.removeListener(listener);
- }
- }
-
- public void addFeedback()
- {
- isSelected = true;
- labelHolder.setBackgroundColor(ColorConstants.black);
- label.setForegroundColor(computeLabelColor());
- labelHolder.setFill(true);
- }
-
- public void removeFeedback()
- {
- isSelected = false;
- labelHolder.setBackgroundColor(null);
- label.setForegroundColor(computeLabelColor());
- labelHolder.setFill(false);
- }
-
- public boolean isExpanded()
- {
- return contentFigure.getInteractor().isExpanded();
- }
-
- public void setExpanded(boolean arg)
- {
- interactorHelper.setExpanded(arg);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/UnknownObjectEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/UnknownObjectEditPart.java
deleted file mode 100644
index 2354fbf..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/UnknownObjectEditPart.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-
-
-public class UnknownObjectEditPart extends TreeNodeEditPart
-{
- protected ModelAdapter getModelAdapter(Object model)
- {
- return null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/WSDLEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/WSDLEditPart.java
deleted file mode 100644
index a8872a4..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/WSDLEditPart.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.gef.util.editparts.MultiContentPaneEditPart;
-import org.eclipse.wst.wsdl.ui.internal.graph.GraphicsConstants;
-import org.eclipse.wst.wsdl.ui.internal.graph.model.WSDLGraphModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
-
-
-public abstract class WSDLEditPart extends MultiContentPaneEditPart implements ModelAdapterListener, GraphicsConstants
-{
- /**
- * Activates the <code>EditPart</code> by setting the
- * appropriate flags, and activating its children.
- * activation signals to the EditPart that is should start observing
- * it's model, and that is should support editing at this time.
- * An EditPart will have a parent prior to activiation.
- * @see #deactivate()
- */
- public void activate()
- {
- super.activate();
- addModelAdapterListener(getModel(), this);
- }
- /**
- * Apart from the deactivation done in super, the source
- * and target connections are deactivated, and the visual
- * part of the this is removed.
- *
- * @see #activate()
- */
- public void deactivate()
- {
- removeModelAdapterListener(getModel(), this);
- super.deactivate();
- }
-
- protected void createEditPolicies()
- {
- SelectionEditPolicy policy = new SelectionEditPolicy()
- {
- protected void hideSelection()
- {
- EditPart editPart = getHost();
- if (editPart instanceof IFeedbackHandler)
- {
- ((IFeedbackHandler)editPart).removeFeedback();
- }
- }
-
- protected void showSelection()
- {
- EditPart editPart = getHost();
- if (editPart instanceof IFeedbackHandler)
- {
- ((IFeedbackHandler)editPart).addFeedback();
- }
- }
- };
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);
- }
-
- protected EditPart createChild(Object model)
- {
- return getEditPartFactory().createEditPart(this, model);
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (property == ModelAdapter.CHILDREN_PROPERTY)
- {
- refreshChildren();
- }
- else if (property == ModelAdapter.DETAIL_PROPERTY)
- {
- refreshVisuals();
- }
- else
- {
- refreshChildren();
- refreshVisuals();
- }
- }
-
- protected List getModelChildren()
- {
- List result = null;
- ModelAdapter modelAdapter = getModelAdapter(getModel());
- if (modelAdapter != null)
- {
- result = (List)modelAdapter.getProperty(getModel(), ModelAdapter.CHILDREN_PROPERTY);
- }
- return result != null ? result : Collections.EMPTY_LIST;
- }
-
- protected EditPartFactory getEditPartFactory()
- {
- return ExtensibleEditPartFactory.getInstance();
- }
-
- protected ModelAdapter getModelAdapter(Object modelObject)
- {
- // TODO : port check
- return WSDLGraphModelAdapterFactory.getWSDLGraphModelAdapterFactory().getAdapter(modelObject);
-// return WSDLGraphModelAdapterFactory.EcoreUtil.getAdapter(getWSDLGraphModelAdapterFactory().eAdapters(),modelObject);
- }
-
- protected void addModelAdapterListener(Object modelObject, ModelAdapterListener listener)
- {
- ModelAdapter adapter = getModelAdapter(modelObject);
- if (adapter != null)
- {
- adapter.addListener(listener);
- }
- }
-
- protected void removeModelAdapterListener(Object modelObject, ModelAdapterListener listener)
- {
- ModelAdapter adapter = getModelAdapter(modelObject);
- if (adapter != null)
- {
- adapter.removeListener(listener);
- }
- }
-
- public boolean hitTest(IFigure target, Point location)
- {
- Rectangle b = target.getBounds().getCopy();
- target.translateToAbsolute(b);
- return b.contains(location);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/WSDLEditPartFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/WSDLEditPartFactory.java
deleted file mode 100644
index 6f70cf5..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/WSDLEditPartFactory.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-
-
-public class WSDLEditPartFactory implements EditPartFactory
-{
- protected static WSDLEditPartFactory instance;
-
- public static WSDLEditPartFactory getInstance()
- {
- if (instance == null)
- {
- instance = new WSDLEditPartFactory();
- }
- return instance;
- }
-
-
-
- public EditPart createEditPart(final EditPart parent, Object model)
- {
- WSDLSwitch wsdlSwitch = new WSDLSwitch()
- {
- public Object caseWSDLElement(WSDLElement wsdlElement)
- {
- return new WSDLTreeNodeEditPart();
- }
-
- public Object caseDefinition(Definition definition)
- {
- return new DefinitionEditPart();
- }
- };
- EditPart editPart = null;
- if (model instanceof EObject)
- {
- editPart = (EditPart)wsdlSwitch.doSwitch((EObject)model);
- }
- else if (model instanceof WSDLGroupObject)
- {
- editPart = new GroupEditPart();
- }
-
- if (editPart != null)
- {
- editPart.setModel(model);
- editPart.setParent(parent);
- }
- else
- {
- System.out.println("can't create editPart for " + model);
- Thread.dumpStack();
- }
- return editPart;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/WSDLTreeNodeEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/WSDLTreeNodeEditPart.java
deleted file mode 100644
index a6c9339..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editparts/WSDLTreeNodeEditPart.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.graph.editpolicies.WSDLDragAndDropEditPolicy;
-import org.eclipse.wst.wsdl.ui.internal.graph.editpolicies.WSDLGraphNodeDragTracker;
-import org.eclipse.wst.wsdl.ui.internal.graph.editpolicies.WSDLSelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.wsdl.ui.internal.graph.figures.TreeNodeContentFigure;
-import org.eclipse.wst.wsdl.ui.internal.graph.model.WSDLGraphModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-
-public class WSDLTreeNodeEditPart extends TreeNodeEditPart
-{
- protected Label label2;
- protected boolean isEmphasized = false;
-
- protected static final Color emphasisColor = new Color(null, 238, 238, 238);
- protected static final Color label2ForegroundColor = new Color(null, 82, 82, 158);
- protected static final Color label2ForegroundColorSelected = new Color(null, 182, 182, 255);
-
- protected ModelAdapter getModelAdapter(Object modelObject)
- {
- return WSDLGraphModelAdapterFactory.getWSDLGraphModelAdapterFactory().getAdapter(modelObject);
- }
-
- protected void createContentFigure()
- {
- contentFigure = new TreeNodeContentFigure()
- {
- public IFigure getConnectionFigure()
- {
- return isTopLevel() ? outlinedArea : iconArea;
- }
- };
- }
-
- protected boolean isTopLevel()
- {
- return getParent() instanceof GroupEditPart;
- }
-
- protected void createFigureContent()
- {
- super.createFigureContent();
-
- if (getModel() instanceof Part)
- {
- label2 = new Label();
- labelHolder.add(label2);
- label2.setBorder(new MarginBorder(0, 5, 0, 0));
- label2.setForegroundColor(label2ForegroundColor);
- }
- }
-
- public void setEmphasized(boolean isEmphasized)
- {
- this.isEmphasized = isEmphasized;
- refreshVisuals();
- }
-
- protected void updateEmphasis()
- {
- boolean isEmphasisShowing = isEmphasized && (!isSelected || getModelChildren().size() > 0);
- if (isEmphasisShowing)
- {
- contentFigure.getOutlinedArea().setBackgroundColor(emphasisColor);
- }
-
- contentFigure.getOutlinedArea().setFill(isEmphasisShowing);
- contentFigure.getOutlinedArea().setOutlined(isEmphasisShowing);
- contentFigure.setForegroundColor(elementBorderColor);
- }
-
- public void refreshVisuals()
- {
- updateEmphasis();
-
- super.refreshVisuals();
-
- if (label2 != null)
- {
- Part part = (Part)getModel();
- //String label = ComponentReferenceUtil.isType(part) ? "type" : "element";
- String value = ComponentReferenceUtil.getPartReferenceValue(part);
- label2.setText("(" + value + ")");
- }
- }
-
- public void performRequest(Request request)
- {
- if (request.getType() == RequestConstants.REQ_OPEN)
- {
- for (EditPart parent = (EditPart)getParent(); parent != null; parent = parent.getParent())
- {
- if (parent instanceof DefinitionEditPart)
- {
- ((DefinitionEditPart)parent).handleOpenRequest(this);
- break;
- }
- }
- }
- //else if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
- //{
- // performDirectEdit();
- //}
- }
-
- public void addFeedback()
- {
- super.addFeedback();
- if (label2 != null)
- {
- label2.setForegroundColor(label2ForegroundColorSelected);
- }
- updateEmphasis();
- }
-
- public void removeFeedback()
- {
- super.removeFeedback();
- if (label2 != null)
- {
- label2.setForegroundColor(label2ForegroundColor);
- }
- updateEmphasis();
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- selectionHandlesEditPolicy = new WSDLSelectionHandlesEditPolicyImpl();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new WSDLDragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);
- }
-
- WSDLSelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
-
- public IFigure getSelectionFigure()
- {
- return getFigure();
- }
-
- public DragTracker getDragTracker(Request request)
- {
- return new WSDLGraphNodeDragTracker((EditPart)this);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/EditUtil.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/EditUtil.java
deleted file mode 100644
index 69bcb3f..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/EditUtil.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editpolicies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.w3c.dom.Element;
-
-//import org.eclipse.wst.wsdl.ui.internal.reconciler.WSDLToDOMElementUtil;
-
-
-public class EditUtil
-{
- public static List getPossiblePropertyValues(Object model, String propertyName)
- {
- List list = null;
- if (model instanceof Port)
- {
- Port port = (Port)model;
- ComponentReferenceUtil util = new ComponentReferenceUtil(port.getEnclosingDefinition());
- list = util.getBindingNames();
- }
- else if (model instanceof Binding)
- {
- Binding binding = (Binding)model;
- ComponentReferenceUtil util = new ComponentReferenceUtil(binding.getEnclosingDefinition());
- list = util.getPortTypeNames();
- }
- else if (model instanceof Part)
- {
- Part part = (Part)model;
- boolean isType = ComponentReferenceUtil.isType(part);
- list = ComponentReferenceUtil.getComponentNameList(part, isType);
- }
- else if (model instanceof Input ||
- model instanceof Output ||
- model instanceof Fault)
- {
- WSDLElement wsdlElement = (WSDLElement)model;
- ComponentReferenceUtil util = new ComponentReferenceUtil(wsdlElement.getEnclosingDefinition());
- list = util.getMessageNames();
- }
-
- if (list == null)
- {
- list = new ArrayList();
- list.add("A");
- list.add("B");
- list.add("C");
- }
- return list;
- }
-
- public static void setPropertyValue(Object model, String propertyName, String value)
- {
- if (model instanceof Part)
- {
- Part part = (Part)model;
- boolean isType = ComponentReferenceUtil.isType(part);
- ComponentReferenceUtil.setComponentReference(part, isType, value);
- }
- else if (model instanceof Port)
- {
- Element element = ((WSDLElement)model).getElement();
- element.setAttribute("binding", value);
- }
- else if (model instanceof Binding)
- {
- Element element = ((WSDLElement)model).getElement();
- element.setAttribute("type", value);
- }
- else if (model instanceof Input ||
- model instanceof Output ||
- model instanceof Fault)
- {
- Element element = ((WSDLElement)model).getElement();
- element.setAttribute("message", value);
- }
- }
-
- public static String getPropertyValue(Object model, String propertyName)
- {
- String result = null;
-
- if (model instanceof Part)
- {
- Element element = ((WSDLElement)model).getElement();
- result = element.getAttribute(propertyName);
- }
- else if (model instanceof Port)
- {
- Element element = ((WSDLElement)model).getElement();
- result = element.getAttribute("binding");
- }
- else if (model instanceof Binding)
- {
- Element element = ((WSDLElement)model).getElement();
- result = element.getAttribute("type");
- }
- else if (model instanceof Input ||
- model instanceof Output ||
- model instanceof Fault)
- {
- Element element = ((WSDLElement)model).getElement();
- result = element.getAttribute("message");
- }
- return result;
- }
-
- public static void setName(Object model, String value)
- {
- if (model instanceof WSDLElement)
- {
- Element element = ((WSDLElement)model).getElement();
- element.setAttribute("name", value);
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/NameDirectEditManager.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/NameDirectEditManager.java
deleted file mode 100644
index 7619958..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/NameDirectEditManager.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editpolicies;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.wsdl.ui.internal.actions.SmartRenameAction;
-import org.eclipse.wst.wsdl.ui.internal.gef.util.editpolicies.TextCellEditorManager;
-
-public class NameDirectEditManager extends TextCellEditorManager
-{
- protected Object model;
-
- public NameDirectEditManager(GraphicalEditPart source, Label label, Object model)
- {
- super(source, label);
- this.model = model;
- }
-
- public void performModify(final String value)
- {
- Display.getCurrent().asyncExec(new SmartRenameAction(model, value));
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLDragAndDropCommand.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLDragAndDropCommand.java
deleted file mode 100644
index f9a9288..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLDragAndDropCommand.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editpolicies;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.actions.CopyWSDLElementAction;
-import org.eclipse.wst.wsdl.ui.internal.actions.WSDLDragAction;
-import org.eclipse.wst.wsdl.ui.internal.actions.WSDLDragReorderAction;
-import org.eclipse.wst.wsdl.ui.internal.actions.WSDLDragSetMessageAction;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.WSDLTreeNodeEditPart;
-import org.eclipse.wst.xml.core.document.XMLNode;
-
-
-public class WSDLDragAndDropCommand extends Command //AbstractCommand
-{
- protected EditPartViewer viewer;
- protected ChangeBoundsRequest request;
- protected Point location;
- protected WSDLDragAction dragAction;
- protected boolean canExecute = false;
-
- public WSDLDragAndDropCommand(EditPartViewer viewer, ChangeBoundsRequest request)
- {
- boolean constructor = false;
- this.viewer = viewer;
- this.request = request;
-
- location = request.getLocation();
- EditPart targetEditPart = viewer.findObjectAt(location);
-
- // Only support drag and drop for WSDLTreeNodeEditPart
- if (targetEditPart instanceof WSDLTreeNodeEditPart) {
- WSDLElement wsdlElement = (WSDLElement) targetEditPart.getModel();
- if (wsdlElement.getElement() instanceof XMLNode) {
- ((GraphicalEditPart)viewer.getRootEditPart()).getFigure().translateToRelative(location);
- Rectangle targetRectangle;
- WSDLTreeNodeEditPart targetParentEditPart;
- WSDLTreeNodeEditPart movingChildEditPart;
- Vector dragActions = new Vector();
-
- if (request.getType().equals(RequestConstants.REQ_ADD)) { // This really shouldn't be REQ_ADD....
- List list = request.getEditParts();
- if (list.size() <= 0) {
- canExecute = false;
- return;
- }
-
- // Grabbing the fist selection
- movingChildEditPart = (WSDLTreeNodeEditPart) list.get(0);
- Object model = movingChildEditPart.getModel();
- EditPart pointerEditPart = viewer.findObjectAt(location);
-
- if (model instanceof Input || model instanceof Output) {
- dragActions.add(new WSDLDragReorderAction(movingChildEditPart, pointerEditPart, getPointerLocation(location)));
- dragActions.add(new WSDLDragSetMessageAction(movingChildEditPart, pointerEditPart, location));
- }
- else if (model instanceof Part) {
- dragActions.add(new WSDLDragReorderAction(movingChildEditPart, pointerEditPart, getPointerLocation(location)));
- }
- else if (model instanceof Fault) {
- dragActions.add(new WSDLDragSetMessageAction(movingChildEditPart, pointerEditPart, location));
- }
- }
- else if (request.getType().equals(RequestConstants.REQ_CLONE)) {
- List list = request.getEditParts();
- if (list.size() > 0)
- {
- // Grabbing the fist selection
- movingChildEditPart = (WSDLTreeNodeEditPart) list.get(0);
-
- dragActions.add(new CopyWSDLElementAction(viewer,
- (WSDLElement) movingChildEditPart.getModel(),
- (WSDLElement) targetEditPart.getModel(),
- null));
- }
- }
-
- Iterator it = dragActions.iterator();
- while (it.hasNext()) {
- dragAction = (WSDLDragAction) it.next();
- canExecute = dragAction.canExecute();
- if (canExecute)
- break;
- }
- }
- }
- }
-
- public boolean canExecute()
- {
- return canExecute;
- }
-
- public void execute() {
- if (canExecute)
- {
- dragAction.run();
- }
- }
-
- public IFigure getFeedbackFigure() {
- if (dragAction != null) {
- return dragAction.getFeedbackFigure();
- }
- else {
- return null;
- }
- }
-
- /*
- * This method compensates for the current scroll position
- */
- private Point getPointerLocation(Point origPointerLocation) {
- Point compensatedLocation = origPointerLocation;
- FigureCanvas figureCanvas = (FigureCanvas) viewer.getControl();
- int yOffset = figureCanvas.getViewport().getVerticalRangeModel().getValue();
- compensatedLocation.y = compensatedLocation.y + yOffset;
-
- return compensatedLocation;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLDragAndDropEditPolicy.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLDragAndDropEditPolicy.java
deleted file mode 100644
index b5dddbc..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLDragAndDropEditPolicy.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editpolicies;
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-
-public class WSDLDragAndDropEditPolicy extends org.eclipse.gef.editpolicies.GraphicalEditPolicy
-{
- protected EditPartViewer viewer;
- protected WSDLSelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
-
- public WSDLDragAndDropEditPolicy(EditPartViewer viewer, WSDLSelectionHandlesEditPolicyImpl selectionHandlesEditPolicy)
- {
- this.viewer = viewer;
- this.selectionHandlesEditPolicy = selectionHandlesEditPolicy;
- }
-
- public boolean understandsRequest(Request req)
- {
- return true;
- }
-
- public org.eclipse.gef.commands.Command getCommand(Request request)
- {
- WSDLDragAndDropCommand command = null;
- if (request instanceof ChangeBoundsRequest)
- {
- command = new WSDLDragAndDropCommand(viewer, (ChangeBoundsRequest)request);
- selectionHandlesEditPolicy.setDragAndDropCommand(command);
- }
- return command;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLGraphNodeDragTracker.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLGraphNodeDragTracker.java
deleted file mode 100644
index 182b939..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLGraphNodeDragTracker.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editpolicies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-
-public class WSDLGraphNodeDragTracker extends DragEditPartsTracker
-{
- protected EditPart editPart;
-
- public WSDLGraphNodeDragTracker(EditPart editPart)
- {
- super(editPart);
- this.editPart = editPart;
- }
-
- protected Command getCommand()
- {
- Request request = getTargetRequest();
- return editPart.getCommand(request);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLSelectionHandlesEditPolicyImpl.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLSelectionHandlesEditPolicyImpl.java
deleted file mode 100644
index b038d9a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/editpolicies/WSDLSelectionHandlesEditPolicyImpl.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.editpolicies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.handles.MoveHandleLocator;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.IFeedbackHandler;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.WSDLTreeNodeEditPart;
-
-public class WSDLSelectionHandlesEditPolicyImpl extends SelectionHandlesEditPolicy
-{
- protected IFigure feedback;
- protected Rectangle originalLocation;
- protected WSDLDragAndDropCommand dragAndDropCommand;
-
- protected List createSelectionHandles()
- {
- List list = new ArrayList();
- EditPart editPart = getHost();
-
- if (editPart instanceof GraphicalEditPart)
- {
- GraphicalEditPart graphicalEditPart = (GraphicalEditPart)editPart;
- IFigure figure = (graphicalEditPart instanceof WSDLTreeNodeEditPart) ?
- ((WSDLTreeNodeEditPart)graphicalEditPart).getSelectionFigure() :
- graphicalEditPart.getFigure();
-
- MoveHandleLocator loc = new MoveHandleLocator(figure);
- MoveHandle moveHandle = new MoveHandle(graphicalEditPart, loc);
- list.add(moveHandle);
- }
-
- return list;
- }
-
-
- public boolean understandsRequest(Request request)
- {
- boolean result = false;
-
- if (REQ_MOVE.equals(request.getType()))
- {
- result = false; // return false to disable move for now
- }
- else
- {
- result = super.understandsRequest(request);
- }
- return result;
- }
-
-
- public org.eclipse.gef.commands.Command getCommand(Request request)
- {
- return null;
- }
-
- public void setDragAndDropCommand(WSDLDragAndDropCommand dragAndDropCommand)
- {
- this.dragAndDropCommand = dragAndDropCommand;
- }
-
- protected org.eclipse.gef.commands.Command getMoveCommand(ChangeBoundsRequest request)
- {
- ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_MOVE_CHILDREN);
- req.setEditParts(getHost());
-
- req.setMoveDelta(request.getMoveDelta());
- req.setSizeDelta(request.getSizeDelta());
- req.setLocation(request.getLocation());
-
- return getHost().getParent().getCommand(req);
- }
-
- public void showSourceFeedback(Request request)
- {
- eraseChangeBoundsFeedback(null);
-
- if (dragAndDropCommand != null && dragAndDropCommand.canExecute()) {
- if (REQ_MOVE.equals(request.getType()) || REQ_ADD.equals(request.getType())) {
- showMoveChangeBoundsFeedback((ChangeBoundsRequest) request);
- }
- else if (REQ_CLONE.equals(request.getType())) {
- showCopyChangeBoundsFeedback((ChangeBoundsRequest) request);
- }
- }
- }
-
- protected void showMoveChangeBoundsFeedback(ChangeBoundsRequest request)
- {
- if (dragAndDropCommand != null && dragAndDropCommand.getFeedbackFigure() != null) {
- feedback = dragAndDropCommand.getFeedbackFigure();
- addFeedback(feedback);
- }
- }
-
- protected void showCopyChangeBoundsFeedback(ChangeBoundsRequest request)
- {
- /*
- IFigure p = getDragSourceFeedbackFigure();
- Rectangle r = originalLocation.getTranslated(request.getMoveDelta());
- Dimension resize = request.getSizeDelta();
- r.width += resize.width;
- r.height+= resize.height;
-
- ((GraphicalEditPart)getHost()).getFigure().translateToAbsolute(r);
- p.translateToRelative(r);
-
- Rectangle pBounds = r.getCopy();
-
- if (dragAndDropCommand != null && dragAndDropCommand.canExecute())
- {
- int size = request.getEditParts().size();
- if (size > 0 && request.getEditParts().get(size - 1) == getHost())
- {
- PointList pointList = dragAndDropCommand.getConnectionPoints(r);
- if (pointList != null && pointList.size() > 0)
- {
- polyLine.setPoints(pointList);
-
- Point firstPoint = pointList.getFirstPoint();
- if (firstPoint != null)
- {
- pBounds = pBounds.getUnion(new Rectangle(firstPoint.x, firstPoint.y, 1, 1));
- }
- }
- }
- }
- p.setBounds(pBounds);
- ghostShape.setBounds(r);
- p.validate();
- */
- }
-/*
- protected IFigure getDragSourceFeedbackFigure()
- {
- EditPart editPart = getHost();
- if (feedback == null && editPart instanceof WSDLTreeNodeEditPart)
- {
- WSDLTreeNodeEditPart baseEditPart = (WSDLTreeNodeEditPart)editPart;
- originalLocation = new Rectangle(baseEditPart.getSelectionFigure().getBounds());
- feedback = createDragSourceFeedbackFigure(baseEditPart.getSelectionFigure());
- }
- return feedback;
- }
-
- protected IFigure createDragSourceFeedbackFigure(IFigure draggedFigure)
- {
- Polyline polyLine = new Polyline();
-// polyLine.setLineStyle(Graphics.LINE_DASHDOT);
- polyLine.setLineWidth(1);
- addFeedback(polyLine);
-
- return polyLine;
- }
- */
-
- public void deactivate()
- {
- if (feedback != null)
- {
- removeFeedback(feedback);
- feedback = null;
- }
- hideFocus();
- super.deactivate();
- }
-
- /**
- * Erase feedback indicating that the receiver object is
- * being dragged. This method is called when a drag is
- * completed or cancelled on the receiver object.
- * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
- */
- protected void eraseChangeBoundsFeedback(ChangeBoundsRequest request)
- {
- if (feedback != null)
- {
- removeFeedback(feedback);
- }
- feedback = null;
- originalLocation = null;
- }
-
- /**
- * Erase feedback indicating that the receiver object is
- * being dragged. This method is called when a drag is
- * completed or cancelled on the receiver object.
- * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
- */
- public void eraseSourceFeedback(Request request)
- {
- if (REQ_MOVE.equals(request.getType()) || REQ_ADD.equals(request.getType()))
- {
- eraseChangeBoundsFeedback((ChangeBoundsRequest)request);
- }
- }
-
- protected void hideSelection()
- {
- EditPart editPart = getHost();
- if (editPart instanceof IFeedbackHandler)
- {
- ((IFeedbackHandler)editPart).removeFeedback();
- }
- }
-
- protected void showSelection()
- {
- EditPart editPart = getHost();
- if (editPart instanceof IFeedbackHandler)
- {
- ((IFeedbackHandler)editPart).addFeedback();
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/ExpandableGraphNodeContentFigure.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/ExpandableGraphNodeContentFigure.java
deleted file mode 100644
index 0120df3..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/ExpandableGraphNodeContentFigure.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.wst.wsdl.ui.internal.gef.util.figures.Interactor;
-
-
-
-
-// --------------------------------------------
-// | ExpandableGraphNodeContentFigure |
-// | |
-// | ---------------------------------- |
-// | | verticalGroup | |
-// | | | |
-// | | ----------------------------- | |
-// | | | horizontalGroup | | |
-// | | | | | |
-// | | | --------------------- | | |
-// | | | | outlinedArea | | | |
-// | | | | ----------------- | | | |
-// | | | | |[+]iconArea | | | | |
-// | | | | ----------------- | | | |
-// | | | | ----------------- | | | |
-// | | | | | innerContent | | | | |
-// | | | | ----------------- | | | |
-// | | | --------------------- | | |
-// | | ----------------------------- | |
-// | | | |
-// | ---------------------------------- |
-// --------------------------------------------
-
-public class ExpandableGraphNodeContentFigure extends GraphNodeContentFigure
-{
- protected Interactor interactor;
- //protected ContainerFigure occurenceArea;
-
- public ExpandableGraphNodeContentFigure()
- {
- super();
- }
-
- public Interactor getInteractor()
- {
- return interactor;
- }
-
-
- protected void createFigure()
- {
- //createPreceedingSpace(this);
- createVerticalGroup(this);
- createOutlinedArea(verticalGroup);
- createInteractor(iconArea);
- innerContentArea.setBorder(new MarginBorder(0, 10, 0, 0));
- //createOccurenceArea(verticalGroup);
- }
-
-
-
- protected void createInteractor(IFigure parent)
- {
- interactor = new Interactor();
- interactor.setBorder(new MarginBorder(0, 0, 0, 5));
- interactor.setForegroundColor(ColorConstants.black);
- interactor.setBackgroundColor(ColorConstants.white);
- parent.add(interactor);
- }
-
-
- protected void createPreceedingSpace(IFigure parent)
- {
- // create a small space
- RectangleFigure space = new RectangleFigure();
- space.setVisible(false);
- space.setPreferredSize(new Dimension(10, 10));
- parent.add(space);
- }
-
-
- //protected void createOccurenceArea(IFigure parent)
- //{
- // occurenceArea = new ContainerFigure();
- // parent.add(occurenceArea);
- //}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/GraphNodeContentFigure.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/GraphNodeContentFigure.java
deleted file mode 100644
index 61003b2..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/GraphNodeContentFigure.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.figures;
-
-import org.eclipse.draw2d.IFigure;
-
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.IConnectedFigure;
-
-
-// ------------------------------
-// | GraphNodeContentFigure |
-// | |
-// | ------------------------- |
-// | | vertical group | |
-// | | --------------------- | |
-// | | | outlined area | | |
-// | | | ----------------- | | |
-// | | | | icon area | | | |
-// | | | ----------------- | | |
-// | | | ----------------- | | |
-// | | | | inner content | | | |
-// | | | ----------------- | | |
-// | | --------------------- | |
-// | ------------------------- |
-// ------------------------------
-
-public class GraphNodeContentFigure extends ContainerFigure implements IConnectedFigure
-{
- protected ContainerFigure verticalGroup;
- protected ContainerFigure outlinedArea;
- protected ContainerFigure iconArea;
- protected ContainerFigure innerContentArea;
-
- public GraphNodeContentFigure()
- {
- createFigure();
- }
-
- protected void createFigure()
- {
- //getContainerLayout().setHorizontal(true);
- //setLayoutManager(new FillLayout());
- createVerticalGroup(this);
- createOutlinedArea(verticalGroup);
- }
-
- protected void createVerticalGroup(IFigure parent)
- {
- verticalGroup = new ContainerFigure();
- verticalGroup.getContainerLayout().setHorizontal(false);
- ///verticalGroup.setLayoutManager(new FillLayout());
- parent.add(verticalGroup);
- }
-
- protected void createOutlinedArea(IFigure parent)
- {
- outlinedArea = new ContainerFigure();
- //outlinedArea.setLayoutManager(new FillLayout());
- outlinedArea.getContainerLayout().setHorizontal(false);
- parent.add(outlinedArea);
-
- iconArea = new ContainerFigure();
- iconArea.getContainerLayout().setHorizontal(true);
- outlinedArea.add(iconArea);
-
- innerContentArea = new ContainerFigure();
- //innerContentArea.setLayoutManager(new FillLayout());
- innerContentArea.getContainerLayout().setHorizontal(false);
- outlinedArea.add(innerContentArea);
- }
-
- public ContainerFigure getIconArea()
- {
- return iconArea;
- }
-
- public ContainerFigure getOutlinedArea()
- {
- return outlinedArea;
- }
-
- public ContainerFigure getInnerContentArea()
- {
- return innerContentArea;
- }
-
- public IFigure getConnectionFigure()
- {
- return outlinedArea;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/MyConnectionRenderingHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/MyConnectionRenderingHelper.java
deleted file mode 100644
index 7f00787..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/MyConnectionRenderingHelper.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.figures;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.DefinitionEditPart;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.GroupEditPart;
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.PartReferenceSectionEditPart;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.IConnectedFigure;
-
-
-public class MyConnectionRenderingHelper //implements ISelectionChangedListener
-{
- protected boolean isOutlined = true;
- protected EditPartViewer viewer;
-
- public MyConnectionRenderingHelper(EditPartViewer viewer)
- {
- this.viewer = viewer;
- //viewer.addSelectionChangedListener(this);
- //setFocusTraversable(false);
- //setEnabled(false);
- }
-
- //public void selectionChanged(SelectionChangedEvent event)
- //{
- //}
-
- public void fillShapeHelper(Graphics graphics)
- {
- drawLines(graphics, viewer.getRootEditPart());
- }
-
- protected Rectangle getConnectionBounds(IFigure figure)
- {
- Rectangle r = null;
- if (figure instanceof IConnectedFigure)
- {
- IConnectedFigure connectedFigure = (IConnectedFigure)figure;
- r = connectedFigure.getConnectionFigure().getBounds();
- }
- else
- {
- r = figure.getBounds();
- }
- return r;
- }
-
- final static int DOTTED_LINE_HEIGHT = 20;
- protected int getClippedY(int y, Rectangle bounds)
- {
- if (bounds != null)
- {
- if (y < bounds.y)
- {
- y = bounds.y;
- }
- if (y > (bounds.y + bounds.height))
- {
- y = bounds.y + bounds.height;
- }
- }
- return y;
- }
-
- protected void drawLine(Graphics graphics, IFigure a, IFigure b, int mx, Rectangle bounds)
- {
- Rectangle r1 = getConnectionBounds(a);
- Rectangle r2 = getConnectionBounds(b);
- int x1 = r1.x + r1.width;
- int y1 = r1.y + r1.height / 2;
- int x2 = r2.x - 1;
- int y2 = r2.y + r2.height / 2;
-
- int clippedY1 = getClippedY(y1, bounds);
- int clippedY2 = getClippedY(y2, bounds);
-
- graphics.setForegroundColor(ColorConstants.black);
-
- if (clippedY1 == y1 || clippedY2 == y2)
- {
- if (clippedY1 == y1)
- {
- // draw horizontal line
- graphics.drawLine(x1, y1, mx, y1);
- }
-
- if (clippedY2 == y2)
- {
- // draw horizontal line
- graphics.drawLine(mx, y2, x2 - 1, y2);
-
- // draw the arrow head
- //
- graphics.drawLine(x2 - 1, y2, x2 - 4, y2 - 3);
- graphics.drawLine(x2 - 1, y2, x2 - 4, y2 + 3);
- }
-
-
- // draw the vertical line including dotted ends
- //
- int lowClippedY = Math.min(clippedY1, clippedY2);
- int highClippedY = Math.max(clippedY1, clippedY2);
- int lowY = Math.min(y1, y2);
- int highY = Math.max(y1, y2);
-
- if (lowY == lowClippedY && highY == highClippedY)
- {
- graphics.drawLine(mx, lowClippedY, mx, highClippedY);
- }
- else
- {
- int dottedLineLength = Math.min(DOTTED_LINE_HEIGHT, (highY - lowY)/3);
- if (lowY != lowClippedY)
- {
- graphics.setLineStyle(Graphics.LINE_DOT);
- int dottedY = lowClippedY + dottedLineLength;
- graphics.drawLine(mx, lowClippedY, mx, dottedY);
- graphics.setLineStyle(Graphics.LINE_SOLID);
- graphics.drawLine(mx, dottedY, mx, highClippedY);
- }
- else //if (highY != highClippedY)
- {
- graphics.setLineStyle(Graphics.LINE_DOT);
- int dottedY = highClippedY - dottedLineLength;
- graphics.drawLine(mx, highClippedY, mx, dottedY);
- graphics.setLineStyle(Graphics.LINE_SOLID);
- graphics.drawLine(mx, dottedY, mx, lowClippedY);
- }
- }
- }
- }
-
- protected void drawLines(Graphics graphics, EditPart editPart)
- {
- if (editPart instanceof GroupEditPart)
- {
- GroupEditPart leftGroupEditPart = (GroupEditPart)editPart;
- GroupEditPart rightGroupEditPart = leftGroupEditPart.getNext();
-
- if (leftGroupEditPart != null && rightGroupEditPart != null)
- {
- if (leftGroupEditPart.outputConnection != null && rightGroupEditPart.inputConnection != null)
- {
- int mx = rightGroupEditPart.getFigure().getBounds().x - 5;
-
- Rectangle l = leftGroupEditPart.outerPane.getBounds();
- Rectangle r = leftGroupEditPart.outerPane.getBounds();
-
- // here we compute the union of the group bounds... rectangle.union() doesn't seem to work
- //
- int ux1 = Math.min(l.x, r.x);
- int uy1 = Math.min(l.y, r.y);
- int ux2 = Math.max(l.x + l.width, r.x + r.width);
- int uy2 = Math.max(l.y + l.height, r.y + r.height);
- Rectangle bounds = new Rectangle(ux1, uy1, ux2 - ux1, uy2 - uy1);
- drawLine(graphics, leftGroupEditPart.outputConnection.getFigure(), rightGroupEditPart.inputConnection.getFigure(), mx, bounds);
- }
- }
- }
- else if (editPart instanceof PartReferenceSectionEditPart)
- {
- AbstractGraphicalEditPart child = (editPart.getChildren().size() > 0) ?
- (AbstractGraphicalEditPart)editPart.getChildren().get(0) :
- null;
- if (child != null)
- {
- DefinitionEditPart def = (DefinitionEditPart)editPart.getParent();
- GroupEditPart groupEditPart = def.getGroupEditPart(WSDLGroupObject.MESSAGES_GROUP);
- if (groupEditPart != null && groupEditPart.outputConnection != null)
- {
- int mx = child.getFigure().getBounds().x - 12;
- drawLine(graphics, groupEditPart.outputConnection.getFigure(), child.getFigure(), mx, null);
- }
- }
- }
- else
- {
- for (Iterator i = editPart.getChildren().iterator(); i.hasNext(); )
- {
- EditPart child = (EditPart)i.next();
- drawLines(graphics, child);
- }
- }
- }
-}
-
-/*
- /*
- List children = figure.getChildren();
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- IFigure child = (IFigure)i.next();
- drawLines(graphics, child);
- } */
- /*
- List connectedFigures = graphNodeFigure.getConnectedFigures(IConnectedEditPartFigure.RIGHT_CONNECTION);
- int connectedFiguresSize = connectedFigures.size();
-
- if (connectedFiguresSize > 0)
- {
- IConnectedEditPartFigure firstGraphNodeFigure = (IConnectedEditPartFigure)connectedFigures.get(0);
- Rectangle r = graphNodeFigure.getConnectionFigure().getBounds();
-
- int x1 = r.x + r.width;
- int y1 = r.y + r.height/2;
-
- int startOfChildBox = firstGraphNodeFigure.getConnectionFigure().getBounds().x;
- int x2 = x1 + (startOfChildBox - x1) / 3;
- int y2 = y1;
-
- if (connectedFiguresSize == 1)
- {
- graphics.drawLine(x1, y1, startOfChildBox, y2);
- }
- else // (connectedFigures.length > 1)
- {
- graphics.drawLine(x1, y1, x2, y2);
-
- int minY = Integer.MAX_VALUE;
- int maxY = -1;
-
- for (Iterator i = connectedFigures.iterator(); i.hasNext(); )
- {
- IConnectedEditPartFigure connectedFigure = (IConnectedEditPartFigure)i.next();
- Rectangle childConnectionRectangle = connectedFigure.getConnectionFigure().getBounds();
- int y = childConnectionRectangle.y + childConnectionRectangle.height / 2;
- minY = Math.min(minY, y);
- maxY = Math.max(maxY, y);
- graphics.drawLine(x2, y, childConnectionRectangle.x, y);
- }
- graphics.drawLine(x2, minY, x2, maxY);
- }
- }
- }
-
- //boolean visitChildren = true;
- List children = figure.getChildren();
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- IFigure child = (IFigure)i.next();
- drawLines(graphics, child);
- }
-*/
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/TreeNodeContentFigure.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/TreeNodeContentFigure.java
deleted file mode 100644
index 628b798..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/figures/TreeNodeContentFigure.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.MarginBorder;
-
-
-public class TreeNodeContentFigure extends ExpandableGraphNodeContentFigure
-{
- protected void createOutlinedArea(IFigure parent)
- {
- super.createOutlinedArea(parent);
- outlinedArea.setBorder(new MarginBorder(0,2,0,2));
- }
-
- public IFigure getConnectionFigure()
- {
- return outlinedArea;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/model/WSDLGraphModelAdapterFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/model/WSDLGraphModelAdapterFactory.java
deleted file mode 100644
index c336ce0..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/graph/model/WSDLGraphModelAdapterFactory.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.graph.model;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.graph.ViewMode;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-
-
-public class WSDLGraphModelAdapterFactory extends WSDLModelAdapterFactory
-{
- protected static WSDLGraphModelAdapterFactory wsdlGraphModelAdapterFactoryInstance;
-
- public static WSDLGraphModelAdapterFactory getWSDLGraphModelAdapterFactory()
- {
- if (wsdlGraphModelAdapterFactoryInstance == null)
- {
- wsdlGraphModelAdapterFactoryInstance = new WSDLGraphModelAdapterFactory();
- }
- return wsdlGraphModelAdapterFactoryInstance;
- }
-
- protected AdapterFactory createAdapterFactory()
- {
- return new GraphAdapterFactory();
- }
-
- //protected boolean isExtensibilityElementConsideredChild()
- //{
- // return false;
- //}
-
-
- // There are many adapters associated with this factory. Each DOM Node has its own adapter.
- //
- protected class GraphAdapterFactory extends WSDLAdapterFactoryImpl
- {
-
- public Adapter createDefinitionAdapter()
- {
- return new GraphDefinitionAdapter();
- }
-
- public Adapter createBindingAdapter()
- {
- return new GraphBindingAdapter();
- }
-
- public Adapter createPartAdapter()
- {
- return new GraphPartAdapter();
- }
-
- //public Adapter createPortAdapter()
- //{
- // return new GraphPortAdapter();
- //}
-
- public Adapter createPortTypeAdapter()
- {
- return new GraphPortTypeAdapter();
- }
-
- //public Adapter createInputAdapter()
- //{
- // return new GraphInputAdapter();
- //}
-
- //public Adapter createOutputAdapter()
- //{
- // return new GraphOutputAdapter();
- //}
-
- //public Adapter createFaultAdapter()
- //{
- // return new GraphFaultAdapter();
- //}
-
- public Adapter createTypesAdapter()
- {
- return new GraphTypesAdapter();
- }
- }
-
-
-
- protected class GraphDefinitionAdapter extends DefinitionAdapter implements ViewMode.Listener
- {
- protected ViewMode viewMode = new ViewMode();
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- viewMode.addListener(this);
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
- list.add(permanentWSDLGroupObjectList.get(0));
- list.add(permanentWSDLGroupObjectList.get(1));
- list.add(permanentWSDLGroupObjectList.get(5));
- if (viewMode.isBindingVisible())
- {
- list.add(permanentWSDLGroupObjectList.get(4));
- }
- list.add(permanentWSDLGroupObjectList.get(3));
- list.add(permanentWSDLGroupObjectList.get(2));
- if (extensibilityElementsGroup.getChildren().size() > 0)
- {
- list.add(extensibilityElementsGroup);
- }
- return list;
- }
-
-
- public void viewModeChanged(ViewMode mode)
- {
- firePropertyChangedHelper();
- }
-
- public ViewMode getViewMode()
- {
- return viewMode;
- }
-
- protected ModelAdapterFactory getModelAdapterFactory()
- {
- return getWSDLGraphModelAdapterFactory();
- }
- }
-
-
-
-
- protected class GraphBindingAdapter extends BindingAdapter
- { /*
- protected List getChildren()
- {
- List list = new ArrayList();
- if (binding.getPortType() != null)
- {
- list.add(binding.getPortType());
- }
- return list;
- }*/
- }
-
-
- protected class GraphPartAdapter extends PartAdapter
- { /*
- protected List getChildren()
- {
- List list = new ArrayList();
-
- Object component = part.getType();
- if (component != null)
- {
- // TODO... i'm pulling a fast one here.... we should call the extension
- // to see if he wants to show a child here
- if (component instanceof org.eclipse.xsd.XSDComplexTypeDefinition)
- {
- list.add(component);
- }
- }
- else
- {
- component = part.getElement();
- if (component != null)
- {
- list.add(component);
- }
- }
-
- return list;
- }*/
- }
-
- protected class GraphPortTypeAdapter extends PortTypeAdapter
- {
- public Object getProperty(Object modelObject, String propertyName)
- {
- Object result = null;
- if (propertyName.equals("bindings"))
- {
- ComponentReferenceUtil util = new ComponentReferenceUtil(portType.getEnclosingDefinition());
- result = util.getBindings(portType);
- }
- else
- {
- result = super.getProperty(modelObject, propertyName);
- }
- return result;
- }
- }
-
- protected class GraphPortAdapter extends PortAdapter implements ModelAdapterListener
- {
- protected List getChildren()
- {
- List list = new ArrayList();
-
- Binding binding = (Binding)port.getBinding();
-
- if (binding != null)
- {
- list.add(binding);
- }
-
- return list;
- }
-
- // propagate changes to the binding object
- //
- public void propertyChanged(Object object, String property)
- {
- firePropertyChanged(port, null);
- }
- }
-
-
- protected class GraphInputAdapter extends InputAdapter
- {
- protected List getChildren()
- {
- List list = new ArrayList();
- if (input.getMessage() != null)
- {
- list.add(input.getMessage());
- }
- return list;
- }
-
- public Object getProperty(Object modelObject, String propertyName)
- {
- Object result = null;
- if (propertyName.equals("bindings"))
- {
- ComponentReferenceUtil util = new ComponentReferenceUtil(input.getEnclosingDefinition());
- result = util.getBindingInputs(input);
- }
- else
- {
- result = super.getProperty(modelObject, propertyName);
- }
- return result;
- }
- }
-
-
- protected class GraphOutputAdapter extends OutputAdapter
- {
- protected List getChildren()
- {
- List list = new ArrayList();
- if (output.getMessage() != null)
- {
- list.add(output.getMessage());
- }
- return list;
- }
-
- public Object getProperty(Object modelObject, String propertyName)
- {
- Object result = null;
- if (propertyName.equals("bindings"))
- {
- ComponentReferenceUtil util = new ComponentReferenceUtil(output.getEnclosingDefinition());
- result = util.getBindingOutputs(output);
- }
- else
- {
- result = super.getProperty(modelObject, propertyName);
- }
- return result;
- }
- }
-
- protected class GraphFaultAdapter extends FaultAdapter
- {
- protected List getChildren()
- {
- List list = new ArrayList();
- if (fault.getMessage() != null)
- {
- list.add(fault.getMessage());
- }
- return list;
- }
-
- public Object getProperty(Object modelObject, String propertyName)
- {
- Object result = null;
- if (propertyName.equals("bindings"))
- {
- ComponentReferenceUtil util = new ComponentReferenceUtil(fault.getEnclosingDefinition());
- result = util.getBindingFaults(fault);
- }
- else
- {
- result = super.getProperty(modelObject, propertyName);
- }
- return result;
- }
- }
-
- public class GraphTypesAdapter extends TypesAdapter
- {
- protected List getChildren()
- {
- List list = new ArrayList();
- for (Iterator i = types.getEExtensibilityElements().iterator(); i.hasNext(); )
- {
- Object o = i.next();
- if (o instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement s = (XSDSchemaExtensibilityElement)o;
- Object schema = s.getSchema();
- if (schema != null)
- {
- list.add(schema);
- }
- }
- else
- {
- list.add(o);
- }
- }
- return list;
- }
- }
- /*
- protected class GraphBindingAdapter extends BindingAdapter
- {
- protected List getChildren()
- {
- List list = new ArrayList();
- if (binding.getPortType() != null)
- {
- list.add(binding.getPortType());
- }
- return list;
- }
- }*/
-
- // convenience methods
- //
- public static void addModelAdapterListener(Object modelObject, ModelAdapterListener listener)
- {
-// TODO: port check
- ModelAdapter adapter = getWSDLGraphModelAdapterFactory().getAdapter(modelObject);
-// ModelAdapter adapter = EcoreUtil.getAdapter(getWSDLGraphModelAdapterFactory().eAdapters(),modelObject);
- if (adapter != null)
- {
- adapter.addListener(listener);
- }
- }
-
- public static void removeModelAdapterListener(Object modelObject, ModelAdapterListener listener)
- {
- ModelAdapter adapter = getWSDLGraphModelAdapterFactory().getAdapter(modelObject);
- if (adapter != null)
- {
- adapter.removeListener(listener);
- }
- }
-
- public static ViewMode getViewMode(Definition definition)
- {
- GraphDefinitionAdapter adapter = (GraphDefinitionAdapter)getWSDLGraphModelAdapterFactory().getAdapter(definition);
- return adapter.getViewMode();
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/back.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/back.gif
deleted file mode 100644
index 24d1a27..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/back.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/binding_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/binding_obj.gif
deleted file mode 100644
index 896e2f0..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/binding_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/bindingheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/bindingheader_obj.gif
deleted file mode 100644
index 1ffe54e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/bindingheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/browsebutton.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/browsebutton.gif
deleted file mode 100644
index e2402f8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/browsebutton.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/complextype_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/complextype_obj.gif
deleted file mode 100644
index 007f852..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/complextype_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/element_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/element_obj.gif
deleted file mode 100644
index dd45f08..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/element_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/error_co.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/error_co.gif
deleted file mode 100644
index 119dccc..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/error_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/fault_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/fault_obj.gif
deleted file mode 100644
index f228117..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/fault_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/file_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/file_obj.gif
deleted file mode 100644
index efa7a38..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/file_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/fldr_el.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/fldr_el.gif
deleted file mode 100644
index 801c133..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/fldr_el.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/forward.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/forward.gif
deleted file mode 100644
index eab699e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/forward.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/hidebinding.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/hidebinding.gif
deleted file mode 100644
index c846cd8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/hidebinding.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpaddress_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpaddress_obj.gif
deleted file mode 100644
index fb20c38..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpaddress_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpbinding_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpbinding_obj.gif
deleted file mode 100644
index 4428ef3..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpbinding_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpoperation_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpoperation_obj.gif
deleted file mode 100644
index 1c40418..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpoperation_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpurlencoded_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpurlencoded_obj.gif
deleted file mode 100644
index ed5050f..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpurlencoded_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpurlreplacement_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpurlreplacement_obj.gif
deleted file mode 100644
index 273587e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/httpurlreplacement_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/import_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/import_obj.gif
deleted file mode 100644
index b7275aa..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/import_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/importheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/importheader_obj.gif
deleted file mode 100644
index 6000cb8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/importheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/input_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/input_obj.gif
deleted file mode 100644
index fe6b349..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/input_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/message_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/message_obj.gif
deleted file mode 100644
index 2dce483..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/message_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/messageheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/messageheader_obj.gif
deleted file mode 100644
index 02a711c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/messageheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/namespace_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/namespace_obj.gif
deleted file mode 100644
index 7e3f274..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/namespace_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/namespacedecl_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/namespacedecl_obj.gif
deleted file mode 100644
index 2b79d27..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/namespacedecl_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/new_wsdl_wiz.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/new_wsdl_wiz.gif
deleted file mode 100644
index d1087b9..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/new_wsdl_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/operation_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/operation_obj.gif
deleted file mode 100644
index 5818a30..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/operation_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/operationbinding_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/operationbinding_obj.gif
deleted file mode 100644
index ae386c6..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/operationbinding_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/output_no.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/output_no.gif
deleted file mode 100644
index f6b9f8a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/output_no.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/output_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/output_obj.gif
deleted file mode 100644
index bd0918c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/output_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/output_yes.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/output_yes.gif
deleted file mode 100644
index 9cacb96..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/output_yes.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/page_banner.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/page_banner.gif
deleted file mode 100644
index aebc0b2..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/page_banner.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/part_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/part_obj.gif
deleted file mode 100644
index 5219dfa..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/part_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/port_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/port_obj.gif
deleted file mode 100644
index 379498b..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/port_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/porttype_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/porttype_obj.gif
deleted file mode 100644
index 21325ca..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/porttype_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/porttypeheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/porttypeheader_obj.gif
deleted file mode 100644
index 9afcc01..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/porttypeheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/prtcmplxpltyp_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/prtcmplxpltyp_obj.gif
deleted file mode 100644
index db86643..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/prtcmplxpltyp_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/prtelemt_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/prtelemt_obj.gif
deleted file mode 100644
index 782d108..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/prtelemt_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/prtsmpltyp_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/prtsmpltyp_obj.gif
deleted file mode 100644
index 8ffc7c5..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/prtsmpltyp_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/service_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/service_obj.gif
deleted file mode 100644
index 5216b3f..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/service_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/serviceheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/serviceheader_obj.gif
deleted file mode 100644
index 8b4814c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/serviceheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/simpletype_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/simpletype_obj.gif
deleted file mode 100644
index e45dbb1..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/simpletype_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soap_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soap_obj.gif
deleted file mode 100644
index fd426ed..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soap_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapaddress_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapaddress_obj.gif
deleted file mode 100644
index 4880ba7..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapaddress_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapatt_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapatt_obj.gif
deleted file mode 100644
index d0b3661..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapatt_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapbinding_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapbinding_obj.gif
deleted file mode 100644
index 115f6bf..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapbinding_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapbody_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapbody_obj.gif
deleted file mode 100644
index b2d01aa..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapbody_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapfault_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapfault_obj.gif
deleted file mode 100644
index 856b1f7..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapfault_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapheader_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapheader_obj.gif
deleted file mode 100644
index f72ea3b..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapheader_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapheaderfault_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapheaderfault_obj.gif
deleted file mode 100644
index 2f0e190..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapheaderfault_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapoperation_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapoperation_obj.gif
deleted file mode 100644
index bcc1914..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/soapoperation_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/types_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/types_obj.gif
deleted file mode 100644
index d1f6f88..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/types_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/validate.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/validate.gif
deleted file mode 100644
index 2b347ac..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/validate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/wsdl_file_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/wsdl_file_obj.gif
deleted file mode 100644
index 75b1f92..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/wsdl_file_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/xsd_file_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/xsd_file_obj.gif
deleted file mode 100644
index 13dcfce..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/xsd_file_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/xsd_obj.gif b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/xsd_obj.gif
deleted file mode 100644
index 13dcfce..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/icons/xsd_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/ModelAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/ModelAdapter.java
deleted file mode 100644
index 0e53e7e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/ModelAdapter.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.model;
-
-public interface ModelAdapter
-{
- public static final String CHILDREN_PROPERTY = "CHILDREN_PROPERTY";
- public static final String LABEL_PROPERTY = "LABEL_PROPERTY";
- public static final String IMAGE_PROPERTY = "IMAGE_PROPERTY";
- public static final String DETAIL_PROPERTY = "DETAIL_PROPERTY";
-
- public void addListener(ModelAdapterListener l);
- public void removeListener(ModelAdapterListener l);
- public Object getProperty(Object modelObject, String propertyName);
- public void firePropertyChanged(Object modelObject, String propertyName);
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/ModelAdapterFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/ModelAdapterFactory.java
deleted file mode 100644
index 9db0daa..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/ModelAdapterFactory.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.model;
-
-public interface ModelAdapterFactory
-{
- public ModelAdapter getAdapter(Object o);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/ModelAdapterListener.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/ModelAdapterListener.java
deleted file mode 100644
index 1e3e851..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/ModelAdapterListener.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.model;
-
-public interface ModelAdapterListener
-{
- public void propertyChanged(Object object, String property);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/WSDLGroupObject.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/WSDLGroupObject.java
deleted file mode 100644
index efc43c2..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/WSDLGroupObject.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.model;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-
-
-
-// Note that the TYPES_GROUP group is just a place holder. If the Types obejct actually exists
-// for the root WSDL document, it will be used instead of this model group
-//
-public class WSDLGroupObject implements ModelAdapter
-{
- public static final int IMPORTS_GROUP = 1;
- public static final int MESSAGES_GROUP = 2;
- public static final int SERVICES_GROUP = 3;
- public static final int PORT_TYPES_GROUP = 4;
- public static final int BINDINGS_GROUP = 5;
- public static final int TYPES_GROUP = 6;
- public static final int EXTENSIBILITY_ELEMENTS_GROUP = 7;
-
- protected Definition definition;
- protected int type;
- protected List listenerList = new ArrayList();
- protected ModelAdapterFactory modelAdapterFactory;
-
- public WSDLGroupObject(Definition definition, int type)
- {
- this(definition, type, null);
- }
-
- public WSDLGroupObject(Definition definition, int type, ModelAdapterFactory modelAdapterFactory)
- {
- this.definition = definition;
- this.type = type;
- this.modelAdapterFactory = modelAdapterFactory;
- }
-
- public Definition getParent()
- {
- return definition;
- }
-
- public Definition getDefinition()
- {
- return definition;
- }
-
-
- public int getType()
- {
- return type;
- }
-
- public String getLabel()
- {
- String name = "";
- switch (type)
- {
- case IMPORTS_GROUP :
- {
- name = WSDLEditorPlugin.getWSDLString("_UI_FOLDER_IMPORTS"); //$NON-NLS-1$
- break;
- }
- case MESSAGES_GROUP :
- {
- name = WSDLEditorPlugin.getWSDLString("_UI_FOLDER_MESSAGES"); //$NON-NLS-1$
- break;
- }
- case SERVICES_GROUP :
- {
- name = WSDLEditorPlugin.getWSDLString("_UI_FOLDER_SERVICES"); //$NON-NLS-1$
- break;
- }
- case BINDINGS_GROUP :
- {
- name = WSDLEditorPlugin.getWSDLString("_UI_FOLDER_BINDINGS"); //$NON-NLS-1$
- break;
- }
- case PORT_TYPES_GROUP :
- {
- name = WSDLEditorPlugin.getWSDLString("_UI_FOLDER_PORTTYPES"); //$NON-NLS-1$
- break;
- }
- case TYPES_GROUP :
- {
- name = WSDLEditorPlugin.getWSDLString("_UI_FOLDER_TYPES"); //$NON-NLS-1$
- break;
- }
- case EXTENSIBILITY_ELEMENTS_GROUP:
- {
- name = WSDLEditorPlugin.getWSDLString("_UI_FOLDER_EXTENSIBILITY_ELEMENTS"); //$NON-NLS-1$
- break;
- }
- }
- return name;
- }
-
-
- public Image getImage()
- {
- Image image = null;
- switch (type)
- {
- case IMPORTS_GROUP :
- {
- image = WSDLEditorPlugin.getInstance().getImage("icons/importheader_obj.gif"); //$NON-NLS-1$
- break;
- }
- case MESSAGES_GROUP :
- {
- image = WSDLEditorPlugin.getInstance().getImage("icons/messageheader_obj.gif"); //$NON-NLS-1$
- break;
- }
- case SERVICES_GROUP :
- {
- image = WSDLEditorPlugin.getInstance().getImage("icons/serviceheader_obj.gif"); //$NON-NLS-1$
- break;
- }
- case PORT_TYPES_GROUP :
- {
- image = WSDLEditorPlugin.getInstance().getImage("icons/porttypeheader_obj.gif"); //$NON-NLS-1$
- break;
- }
- case BINDINGS_GROUP :
- {
- image = WSDLEditorPlugin.getInstance().getImage("icons/bindingheader_obj.gif"); //$NON-NLS-1$
- break;
- }
- case TYPES_GROUP :
- {
- image = WSDLEditorPlugin.getInstance().getImage("icons/types_obj.gif"); //$NON-NLS-1$
- break;
- }
- case EXTENSIBILITY_ELEMENTS_GROUP:
- {
- image = WSDLEditorPlugin.getInstance().getImage("icons/fldr_el.gif"); //$NON-NLS-1$
- break;
- }
- }
- return image;
- }
-
-
- // implement ModelAdapter
- public void addListener(ModelAdapterListener listener)
- {
- if (!listenerList.contains(listener))
- {
- listenerList.add(listener);
- }
- }
-
- public void removeListener(ModelAdapterListener listener)
- {
- listenerList.remove(listener);
- }
-
-
- public Object getProperty(Object modelObject, String propertyName)
- {
- Object result = null;
- if (propertyName.equals(CHILDREN_PROPERTY))
- {
- result = getChildren();
- }
- else if (propertyName.equals(LABEL_PROPERTY))
- {
- result = getLabel();
- }
- else if (propertyName.equals(IMAGE_PROPERTY))
- {
- result = getImage();
- }
- return result;
- }
-
-
- public void firePropertyChanged(Object notifier, String property)
- {
- List list = new ArrayList();
- list.addAll(listenerList);
- for (Iterator i = list .iterator(); i.hasNext(); )
- {
- ModelAdapterListener listener = (ModelAdapterListener)i.next();
- listener.propertyChanged(notifier, property);
- }
- }
-
-
- public List getChildren()
- {
- List list = Collections.EMPTY_LIST;
-
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
- switch (getType())
- {
- case WSDLGroupObject.IMPORTS_GROUP :
- {
- list = definition.getEImports();
- break;
- }
- case WSDLGroupObject.MESSAGES_GROUP :
- {
- try
- {
- list = sortMessages(util.getMessages());
- }
- catch(Exception e)
- {
- list = util.getMessages();
- }
- break;
- }
- case WSDLGroupObject.SERVICES_GROUP :
- {
- list = util.getServices();
- break;
- }
- case WSDLGroupObject.PORT_TYPES_GROUP :
- {
- list = util.getPortTypes();
- break;
- }
- case WSDLGroupObject.BINDINGS_GROUP :
- {
- list = util.getBindings();
- break;
- }
- case WSDLGroupObject.TYPES_GROUP :
- {
- Object types = definition.getETypes();
- if (types != null)
- {
- list = (List)modelAdapterFactory.getAdapter(types).getProperty(types, ModelAdapter.CHILDREN_PROPERTY);
- }
- break;
- }
- case WSDLGroupObject.EXTENSIBILITY_ELEMENTS_GROUP:
- {
- list = WSDLEditorUtil.getInstance().getExtensibilityElementNodes(definition);
- break;
- }
- }
- return list;
- }
-
- private List initialSort(List inputList) {
- List messageGroups = new ArrayList();
- Iterator iterator = inputList.iterator();
-
- while (iterator.hasNext()) {
- Message newMessage = (Message) iterator.next();
-
- boolean messageAdded = false;
- for (int index = 0; index < messageGroups.size(); index++) {
- MessageGroup messageItem = (MessageGroup) messageGroups.get(index);
-
- if(messageItem.addMessage(newMessage)) {
- messageAdded = true;
- break;
- }
- }
-
- // Do we need to create a new MessageGroup object?
- if (!messageAdded) {
- MessageGroup msGroup = new MessageGroup(newMessage.getQName().getLocalPart());
- msGroup.addMessage(newMessage);
- messageGroups.add(msGroup);
- }
- }
-
- return messageGroups;
- }
-
- private List buildMessageList(List list) {
- List sortedMessageList = new ArrayList();
-
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- MessageGroup mGroup = (MessageGroup) iterator.next();
- sortedMessageList.addAll(mGroup.getMessages());
- }
-
- return sortedMessageList;
- }
-
- private List sortMessages(List inputList) {
- List sortedList = new ArrayList();
- sortedList.addAll(inputList);
-
- // Get a sorted list of MessageGroups
- sortedList = initialSort(inputList);
-
- Collections.sort(sortedList, new Comparator() {
- public int compare(Object o1, Object o2) {
- String name1 = ((MessageGroup) o1).getBaseName();
- String name2 = ((MessageGroup) o2).getBaseName();
-
- return name1.compareToIgnoreCase(name2);
- }
- });
-
- sortedList = buildMessageList(sortedList);
- return sortedList;
- }
-
- private class MessageGroup {
- private String baseName;
- private Vector messages;
-
- public MessageGroup(String name) {
- this.baseName = computeBaseName(name);
- messages = new Vector();
- }
-
- public boolean addMessage(Message newMessage) {
- // do check if it belongs here?......
- String newMessageBaseName = computeBaseName(newMessage.getQName().getLocalPart());
-
- if (newMessageBaseName.equalsIgnoreCase(getBaseName())) {
- addToSortedList(newMessage);
-
- return true;
- }
-
- return false;
- }
-
- public Vector getMessages() {
- return messages;
- }
-
- public String getBaseName() {
- return baseName;
- }
-
- private int getFirstInstance(String subString) {
- for (int index = 0; index < messages.size(); index++) {
- Message message = (Message) messages.get(index);
- String messageName = message.getQName().getLocalPart();
-
- if (messageName.indexOf(subString, 1) > 0) {
- return index;
- }
- }
-
- return -1;
- }
-
- private void addToSortedList(Message message) {
- // We need to add the new Message in the right position
- int index = -1;
- String name = message.getQName().getLocalPart();
- if (name.indexOf("Request", 1) > 0) {
- // Add after first instance of 'Response'
- index = getFirstInstance("Response");
- }
- else if (name.indexOf("Response", 1) > 0) {
- // Add after first instance of 'Request'
- index = getFirstInstance("Request");
- if (index >= 0)
- index++;
- }
-
- if (index >= 0) {
- messages.add(index, message);
- }
- else {
- messages.add(message);
- }
- }
-
- private String computeBaseName(String name) {
- int resReqIndex = name.indexOf("Request", 1);
- int resReqLength;
- if (resReqIndex == -1) {
- resReqIndex = name.indexOf("Response", 1);
- resReqLength = "Response".length();
- }
- else {
- resReqLength = "Request".length();
- }
-
- // Did we even find a Request/Response in both strings?
- if (resReqIndex != -1) {
- return name.substring(0, resReqIndex) + name.substring(resReqIndex + resReqLength, name.length());
- }
- else {
- return name;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/WSDLModelAdapterFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/WSDLModelAdapterFactory.java
deleted file mode 100644
index 8604dbf..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/model/WSDLModelAdapterFactory.java
+++ /dev/null
@@ -1,1219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.model;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.wsdl.OperationType;
-
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibleElement;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.UnknownExtensibilityElement;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.ITreeChildProvider;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.internal.impl.OperationImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class WSDLModelAdapterFactory implements ModelAdapterFactory
-{
- protected static WSDLModelAdapterFactory wsdlModelAdapterFactoryInstance;
-
- public AdapterFactory adapterFactory;
-
- public WSDLModelAdapterFactory()
- {
- adapterFactory = createAdapterFactory();
- }
-
- protected boolean isExtensibilityElementConsideredChild()
- {
- return true;
- }
-
- protected void addExtensiblityElementChildren(List list, ExtensibleElement extensibleElement)
- {
- if (isExtensibilityElementConsideredChild())
- {
- //list.addAll(WSDLEditorUtil.getInstance().getExtensibilityElementNodes(extensibleElement));
- list.addAll(WSDLEditorUtil.getInstance().getExtensibilityElementNodes(extensibleElement));
- }
- }
-
- public static WSDLModelAdapterFactory getWSDLModelAdapterFactory()
- {
- if (wsdlModelAdapterFactoryInstance == null)
- {
- wsdlModelAdapterFactoryInstance = new WSDLModelAdapterFactory();
- }
- return wsdlModelAdapterFactoryInstance;
- }
-
-
- protected AdapterFactory createAdapterFactory()
- {
- return new WSDLAdapterFactoryImpl();
- }
-
-
- public ModelAdapter getAdapter(Object o)
- {
- ModelAdapter adapter = null;
- if (o instanceof WSDLElement)
- {
- adapter = (ModelAdapter)adapterFactory.adapt((WSDLElement)o, adapterFactory);
- }
- else if (o instanceof WSDLGroupObject)
- {
- adapter = (WSDLGroupObject)o;
- }
- return adapter;
- }
-
- //
- //
- //
- public class WSDLAdapterFactoryImpl extends AdapterFactoryImpl
- {
- public Adapter createAdapter(Notifier target)
- {
- WSDLSwitch wsdlSwitch = new WSDLSwitch()
- {
- public Object caseWSDLElement(WSDLElement wsdlElement)
- {
- return createWSDLElementAdapter();
- }
-
- public Object caseBinding(Binding binding)
- {
- return createBindingAdapter();
- }
-
- public Object caseBindingFault(BindingFault bindingFault)
- {
- return createBindingFaultAdapter();
- }
-
- public Object caseBindingInput(BindingInput bindingInput)
- {
- return createBindingInputAdapter();
- }
-
- public Object caseBindingOutput(BindingOutput bindingOutput)
- {
- return createBindingOutputAdapter();
- }
-
- public Object caseBindingOperation(BindingOperation bindingOperation)
- {
- return createBindingOperationAdapter();
- }
-
- public Object caseDefinition(Definition definition)
- {
- return createDefinitionAdapter();
- }
-
- public Object caseFault(Fault fault)
- {
- return createFaultAdapter();
- }
-
- public Object caseImport(Import i)
- {
- return createImportAdapter();
- }
-
- public Object caseInput(Input input)
- {
- return createInputAdapter();
- }
-
- public Object caseOutput(Output output)
- {
- return createOutputAdapter();
- }
-
- public Object caseMessage(Message message)
- {
- return createMessageAdapter();
- }
-
- public Object caseOperation(Operation operation)
- {
- return createOperationAdapter();
- }
-
- public Object casePart(Part part)
- {
- return createPartAdapter();
- }
-
- public Object casePort(Port port)
- {
- return createPortAdapter();
- }
-
- public Object casePortType(PortType portType)
- {
- return createPortTypeAdapter();
- }
-
- public Object caseService(Service service)
- {
- return createServiceAdapter();
- }
-
- public Object caseTypes(Types types)
- {
- return createTypesAdapter();
- }
-
- public Object caseUnknownExtensibilityElement(UnknownExtensibilityElement uee)
- {
- return createUnknownExtensibilityElementAdapter();
- }
- };
-
- Object o = wsdlSwitch.doSwitch((EObject)target);
-
- Adapter result = null;
- if (o instanceof Adapter)
- {
- result = (Adapter)o;
- }
- else
- {
- System.out.println("did not create adapter for target : " + target);
- Thread.dumpStack();
- }
- return result;
- }
-
-
- public Adapter createWSDLElementAdapter()
- {
- return new WSDLElementAdapter();
- }
-
- public Adapter createBindingAdapter()
- {
- return new BindingAdapter();
- }
-
- public Adapter createBindingFaultAdapter()
- {
- return new BindingFaultAdapter();
- }
-
- public Adapter createBindingInputAdapter()
- {
- return new BindingInputAdapter();
- }
-
- public Adapter createBindingOutputAdapter()
- {
- return new BindingOutputAdapter();
- }
-
- public Adapter createBindingOperationAdapter()
- {
- return new BindingOperationAdapter();
- }
-
- public Adapter createDefinitionAdapter()
- {
- return new DefinitionAdapter();
- }
-
- public Adapter createFaultAdapter()
- {
- return new FaultAdapter();
- }
-
- public Adapter createImportAdapter()
- {
- return new ImportAdapter();
- }
-
- public Adapter createInputAdapter()
- {
- return new InputAdapter();
- }
-
- public Adapter createMessageAdapter()
- {
- return new MessageAdapter();
- }
-
-
- public Adapter createOperationAdapter()
- {
- return new OperationAdapter();
- }
-
- public Adapter createOutputAdapter()
- {
- return new OutputAdapter();
- }
-
- public Adapter createPartAdapter()
- {
- return new PartAdapter();
- }
-
- public Adapter createPortAdapter()
- {
- return new PortAdapter();
- }
-
- public Adapter createPortTypeAdapter()
- {
- return new PortTypeAdapter();
- }
-
- public Adapter createServiceAdapter()
- {
- return new ServiceAdapter();
- }
-
- public Adapter createTypesAdapter()
- {
- return new TypesAdapter();
- }
-
- public Adapter createUnknownExtensibilityElementAdapter()
- {
- return new UnknownExtensibilityElementAdapter();
- }
-
- // convenience method
- //
- public Adapter adapt(Notifier target)
- {
- return adapt(target, this);
- }
- }
-
- //
- //
- //
- protected class WSDLElementAdapter extends AdapterImpl implements ModelAdapter
- {
- protected List listenerList = new ArrayList();
-
-
- public WSDLElementAdapter()
- {
- }
-
- public boolean isAdapterForType(Object type)
- {
- return type == adapterFactory;
- }
-
- public void addListener(ModelAdapterListener listener)
- {
- if (!listenerList.contains(listener))
- {
- listenerList.add(listener);
- }
- }
-
- public void removeListener(ModelAdapterListener listener)
- {
- if (listenerList.contains(listener))
- {
- listenerList.remove(listener);
- }
- }
-
- public void firePropertyChanged(Object notifier, String property)
- {
- List list = new ArrayList();
- list.addAll(listenerList);
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- ModelAdapterListener listener = (ModelAdapterListener)i.next();
- listener.propertyChanged(getTarget(), property);
- }
- }
-
- public void notifyChanged(Notification msg)
- {
- if (msg.getEventType() != Notification.RESOLVE)
- {
- firePropertyChanged(msg.getNotifier(), null);
- }
- }
-
-
- public Object getProperty(Object modelObject, String propertyName)
- {
- Object result = null;
- if (propertyName.equals(CHILDREN_PROPERTY))
- {
- result = getChildren();
- }
- else if (propertyName.equals(LABEL_PROPERTY))
- {
- result = getLabel();
- }
- else if (propertyName.equals(IMAGE_PROPERTY))
- {
- result = getImage();
- }
- else if (propertyName.equals("extensibilityElements"))
- {
- if (modelObject instanceof ExtensibleElement)
- {
- result = WSDLEditorUtil.getInstance().getExtensibilityElementNodes((ExtensibleElement)modelObject);
- }
- }
- else if (propertyName.equals("isReadOnly"))
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(target);
- result = (element instanceof XMLNode) ? Boolean.FALSE : Boolean.TRUE;
- }
- return result;
- }
-
- protected List getChildren()
- {
- return Collections.EMPTY_LIST;
- }
-
- protected String getLabel()
- {
- return "todo";
- }
-
- protected Image getImage()
- {
- return null;
- }
- }
-
-
- protected class BindingAdapter extends WSDLElementAdapter
- {
- protected Binding binding;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.binding = (Binding)newTarget;
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
- addExtensiblityElementChildren(list, binding);
- List operationsList = binding.getEBindingOperations();
- List tempList = new ArrayList();
- tempList.addAll(operationsList);
-
- Collections.sort(tempList, new Comparator() {
- public int compare(Object o1, Object o2) {
- String s1 = ((BindingOperation) o1).getName();
- String s2 = ((BindingOperation) o2).getName();
-
- if (s1 == null) {
- s1 = "";
- }
- if (s2 == null) {
- s2 = "";
- }
-
- boolean boo = true;
- return s1.compareToIgnoreCase(s2);
- }
- });
-
- list.addAll(tempList);
-
- return list;
- }
-
- protected String getLabel()
- {
- return binding.getQName().getLocalPart();
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/binding_obj.gif");
- }
- }
-
-
- protected class BindingFaultAdapter extends WSDLElementAdapter
- {
- protected BindingFault bindingFault;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.bindingFault = (BindingFault)newTarget;
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
- addExtensiblityElementChildren(list, bindingFault);
- return list;
- }
-
- protected String getLabel()
- {
- return bindingFault.getName();
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/fault_obj.gif");
- }
- }
-
-
- protected class BindingInputAdapter extends WSDLElementAdapter
- {
- protected BindingInput bindingInput;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.bindingInput = (BindingInput)newTarget;
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
- addExtensiblityElementChildren(list, bindingInput);
- return list;
- }
-
- protected String getLabel()
- {
- return "input";
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/input_obj.gif");
- }
- }
-
-
- protected class BindingOutputAdapter extends WSDLElementAdapter
- {
- protected BindingOutput bindingOutput;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.bindingOutput = (BindingOutput)newTarget;
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
- addExtensiblityElementChildren(list, bindingOutput);
- return list;
- }
-
- protected String getLabel()
- {
- return "output";
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/output_obj.gif");
- }
- }
-
-
- protected class BindingOperationAdapter extends WSDLElementAdapter
- {
- protected BindingOperation bindingOperation;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.bindingOperation = (BindingOperation)newTarget;
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
-
- addExtensiblityElementChildren(list, bindingOperation);
-
- if (bindingOperation.getBindingInput() != null)
- {
- list.add(bindingOperation.getBindingInput());
- }
- if (bindingOperation.getBindingOutput() != null)
- {
- list.add(bindingOperation.getBindingOutput());
- }
- list.addAll(bindingOperation.getEBindingFaults());
-
- return list;
- }
-
-
- protected String getLabel()
- {
- return bindingOperation.getName();
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/operationbinding_obj.gif");
- }
- }
-
- //
- //
- //
- protected class DefinitionAdapter extends WSDLElementAdapter implements ModelAdapterListener
- {
- protected List permanentWSDLGroupObjectList;
- protected Definition definition;
-
- protected WSDLGroupObject typesGroup;
- protected WSDLGroupObject extensibilityElementsGroup;
- protected Types types;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.definition = (Definition)newTarget;
-
- // this group is added and removed from the child list dynamically
- // dependant on the presence of an 'actual' types element
- //
- typesGroup = new WSDLGroupObject(definition, WSDLGroupObject.TYPES_GROUP, getModelAdapterFactory());
-
- // these groups always exist in the child list
- //
- permanentWSDLGroupObjectList = new ArrayList();
- permanentWSDLGroupObjectList.add(new WSDLGroupObject(definition, WSDLGroupObject.IMPORTS_GROUP));
- permanentWSDLGroupObjectList.add(typesGroup);
- permanentWSDLGroupObjectList.add(new WSDLGroupObject(definition, WSDLGroupObject.MESSAGES_GROUP));
- permanentWSDLGroupObjectList.add(new WSDLGroupObject(definition, WSDLGroupObject.PORT_TYPES_GROUP));
- permanentWSDLGroupObjectList.add(new WSDLGroupObject(definition, WSDLGroupObject.BINDINGS_GROUP));
- permanentWSDLGroupObjectList.add(new WSDLGroupObject(definition, WSDLGroupObject.SERVICES_GROUP));
- // we only add this group when it has content
- //
- extensibilityElementsGroup = new WSDLGroupObject(definition, WSDLGroupObject.EXTENSIBILITY_ELEMENTS_GROUP);
-
- updateTypes();
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
- list.addAll(permanentWSDLGroupObjectList);
- //if (extensibilityElementsGroup.getChildren().size() > 0)
- //{
- list.add(extensibilityElementsGroup);
- //}
- return list;
- }
-
- public void notifyChanged(Notification msg)
- {
- if (msg.getEventType() != Notification.RESOLVE)
- {
- updateTypes();
- firePropertyChangedHelper();
- }
- }
-
- protected void updateTypes()
- {
- if (types != definition.getETypes())
- {
- if (types != null)
- {
- removeModelAdapterListener(types, this);
- }
- types = definition.getETypes();
- if (types != null)
- {
- addModelAdapterListener(types, this);
- }
- }
- }
-
- protected void firePropertyChangedHelper()
- {
- firePropertyChanged(getTarget(), null);
-
- for (Iterator i = getChildren().iterator(); i.hasNext(); )
- {
- ModelAdapter adapter = getAdapter(i.next());
- adapter.firePropertyChanged(adapter, null);
- }
- }
-
- // propagate changes to 'types' object
- //
- public void propertyChanged(Object object, String property)
- {
- typesGroup.firePropertyChanged(typesGroup, property);
- }
-
- protected ModelAdapterFactory getModelAdapterFactory()
- {
- return getWSDLModelAdapterFactory();
- }
-
- protected String getLabel()
- {
- return definition.getQName().getLocalPart();
- }
-
- protected Image getImage()
- {
- return null;
- }
- }
-
-
-
- protected class FaultAdapter extends WSDLElementAdapter
- {
- protected Fault fault;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.fault = (Fault)newTarget;
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/fault_obj.gif");
- }
-
- protected String getLabel()
- {
- return fault.getName();
- }
- }
-
-
- //
- //
- //
- protected class ImportAdapter extends WSDLElementAdapter
- {
- protected Import theImport;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.theImport = (Import)newTarget;
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/import_obj.gif");
- }
-
- protected String getLabel()
- {
- String result = theImport.getLocationURI();
- if (result == null || result.length() == 0)
- {
- result = WSDLEditorPlugin.getWSDLString("_UI_NO_IMPORT_SPECIFIED");
- }
- return result;
- }
- }
-
-
- //
- //
- //
- protected class InputAdapter extends WSDLElementAdapter
- {
- protected Input input;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.input = (Input)newTarget;
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/input_obj.gif");
- }
-
- protected String getLabel()
- {
- return "input";
- }
- }
-
-
-
- //
- //
- //
- protected class MessageAdapter extends WSDLElementAdapter
- {
- protected Message message;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.message = (Message)newTarget;
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
- list.addAll(message.getEParts());
- return list;
- }
-
- protected String getLabel()
- {
- if (message.getQName() == null) return ""; // revisit...it shouldn't be null
- return message.getQName().getLocalPart();
-
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/message_obj.gif");
- }
- }
-
-
- //
- //
- //
- protected class OutputAdapter extends WSDLElementAdapter
- {
- protected Output output;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.output = (Output)newTarget;
- }
-
- protected String getLabel()
- {
- return "output";
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/output_obj.gif");
- }
- }
-
- //
- //
- //
- protected class OperationAdapter extends WSDLElementAdapter
- {
- protected Operation operation;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.operation = (Operation)newTarget;
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
- Input input = operation.getEInput();
- Output output = operation.getEOutput();
-
- OperationType operationType = ((OperationImpl) operation).getStyle();
- if (operationType != null) {
- if (operationType.equals(OperationType.REQUEST_RESPONSE) && input != null && output != null) {
- // Input, Output
- list.add(input);
- list.add(output);
- }
- else if (operationType.equals(OperationType.SOLICIT_RESPONSE) && input != null && output != null) {
- // Output, Input
- list.add(output);
- list.add(input);
- }
- else if (operationType.equals(OperationType.ONE_WAY) && input != null) {
- // Input
- list.add(input);
- }
- else if (operationType.equals(OperationType.NOTIFICATION) && output != null) {
- //Output
- list.add(output);
- }
- }
- list.addAll(operation.getFaults().values());
-
- return list;
- }
-
- private int getNodeIndex(NodeList nodeList, Node node) {
- int index = 0;
- while (index < nodeList.getLength() && !(nodeList.item(index).equals(node))) {
- index++;
- }
-
- if (index >= nodeList.getLength()) {
- index = -1;
- }
-
- return index;
- }
-
- protected String getLabel()
- {
- return operation.getName();
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/operation_obj.gif");
- }
- }
-
-
- //
- //
- //
- protected class PartAdapter extends WSDLElementAdapter
- {
- protected Part part;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.part = (Part)newTarget;
- }
-
- protected String getLabel()
- {
- return part.getName();
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/part_obj.gif");
- }
- }
-
- //
- //
- //
- protected class PortAdapter extends WSDLElementAdapter implements ModelAdapterListener
- {
- protected Port port;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.port = (Port)newTarget;
- }
-
- protected String getLabel()
- {
- return port.getName();
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/port_obj.gif");
- }
-
- protected List getChildren()
- {
- return WSDLEditorUtil.getInstance().getExtensibilityElementNodes(port);
- }
- // propagate changes to the binding object
- //
- public void propertyChanged(Object object, String property)
- {
- firePropertyChanged(port, property);
- }
- }
-
- protected class UnknownExtensibilityElementAdapter extends WSDLElementAdapter implements ModelAdapterListener
- {
- protected UnknownExtensibilityElement uee;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.uee = (UnknownExtensibilityElement)newTarget;
- }
-
- protected String getLabel()
- {
- String result = null;
- Node node = (Node) uee.getElement();
-
- ILabelProvider labelProvider = getExtensibilityLabelProvider(node);
- if (labelProvider != null)
- {
- result = labelProvider.getText(node);
- }
-
- if (result == null)
- {
- result = node.getNodeName();
- }
- return result;
- }
-
- protected Image getImage()
- {
- Image image = null;
- Node node = (Node) uee.getElement();
-
- ILabelProvider labelProvider = getExtensibilityLabelProvider(node);
- if (labelProvider != null)
- {
- image = labelProvider.getImage(node);
- }
-
- if (image == null)
- {
- image = WSDLEditorPlugin.getInstance().getImage("icons/element_obj.gif");
- }
- return image;
- }
-
- protected List getChildren()
- {
- List list = null;
- //Node node = (Node) uee.getElement();
- //ITreeChildProvider childProvider = getExtensibilityContentProvider(node);
- // TBD - Discuss with Craig why we would need childProvider
- //if (childProvider != null)
- //{
- // Object[] array = childProvider.getChildren(node);
- // list = Arrays.asList(array);
- //}
- //else
- {
- list = uee.getChildren();
- }
- return list;
- }
-
- public void propertyChanged(Object object, String property)
- {
- firePropertyChanged(uee, property);
- }
-
- protected ILabelProvider getExtensibilityLabelProvider(Node node)
- {
- ILabelProvider result = null;
- String namespaceURI = node.getNamespaceURI();
- if (namespaceURI != null)
- {
- result = WSDLEditorPlugin.getInstance().getExtensibilityItemTreeProviderRegistry().getLabelProvider(namespaceURI);
- }
- return result;
- }
-
- protected ITreeChildProvider getExtensibilityContentProvider(Node node)
- {
- ITreeChildProvider result = null;
- String namespaceURI = node.getNamespaceURI();
- if (namespaceURI != null)
- {
- result = WSDLEditorPlugin.getInstance().getExtensibilityItemTreeProviderRegistry().getContentProvider(namespaceURI);
- }
- return result;
- }
-
- boolean isReadOnly()
- {
- return true;
- }
- }
-
-
- //
- //
- //
- protected class PortTypeAdapter extends WSDLElementAdapter
- {
- protected PortType portType;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.portType = (PortType)newTarget;
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
- list.addAll(portType.getOperations());
-
- Collections.sort(list, new Comparator()
- {
- public int compare(Object o1, Object o2)
- {
- String o1Name = ((Operation) o1).getName();
- String o2Name = ((Operation) o2).getName();
- if (o1Name == null) o1Name = "";
- if (o2Name == null) o2Name = "";
- return (o1Name.compareToIgnoreCase(o2Name));
- }
- });
- return list;
- }
-
- protected String getLabel()
- {
- return portType.getQName().getLocalPart();
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/porttype_obj.gif");
- }
- }
-
-
- protected class ServiceAdapter extends WSDLElementAdapter
- {
- protected Service service;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.service = (Service)newTarget;
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
- list.addAll(service.getEPorts());
- return list;
- }
-
- protected String getLabel()
- {
- return service.getQName().getLocalPart();
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/service_obj.gif");
- }
- }
-
- //
- //
- //
- public class TypesAdapter extends WSDLElementAdapter
- {
- protected Types types;
-
- public void setTarget(Notifier newTarget)
- {
- super.setTarget(newTarget);
- this.types = (Types)newTarget;
- }
-
- protected List getChildren()
- {
- List list = new ArrayList();
- list.addAll(WSDLEditorUtil.getInstance().getExtensibilityElementNodes(types));
- return list;
- }
-
- protected String getLabel()
- {
- return "Types";
- }
-
- protected Image getImage()
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/types_obj.gif");
- }
- }
-
- public static void addModelAdapterListener(Object modelObject, ModelAdapterListener listener)
- {
-// TODO: port check
- ModelAdapter adapter = getWSDLModelAdapterFactory().getAdapter(modelObject);
-// ModelAdapter adapter = EcoreUtil.getAdapter(getWSDLModelAdapterFactory().eAdapters(),modelObject);
- if (adapter != null)
- {
- adapter.addListener(listener);
- }
- }
-
- public static void removeModelAdapterListener(Object modelObject, ModelAdapterListener listener)
- {
-// TODO: port check
- ModelAdapter adapter = getWSDLModelAdapterFactory().getAdapter(modelObject);
-// ModelAdapter adapter = EcoreUtil.getAdapter(getWSDLModelAdapterFactory().eAdapters(),modelObject);
- if (adapter != null)
- {
- adapter.removeListener(listener);
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/nsedit/EditNamespacesDialog.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/nsedit/EditNamespacesDialog.java
deleted file mode 100644
index 97cc505..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/nsedit/EditNamespacesDialog.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.nsedit;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.ui.nsedit.CommonEditNamespacesTargetFieldDialog;
-
-public class EditNamespacesDialog extends Dialog
-{
- protected Button okButton;
- protected String title;
- protected String targetNamespace;
- protected List namespaceInfoList;
- protected CommonEditNamespacesTargetFieldDialog editWSDLNamespacesControl;
- protected IPath resourceLocation;
- // protected Label errorMessageLabel;
- // protected String errorMessage;
-
- //protected Label errorMessageLabel;
-
- public EditNamespacesDialog(Shell parentShell, IPath resourceLocation, String title, String targetNamespace, List namespaceList)
- {
- super(parentShell);
- this.resourceLocation = resourceLocation;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.title = title;
- this.targetNamespace = targetNamespace;
- this.namespaceInfoList = namespaceList;
- }
-
- public int createAndOpen()
- {
- create();
- getShell().setText(title);
- setBlockOnOpen(true);
- return open();
- }
-
- protected Control createContents(Composite parent)
- {
- Control control = super.createContents(parent);
- updateErrorMessage();
- return control;
- }
-
- protected void createButtonsForButtonBar(Composite parent)
- {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected Control createDialogArea(Composite parent)
- {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
- editWSDLNamespacesControl = new CommonEditNamespacesTargetFieldDialog(dialogArea, resourceLocation);
- editWSDLNamespacesControl.setNamespaceInfoList(namespaceInfoList);
- editWSDLNamespacesControl.setTargetNamespace(targetNamespace);
-
- return dialogArea;
- }
-
- public void modifyText(ModifyEvent e)
- {
- updateErrorMessage();
- }
-
- protected String computeErrorMessage(String name)
- {
- return null;
- }
-
- protected void updateErrorMessage()
- {
- String errorMessage = null;
- /*
- String name = nameField.getText().trim();
- if (name.length() > 0)
- {
- errorMessage = computeErrorMessage(name);
- }
- else
- {
- errorMessage = "";
- }*/
-
- //errorMessageLabel.setText(errorMessage != null ? errorMessage : "");
- okButton.setEnabled(errorMessage == null);
- }
-
- protected void buttonPressed(int buttonId)
- {
- if (buttonId == IDialogConstants.OK_ID)
- {
- targetNamespace = editWSDLNamespacesControl.getTargetNamespace();
- }
- super.buttonPressed(buttonId);
- }
-
- public List getNamespaceInfoList()
- {
- return namespaceInfoList;
- }
-
- public String getTargetNamespace()
- {
- return targetNamespace;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/ExtensibleOutlineProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/ExtensibleOutlineProvider.java
deleted file mode 100644
index b1ca649..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/ExtensibleOutlineProvider.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.outline;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtensionRegistry;
-
-
-public class ExtensibleOutlineProvider implements ITreeContentProvider, ILabelProvider
-{
- protected WSDLEditorExtension[] treeContentProviderExtensions;
- protected ITreeContentProvider[] treeContentProviders;
-
- protected WSDLEditorExtension[] labelProviderExtensions;
- protected ILabelProvider[] labelProviders;
-
- protected final static Object[] EMPTY_ARRAY = {};
-
- public ExtensibleOutlineProvider(WSDLEditor wsdlEditor)
- {
- WSDLEditorExtensionRegistry registry = WSDLEditorPlugin.getInstance().getWSDLEditorExtensionRegistry();
-
- treeContentProviderExtensions = registry.getRegisteredExtensions(WSDLEditorExtension.OUTLINE_TREE_CONTENT_PROVIDER);
- treeContentProviders = new ITreeContentProvider[treeContentProviderExtensions.length];
- for (int i = 0; i < treeContentProviderExtensions.length; i++)
- {
- treeContentProviders[i] = (ITreeContentProvider)treeContentProviderExtensions[i].createExtensionObject(WSDLEditorExtension.OUTLINE_TREE_CONTENT_PROVIDER, wsdlEditor);
- }
-
- labelProviderExtensions = registry.getRegisteredExtensions(WSDLEditorExtension.OUTLINE_LABEL_PROVIDER);
- labelProviders = new ILabelProvider[labelProviderExtensions.length];
- for (int i = 0; i < labelProviderExtensions.length; i++)
- {
- labelProviders[i] = (ILabelProvider)labelProviderExtensions[i].createExtensionObject(WSDLEditorExtension.OUTLINE_LABEL_PROVIDER, wsdlEditor);
- }
- }
-
-
- protected ITreeContentProvider getApplicableTreeContentProvider(Object object)
- {
- ITreeContentProvider provider = null;
- for (int i = 0; i < treeContentProviderExtensions.length; i++)
- {
- if (treeContentProviderExtensions[i].isApplicable(object))
- {
- provider = treeContentProviders[i];
- if (provider != null)
- {
- break;
- }
- }
- }
- return provider;
- }
-
-
- protected ILabelProvider getApplicableLabelProvider(Object object)
- {
- ILabelProvider provider = null;
- for (int i = 0; i < labelProviderExtensions.length; i++)
- {
- if (labelProviderExtensions[i].isApplicable(object))
- {
- provider = labelProviders[i];
- if (provider != null)
- {
- break;
- }
- }
- }
- return provider;
- }
-
- // implements ITreeContentProvider
- //
- public Object[] getChildren(Object parentElement)
- {
- ITreeContentProvider provider = getApplicableTreeContentProvider(parentElement);
- //System.out.println("getElements " + provider);
- return provider != null ? provider.getChildren(parentElement) : EMPTY_ARRAY;
- }
-
- public Object getParent(Object element)
- {
- ITreeContentProvider provider = getApplicableTreeContentProvider(element);
- return provider != null ? provider.getParent(element) : null;
- }
-
- public boolean hasChildren(Object element)
- {
- ITreeContentProvider provider = getApplicableTreeContentProvider(element);
- return provider != null ? provider.hasChildren(element) : false;
- }
-
- public Object[] getElements(Object inputElement)
- {
- ITreeContentProvider provider = getApplicableTreeContentProvider(inputElement);
- //System.out.println("getElements " + provider);
- return provider != null ? provider.getElements(inputElement) : EMPTY_ARRAY;
- }
-
- public void dispose()
- {
- // TODO... call dispose dispose the created label and content providers
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- for (int i = 0; i < treeContentProviders.length; i++)
- {
- treeContentProviders[i].inputChanged(viewer, oldInput, newInput);
- }
- }
-
- // implements ILabelProvider
- //
- public Image getImage(Object element)
- {
- ILabelProvider provider = getApplicableLabelProvider(element);
- return provider != null ? provider.getImage(element) : null;
- }
-
- public String getText(Object element)
- {
- String result = null;
- if (element != null)
- {
- ILabelProvider provider = getApplicableLabelProvider(element);
- result = provider != null ? provider.getText(element) : (element.toString() + "noProviderForClass=" + element.getClass().getName());
- }
- return result != null ? result : "";
- }
-
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return false;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/HTTPLabelProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/HTTPLabelProvider.java
deleted file mode 100644
index 7de18a1..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/HTTPLabelProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.outline;
-
-import java.util.HashMap;
-
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.w3c.dom.Node;
-
-
-public class HTTPLabelProvider extends LabelProvider
-{
- protected final static String ADDRESS = "address";
- protected final static String BINDING = "binding";
- protected final static String OPERATION = "operation";
- protected final static String URL_ENCODED = "urlEncoded";
- protected final static String URL_REPLACEMENT = "urlReplacement";
-
- protected HashMap map = new HashMap();
-
- public HTTPLabelProvider()
- {
- map.put(ADDRESS, "icons/httpaddress_obj.gif");
- map.put(BINDING, "icons/httpbinding_obj.gif");
- map.put(OPERATION, "icons/httpoperation_obj.gif");
- map.put(URL_ENCODED, "icons/httpurlencoded_obj.gif");
- map.put(URL_REPLACEMENT, "icons/httpurlreplacement_obj.gif");
- }
-
- public Image getImage(Object object)
- {
- Node node = (Node)object;
- String imageName = (String)map.get(node.getLocalName());
- return imageName != null ? WSDLEditorPlugin.getInstance().getImage(imageName) : null;
- }
-
- public String getText(Object object)
- {
- Node node = (Node)object;
- return node.getNodeName();
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/ModelAdapterContentProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/ModelAdapterContentProvider.java
deleted file mode 100644
index 7068aad..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/ModelAdapterContentProvider.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.outline;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
-
-
-
-public class ModelAdapterContentProvider implements ITreeContentProvider, ModelAdapterListener
-{
- protected Viewer viewer;
- protected ModelAdapterFactory adapterFactory;
-
- public ModelAdapterContentProvider(ModelAdapterFactory adapterFactory)
- {
- this.adapterFactory = adapterFactory;
- }
-
- protected void attachListener(Object object)
- {
- ModelAdapter adapter = adapterFactory.getAdapter(object);
-// TODO: port check
-// ModelAdapter adapter = EcoreUtil.getAdapter(adapterFactory.eAdapters(),object);
- if (adapter != null)
- {
- adapter.addListener(this);
- }
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (viewer != null)
- {
- if (viewer instanceof StructuredViewer)
- {
- ((StructuredViewer)viewer).refresh(object);
- }
- else
- {
- viewer.refresh();
- }
- }
- }
-
- /*
- * @see ITreeContentProvider#getChildren(Object)
- */
- public Object[] getChildren(Object parentObject)
- {
- attachListener(parentObject);
-
- List list = null;
-// TODO: port check
- ModelAdapter modelAdapter = adapterFactory.getAdapter(parentObject);
-// ModelAdapter modelAdapter = EcoreUtil.getAdapter(adapterFactory.eAdapters(),parentObject);
- if (modelAdapter != null)
- {
- list = (List)modelAdapter.getProperty(parentObject, ModelAdapter.CHILDREN_PROPERTY);
- }
- list = list != null ? list : Collections.EMPTY_LIST;
- return list.toArray();
- }
-
- /*
- * @see ITreeContentProvider#getParent(Object)
- */
- public Object getParent(Object element)
- {
- return null;
- }
-
- /*
- * @see ITreeContentProvider#hasChildren(Object)
- */
- public boolean hasChildren(Object element)
- {
- Object[] children = getChildren(element);
- return children != null && children.length > 0;
- }
-
- /*
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement)
- {
- return getChildren(inputElement);
- }
-
- /*
- * @see IContentProvider#dispose()
- */
- public void dispose()
- {
- viewer = null;
- }
-
- /*
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- this.viewer = viewer;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/ModelAdapterLabelProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/ModelAdapterLabelProvider.java
deleted file mode 100644
index 720c74c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/ModelAdapterLabelProvider.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.outline;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterFactory;
-
-
-
-public class ModelAdapterLabelProvider extends LabelProvider
-{
- protected ModelAdapterFactory adapterFactory;
-
- public ModelAdapterLabelProvider(ModelAdapterFactory adapterFactory)
- {
- this.adapterFactory = adapterFactory;
- }
-
-
- public Image getImage(Object object)
- {
- Image result = null;
-// TODO: port check
- ModelAdapter modelAdapter = adapterFactory.getAdapter(object);
-// ModelAdapter modelAdapter = EcoreUtil.getAdapter(adapterFactory.eAdapters(),object);
- if (modelAdapter != null)
- {
- result = (Image)modelAdapter.getProperty(object, ModelAdapter.IMAGE_PROPERTY);
- }
- return result;
- }
-
-
- public String getText(Object object)
- {
- String result = null;
-// TODO: port check
- ModelAdapter modelAdapter = adapterFactory.getAdapter(object);
-// ModelAdapter modelAdapter = EcoreUtil.getAdapter(adapterFactory.eAdapters(),object);
- if (modelAdapter != null)
- {
- result = (String)modelAdapter.getProperty(object, ModelAdapter.LABEL_PROPERTY);
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/SOAPLabelProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/SOAPLabelProvider.java
deleted file mode 100644
index 2c2a07c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/SOAPLabelProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.outline;
-
-import java.util.HashMap;
-
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.w3c.dom.Node;
-
-
-public class SOAPLabelProvider extends LabelProvider
-{
- protected final static String ADDRESS = "address";
- protected final static String BODY = "body";
- protected final static String BINDING = "binding";
- protected final static String FAULT = "fault";
- protected final static String HEADER = "header";
- protected final static String HEADER_FAULT = "headerfault";
- protected final static String OPERATION = "operation";
-
- protected HashMap map = new HashMap();
-
- public SOAPLabelProvider()
- {
- map.put(ADDRESS, "icons/soapaddress_obj.gif");
- map.put(BINDING, "icons/soapbinding_obj.gif");
- map.put(BODY, "icons/soapbody_obj.gif");
- map.put(FAULT, "icons/soapfault_obj.gif");
- map.put(HEADER, "icons/soapheader_obj.gif");
- map.put(HEADER_FAULT, "icons/soapheaderfault_obj.gif");
- map.put(OPERATION, "icons/soapoperation_obj.gif");
- }
-
- public Image getImage(Object object)
- {
- Node node = (Node)object;
- String imageName = (String)map.get(node.getLocalName());
- boolean isReadOnly = !(node instanceof XMLNode);
- return imageName != null ? WSDLEditorPlugin.getInstance().getImage(imageName) : null;
- }
-
- public String getText(Object object)
- {
- Node node = (Node)object;
- return node.getNodeName();
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/WSDLContentOutlinePage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/WSDLContentOutlinePage.java
deleted file mode 100644
index 07d2fb6..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/outline/WSDLContentOutlinePage.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.outline;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLSelectionManager;
-import org.eclipse.wst.wsdl.ui.internal.actions.WSDLMenuListener;
-import org.eclipse.wst.wsdl.ui.internal.util.OpenOnSelectionHelper;
-
-
-public class WSDLContentOutlinePage extends ContentOutlinePage
-{
- protected WSDLEditor wsdlEditor;
- protected int level = 0;
- protected Object model;
- protected ITreeContentProvider contentProvider;
- protected ILabelProvider labelProvider;
- protected WSDLSelectionManager selectionManager;
- protected SelectionManagerSelectionChangeListener selectionManagerSelectionChangeListener = new SelectionManagerSelectionChangeListener();
- protected TreeSelectionChangeListener treeSelectionChangeListener = new TreeSelectionChangeListener();
-
- public WSDLContentOutlinePage(WSDLEditor wsdlEditor)
- {
- this.wsdlEditor = wsdlEditor;
- }
-
-
- public void setContentProvider(ITreeContentProvider contentProvider)
- {
- this.contentProvider = contentProvider;
- }
-
-
- public void setLabelProvider(ILabelProvider labelProvider)
- {
- this.labelProvider = labelProvider;
- }
-
-
- // expose
- public TreeViewer getTreeViewer()
- {
- return super.getTreeViewer();
- }
-
- public void createControl(Composite parent)
- {
- super.createControl(parent);
-
- getTreeViewer().setContentProvider(contentProvider);
- getTreeViewer().setLabelProvider(labelProvider);
- getTreeViewer().setInput(model);
- getTreeViewer().addSelectionChangedListener(this);
-
- KeyAdapter keyListener = new KeyAdapter()
- {
- public void keyReleased(KeyEvent e)
- {
- if (e.keyCode == SWT.F3)
- {
- ISelection selection = selectionManager.getSelection();
- if (selection instanceof IStructuredSelection)
- {
- Object object = ((IStructuredSelection)selection).getFirstElement();
- if (object instanceof EObject)
- {
- OpenOnSelectionHelper helper = new OpenOnSelectionHelper(wsdlEditor.getDefinition());
- helper.openEditor((EObject)object);
- }
- }
- }
- }
- };
- getTreeViewer().getTree().addKeyListener(keyListener);
-
- MenuManager menuManager = new MenuManager("#popup");//$NON-NLS-1$
- menuManager.setRemoveAllWhenShown(true);
- Menu menu = menuManager.createContextMenu(getTreeViewer().getControl());
- getTreeViewer().getControl().setMenu(menu);
-
- WSDLMenuListener menuListener = new WSDLMenuListener(wsdlEditor, wsdlEditor.getSelectionManager());//, (XSDTextEditor)fTextEditor);
- menuManager.addMenuListener(menuListener);
-
- setSelectionManager(wsdlEditor.getSelectionManager());
- }
-
-
- public void setModel(Object object)
- {
- model = object;
- }
-
-
- public void setExpandToLevel(int i)
- {
- level = i;
- }
-
-
- public void setInput(Object value)
- {
- getTreeViewer().setInput(value);
- getTreeViewer().expandToLevel(level);
- }
-
-
- public void setSelectionManager(WSDLSelectionManager newSelectionManager)
- {
- TreeViewer treeViewer = getTreeViewer();
-
- // disconnect from old one
- if (selectionManager != null)
- {
- selectionManager.removeSelectionChangedListener(selectionManagerSelectionChangeListener);
- treeViewer.removeSelectionChangedListener(treeSelectionChangeListener);
- }
-
- selectionManager = newSelectionManager;
-
- // connect to new one
- if (selectionManager != null)
- {
- selectionManager.addSelectionChangedListener(selectionManagerSelectionChangeListener);
- treeViewer.addSelectionChangedListener(treeSelectionChangeListener);
- }
- }
-
- class SelectionManagerSelectionChangeListener implements ISelectionChangedListener
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (event.getSelectionProvider() != getTreeViewer())
- {
- getTreeViewer().setSelection(event.getSelection(), true);
- }
- }
- }
-
- class TreeSelectionChangeListener implements ISelectionChangedListener
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (selectionManager != null)
- {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- Object o = structuredSelection.getFirstElement();
-
- // TODO ...
- // we need to implement a selectionManagerMapping extension point
- // so that extensions can specify how they'd like to map view objects
- // to selection objects
- //
-// if (o instanceof Element)
-// {
-// try
-// {
-// Object modelObject = WSDLEditorUtil.getInstance().findModelObjectForElement(wsdlEditor.getDefinition(), (Element)o);
-// if (modelObject != null && !(modelObject instanceof UnknownExtensibilityElement))
-// {
-// o = modelObject;
-// }
-// }
-// catch (Exception e)
-// {
-// }
-// }
-
- if (o != null)
- {
- selectionManager.setSelection(new StructuredSelection(o), getTreeViewer());
- }
- else
- {
- selectionManager.setSelection(new StructuredSelection(), getTreeViewer());
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/AbstractSection.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/AbstractSection.java
deleted file mode 100644
index a8289f0..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/AbstractSection.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.wst.common.ui.properties.ISection;
-import org.eclipse.wst.common.ui.properties.TabbedPropertySheetPage;
-import org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.graph.model.WSDLGraphModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.w3c.dom.Element;
-
-public class AbstractSection implements ISection, IPropertyChangeListener, Listener, SelectionListener
-{
- private TabbedPropertySheetWidgetFactory factory;
- private WSDLElement element;
- protected boolean isReadOnly = false;
- protected Composite composite;
- protected int rightMarginSpace;
- protected int tableMinimumWidth = 50;
-
- public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage)
- {
- createControls(parent, tabbedPropertySheetPage.getWidgetFactory());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory aFactory)
- {
- this.factory = aFactory;
- GC gc = new GC(parent);
- Point extent = gc.textExtent(" ... "); //$NON-NLS-1$
- rightMarginSpace = extent.x;
- gc.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISection#setInput(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void setInput(IWorkbenchPart part, ISelection selection)
- {
- Assert.isTrue(selection instanceof IStructuredSelection);
- Object input = ((IStructuredSelection)selection).getFirstElement();
-
- if (input instanceof WSDLElement)
- {
- this.element = (WSDLElement)input;
- ModelAdapter adapter = WSDLGraphModelAdapterFactory.getWSDLGraphModelAdapterFactory().getAdapter(input);
- if (adapter != null)
- {
- isReadOnly = Boolean.TRUE.equals(adapter.getProperty(input, "isReadOnly")); //$NON-NLS-1$
- }
- }
- else if (input instanceof WSDLGroupObject)
- {
- this.element = ((WSDLGroupObject)input).getDefinition();
- }
- refresh();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISection#aboutToBeShown()
- */
- public void aboutToBeShown()
- {
- refresh();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISection#aboutToBeHidden()
- */
- public void aboutToBeHidden()
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISection#dispose()
- */
- public void dispose()
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISection#getMinimumHeight()
- */
- public int getMinimumHeight()
- {
- return SWT.DEFAULT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISection#refresh()
- */
- public void refresh()
- {
- if (isReadOnly)
- {
- composite.setEnabled(false);
- }
- else
- {
- composite.setEnabled(true);
- }
- }
-
- public WSDLElement getElement()
- {
- return element;
- }
-
- /**
- * Get the widget factory.
- * @return the widget factory.
- */
- public TabbedPropertySheetWidgetFactory getWidgetFactory() {
- return factory;
- }
-
- public void propertyChange(PropertyChangeEvent event)
- {
- refresh();
- }
-
-
- public void doWidgetDefaultSelected(SelectionEvent e)
- {}
-
- public void doWidgetSelected(SelectionEvent e)
- {}
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e)
- {
- if (isListenerEnabled() &&
- getElement() != null &&
- !isInDoHandle)
- {
- isInDoHandle = true;
- doWidgetDefaultSelected(e);
- isInDoHandle = false;
- }
-
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e)
- {
- if (isListenerEnabled() &&
- getElement() != null &&
- !isInDoHandle)
- {
- isInDoHandle = true;
- doWidgetSelected(e);
- isInDoHandle = false;
- }
-
- }
-
- boolean listenerEnabled = true;
- /**
- * Get the value of listenerEnabled.
- * @return value of listenerEnabled.
- */
- public boolean isListenerEnabled()
- {
- return listenerEnabled;
- }
-
- /**
- * Set the value of listenerEnabled.
- * @param v Value to assign to listenerEnabled.
- */
- public void setListenerEnabled(boolean v)
- {
- this.listenerEnabled = v;
- }
-
- public void handleEvent(Event event)
- {
- if (isListenerEnabled() && !isInDoHandle)
- {
- isInDoHandle = true;
- startDelayedEvent(event);
- isInDoHandle = false;
- } // end of if ()
- }
-
- public void doHandleEvent(Event event)
- {
-
- }
-
- protected DelayedEvent delayedTask;
-
- protected void startDelayedEvent(Event e)
- {
- if (delayedTask == null ||
- delayedTask.getEvent() == null)
- {
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500,delayedTask);
- }
- else
- {
- Event delayedEvent = delayedTask.getEvent();
-
- if (e.widget == delayedEvent.widget &&
- e.type == delayedEvent.type)
- {
- // same event, just different data, delay new event
- delayedTask.setEvent(null);
- }
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500,delayedTask);
- }
- }
-
- class DelayedEvent implements Runnable
- {
- protected Event event;
-
- /*
- * @see Runnable#run()
- */
- public void run()
- {
- if (event != null)
- {
- isInDoHandle = true;
- doHandleEvent(event);
- isInDoHandle = false;
- event = null;
- }
- }
-
- /**
- * Gets the event.
- * @return Returns a Event
- */
- public Event getEvent()
- {
- return event;
- }
-
- /**
- * Sets the event.
- * @param event The event to set
- */
- public void setEvent(Event event)
- {
- this.event = event;
- }
-
- }
-
- boolean isInDoHandle;
- /**
- * Get the value of isInDoHandle.
- * @return value of isInDoHandle.
- */
- public boolean isInDoHandle()
- {
- return isInDoHandle;
- }
-
-
- static protected IEditorPart getActiveEditor()
- {
- IWorkbench workbench = WSDLEditorPlugin.getInstance().getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-
- return editorPart;
- }
-
- static protected IStatusLineManager getStatusLineManager(IEditorPart editorPart)
- {
- IStatusLineManager result = null;
- try
- {
- EditorActionBarContributor contributor = (EditorActionBarContributor)editorPart.getEditorSite().getActionBarContributor();
- result = contributor.getActionBars().getStatusLineManager();
- }
- catch (Exception e)
- {
- }
- return result;
- }
-
- public DocumentImpl getDocument(Element element)
- {
- return (DocumentImpl) element.getOwnerDocument();
- }
-
- public void beginRecording(String description, Element element)
- {
- getDocument(element).getModel().beginRecording(this, description);
- }
-
- public void endRecording(Element element)
- {
- DocumentImpl doc = (DocumentImpl) getDocument(element);
-
- doc.getModel().endRecording(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/AbstractSectionDescriptor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/AbstractSectionDescriptor.java
deleted file mode 100644
index 0e295dd..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/AbstractSectionDescriptor.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.ISection;
-import org.eclipse.wst.common.ui.properties.ISectionDescriptor;
-import org.eclipse.wst.common.ui.properties.ITypeMapper;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-
-public class AbstractSectionDescriptor implements ISectionDescriptor
-{
- /**
- *
- */
- public AbstractSectionDescriptor()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getId()
- */
- public String getId()
- {
- return "";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getFilter()
- */
- public ITypeMapper getFilter()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes()
- {
- List list = new ArrayList();
- list.add(WSDLElement.class);
- return list;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection)
- {
- Object object = null;
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof WSDLElement || object instanceof WSDLGroupObject)
- {
- return true;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getAfterSection()
- */
- public String getAfterSection()
- {
- return "";
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/DocumentationSection.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/DocumentationSection.java
deleted file mode 100644
index 9993a13..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/DocumentationSection.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddElementAction;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class DocumentationSection extends AbstractSection {
-
- Text docText;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- docText = getWidgetFactory().createText(composite, "", SWT.MULTI | SWT.NONE | SWT.H_SCROLL | SWT.V_SCROLL); //$NON-NLS-1$
- docText.addListener(SWT.Modify, this);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(0, 0);
- data.bottom = new FormAttachment(100, 0);
- docText.setLayoutData(data);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
- if (docText.isFocusControl())
- {
- return;
- }
- setListenerEnabled(false);
- docText.setText("");
- if (getElement() != null)
- {
- Element docNode = getElement().getDocumentationElement();
- if (docNode != null)
- {
- Node textNode = docNode.getFirstChild();
- if (textNode != null)
- {
- String docValue = textNode.getNodeValue();
- if (docValue != null)
- {
- docText.setText(docValue);
- }
- }
- }
- }
- setListenerEnabled(true);
- }
-
- public void doHandleEvent(Event event)
- {
- if (event.widget == docText)
- {
- String value = docText.getText();
- if (getElement() != null)
- {
- Element docNode = getElement().getDocumentationElement();
- if (docNode != null)
- {
- Node textNode = docNode.getFirstChild();
- if (textNode != null)
- {
- textNode.setNodeValue(value);
- }
- else
- {
- if (value.length() > 0)
- {
- Document document = docNode.getOwnerDocument();
- org.w3c.dom.Text newTextNode = document.createTextNode(value);
- docNode.appendChild(newTextNode);
- }
- }
- }
- else
- {
- Element element = getElement().getElement();
- AddElementAction action = new AddElementAction(element, element.getPrefix(), "documentation", element.getFirstChild()); //$NON-NLS-1$
- action.run();
- Element newDocumentation = action.getNewElement();
-
- Document document = newDocumentation.getOwnerDocument();
- org.w3c.dom.Text newTextNode = document.createTextNode(value);
- newDocumentation.appendChild(newTextNode);
- getElement().setDocumentationElement(newDocumentation);
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/DocumentationSectionDescriptor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/DocumentationSectionDescriptor.java
deleted file mode 100644
index 95c0286..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/DocumentationSectionDescriptor.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.ISection;
-import org.eclipse.wst.common.ui.properties.ISectionDescriptor;
-import org.eclipse.wst.wsdl.WSDLElement;
-
-
-public class DocumentationSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor
-{
- /**
- *
- */
- public DocumentationSectionDescriptor()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getId()
- */
- public String getId()
- {
- return "org.eclipse.wst.wsdl.ui.internal.section.documentation";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass()
- {
- // TODO Auto-generated method stub
- return new DocumentationSection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab()
- {
- // TODO Auto-generated method stub
- return "com.ibm.xmlwebservices.documentation";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection)
- {
- Object object = null;
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof WSDLElement)
- {
- return true;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getAfterSection()
- */
- public String getAfterSection()
- {
- return "com.ibm.xmlwebservices.general";
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ExtensibilityElementSectionDescriptor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ExtensibilityElementSectionDescriptor.java
deleted file mode 100644
index e94c9e6..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ExtensibilityElementSectionDescriptor.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.ISection;
-import org.eclipse.wst.common.ui.properties.ISectionDescriptor;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-
-public class ExtensibilityElementSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor
-{
- /**
- *
- */
- public ExtensibilityElementSectionDescriptor()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getId()
- */
- public String getId()
- {
- return "org.eclipse.wst.wsdl.ui.internal.section.extensibilityelement";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass()
- {
- // TODO Auto-generated method stub
- return new ExtensiblityElementSection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab()
- {
- // TODO Auto-generated method stub
- return "com.ibm.xmlwebservices.general";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection)
- {
- Object object = null;
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof ExtensibilityElement)
- {
- return true;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getAfterSection()
- */
- public String getAfterSection()
- {
- return "";
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ExtensiblityElementSection.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ExtensiblityElementSection.java
deleted file mode 100644
index dc9d2c7..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ExtensiblityElementSection.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
-import org.eclipse.wst.wsdl.ui.internal.viewers.ExtensibilityElementViewer;
-import org.eclipse.wst.wsdl.ui.internal.viewers.widgets.AttributesTable;
-
-public class ExtensiblityElementSection extends AbstractSection implements ModelAdapterListener
-{
- ExtensibilityElementViewer viewer;
- protected AttributesTable attributesTable;
- /**
- * @see org.eclipse.wst.common.ui.properties.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
-
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
-// viewer = new ExtensibilityElementViewer(composite, getActiveEditor(), true);
- attributesTable = new AttributesTable(getActiveEditor(), composite);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(0, 0);
- data.bottom = new FormAttachment(100, 0);
- attributesTable.getControl().setLayoutData(data);
-// viewer.getControl().setLayoutData(data);
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (isListenerEnabled())
- {
- setListenerEnabled(false);
- refresh();
- setListenerEnabled(true);
- }
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
- attributesTable.setInput(getElement().getElement());
-
- Runnable runnable = new Runnable()
- {
- public void run()
- {
- if (!attributesTable.getControl().isDisposed())
- {
- attributesTable.refresh();
- }
- }
- };
- Display.getCurrent().asyncExec(runnable);
-
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/IPropertyDescriptorProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/IPropertyDescriptorProvider.java
deleted file mode 100644
index c5f1e93..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/IPropertyDescriptorProvider.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.w3c.dom.Element;
-
-public interface IPropertyDescriptorProvider
-{
- //public void init(IEditorPart editor);
- public IPropertyDescriptor getPropertyDescriptor(IEditorPart editor, Element ownerElement, String attributeNamespace, String attributeName);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ImportSection.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ImportSection.java
deleted file mode 100644
index a94bdf8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ImportSection.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.ui.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.common.ui.properties.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.XMLQuickScan;
-import org.w3c.dom.Element;
-
-public class ImportSection extends AbstractSection
-{
- protected Text namespaceText, prefixText, locationText;
- private String oldPrefixValue;
- Button button;
- IEditorPart editorPart;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
- FormData data;
-
- namespaceText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- namespaceText.setEditable(false);
-// namespaceText.addListener(SWT.Modify, this);
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(0, 0);
- namespaceText.setLayoutData(data);
-
- CLabel namespaceLabel = getWidgetFactory().createCLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_NAMESPACE")); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(namespaceText, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(namespaceText, 0, SWT.CENTER);
- namespaceLabel.setLayoutData(data);
-
- prefixText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-// prefixText.setEditable(false);
- prefixText.addListener(SWT.Modify, this);
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(namespaceText, +ITabbedPropertyConstants.VSPACE);
- prefixText.setLayoutData(data);
-
- CLabel prefixLabel = getWidgetFactory().createCLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_PREFIX")); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(prefixText, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(prefixText, 0, SWT.CENTER);
- prefixLabel.setLayoutData(data);
-
- locationText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- locationText.setEditable(false);
-// locationText.addListener(SWT.Modify, this);
-
- CLabel locationLabel = getWidgetFactory().createCLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_LOCATION")); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(locationText, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(locationText, 0, SWT.CENTER);
- locationLabel.setLayoutData(data);
-
- button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
- button.setImage(WSDLEditorPlugin.getInstance().getImage("icons/browsebutton.gif")); //$NON-NLS-1$
-
- button.addSelectionListener(this);
- data = new FormData();
- data.left = new FormAttachment(100, -rightMarginSpace + 2);
- data.right = new FormAttachment(100,0);
- data.top = new FormAttachment(locationText, 0, SWT.CENTER);
- button.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(button, 0);
- data.top = new FormAttachment(prefixText, +ITabbedPropertyConstants.VSPACE);
- locationText.setLayoutData(data);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- setListenerEnabled(false);
- Object obj = getElement();
- boolean refreshPrefixText = true;
- boolean refreshLocationText = true;
- boolean refreshNamespaceText = true;
- if (prefixText.isFocusControl())
- {
- refreshPrefixText = false;
- }
- if (locationText.isFocusControl())
- {
- refreshLocationText = false;
- }
- if (namespaceText.isFocusControl())
- {
- refreshNamespaceText = false;
- }
-
- if (refreshPrefixText)
- {
- prefixText.setText(""); //$NON-NLS-1$
- }
- if (refreshLocationText)
- {
- locationText.setText(""); //$NON-NLS-1$
- }
- if (refreshNamespaceText)
- {
- namespaceText.setText(""); //$NON-NLS-1$
- }
- if (obj instanceof Import)
- {
- Element element = ((Import)obj).getElement();
- if (refreshLocationText)
- {
- String locationValue = element.getAttribute("location"); //$NON-NLS-1$
- locationText.setText(locationValue != null ? locationValue : ""); //$NON-NLS-1$
- }
-
- String namespaceValue = element.getAttribute("namespace"); //$NON-NLS-1$
- if (refreshNamespaceText)
- {
- namespaceText.setText(namespaceValue != null ? namespaceValue : ""); //$NON-NLS-1$
- }
-
- if (refreshPrefixText)
- {
- String prefix = ((Import)obj).getEnclosingDefinition().getPrefix(namespaceValue);
- prefixText.setText(prefix != null ? prefix : ""); //$NON-NLS-1$
- }
- }
- oldPrefixValue = prefixText.getText();
- setListenerEnabled(true);
- }
-
- public void doHandleEvent(Event event) {
- if (event.widget == prefixText && locationText.getText().length() > 0 && namespaceText.getText().length() > 0) {
- Object input = getElement();
- Import importObj = (Import)input;
- org.w3c.dom.Element importElement = WSDLEditorUtil.getInstance().getElementForObject(importObj);
- Map namespacesMap = importObj.getEnclosingDefinition().getNamespaces();
-
- if (namespacesMap.containsKey(prefixText.getText())) {
- // We should add error messages.........
- // setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_LABEL_PREFIX_EXISTS"));
- }
- else {
- Element definitionElement = importObj.getEnclosingDefinition().getElement();
- definitionElement.removeAttribute("xmlns:"+oldPrefixValue);
- definitionElement.setAttribute("xmlns:" + prefixText.getText(), namespaceText.getText());
-
-// clearErrorMessage();
- oldPrefixValue = prefixText.getText();
- }
- }
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == button)
- {
- ResourceSet resourceSet = null;
-
- Object input = getElement();
-
- resourceSet = ((org.eclipse.emf.ecore.EObject)input).eResource().getResourceSet();
-
- WSDLEditor editor = (WSDLEditor)editorPart;
- IFile currentWSDLFile = ((IFileEditorInput)editor.getEditorInput()).getFile();
-
- SelectSingleFileDialog dialog = new SelectSingleFileDialog(WSDLEditorPlugin.getShell(), null, true);
- String [] filters = { "xsd", "wsdl" }; //$NON-NLS-1$
- IFile [] excludedFiles = { currentWSDLFile };
-
- dialog.addFilterExtensions(filters, excludedFiles);
- dialog.create();
- dialog.getShell().setText(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT")); //$NON-NLS-1$
- dialog.setTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT_FILE")); //$NON-NLS-1$
- dialog.setMessage(WSDLEditorPlugin.getWSDLString("_UI_DESCRIPTION_SELECT_WSDL_OR_XSD")); //$NON-NLS-1$
- int rc = dialog.open();
- if (rc == IDialogConstants.OK_ID)
- {
- IFile selectedFile = dialog.getFile();
-
- //if (selectedFile.getLocation().toOSString().equals(currentWSDLFile.getLocation().toOSString()))
- //{
- // System.out.println("SAME FILE:" + currentWSDLFile.getLocation());
- //}
-
- String location = ComponentReferenceUtil.computeRelativeURI(selectedFile, currentWSDLFile, true);
-
- Import importObj = (Import)input;
- org.w3c.dom.Element importElement = WSDLEditorUtil.getInstance().getElementForObject(importObj);
- Definition definition = importObj.getEnclosingDefinition();
- org.w3c.dom.Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
-
- String importTargetNamespace = ""; //$NON-NLS-1$
- String prefix = prefixText.getText();
- String uniquePrefix = ""; //$NON-NLS-1$
-
- URI uri = URI.createPlatformResourceURI(selectedFile.getFullPath().toString());
-
- // note that the getTargetNamespaceURIForSchema works for both schema and wsdl files
- // I should change the name of this convenience method
- importTargetNamespace = XMLQuickScan.getTargetNamespaceURIForSchema(uri.toString());
-
- if (prefix.trim().equals("")) //$NON-NLS-1$
- {
- uniquePrefix = getUniquePrefix(definition, uri.fileExtension());
- }
- else
- {
- uniquePrefix = prefix;
- }
-
-
- if (importTargetNamespace == null ||
- (importTargetNamespace != null && importTargetNamespace.trim().length() == 0))
- {
- return; // what to do with no namespace docs?
- }
-
- importElement.setAttribute("location", location); //$NON-NLS-1$
- importElement.setAttribute("namespace", importTargetNamespace); //$NON-NLS-1$
-
- definitionElement.setAttribute("xmlns:" + uniquePrefix, importTargetNamespace); //$NON-NLS-1$
-
- namespaceText.setText(importTargetNamespace);
- locationText.setText(location);
- prefixText.setText(uniquePrefix);
- }
-
- refresh();
- }
- }
-
-
- private String getUniquePrefix(Definition definition, String initPrefix)
- {
- String uniquePrefix;
- Map map = definition.getNamespaces();
-
- if (definition.getNamespace(initPrefix) == null)
- {
- uniquePrefix = initPrefix;
- }
- else // if used, then try to create a unique one
- {
- String tempPrefix = initPrefix;
- int i = 1;
- while(map.containsKey(tempPrefix + i))
- {
- i++;
- }
- uniquePrefix = tempPrefix + i;
- }
- return uniquePrefix;
- }
-
- public void setEditorPart(IEditorPart editorPart)
- {
- this.editorPart = editorPart;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ImportSectionDescriptor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ImportSectionDescriptor.java
deleted file mode 100644
index 022cabf..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ImportSectionDescriptor.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.ISection;
-import org.eclipse.wst.common.ui.properties.ISectionDescriptor;
-import org.eclipse.wst.wsdl.Import;
-
-public class ImportSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor
-{
- ImportSection importSection;
- /**
- *
- */
- public ImportSectionDescriptor()
- {
- super();
- importSection = new ImportSection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getId()
- */
- public String getId()
- {
- return "org.eclipse.wst.wsdl.ui.internal.section.import";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes()
- {
- List list = new ArrayList();
- list.add(Import.class);
- return list;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass()
- {
- return importSection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab()
- {
- return "com.ibm.xmlwebservices.general";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection)
- {
- importSection.setEditorPart(part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor());
- Object object = null;
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof Import)
- {
- return true;
- }
- }
- return false;
- }
-
- public String getAfterSection()
- {
- return "org.eclipse.wst.wsdl.ui.internal.section.name";
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NameSection.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NameSection.java
deleted file mode 100644
index 3b37396..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NameSection.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.SmartRenameAction;
-
-
-public class NameSection extends AbstractSection
-{
-
- Text nameText;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent,TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- composite = getWidgetFactory().createFlatFormComposite(parent);
- FormData data;
-
-
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(0, 0);
- nameText.setLayoutData(data);
-
- CLabel nameLabel = getWidgetFactory().createCLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_NAME") + ":"); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(nameText, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(nameText, 0, SWT.CENTER);
- nameLabel.setLayoutData(data);
-
- nameText.addListener(SWT.Modify, this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
- if (nameText.isFocusControl())
- {
- return;
- }
- setListenerEnabled(false);
- nameText.setText(""); //$NON-NLS-1$
- if (getElement() != null)
- {
- if (getElement().getElement()!= null)
- {
- String name = getElement().getElement().getAttribute("name"); //$NON-NLS-1$
- if (name==null) name="";
- nameText.setText(name);
- }
- }
- setListenerEnabled(true);
- }
-
- public boolean shouldUseExtraSpace()
- {
- return false;
- }
-
- public void doHandleEvent(Event event)
- {
- if (event.widget == nameText && !nameText.isDisposed()) {
- String newValue = nameText.getText();
- Object wsdlElement = getElement();
-
- if (wsdlElement instanceof Definition) {
- Definition definition = (Definition) wsdlElement;
- String uri = definition.getQName().getNamespaceURI();
- definition.setQName(new QName(uri, newValue));
- }
- else if (wsdlElement instanceof Service) {
- Service service = (Service) wsdlElement;
- String uri = service.getQName().getNamespaceURI();
- service.setQName(new QName(uri, newValue));
- }
- else if (wsdlElement instanceof Port) {
- new SmartRenameAction(wsdlElement, newValue).run();
-// ((Port) wsdlElement).setName(newValue);
- }
- else if (wsdlElement instanceof Binding) {
- Binding binding = (Binding) wsdlElement;
- String uri = binding.getQName().getNamespaceURI();
- binding.setQName(new QName(uri, newValue));
- }
- else if (wsdlElement instanceof BindingOperation) {
- ((BindingOperation) wsdlElement).setName(newValue);
- }
- else if (wsdlElement instanceof BindingInput) {
- if(((BindingInput) wsdlElement).getName() == null && newValue.equals("")) //$NON-NLS-1$
- return;
-
- ((BindingInput) wsdlElement).setName(newValue);
- }
- else if (wsdlElement instanceof BindingOutput) {
- if (((BindingOutput) wsdlElement).getName() == null && newValue.equals("")) //$NON-NLS-1$
- return;
-
- ((BindingOutput) wsdlElement).setName(newValue);
- }
- else if (wsdlElement instanceof BindingFault) {
- ((BindingFault) wsdlElement).setName(newValue);
- }
- else if (wsdlElement instanceof PortType) {
- PortType portType = (PortType) wsdlElement;
- String uri = portType.getQName().getNamespaceURI();
- portType.setQName(new QName(uri, newValue));
- }
- else if (wsdlElement instanceof Operation) {
- new SmartRenameAction(wsdlElement, newValue).run();
-// ((Operation) wsdlElement).setName(newValue);
- }
- else if (wsdlElement instanceof MessageReference) {
- if (((MessageReference) wsdlElement).getName() == null && newValue.equals("")) //$NON-NLS-1$
- return;
-
- new SmartRenameAction(wsdlElement, newValue).run();
-// ((MessageReference) wsdlElement).setName(newValue);
- }
- else if (wsdlElement instanceof Message) {
-/*
- Message message = (Message) wsdlElement;
- String uri = message.getQName().getNamespaceURI();
- message.setQName(new QName(uri, newValue));
- */
- new SmartRenameAction(wsdlElement, newValue).run();
- }
- else if (wsdlElement instanceof Part) {
-// ((Part) wsdlElement).setName(newValue);
- new SmartRenameAction(wsdlElement, newValue).run();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NameSectionDescriptor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NameSectionDescriptor.java
deleted file mode 100644
index 087f832..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NameSectionDescriptor.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.ISection;
-import org.eclipse.wst.common.ui.properties.ISectionDescriptor;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.WSDLElement;
-
-
-public class NameSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor
-{
- /**
- *
- */
- public NameSectionDescriptor()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getId()
- */
- public String getId()
- {
- return "org.eclipse.wst.wsdl.ui.internal.section.name";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes()
- {
- List list = new ArrayList();
- list.add(WSDLElement.class);
- return list;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass()
- {
- return new NameSection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab()
- {
- return "com.ibm.xmlwebservices.general";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection)
- {
- Object object = null;
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof WSDLElement &&
- !(object instanceof ExtensibilityElement) &&
- !(object instanceof Import))
- {
- if (object instanceof WSDLElement) {
- Definition definition = ((WSDLElement) object).getEnclosingDefinition();
- if (definition.getElement() != null && !(object instanceof Definition)) {
- return true;
- }
-
- return false;
- }
- /*
- else if (object instanceof WSDLGroupObject) {
- Definition definition = ((WSDLGroupObject) object).getDefinition();
- if (definition.getElement() != null) {
- return true;
- }
-
- return false;
- }
- */
- }
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NamespaceSection.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NamespaceSection.java
deleted file mode 100644
index 2d75866..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NamespaceSection.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.EditNamespacesAction;
-import org.eclipse.wst.xml.core.internal.document.AttrImpl;
-import org.eclipse.wst.xml.ui.nsedit.CommonEditNamespacesTargetFieldDialog;
-import org.eclipse.wst.xml.ui.nsedit.CommonNamespaceInfoTable;
-import org.w3c.dom.Element;
-
-public class NamespaceSection extends AbstractSection
-{
- protected String targetNamespace;
- protected List namespaceInfoList;
- protected CommonEditNamespacesTargetFieldDialog editWSDLNamespacesControl;
- protected Button button;
-
- Text nameText;
- Text prefixText;
- Text targetNamespaceText;
- protected CommonNamespaceInfoTable tableViewer;
- private boolean handlingEvent;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // name
- CLabel nameLabel = getWidgetFactory().createCLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_NAME") + ":"); //$NON-NLS-1$
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-
- // prefix
- CLabel prefixLabel = getWidgetFactory().createCLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_PREFIX") + ":"); //$NON-NLS-1$
- prefixText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-
- // targetnamespace
- CLabel targetNamespaceLabel = getWidgetFactory().createCLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_TARGET_NAMESPACE")); //$NON-NLS-1$
- targetNamespaceText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-
- // Advanced button
- button = getWidgetFactory().createButton(composite, WSDLEditorPlugin.getWSDLString("_UI_SECTION_ADVANCED_ATTRIBUTES") + "...", SWT.PUSH); //$NON-NLS-1$
-
-
- ///////////////////// Labels
- // name layout
- FormData dataNameLabel = new FormData();
- dataNameLabel.top = new FormAttachment(nameText, 0, SWT.CENTER);
- nameLabel.setLayoutData(dataNameLabel);
-
- // prefix layout
- FormData dataPrefixLabel = new FormData();
- dataPrefixLabel.left = new FormAttachment(0, 0);
- dataPrefixLabel.top = new FormAttachment(prefixText, 0, SWT.CENTER);
- prefixLabel.setLayoutData(dataPrefixLabel);
-
- // targetNamespaceLabel layout
- FormData datatnsLabel = new FormData();
- datatnsLabel.left = new FormAttachment(0, 0);
- datatnsLabel.right = new FormAttachment(targetNamespaceText, 0);
- datatnsLabel.top = new FormAttachment(targetNamespaceText, 0, SWT.CENTER);
- targetNamespaceLabel.setLayoutData(datatnsLabel);
-
-
- ///////////////////// Text Fields
- // name text field
- FormData dataNameText = new FormData();
- dataNameText.left = new FormAttachment(0, 115);
- dataNameText.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- dataNameText.top = new FormAttachment(0, 0);
- nameText.setLayoutData(dataNameText);
- nameText.addListener(SWT.Modify, this);
-
- // prefix text field
- FormData dataPrefixText = new FormData();
- dataPrefixText.left = new FormAttachment(0, 115);
- dataPrefixText.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- dataPrefixText.top = new FormAttachment(nameText, +ITabbedPropertyConstants.VSPACE);
- prefixText.setLayoutData(dataPrefixText);
- prefixText.addListener(SWT.Modify, this);
-
- // targetnamespace text field
- FormData data = new FormData();
- data.left = new FormAttachment(0, 115);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(prefixText, +ITabbedPropertyConstants.VSPACE);
- targetNamespaceText.setLayoutData(data);
- targetNamespaceText.addListener(SWT.Modify, this);
-
- // Advanced button layout
- FormData dataButton = new FormData();
-// dataButton.left = new FormAttachment(100, -rightMarginSpace + 2);
- dataButton.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- dataButton.top = new FormAttachment(targetNamespaceText, +ITabbedPropertyConstants.VSPACE);
-// dataButton.top = new FormAttachment(targetNamespaceText, 0, SWT.CENTER);
- button.setLayoutData(dataButton);
- button.addSelectionListener(this);
- }
-
- public void doHandleEvent(Event event)
- {
- handlingEvent = true;
- if (event.widget == nameText) {
- Object obj = getElement();
- if (obj instanceof Definition) {
- Definition definition = (Definition) obj;
- String uri = definition.getQName().getNamespaceURI();
- definition.setQName(new QName(uri, nameText.getText()));
- }
- }
- else if (event.widget == prefixText) {
- Object obj = getElement();
- if (obj instanceof Definition) {
- Definition definition = (Definition) obj;
- String uri = definition.getQName().getNamespaceURI();
-
- Element element = definition.getElement();
-
- // Remove the old prefix
- String oldPrefix = definition.getPrefix(definition.getTargetNamespace());
- element.removeAttribute("xmlns:"+oldPrefix);
-
- // Set the new prefix
- element.setAttribute("xmlns:" + prefixText.getText(), definition.getTargetNamespace());
- }
- }
- else if (event.widget == targetNamespaceText)
- {
- Object obj = getElement();
- if (obj instanceof Definition)
- {
- Definition definition = (Definition)obj;
- String newValue = targetNamespaceText.getText();
- String prefix = definition.getPrefix(definition.getTargetNamespace());
- definition.setTargetNamespace(newValue);
- definition.getElement().setAttribute("xmlns:" + prefix, newValue);
- }
- }
- handlingEvent = false;
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
-
- if (targetNamespaceText.isFocusControl() || handlingEvent)
- {
- return;
- }
- setListenerEnabled(false);
- Object obj = getElement();
- if (obj instanceof Definition)
- {
- Definition definition = (Definition)obj;
- String targetNS = definition.getTargetNamespace();
-
- // set targetnamespace field and prefix field
- if (targetNS != null)
- {
- targetNamespaceText.setText(targetNS);
-
- Element element = definition.getElement();
-
- String newPrefix = definition.getPrefix(targetNS);
- if (newPrefix == null) newPrefix = "";
- // TODO: remove this code
- if (element != null)
- {
- for (int index = 0; index < element.getAttributes().getLength(); index++) {
- AttrImpl attr = (AttrImpl) element.getAttributes().item(index);
- String name = attr.getName();
- String nodeName = attr.getNodeName();
- String nsValue = attr.getNodeValue();
- if (nsValue.equals(targetNS)) {
- if (nodeName.indexOf(":") != -1) {
- String xmlnsString = nodeName.substring(0, nodeName.indexOf(":"));
-
- if (xmlnsString.equals("xmlns")) {
- newPrefix = attr.getLocalName();
- break;
- }
- }
- }
- }
- }
- prefixText.setText(newPrefix);
- }
- }
-
- // set name field
- if (getElement() != null)
- {
- if (getElement().getElement()!= null)
- {
- String name = getElement().getElement().getAttribute("name"); //$NON-NLS-1$
- if (name==null) name="";
- nameText.setText(name);
- }
- }
-
- setListenerEnabled(true);
- }
-
-
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == button)
- {
- Object obj = getElement();
- if (obj instanceof Definition)
- {
- Definition definition = (Definition)obj;
- EditNamespacesAction action = new EditNamespacesAction(definition);
- action.run();
- refresh();
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NamespaceSectionDescriptor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NamespaceSectionDescriptor.java
deleted file mode 100644
index ac7ce4a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/NamespaceSectionDescriptor.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.ISection;
-import org.eclipse.wst.common.ui.properties.ISectionDescriptor;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-
-public class NamespaceSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor
-{
- /**
- *
- */
- public NamespaceSectionDescriptor()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getId()
- */
- public String getId()
- {
- return "org.eclipse.wst.wsdl.ui.internal.section.namespace";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes()
- {
- List list = new ArrayList();
- list.add(WSDLGroupObject.class);
- return list;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass()
- {
- return new NamespaceSection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab()
- {
- return "com.ibm.xmlwebservices.general";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection)
- {
- Object object = null;
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof WSDLGroupObject)
- {
- Definition definition = ((WSDLGroupObject) object).getDefinition();
- if (definition.getElement() != null) {
- return true;
- }
-
- return false;
- }
- else if (object instanceof org.eclipse.wst.wsdl.Definition) {
- Definition definition = (Definition) object;
- if (definition.getElement() != null) {
- return true;
- }
-
- return false;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getAfterSection()
- */
- public String getAfterSection()
- {
- return "";
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/PartSection.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/PartSection.java
deleted file mode 100644
index 734b3f0..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/PartSection.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.ui.properties.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.dialogs.InvokeSetDialog;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-
-
-public class PartSection extends AbstractSection
-{
- CCombo componentNameCombo;
- CCombo referenceKindCombo;
- CLabel componentNameLabel;
- Button button;
- IEditorPart editorPart;
-
- public void handleEvent (Event event)
- {
- if (event.type == SWT.Modify)
- {
- if (event.widget == referenceKindCombo)
- {
- boolean isType = referenceKindCombo.getText().equals(WSDLEditorPlugin.getWSDLString("_UI_LABEL_TYPE")); //$NON-NLS-1$
- ComponentReferenceUtil.setComponentReference((Part)getElement(), isType, null);
- refresh();
- }
- }
-
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- composite = getWidgetFactory().createFlatFormComposite(parent);
-
- FormData data;
-
- referenceKindCombo = getWidgetFactory().createCCombo(composite);
- referenceKindCombo.setBackground(composite.getBackground());
- referenceKindCombo.add(WSDLEditorPlugin.getWSDLString("_UI_LABEL_ELEMENT")); //$NON-NLS-1$
- referenceKindCombo.add(WSDLEditorPlugin.getWSDLString("_UI_LABEL_TYPE")); //$NON-NLS-1$
-
- CLabel valueLabel = getWidgetFactory().createCLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_REFERENCE_KIND")); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(referenceKindCombo, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(referenceKindCombo, 0, SWT.CENTER);
- valueLabel.setLayoutData(data);
-
- componentNameCombo = getWidgetFactory().createCCombo(composite);
- componentNameCombo.setBackground(composite.getBackground());
- componentNameCombo.addListener(SWT.Modify, this);
- componentNameCombo.addSelectionListener(this);
-
- componentNameLabel = getWidgetFactory().createCLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_ELEMENT") + ":"); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(componentNameCombo, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(componentNameCombo, 0, SWT.CENTER);
- componentNameLabel.setLayoutData(data);
-
- button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
- button.setImage(WSDLEditorPlugin.getInstance().getImage("icons/browsebutton.gif")); //$NON-NLS-1$
-
- button.addSelectionListener(this);
- data = new FormData();
- data.left = new FormAttachment(100, -rightMarginSpace + 2);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(componentNameCombo, 0, SWT.CENTER);
- button.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(0, 0);
- referenceKindCombo.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(button, 0);
- data.top = new FormAttachment(referenceKindCombo, +ITabbedPropertyConstants.VSPACE);
- componentNameCombo.setLayoutData(data);
-
- referenceKindCombo.addListener(SWT.Modify, this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
- referenceKindCombo.removeListener(SWT.Modify, this);
- if (((Part)getElement()).getTypeDefinition() != null)
- {
- referenceKindCombo.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_TYPE")); //$NON-NLS-1$
- }
- else
- {
- referenceKindCombo.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_ELEMENT")); //$NON-NLS-1$
- }
-
- try
- {
- Part part = (Part)getElement();
- boolean isType = ComponentReferenceUtil.isType(part);
- String value = ComponentReferenceUtil.getPartComponentReference(part);
-
- // update the combo-box content
- //
- componentNameCombo.removeAll();
- List compList = ComponentReferenceUtil.getComponentNameList(part, isType);
- if (compList != null)
- {
- for (Iterator iterator = compList.iterator(); iterator.hasNext();)
- {
- componentNameCombo.add((String)iterator.next());
- }
- }
-
- if (isType)
- {
- referenceKindCombo.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_TYPE")); //$NON-NLS-1$
- componentNameLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_TYPE") + ":"); //$NON-NLS-1$
- componentNameCombo.setText(value != null ? value : ""); //$NON-NLS-1$
-// button.setReferenceKind("type");
- }
- else
- {
- referenceKindCombo.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_ELEMENT")); //$NON-NLS-1$
- componentNameLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_ELEMENT") + ":"); //$NON-NLS-1$
- componentNameCombo.setText(value != null ? value : ""); //$NON-NLS-1$
-
-// button.setReferenceKind("element");
- }
-// button.setInput(input);
-// button.setEditor(editorPart);
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- referenceKindCombo.addListener(SWT.Modify, this);
- }
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e)
- {
- Part part = (Part)getElement();
- boolean isType = referenceKindCombo.getText().equals(WSDLEditorPlugin.getWSDLString("_UI_LABEL_TYPE")); //$NON-NLS-1$
- if (e.widget == componentNameCombo)
- {
- ComponentReferenceUtil.setComponentReference(part, isType, componentNameCombo.getText());
- refresh();
- }
- else if (e.widget == button)
- {
- if (e.widget == button)
- {
- InvokeSetDialog dialog = new InvokeSetDialog();
-
- if (getElement() instanceof Part)
- {
- dialog.setReferenceKind(referenceKindCombo.getText());
- }
- dialog.run(getElement(), editorPart);
- refresh();
- }
-
- }
-
- }
-
- public void setEditorPart(IEditorPart editorPart)
- {
- this.editorPart = editorPart;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/PartSectionDescriptor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/PartSectionDescriptor.java
deleted file mode 100644
index 217fee0..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/PartSectionDescriptor.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.ISection;
-import org.eclipse.wst.common.ui.properties.ISectionDescriptor;
-import org.eclipse.wst.wsdl.Part;
-
-
-public class PartSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor
-{
- PartSection partSection;
- /**
- *
- */
- public PartSectionDescriptor()
- {
- super();
- partSection = new PartSection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getId()
- */
- public String getId()
- {
- return "org.eclipse.wst.wsdl.ui.internal.section.part";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes()
- {
- List list = new ArrayList();
- list.add(Part.class);
- return list;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass()
- {
- return partSection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab()
- {
- return "com.ibm.xmlwebservices.general";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection)
- {
- partSection.setEditorPart(part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor());
- Object object = null;
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof Part)
- {
- return true;
- }
- }
- return false;
- }
-
- public String getAfterSection()
- {
- return "org.eclipse.wst.wsdl.ui.internal.section.name";
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ReferenceSection.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ReferenceSection.java
deleted file mode 100644
index ab3fdff..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ReferenceSection.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.ui.properties.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.dialogs.InvokeSetDialog;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.viewers.widgets.ComponentNameComboHelper;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-
-public class ReferenceSection extends AbstractSection
-{
- protected CCombo componentNameCombo;
- protected ComponentNameComboHelper componentNameComboHelper;
- Button button;
- IEditorPart editorPart;
- CLabel messageLabel;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
- {
- super.createControls(parent, factory);
- composite = getWidgetFactory().createFlatFormComposite(parent);
- FormData data;
-
- messageLabel = getWidgetFactory().createCLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_MESSAGE")); //$NON-NLS-1$
- componentNameCombo = getWidgetFactory().createCCombo(composite);
- componentNameCombo.setBackground(composite.getBackground());
- button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
- button.setImage(WSDLEditorPlugin.getInstance().getImage("icons/browsebutton.gif")); //$NON-NLS-1$
- button.addSelectionListener(this);
-
- data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(componentNameCombo, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(componentNameCombo, 0, SWT.CENTER);
- messageLabel.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(100, -rightMarginSpace + 2);
- data.right = new FormAttachment(100,0);
- data.top = new FormAttachment(componentNameCombo, 0, SWT.CENTER);
- button.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(0, 100);
- data.right = new FormAttachment(button, 0);
- componentNameCombo.setLayoutData(data);
-
- componentNameCombo.addListener(SWT.Modify, this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- super.refresh();
- setListenerEnabled(false);
- componentNameCombo.removeListener(SWT.Modify, this);
- Object obj = getElement();
- if (obj instanceof MessageReference)
- {
- messageLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_MESSAGE")); //$NON-NLS-1$
- componentNameComboHelper = new ComponentNameComboHelper(componentNameCombo)
- {
- protected List getComponentNameList(ComponentReferenceUtil util)
- {
- return util.getMessageNames();
- }
-
- protected String getAttributeName()
- {
- return WSDLConstants.MESSAGE_ATTRIBUTE;
- }
- };
-
- }
- else if (obj instanceof Binding)
- {
- componentNameComboHelper = new ComponentNameComboHelper(componentNameCombo)
- {
- protected List getComponentNameList(ComponentReferenceUtil util)
- {
- return util.getPortTypeNames();
- }
-
- protected String getAttributeName()
- {
- return WSDLConstants.TYPE_ATTRIBUTE;
- }
- };
-
- messageLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_PORTTYPE")); //$NON-NLS-1$
- }
- else if (obj instanceof Port)
- {
- componentNameComboHelper = new ComponentNameComboHelper(componentNameCombo)
- {
- protected List getComponentNameList(ComponentReferenceUtil util)
- {
- return util.getBindingNames();
- }
-
- protected String getAttributeName()
- {
- return WSDLConstants.BINDING_ATTRIBUTE;
- }
- };
- messageLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_BINDING")); //$NON-NLS-1$
- }
-
- componentNameComboHelper.update(getElement());
- setListenerEnabled(true);
- componentNameCombo.addListener(SWT.Modify, this);
- }
-
-
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == button)
- {
- if (e.widget == button)
- {
- InvokeSetDialog dialog = new InvokeSetDialog();
- dialog.run(getElement(), editorPart);
- refresh();
- }
-
- }
- }
-
- public void handleEvent(Event event)
- {
- componentNameComboHelper.handleEventHelper(getElement().getElement(), event);
- }
-
- public void setEditorPart(IEditorPart editorPart)
- {
- this.editorPart = editorPart;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ReferenceSectionDescriptor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ReferenceSectionDescriptor.java
deleted file mode 100644
index 2545cc5..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/ReferenceSectionDescriptor.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.ISection;
-import org.eclipse.wst.common.ui.properties.ISectionDescriptor;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Port;
-
-
-public class ReferenceSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor
-{
- ReferenceSection referenceSection;
-
- /**
- *
- */
- public ReferenceSectionDescriptor()
- {
- super();
- this.referenceSection = new ReferenceSection();
- }
-
-
- /**
- *
- */
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getId()
- */
- public String getId()
- {
- return "org.eclipse.wst.wsdl.ui.internal.section.reference";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes()
- {
- List list = new ArrayList();
- list.add(MessageReference.class);
- list.add(Binding.class);
- list.add(Port.class);
- return list;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass()
- {
- return referenceSection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab()
- {
- return "com.ibm.xmlwebservices.general";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection)
- {
- referenceSection.setEditorPart(part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor());
- Object object = null;
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof MessageReference || object instanceof Binding || object instanceof Port)
- {
- return true;
- }
- }
- return false;
- }
-
- public String getAfterSection()
- {
- return "org.eclipse.wst.wsdl.ui.internal.section.name";
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/TextChangeHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/TextChangeHelper.java
deleted file mode 100644
index 124ed18..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/TextChangeHelper.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * TextChangeHelper notifies the listner of text lifecycle events
- * on behalf of the widget(s) it listens to.
- *
- * @author Anthony Hunter
- * <a href="mailto:anthonyh@ca.ibm.com">anthonyh@ca.ibm.com</a>
- */
-public abstract class TextChangeHelper implements Listener {
-
- private boolean nonUserChange;
-
- /**
- * Marks the start of a programmatic change to the widget contents.
- * Clients must call startNonUserChange() before directly setting
- * the widget contents to avoid unwanted lifecycle events.
- * @throws IllegalArgumentException if a programmatic change is
- * already in progress.
- */
- public void startNonUserChange() {
- if (nonUserChange)
- throw new IllegalStateException("we already started a non user change");//$NON-NLS-1$
- nonUserChange = true;
- }
-
- /**
- * Clients who call startNonUserChange() should call
- * finishNonUserChange() as soon as possible after the change is done.
- * @throws IllegalArgumentException if no change is in progress.
- */
- public void finishNonUserChange() {
- if (!nonUserChange)
- throw new IllegalStateException("we are not in a non user change");//$NON-NLS-1$
- nonUserChange = false;
- }
-
- /**
- * Returns true if a programmatic change is in progress.
- */
- public boolean isNonUserChange() {
- return nonUserChange;
- }
-
- /**
- * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
- */
- public void handleEvent(Event event) {
- switch (event.type) {
- case SWT.KeyDown :
- if (event.character == SWT.CR)
- textChanged((Control)event.widget);
- break;
- case SWT.FocusOut :
- textChanged((Control)event.widget);
- break;
- }
- }
-
- /**
- * Abstract method notified when a text field has been changed.
- * @param control
- */
- public abstract void textChanged(Control control);
-
- /**
- * Registers this helper with the given control to listen for events
- * which indicate that a change is in progress (or done).
- */
- public void startListeningTo(Control control) {
- control.addListener(SWT.FocusOut, this);
- control.addListener(SWT.Modify, this);
- }
-
- /**
- * Registers this helper with the given control to listen for the
- * Enter key. When Enter is pressed, the change is considered done
- * (this is only appropriate for single-line Text widgets).
- */
- public void startListeningForEnter(Control control) {
- // NOTE: KeyDown rather than KeyUp, because of similar usage in CCombo.
- control.addListener(SWT.KeyDown, this);
- }
-
- /**
- * Unregisters this helper from a control previously passed to
- * startListeningTo() and/or startListeningForEnter().
- */
- public void stopListeningTo(Control control) {
- control.removeListener(SWT.FocusOut, this);
- control.removeListener(SWT.Modify, this);
- control.removeListener(SWT.KeyDown, this);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLLabelProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLLabelProvider.java
deleted file mode 100644
index 22014ce..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLLabelProvider.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtensionRegistry;
-import org.eclipse.wst.wsdl.ui.internal.graph.model.WSDLGraphModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLModelAdapterFactory;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public class WSDLLabelProvider extends LabelProvider
-{
- protected ModelAdapterFactory adapterFactory = new WSDLModelAdapterFactory();
- private WSDLTypeMapper typeMapper;
-
- protected WSDLEditorExtension[] labelProviderExtensions;
- protected LabelProvider[] labelProviders;
- IEditorPart editorPart;
-
- /**
- *
- */
- public WSDLLabelProvider()
- {
- super();
- typeMapper = new WSDLTypeMapper();
- editorPart = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- WSDLEditorExtensionRegistry registry = WSDLEditorPlugin.getInstance().getWSDLEditorExtensionRegistry();
- labelProviderExtensions = registry.getRegisteredExtensions(WSDLEditorExtension.OUTLINE_LABEL_PROVIDER);
- labelProviders = new LabelProvider[labelProviderExtensions.length];
- for (int i = 0; i < labelProviderExtensions.length; i++)
- {
- labelProviders[i] = (LabelProvider)labelProviderExtensions[i].createExtensionObject(WSDLEditorExtension.OUTLINE_LABEL_PROVIDER, (WSDLEditor)editorPart);
- }
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object object)
- {
- if (object == null || object.equals(StructuredSelection.EMPTY)) {
- return null;
- }
- Image result = null;
- if (object instanceof StructuredSelection)
- {
- Object selected = ((StructuredSelection)object).getFirstElement();
- selected = typeMapper.remapObject(selected);
- for (int i = 0; i < labelProviders.length; i++)
- {
- result = labelProviders[i].getImage(selected);
- if (result!=null)
- break;
- }
-// if (result != null)
-// {
-// ModelAdapter modelAdapter = adapterFactory.getAdapter(selected);
-// if (modelAdapter != null)
-// {
-// result = (Image)modelAdapter.getProperty(selected, ModelAdapter.IMAGE_PROPERTY);
-// }
-// }
- }
- return result;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object object)
- {
- if (object == null || object.equals(StructuredSelection.EMPTY)) {
- return "No items selected";//$NON-NLS-1$
- }
- String result = null;
- Object selected = null;
- if (object instanceof StructuredSelection)
- {
- selected = ((StructuredSelection)object).getFirstElement();
- selected = typeMapper.remapObject(selected);
-
- // Override outline provider's getText for WSDLElements
- if (selected instanceof WSDLElement)
- {
- if (((WSDLElement)selected).getElement() == null) {
- return "";
- }
- boolean isReadOnly = false;
- ModelAdapter adapter = WSDLGraphModelAdapterFactory.getWSDLGraphModelAdapterFactory().getAdapter(selected);
- if (adapter != null)
- {
- isReadOnly = Boolean.TRUE.equals(adapter.getProperty(selected, "isReadOnly"));
- }
- if (isReadOnly)
- {
- result = ((WSDLElement)selected).getElement().getLocalName() + " (" + WSDLEditorPlugin.getWSDLString("_UI_LABEL_READ_ONLY") + ")"; //$NON-NLS-1$
- }
- else
- {
- result = ((WSDLElement)selected).getElement().getLocalName();
- }
- return result;
- }
- else if (selected instanceof XSDConcreteComponent)
- {
- // Override for XSD Components
-
- Element element = ((XSDConcreteComponent)selected).getElement();
- if (element != null)
- {
- if (element instanceof XMLNode)
- {
- return ((XSDConcreteComponent)selected).getElement().getLocalName();
- }
- else
- {
- return ((XSDConcreteComponent)selected).getElement().getLocalName() + " (" + WSDLEditorPlugin.getWSDLString("_UI_LABEL_READ_ONLY") + ")"; //$NON-NLS-1$
- }
- }
- else
- {
- return "(" + WSDLEditorPlugin.getWSDLString("_UI_LABEL_READ_ONLY") + ")"; //$NON-NLS-1$
- }
-
- }
- // otherwise get it from the extensions
- for (int i = 0; i < labelProviders.length; i++)
- {
- result = labelProviders[i].getText(selected);
- if (result!=null)
- break;
- }
- }
- else if (object instanceof TextSelection)
- {
- }
-
-
- return result;
- }
-
- /**
- * Determine if a multiple object selection has been passed to the
- * label provider. If the objects is a IStructuredSelection, see if
- * all the objects in the selection are the same and if so, we want
- * to provide labels for the common selected element.
- * @param objects a single object or a IStructuredSelection.
- * @param multiple first element in the array is true if there is multiple
- * unequal selected elements in a IStructuredSelection.
- * @return the object to get labels for.
- */
- private Object getObject(Object objects, boolean multiple[]) {
- Assert.isNotNull(objects);
- Object object = null;
- return object;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLSectionDescriptorProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLSectionDescriptorProvider.java
deleted file mode 100644
index 97c7b8b..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLSectionDescriptorProvider.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.ui.properties.ISectionDescriptor;
-import org.eclipse.wst.common.ui.properties.ISectionDescriptorProvider;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtensionRegistry;
-
-public class WSDLSectionDescriptorProvider implements ISectionDescriptorProvider
-{
- protected WSDLEditorExtension[] propertySectionDescriptorProviderExtensions;
- protected ISectionDescriptorProvider[] propertySectionDescriptorProviders;
-
- protected WSDLEditorExtension[] labelProviderExtensions;
-
- protected final static Object[] EMPTY_ARRAY = {};
-
- IEditorPart editorPart;
-
- /**
- *
- */
- public WSDLSectionDescriptorProvider()
- {
- super();
- // TODO Check this
- this.editorPart = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptorProvider#getSectionDescriptors()
- */
- public ISectionDescriptor[] getSectionDescriptors()
- {
- List list = new ArrayList();
-
-
- WSDLEditorExtensionRegistry registry = WSDLEditorPlugin.getInstance().getWSDLEditorExtensionRegistry();
-
- propertySectionDescriptorProviderExtensions = registry.getRegisteredExtensions(WSDLEditorExtension.PROPERTY_SECTION_DESCRIPTOR_PROVIDER);
- propertySectionDescriptorProviders = new ISectionDescriptorProvider[propertySectionDescriptorProviderExtensions.length];
- for (int i = 0; i < propertySectionDescriptorProviderExtensions.length; i++)
- {
- propertySectionDescriptorProviders[i] = (ISectionDescriptorProvider)propertySectionDescriptorProviderExtensions[i].createExtensionObject(WSDLEditorExtension.PROPERTY_SECTION_DESCRIPTOR_PROVIDER, (WSDLEditor)editorPart);
-
- ISectionDescriptor [] extensionSectionDescriptors = propertySectionDescriptorProviders[i].getSectionDescriptors();
- for (int j = 0; j < extensionSectionDescriptors.length; j++)
- {
- list.add(extensionSectionDescriptors[j]);
- }
- }
-
-
- list.add(new NameSectionDescriptor());
- list.add(new PartSectionDescriptor());
- list.add(new DocumentationSectionDescriptor());
- list.add(new ReferenceSectionDescriptor());
- list.add(new NamespaceSectionDescriptor());
- list.add(new ExtensibilityElementSectionDescriptor());
- list.add(new ImportSectionDescriptor());
-
- ISectionDescriptor[] descriptors = new ISectionDescriptor[list.size()];
- list.toArray(descriptors);
-
- return descriptors;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLTabbedPropertySheetPage.java
deleted file mode 100644
index c6bd720..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLTabbedPropertySheetPage.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.ITabbedPropertySheetPageContributor;
-import org.eclipse.wst.common.ui.properties.TabbedPropertySheetPage;
-import org.eclipse.wst.sse.ui.view.events.INodeSelectionListener;
-import org.eclipse.wst.sse.ui.view.events.NodeSelectionChangedEvent;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLSelectionManager;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapter;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class WSDLTabbedPropertySheetPage extends TabbedPropertySheetPage implements ISelectionChangedListener, INodeSelectionListener, ModelAdapterListener
-{
- private WSDLSelectionManager fViewerSelectionManager;
- private WSDLEditor wsdlEditor;
- private Object currentObject;
-
- /**
- * @param tabbedPropertySheetPageContributor
- */
- public WSDLTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor, WSDLEditor editor)
- {
- super(tabbedPropertySheetPageContributor);
- this.wsdlEditor = editor;
- }
-
- public void createControl(Composite parent) {
- super.createControl(parent);
- wsdlEditor.getSelectionManager().setSelection(new StructuredSelection(wsdlEditor.getDefinition()));
- }
-
- public void setSelectionManager(WSDLSelectionManager viewerSelectionManager) {
- // disconnect from old one
- if (fViewerSelectionManager != null) {
- fViewerSelectionManager.removeSelectionChangedListener(this);
- }
-
- fViewerSelectionManager = viewerSelectionManager;
-
- // connect to new one
- if (fViewerSelectionManager != null) {
- fViewerSelectionManager.addSelectionChangedListener(this);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (!event.getSelection().isEmpty()) {
- selectionChanged(getSite().getWorkbenchWindow().getActivePage().getActivePart(), event.getSelection());
- //super.selectionChanged(getSite().getWorkbenchWindow().getActivePage().getActivePart(), event.getSelection());
- }
- }
-
- public void selectionChanged(IWorkbenchPart part, ISelection selection)
- {
- // override for category
- if (selection != null)
- {
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- if (structuredSelection.isEmpty())
- {
- return;
- }
- Object obj = structuredSelection.getFirstElement();
- Node node = WSDLEditorUtil.getInstance().getNodeForObject(obj);
- Object o = WSDLEditorUtil.getInstance().findModelObjectForElement(wsdlEditor.getDefinition(), (Element)node);
-
- // bad hack to get schema from category
- // until we provide a better mechanism (selection manager extension)
- // see also WSDLGraphViewer
- if (o instanceof XSDSchemaExtensibilityElement)
- {
- obj = ((XSDSchemaExtensibilityElement)o).getSchema();
- selection = new StructuredSelection(obj);
- }
-
- attachListener(o);
- }
- else if (selection instanceof TextSelection)
- {
- return;
- }
- }
-
- super.selectionChanged(wsdlEditor.getEditorPart(), selection); // event.getSelection());
- }
-
- protected void attachListener(Object object)
- {
- WSDLModelAdapterFactory adapterFactory = WSDLModelAdapterFactory.getWSDLModelAdapterFactory();
- ModelAdapter adapter = adapterFactory.getAdapter(object);
- if (adapter != null)
- {
- // remove listener from the previously selected object
- removeListener(currentObject);
-
- // add listener to the newly selected object
- adapter.addListener(this);
- currentObject = object;
- }
- }
-
- protected void removeListener(Object object)
- {
- WSDLModelAdapterFactory adapterFactory = WSDLModelAdapterFactory.getWSDLModelAdapterFactory();
- ModelAdapter adapter = adapterFactory.getAdapter(object);
- if (adapter != null)
- {
- adapter.removeListener(this);
- currentObject = null;
- }
- }
- public void dispose() {
- // disconnect from the ViewerSelectionManager
- if (fViewerSelectionManager != null) {
- fViewerSelectionManager.removeSelectionChangedListener(this);
- }
-
- // disconnect listener from the current object
- if (currentObject != null) {
- removeListener(currentObject);
- }
-
- super.dispose();
- }
-
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.view.events.INodeSelectionListener#nodeSelectionChanged(com.ibm.sse.editor.view.events.NodeSelectionChangedEvent)
- */
- public void nodeSelectionChanged(NodeSelectionChangedEvent event)
- {
- }
-
- public void propertyChanged(Object object, String property) {
- if (getCurrentTab() != null) {
- refresh();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLTypeMapper.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLTypeMapper.java
deleted file mode 100644
index 939b606..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/properties/section/WSDLTypeMapper.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.properties.section;
-
-import org.eclipse.wst.common.ui.properties.ITypeMapper;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-
-public class WSDLTypeMapper implements ITypeMapper
-{
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ITypeMapper#remapType(java.lang.Object, java.lang.Class)
- */
- public Class remapType(Object object, Class effectiveType)
- {
- Class type = effectiveType;
-
- if (object instanceof WSDLGroupObject) {
- type = ((WSDLGroupObject) object).getDefinition().getClass();
- }
-
- return type;
- }
-
- public Object remapObject(Object object)
- {
- Object type = object;
-
- if (object instanceof WSDLGroupObject)
- {
- type = ((WSDLGroupObject) object).getDefinition();
- }
- return type;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/reconciler/ExtensibleNodeReconciler.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/reconciler/ExtensibleNodeReconciler.java
deleted file mode 100644
index 58a0759..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/reconciler/ExtensibleNodeReconciler.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.reconciler;
-
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.INodeReconciler;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtensionRegistry;
-import org.w3c.dom.Element;
-
-
-
-// TODO.. we should probably be keying off of the node's qname (perhaps supporting 'null' as a wild card for local names)
-// in order to compute an applicable reconciler
-//
-public class ExtensibleNodeReconciler
-{
- protected WSDLEditorExtension[] extensions;
- protected INodeReconciler[] reconcilers;
-
- public ExtensibleNodeReconciler()
- {
- WSDLEditorExtensionRegistry registry = WSDLEditorPlugin.getInstance().getWSDLEditorExtensionRegistry();
- extensions = registry.getRegisteredExtensions(WSDLEditorExtension.NODE_RECONCILER);
- reconcilers = new INodeReconciler[extensions.length];
- for (int i = 0; i < extensions.length; i++)
- {
- reconcilers[i] = (INodeReconciler)extensions[i].createExtensionObject(WSDLEditorExtension.NODE_RECONCILER, null);
- }
- }
-
- protected INodeReconciler getApplicableNodeReconciler(Object object)
- {
- INodeReconciler reconciler = null;
- for (int i = 0; i < extensions.length; i++)
- {
- if (extensions[i].isApplicable(object))
- {
- reconciler = reconcilers[i];
- if (reconciler != null)
- {
- break;
- }
- }
- }
- return reconciler;
- }
-
- public void notifyChanged(Object modelObject, Element element, int eventType, Object feature, Object oldValue, Object newValue, int index)
- {
- INodeReconciler reconciler = getApplicableNodeReconciler(modelObject);
- if (reconciler != null)
- {
- reconciler.notifyChanged(modelObject, element, eventType, feature, oldValue, newValue, index);
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/reconciler/SEDDocumentAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/reconciler/SEDDocumentAdapter.java
deleted file mode 100644
index ce15848..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/reconciler/SEDDocumentAdapter.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.reconciler;
-
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.wst.wsdl.internal.impl.XSDSchemaExtensibilityElementImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class SEDDocumentAdapter
-{
- protected Document document;
- protected Definition definition;
- protected ExtensibleNodeReconciler extensibleNodeReconciler;
-
- public SEDDocumentAdapter(IStructuredModel model, Definition definition)
- {
- this.document = (model instanceof XMLModel) ? ((XMLModel)model).getDocument() : null;
- this.definition = definition;
- this.extensibleNodeReconciler = new ExtensibleNodeReconciler();
- new MyDocumentAdapter(document);
- }
-
-
- class MyDocumentAdapter extends DocumentAdapter
- {
-// private boolean isValidDefinition = true;
-
- MyDocumentAdapter(Document document)
- {
- super(document);
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index)
- {
- if (eventType == INodeNotifier.ADD)
- {
- if (newValue instanceof Element)
- {
- adapt((Element)newValue);
-
- // See Bug 5366
- // We need to sync up the Model and the DOM
- Element newDocumentElement = (Element)newValue;
- String wsdlPrefix = newDocumentElement.getPrefix();
- if (wsdlPrefix == null) wsdlPrefix = "";
- String ns = definition.getNamespace(wsdlPrefix);
- if (ns != null && ns.equals(WSDLConstants.WSDL_NAMESPACE_URI)
- && newDocumentElement.getLocalName().equals(WSDLConstants.DEFINITION_ELEMENT_TAG)) // &&
- // !isValidDefinition)
- {
-// System.out.println("****** Setting new definition");
- definition.setElement(newDocumentElement);
- }
- }
- }
-
- switch (eventType)
- {
- // we make the assumption that reconciling will only be triggered by one of these notifications
- // (ADD and REMOVE notifications are omitted)
- //
- case INodeNotifier.CHANGE:
- case INodeNotifier.STRUCTURE_CHANGED:
- case INodeNotifier.CONTENT_CHANGED:
- {
- if (notifier instanceof Element)
- {
- reconcileModelObjectForElement((Element)notifier, eventType, feature, oldValue, newValue, index);
- }
- else if (notifier instanceof Document)
- {
- Document document = (Document)notifier;
- Element definitionElement = null;
-
- for (Node node = document.getFirstChild(); node != null; node = node.getNextSibling())
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- Element element = (Element)node;
- if (WSDLEditorUtil.getInstance().getWSDLType(element) == WSDLConstants.DEFINITION)
- {
- definitionElement = element;
- break;
- }
- }
- }
-
- // TODO... revisit definition.removeAllContent() and who should call this?
- //
- if (definitionElement != null)
- {
-// isValidDefinition = true;
-// System.out.println("VALID DEFINITION ELEMENT");
- ((DefinitionImpl)definition).elementChanged(definitionElement);
- }
- else
- {
-// System.out.println("INVALID DEFINITION ELEMENT");
-// isValidDefinition = false;
- ((DefinitionImpl)definition).removeAll();
- }
- }
- break;
- }
- }
- }
-
- private void removeAllContent(Definition definition)
- {
- }
-
- protected void reconcileModelObjectForElement(Element element, int eventType, Object feature, Object oldValue, Object newValue, int index)
- {
- Object modelObject = WSDLEditorUtil.getInstance().findModelObjectForElement(definition, element);
- if (modelObject != null)
- {
- if (modelObject instanceof XSDSchemaExtensibilityElementImpl)
- {
- XSDSchemaExtensibilityElementImpl ee = (XSDSchemaExtensibilityElementImpl)modelObject;
- ((XSDSchemaImpl)ee.getSchema()).elementChanged(element);
- ee.elementChanged(element);
- }
- else if (modelObject instanceof WSDLElementImpl)
- {
- ((WSDLElementImpl)modelObject).elementChanged(element);
- }
- else if (modelObject instanceof XSDConcreteComponent)
- {
- ((XSDConcreteComponent)modelObject).elementChanged(element);
- extensibleNodeReconciler.notifyChanged(modelObject, element, eventType, feature, oldValue, newValue, index);
- }
- }
- }
- }
-
-
- // An abstract adapter that ensures that the children of a new Node are also adapted
- //
- abstract class DocumentAdapter implements INodeAdapter
- {
- public DocumentAdapter(Document document)
- {
- ((INodeNotifier)document).addAdapter(this);
-
- for (Node child = document.getFirstChild(); child != null; child = child.getNextSibling())
- {
- if (child.getNodeType() == Node.ELEMENT_NODE)
- {
- adapt((Element)child);
- }
- }
- }
-
- public void adapt(Element element)
- {
- if (element != null)
- {
- if (((INodeNotifier)element).getExistingAdapter(this) == null)
- {
- ((INodeNotifier)element).addAdapter(this);
-
- for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling())
- {
- if (child.getNodeType() == Node.ELEMENT_NODE)
- {
- adapt((Element)child);
- }
- }
- }
- }
- }
-
- public boolean isAdapterForType(Object type)
- {
- return type == this;
- }
-
- abstract public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/typesystem/ExtensibleTypeSystemProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/typesystem/ExtensibleTypeSystemProvider.java
deleted file mode 100644
index 0d6df75..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/typesystem/ExtensibleTypeSystemProvider.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.typesystem;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.ITypeSystemProvider;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtensionRegistry;
-import org.eclipse.xsd.XSDSchema;
-
-public class ExtensibleTypeSystemProvider implements ITypeSystemProvider
-{
- protected WSDLEditorExtension[] extensions;
- protected ITypeSystemProvider[] typeSystemProviders;
-
- protected final static Object[] EMPTY_ARRAY = {};
-
- public ExtensibleTypeSystemProvider(WSDLEditor wsdlEditor)
- {
- WSDLEditorExtensionRegistry registry = WSDLEditorPlugin.getInstance().getWSDLEditorExtensionRegistry();
-
- extensions = registry.getRegisteredExtensions(WSDLEditorExtension.TYPE_SYSTEM_PROVIDER);
- typeSystemProviders = new ITypeSystemProvider[extensions.length];
- for (int i = 0; i < extensions.length; i++)
- {
- typeSystemProviders[i] = (ITypeSystemProvider)extensions[i].createExtensionObject(WSDLEditorExtension.TYPE_SYSTEM_PROVIDER, wsdlEditor);
- }
- }
-
- public List getAvailableTypeNames(Definition definition, int typeNameCategory)
- {
- List list = new ArrayList();
- for (int i = 0; i < typeSystemProviders.length; i++)
- {
- list.addAll(typeSystemProviders[i].getAvailableTypeNames(definition, typeNameCategory));
- }
- return list;
- }
-
- public List getAvailableTypes(Definition definition, XSDSchema schema, int typeNameCategory)
- {
- List list = new ArrayList();
- for (int i = 0; i < typeSystemProviders.length; i++)
- {
- list.addAll(typeSystemProviders[i].getAvailableTypes(definition, schema, typeNameCategory));
- }
- return list;
- }
-
- public List getAvailableElementNames(Definition definition)
- {
- List list = new ArrayList();
- for (int i = 0; i < typeSystemProviders.length; i++)
- {
- list.addAll(typeSystemProviders[i].getAvailableElementNames(definition));
- }
- return list;
- }
-
- public int getCategoryForTypeName(Definition definition, String typeName)
- {
- int result = UNKNOWN_TYPE;
- for (int i = 0; i < typeSystemProviders.length; i++)
- {
- result = typeSystemProviders[i].getCategoryForTypeName(definition, typeName);
- if (result != UNKNOWN_TYPE)
- {
- break;
- }
- }
- return result;
- }
-
- public List getPrefixedNames(Definition definition, String namespace, String localName) {
- List list = new ArrayList();
- for (int i = 0; i < typeSystemProviders.length; i++)
- {
- list.addAll(typeSystemProviders[i].getPrefixedNames(definition, namespace, localName));
- }
- return list;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ComponentReferenceUtil.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ComponentReferenceUtil.java
deleted file mode 100644
index 4982273..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ComponentReferenceUtil.java
+++ /dev/null
@@ -1,950 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.extension.ITypeSystemProvider;
-import org.eclipse.wst.wsdl.internal.impl.ImportImpl;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.xml.uriresolver.util.URIHelper;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class ComponentReferenceUtil
-{
- protected Definition rootDefinition;
-
- public ComponentReferenceUtil(Definition rootDefinition)
- {
- this.rootDefinition = rootDefinition;
- }
-
- protected static boolean isEqual(String a, String b)
- {
- boolean result = false;
- if (a != null)
- {
- result = a.equals(b) || (a.length() == 0 && b == null);
- }
- else
- {
- result = (b == null || b.length() == 0);
- }
- return result;
- }
-
- protected static boolean isEqualInputName(Operation operation, BindingOperation bindingOperation)
- {
- boolean result = false;
- Input operationInput = operation.getEInput();
- BindingInput bindingOperationInput = bindingOperation.getEBindingInput();
-
- if (operationInput != null && bindingOperationInput != null)
- {
- result = isEqual(operationInput.getName(), bindingOperationInput.getName());
- }
- else if (operationInput == null && bindingOperationInput == null)
- {
- result = true;
- }
- return result;
- }
-
- protected static boolean isEqualOutputName(Operation operation, BindingOperation bindingOperation)
- {
- boolean result = false;
- Output operationOutput = operation.getEOutput();
- BindingOutput bindingOperationOutput = bindingOperation.getEBindingOutput();
-
- if (operationOutput != null && bindingOperationOutput != null)
- {
- result = isEqual(operationOutput.getName(), bindingOperationOutput.getName());
- }
- else if (operationOutput == null && bindingOperationOutput == null)
- {
- result = true;
- }
- return result;
- }
-
- protected static boolean isMatchingBinding(Operation operation, BindingOperation bindingOperation)
- {
- return isEqual(operation.getName(), bindingOperation.getName()) && isEqualInputName(operation, bindingOperation) && isEqualOutputName(operation, bindingOperation);
- }
-
- public List getPortsForPortType(PortType portType)
- {
- List list = new ArrayList();
- for (Iterator i = getServices().iterator(); i.hasNext();)
- {
- Service service = (Service) i.next();
- for (Iterator j = service.getEPorts().iterator(); j.hasNext();)
- {
- Port port = (Port) j.next();
- Binding binding = port.getEBinding();
- if (binding != null && binding.getEPortType() == portType)
- {
- list.add(port);
- }
- }
- }
- return list;
- }
-
- public List getPortsForBinding(Binding binding)
- {
- List list = new ArrayList();
- for (Iterator i = getServices().iterator(); i.hasNext();)
- {
- Service service = (Service) i.next();
- for (Iterator j = service.getEPorts().iterator(); j.hasNext();)
- {
- Port port = (Port) j.next();
- if (port.getEBinding() == binding)
- {
- list.add(port);
- }
- }
- }
- return list;
- }
-
- public List getBindingOperations(Operation operation)
- {
- List list = new ArrayList();
- String operationName = operation.getName();
-
- if (operationName != null)
- {
- PortType portType = getEnclosingPortType(operation);
- for (Iterator i = getBindings(portType).iterator(); i.hasNext();)
- {
- Binding binding = (Binding) i.next();
- BindingOperation bindingOperation = getBindingOperation(operation, binding);
- if (bindingOperation != null)
- {
- list.add(bindingOperation);
- }
- }
- }
- return list;
- }
-
- public BindingOperation getBindingOperation(Operation operation, Binding binding)
- {
- BindingOperation result = null;
- for (Iterator j = binding.getBindingOperations().iterator(); j.hasNext();)
- {
- BindingOperation bindingOperation = (BindingOperation) j.next();
- if (isMatchingBinding(operation, bindingOperation))
- {
- result = bindingOperation;
- break;
- }
- }
- return result;
- }
-
- public BindingInput getBindingInput(Input input, Binding binding)
- {
- BindingOperation bindingOperation = getBindingOperation((Operation) input.eContainer(), binding);
- return bindingOperation != null ? bindingOperation.getEBindingInput() : null;
- }
-
- public BindingOutput getBindingOutput(Output output, Binding binding)
- {
- BindingOperation bindingOperation = getBindingOperation((Operation) output.eContainer(), binding);
- return bindingOperation != null ? bindingOperation.getEBindingOutput() : null;
- }
-
- public BindingFault getBindingFault(Fault fault, Binding binding)
- {
- BindingFault result = null;
- String faultName = fault.getName();
- if (faultName != null)
- {
- BindingOperation bindingOperation = getBindingOperation((Operation) fault.eContainer(), binding);
- if (bindingOperation != null)
- {
- result = (BindingFault) bindingOperation.getBindingFault(faultName);
- }
- }
- return result;
- }
-
- public EObject getBindingObject(EObject interfaceObject, Binding binding)
- {
- EObject result = null;
- if (interfaceObject instanceof Input)
- {
- result = getBindingInput((Input) interfaceObject, binding);
- }
- else if (interfaceObject instanceof Output)
- {
- result = getBindingOutput((Output) interfaceObject, binding);
- }
- else if (interfaceObject instanceof Fault)
- {
- result = getBindingFault((Fault) interfaceObject, binding);
- }
- else if (interfaceObject instanceof Operation)
- {
- result = getBindingOperation((Operation) interfaceObject, binding);
- }
- else if (interfaceObject instanceof PortType)
- {
- result = binding;
- }
- return result;
- }
-
- public List getBindingInputs(Input input)
- {
- List list = new ArrayList();
- List operations = getBindingOperations((Operation) input.eContainer());
- for (Iterator i = operations.iterator(); i.hasNext();)
- {
- BindingOperation bindingOperation = (BindingOperation) i.next();
- if (bindingOperation.getBindingInput() != null)
- {
- list.add(bindingOperation.getBindingInput());
- }
- }
- return list;
- }
-
- public List getBindingOutputs(Output output)
- {
- List list = new ArrayList();
- Operation operation = (Operation) output.eContainer();
- if (operation != null)
- {
- List operations = getBindingOperations(operation);
- for (Iterator i = operations.iterator(); i.hasNext();)
- {
- BindingOperation bindingOperation = (BindingOperation) i.next();
- if (bindingOperation.getBindingOutput() != null)
- {
- list.add(bindingOperation.getBindingOutput());
- }
- }
- }
- return list;
- }
-
- public List getBindingFaults(Fault fault)
- {
- List list = new ArrayList();
- String faultName = fault.getName();
- if (faultName != null)
- {
- Operation operation = (Operation) fault.eContainer();
- if (operation != null)
- {
- List operations = getBindingOperations(operation);
- for (Iterator i = operations.iterator(); i.hasNext();)
- {
- BindingOperation bindingOperation = (BindingOperation) i.next();
- BindingFault bindingFault = (BindingFault) bindingOperation.getBindingFault(faultName);
- if (bindingFault != null)
- {
- list.add(bindingFault);
- }
- }
- }
- }
- return list;
- }
-
- protected PortType getEnclosingPortType(Operation operation)
- {
- return (PortType) operation.eContainer();
- }
-
- public List getBindings(Operation operation)
- {
- return getBindings(getEnclosingPortType(operation));
- }
-
- public List getBindings(PortType portType)
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- for (Iterator j = definition.getBindings().values().iterator(); j.hasNext();)
- {
- Binding binding = (Binding) j.next();
- if (portType == null || binding.getPortType() == portType)
- {
- list.add(binding);
- }
- }
- }
- return list;
- }
-
- public List getBindingsWithoutOperation(PortType portType, String operationName)
- {
- List result = new ArrayList();
- if (operationName != null)
- {
- List bindings = getBindings(portType);
- for (Iterator i = bindings.iterator(); i.hasNext();)
- {
- Binding binding = (Binding) i.next();
- boolean hasName = false;
- for (Iterator j = binding.getBindingOperations().iterator(); j.hasNext();)
- {
- BindingOperation bindingOperation = (BindingOperation) j.next();
- if (operationName.equals(bindingOperation.getName()))
- {
- hasName = true;
- break;
- }
- }
- if (!hasName)
- {
- result.add(binding);
- }
- }
- }
- return result;
- }
-
- public List getBindings()
- {
- return getBindings((PortType) null);
- }
-
- public List getBindingNames()
- {
- List list = new ArrayList();
- for (Iterator i = getBindings().iterator(); i.hasNext();)
- {
- Binding binding = (Binding) i.next();
- list.addAll(getPrefixedNames(binding.getQName()));
- }
- return list;
- }
-
- public List getPortTypeNames()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- for (Iterator j = definition.getPortTypes().values().iterator(); j.hasNext();)
- {
- PortType portType = (PortType) j.next();
- list.addAll(getPrefixedNames(portType.getQName()));
- }
- }
- return list;
- }
-
- public List getServices()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- list.addAll(definition.getEServices());
- }
- return list;
- }
-
- public List getPortTypes()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- list.addAll(definition.getEPortTypes());
- }
- return list;
- }
-
- public List getMessages()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- list.addAll(definition.getEMessages());
- }
- return list;
- }
-
- public List getTypes()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- if (definition.getETypes() != null)
- {
- list.add(definition.getETypes());
- }
- }
- return list;
- }
-
- public List getMessageNames()
- {
- List list = new ArrayList();
- for (Iterator i = getDefinitions().iterator(); i.hasNext();)
- {
- Definition definition = (Definition) i.next();
- for (Iterator j = definition.getMessages().values().iterator(); j.hasNext();)
- {
- Message message = (Message) j.next();
- list.addAll(getPrefixedNames(message.getQName()));
- }
- }
- return list;
- }
-
- public List getDefinitions()
- {
- List list = new ArrayList();
- addDefinition(rootDefinition, list);
- return list;
- }
-
- /**
- * @deprecated -- we should always use getPrefixedNames
- */
- public String getPrefixedName(QName qname)
- {
- String name = null;
- if (qname != null)
- {
- String prefix = rootDefinition.getPrefix(qname.getNamespaceURI());
- if (prefix != null)
- {
- name = prefix + ":" + qname.getLocalPart();
- }
- }
- return name;
- }
-
- public List getPrefixedNames(QName qname)
- {
- List list = new ArrayList();
- if (qname != null)
- {
- Map map = rootDefinition.getNamespaces();
- for (Iterator i = map.keySet().iterator(); i.hasNext();)
- {
- String prefix = (String) i.next();
- String namespace = (String) map.get(prefix);
- if (namespace != null && namespace.equals(qname.getNamespaceURI()))
- {
- String name = prefix.length() > 0 ? prefix + ":" + qname.getLocalPart() :
- qname.getLocalPart();
- list.add(name);
- }
- }
- }
- return list;
- }
-
- protected void addDefinition(Definition definition, List list)
- {
- if (definition != null)
- {
- list.add(definition);
- for (Iterator i = definition.getEImports().iterator(); i.hasNext();)
- {
- ImportImpl theImport = (ImportImpl) i.next();
- if (theImport.getLocationURI() != null && !theImport.getLocationURI().endsWith("xsd"))
- {
- theImport.importDefinitionOrSchema();
- Definition importedDefinition = (Definition) theImport.getEDefinition();
- if (importedDefinition != null && !list.contains(importedDefinition))
- {
- addDefinition(importedDefinition, list);
- }
- }
- }
- }
- }
-
- public static String getPortTypeReference(Binding binding)
- {
- String result = null;
- Element element = WSDLEditorUtil.getInstance().getElementForObject(binding);
- if (element != null)
- {
- result = element.getAttribute("type");
- }
- return result;
- }
-
- public static void setPortTypeReference(Binding binding, String portType)
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(binding);
- if (element != null)
- {
- element.setAttribute("type", portType);
- }
- }
-
- public static String getBindingReference(Port port)
- {
- String result = null;
- Element element = WSDLEditorUtil.getInstance().getElementForObject(port);
- if (element != null)
- {
- result = element.getAttribute("binding");
- }
- return result;
- }
-
- public static String getName(Binding binding)
- {
- String result = null;
- Element element = WSDLEditorUtil.getInstance().getElementForObject(binding);
- if (element != null)
- {
- result = element.getAttribute("name");
- }
- return result;
- }
-
- public static QName getPortTypeReferenceQName(Binding binding)
- {
- QName result = null;
- Definition definition = binding.getEnclosingDefinition();
- String prefixedName = getPortTypeReference(binding);
- if (prefixedName != null)
- {
- result = WSDLEditorUtil.createQName(definition, prefixedName);
- }
- return result;
- }
-
- public static QName getBindingReferenceQName(Port port)
- {
- QName result = null;
- Definition definition = port.getEnclosingDefinition();
- String prefixedName = getBindingReference(port);
- if (prefixedName != null)
- {
- result = WSDLEditorUtil.createQName(definition, prefixedName);
- }
- return result;
- }
-
- public static String getMessageReference(Input input)
- {
- return getMessageReferenceHelper(input);
- }
-
- public static String getMessageReference(Output output)
- {
- return getMessageReferenceHelper(output);
- }
-
- public static String getMessageReference(Fault fault)
- {
- return getMessageReferenceHelper(fault);
- }
-
- public static QName getMessageReferenceQName(Input input)
- {
- return getMessageReferenceQNameHelper(input);
- }
-
- public static QName getMessageReferenceQName(Output output)
- {
- return getMessageReferenceQNameHelper(output);
- }
-
- public static QName getMessageReferenceQName(Fault fault)
- {
- return getMessageReferenceQNameHelper(fault);
- }
-
- protected static String getMessageReferenceHelper(WSDLElement o)
- {
- String result = null;
- Element element = WSDLEditorUtil.getInstance().getElementForObject(o);
- if (element != null)
- {
- result = element.getAttribute("message");
- }
- return result;
- }
-
- public static QName getMessageReferenceQNameHelper(WSDLElement o)
- {
- QName result = null;
- Definition definition = o.getEnclosingDefinition();
- String prefixedName = getMessageReferenceHelper(o);
- if (prefixedName != null)
- {
- result = WSDLEditorUtil.createQName(definition, prefixedName);
- }
- return result;
- }
-
- public static void updatePortTypeReferences(Definition definition)
- {
- for (Iterator i = definition.getBindings().values().iterator(); i.hasNext();)
- {
- Binding binding = (Binding) i.next();
- QName qname = ComponentReferenceUtil.getPortTypeReferenceQName(binding);
-
- PortType portType = (qname != null) ? (PortType) definition.getPortType(qname) : null;
-
- if (binding.getPortType() != portType)
- {
- binding.setPortType(portType);
- }
- }
- }
-
- public static void updateBindingReferences(Definition definition)
- {
- for (Iterator i = definition.getServices().values().iterator(); i.hasNext();)
- {
- Service service = (Service) i.next();
- for (Iterator j = service.getEPorts().iterator(); j.hasNext();)
- {
- Port port = (Port) j.next();
- QName qname = ComponentReferenceUtil.getBindingReferenceQName(port);
-
- Binding binding = (qname != null) ? (Binding) definition.getBinding(qname) : null;
-
- if (port.getBinding() != binding)
- {
- port.setBinding(binding);
- }
- }
- }
- }
-
- public static void updateMessageReferences(Definition definition)
- {
- // for each port type
- //
- for (Iterator i = definition.getPortTypes().values().iterator(); i.hasNext();)
- {
- PortType portType = (PortType) i.next();
-
- // for each operation
- //
- for (Iterator j = portType.getEOperations().iterator(); j.hasNext();)
- {
- Operation operation = (Operation) j.next();
-
- // handle Input
- //
- Input input = (Input) operation.getInput();
- if (input != null)
- {
- QName qname = ComponentReferenceUtil.getMessageReferenceQName(input);
- Message message = (qname != null) ? (Message) definition.getMessage(qname) : null;
- if (input.getMessage() != message)
- {
- input.setMessage(message);
- }
- }
-
- // handle Output
- //
- Output output = (Output) operation.getOutput();
- if (output != null)
- {
- QName qname = ComponentReferenceUtil.getMessageReferenceQName(output);
- Message message = (qname != null) ? (Message) definition.getMessage(qname) : null;
- if (output.getMessage() != message)
- {
- output.setMessage(message);
- }
- }
-
- // handle Faults
- //
- for (Iterator k = operation.getEFaults().iterator(); k.hasNext();)
- {
- Fault fault = (Fault) k.next();
-
- QName qname = ComponentReferenceUtil.getMessageReferenceQName(fault);
- Message message = (qname != null) ? (Message) definition.getMessage(qname) : null;
- if (fault.getMessage() != message)
- {
- fault.setMessage(message);
- }
- }
- }
- }
- }
-
- public static void updateSchemaReferences(Definition definition)
- {
- for (Iterator i = definition.getEMessages().iterator(); i.hasNext();)
- {
- Message message = (Message) i.next();
- for (Iterator j = message.getEParts().iterator(); j.hasNext();)
- {
- Part part = (Part) j.next();
- Element element = WSDLEditorUtil.getInstance().getElementForObject(part);
- if (element != null)
- {
- ((WSDLElementImpl)part).elementChanged(element);
- }
- }
- }
- }
-
- public static Operation getOperation(PortType portType, BindingOperation bindingOperation)
- {
- Operation result = null;
- for (Iterator i = portType.getEOperations().iterator(); i.hasNext();)
- {
- Operation operation = (Operation) i.next();
- if (isMatchingBinding(operation, bindingOperation))
- {
- result = operation;
- break;
- }
- }
- return result;
- }
-
- public static void updateOperationReference(BindingOperation bindingOperation)
- {
- Operation operation = computeOperation(bindingOperation);
- if (operation != bindingOperation.getOperation())
- {
- bindingOperation.setOperation(operation);
- }
- }
-
- public List getComponentNameList(boolean isType)
- {
- List result = Collections.EMPTY_LIST;
- ITypeSystemProvider typeSystemProvider = WSDLEditorUtil.getInstance().getTypeSystemProvider(rootDefinition);
- if (typeSystemProvider != null)
- {
- result = isType ? typeSystemProvider.getAvailableTypeNames(rootDefinition, 0) : typeSystemProvider.getAvailableElementNames(rootDefinition);
- }
- return result;
- }
-
- public static List getComponentNameList(Part part, boolean isType)
- {
- List result = Collections.EMPTY_LIST;
- Definition definition = part.getEnclosingDefinition();
- ITypeSystemProvider typeSystemProvider = WSDLEditorUtil.getInstance().getTypeSystemProvider(definition);
- if (typeSystemProvider != null)
- {
- result = isType ? typeSystemProvider.getAvailableTypeNames(definition, 0) : typeSystemProvider.getAvailableElementNames(definition);
- }
- return result;
- }
-
- public static boolean isType(Part part)
- {
- //Element element = WSDLEditorUtil.getInstance().getElementForObject(part);
- Element element = part.getElement();
- return !element.hasAttribute("element");
- }
-
- public static String getPartComponentReference(Part part)
- {
- //Element element = WSDLEditorUtil.getInstance().getElementForObject(part);
- Element element = part.getElement();
- String result = null;
- if (element.hasAttribute("type"))
- {
- result = element.getAttribute("type");
- }
- else if (element.hasAttribute("element"))
- {
- result = element.getAttribute("element");
- }
- return result;
- }
-
- public static void setComponentReference(Part part, boolean isType, String componentName)
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(part);
- String newAttribute = isType ? "type" : "element";
- String oldAttribute = isType ? "element" : "type";
- element.removeAttribute(oldAttribute);
-
- String value = componentName != null ? componentName : element.getAttribute(newAttribute);
-
- if (value == null)
- {
- if (isType)
- {
- String xsdPrefix = part.getEnclosingDefinition().getPrefix(WSDLConstants.XSD_NAMESPACE_URI);
- value = "string";
- if (xsdPrefix != null && xsdPrefix.length() > 0)
- {
- value = xsdPrefix + ":" + value;
- }
- }
- else
- {
- List list = getComponentNameList(part, isType);
- value = list.size() > 0 ? (String) list.get(0) : "some-element-name";
- }
- }
- element.setAttribute(newAttribute, value);
- }
-
- public static Operation computeOperation(BindingOperation bindingOperation)
- {
- Operation result = null;
- Binding binding = (Binding) bindingOperation.eContainer();
- PortType portType = (PortType) binding.getPortType();
- if (portType != null)
- {
- result = getOperation(portType, bindingOperation);
- }
- return result;
- }
-
- public static Input computeInput(BindingInput bindingInput)
- {
- Operation operation = computeOperation((BindingOperation) bindingInput.eContainer());
- return operation != null ? operation.getEInput() : null;
- }
-
- public static Output computeOutput(BindingOutput bindingOutput)
- {
- Operation operation = computeOperation((BindingOperation) bindingOutput.eContainer());
- return operation != null ? operation.getEOutput() : null;
- }
-
- public static Fault computeFault(BindingFault bindingFault)
- {
- Fault result = null;
- Operation operation = computeOperation((BindingOperation) bindingFault.eContainer());
- if (operation != null)
- {
- for (Iterator i = operation.getEFaults().iterator(); i.hasNext();)
- {
- Fault fault = (Fault) i.next();
- String faultName = fault.getName();
- if (faultName != null && faultName.equals(bindingFault.getName()))
- {
- result = fault;
- break;
- }
- }
- }
- return result;
- }
-
- public static String getPartReferenceValue(Part part)
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(part);
- String value = null;
- if (element != null)
- {
- if (element.hasAttribute("type"))
- {
- value = element.getAttribute("type");
- }
- else if (element.hasAttribute("element"))
- {
- value = element.getAttribute("element");
- }
- }
- return value != null ? value : "";
- }
-
- public Operation getBindingOperation(Element bindingOperationContent)
- {
- Operation operation = null;
- Node parent = bindingOperationContent.getParentNode();
- if (parent instanceof Element)
- {
- Object object = WSDLEditorUtil.getInstance().findModelObjectForElement(rootDefinition, (Element) parent);
- if (object instanceof BindingOperation)
- {
- operation = ComponentReferenceUtil.computeOperation((BindingOperation) object);
- }
- }
- return operation;
- }
-
- public Message getBindingOperationInputMessage(Element bindingOperationContent)
- {
- Message message = null;
- Operation operation = getBindingOperation(bindingOperationContent);
- if (operation != null)
- {
- Input input = operation.getEInput();
- if (input != null)
- {
- message = input.getEMessage();
- }
- }
- return message;
- }
-
- public Message getBindingOperationOutputMessage(Element bindingOperationContent)
- {
- Message message = null;
- Operation operation = getBindingOperation(bindingOperationContent);
- if (operation != null)
- {
- Output output = operation.getEOutput();
- if (output != null)
- {
- message = output.getEMessage();
- }
- }
- return message;
- }
-
- public static String computeRelativeURI(IFile referencedLocation, IFile baseLocation, boolean enableIEStyleReferences)
- {
- // TODO... we need some extension to allow IE folks to plugin logic to create an 'IE' style path
- // TODO... consider using URI class in EMF
- return URIHelper.getRelativeURI(referencedLocation.getLocation(), baseLocation.getLocation());
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/CreateWSDLElementHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/CreateWSDLElementHelper.java
deleted file mode 100644
index ce28653..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/CreateWSDLElementHelper.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.w3c.dom.Element;
-
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddBindingCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddFaultCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddInputCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddMessageCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOperationCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddOutputCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddPartCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddPortCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddPortTypeCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddServiceCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddXSDElementDeclarationCommand;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.internal.impl.MessageReferenceImpl;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.format.FormatProcessorXML;
-
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDElementDeclaration;
-
-public class CreateWSDLElementHelper {
- // Constants used for getting Part information
- public static final String PART_INFO_ELEMENT_DECLARATION = "ELEMENT_DECLARATION";
- public static final String PART_INFO_TYPE_DEFINITION = "TYPE_DEFINITION";
-
- // The following variables should be set if a name other than the computed name is to be used.
- public static String serviceName = null;
- public static String portName = null;
- public static String bindingName = null;
- public static String portTypeName = null;
- public static String operationName = null;
- public static String inputName = null;
- public static String outputName = null;
- public static String faultName = null;
- public static String messageName = null;
- public static String partName = null;
-
- public static String PART_TYPE_OR_DEFINITION = PART_INFO_TYPE_DEFINITION;
- public static boolean CREATE_DOWN_TO_PART = true;
-
-/*
- * The following methods creates the 'specified' (by calling a certain method) WSDLElement
- * and it's 'children' all the way to the PortType level.
- */
- public static Service createService(Definition definition) {
- if (serviceName == null || serviceName.trim().equals(""))
- serviceName = NameUtil.buildUniqueServiceName(definition);
-
- CreateWSDLElementHelper.portTypeName = serviceName;
-
- AddServiceCommand addService = new AddServiceCommand(definition, serviceName, false);
- addService.run();
- Service service = (Service) addService.getWSDLElement();
- Port port = CreateWSDLElementHelper.createPort(service);
-
- return service;
- }
-
- public static Port createPort(Service service) {
- if (portName == null || portName.trim().equals(""))
- portName = NameUtil.buildUniquePortName(service, null);
-
- AddPortCommand addPort = new AddPortCommand(service, portName);
- addPort.run();
- Port port = (Port) addPort.getWSDLElement();
- Binding binding = CreateWSDLElementHelper.createBinding(port.getEnclosingDefinition(), port);
-
- port.setBinding(binding);
-
- return port;
- }
-
- public static Binding createBinding(Definition definition, Port port) {
- bindingName = port.getName();
- if (bindingName == null || bindingName.trim().equals(""))
- bindingName = NameUtil.buildUniqueBindingName(definition, null);
-
- AddBindingCommand addBinding = new AddBindingCommand(definition, bindingName);
- addBinding.run();
- Binding binding = (Binding) addBinding.getWSDLElement();
- PortType portType = CreateWSDLElementHelper.createPortType(binding.getEnclosingDefinition());
-
- binding.setPortType(portType);
-
- return binding;
- }
-
- public static PortType createPortType(Definition definition) {
- if (portTypeName == null || portTypeName.trim().equals(""))
- portTypeName = NameUtil.buildUniquePortTypeName(definition, "PortType");
-
- AddPortTypeCommand addPortTypeCommand = new AddPortTypeCommand(definition, portTypeName);
- addPortTypeCommand.run();
- PortType portType = (PortType) addPortTypeCommand.getWSDLElement();
-
- if (CREATE_DOWN_TO_PART) {
- CreateWSDLElementHelper.createOperation(portType);
- }
-
- return portType;
- }
-
-
-/*
- * The following methods creates the 'specified' (by calling a certain method) WSDLElement
- * and it's 'children' all the way to the Part level.
- */
- public static Operation createOperation(PortType portType) {
- if (operationName == null || operationName.trim().equals(""))
- operationName = NameUtil.buildUniqueOperationName(portType);
-
- Definition def = portType.getEnclosingDefinition();
- AddOperationCommand action = new AddOperationCommand(portType, operationName);
- action.run();
- Operation operation = (Operation) action.getWSDLElement();
- Output output = CreateWSDLElementHelper.createOutput(portType, operation);
- Input input = CreateWSDLElementHelper.createInput(portType, operation, null);
-
-// ((PortTypeImpl) portType).updateElement(false);
- return operation;
- }
-
- public static Input createInput(PortType portType, Operation operation, String inputName) {
- if (inputName == null || inputName.trim().equals(""))
- inputName = NameUtil.buildUniqueInputName(portType, operation.getName(), "");
-
- Definition def = operation.getEnclosingDefinition();
- AddInputCommand action = new AddInputCommand(operation, inputName);
- action.run();
- Input input = (Input) action.getWSDLElement();
- Message mess = CreateWSDLElementHelper.createMessage(input);
- input.setMessage(mess);
-
- return input;
- }
-
- public static Output createOutput(PortType portType, Operation operation) {
- if (outputName == null || outputName.trim().equals(""))
- outputName = NameUtil.buildUniqueOutputName(portType, operation.getName(), "");
-
- Definition def = operation.getEnclosingDefinition();
- AddOutputCommand action = new AddOutputCommand(operation, outputName);
- action.run();
- Output output = (Output) action.getWSDLElement();
- Message mess = CreateWSDLElementHelper.createMessage(output);
- output.setMessage(mess);
-
- return output;
- }
-
- public static Fault createFault(Operation operation) {
- if (faultName == null || faultName.trim().equals(""))
- faultName = NameUtil.buildUniqueFaultName(operation);
-
- Definition def = operation.getEnclosingDefinition();
- AddFaultCommand action = new AddFaultCommand(operation, faultName);
- action.run();
- Fault fault = (Fault) action.getWSDLElement();
- Message mess = CreateWSDLElementHelper.createMessage(fault);
- fault.setMessage(mess);
-
- return fault;
- }
-
- public static Message createMessage(MessageReference iof) {
- if (messageName == null || messageName.trim().equals(""))
- messageName = NameUtil.buildUniqueMessageName(iof.getEnclosingDefinition(), iof);
-// messageName = NameUtil.buildMessageName(iof.getName());
-
- Definition def = iof.getEnclosingDefinition();
- AddMessageCommand action = new AddMessageCommand(def, messageName);
- action.run();
- Message message = (Message) action.getWSDLElement();
- Part part = CreateWSDLElementHelper.createPart(message);
- Element parentNode = message.getElement();
- if (parentNode instanceof XMLNode)
- {
- // format selected node
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((XMLNode)parentNode);
- }
-
- messageName = null;
- return message;
- }
-
- public static Part createPart(Message message) {
- Definition def = message.getEnclosingDefinition();
- String name = NameUtil.buildUniquePartName(message, message.getQName().getLocalPart());
- AddPartCommand action = null;
-
- if (PART_TYPE_OR_DEFINITION == PART_INFO_TYPE_DEFINITION) {
- action = new AddPartCommand(message, name, WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string", true);
- }
- else if (PART_TYPE_OR_DEFINITION == PART_INFO_ELEMENT_DECLARATION) {
- //action = new AddPartCommand(message, name, WSDLConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string", true);
- String elementName = getNewNameHelper(name, def, false);
- AddXSDElementDeclarationCommand elementAction = new AddXSDElementDeclarationCommand(def, elementName);
- elementAction.run();
- action = new AddPartCommand(message, name, def.getTargetNamespace(), elementName, false);
- }
-
- action.run();
-
- return (Part) action.getWSDLElement();
- }
-
- /*
- * Used to determine a name for an Element
- */
- private static String getNewNameHelper(String base, Definition def, boolean isType)
- {
- String name = base;
- int count = 0;
-
- // Ugly.... Redo this...
- // Get a list of Elements...
- List elementList = null;
- if (def.getETypes() != null) {
- List xsdsList = def.getETypes().getEExtensibilityElements();
- if (xsdsList != null) {
- Iterator xsdsIterator = xsdsList.iterator();
- XSDSchemaExtensibilityElement xsdElement = (XSDSchemaExtensibilityElement) xsdsIterator.next();
- XSDSchema schema = xsdElement.getSchema();
- if (schema != null) {
- elementList = schema.getElementDeclarations();
- }
- }
- }
-
- if (elementList != null) {
- int index = 0;
- while (index < elementList.size()) {
- XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) elementList.get(index);
-
- if (name.equals(elementDeclaration.getName())) {
- count++;
- name = name + count;
- index = 0;
- }
- else {
- index++;
- }
- }
- }
-
- return name;
- }
-
- /*
- * Return the type of Part this WSDLElement should have (Element vs Type). To determine this, we filter up to the 'parent' PortType
- * and go down to the first Part we encounter and check the type it has. If this fails, default to Type.
- */
- public static String getPartInfo(WSDLElement element) {
- String partInfo = null;
-
- if (element instanceof PortType) {
- partInfo = getPartInfo((PortType) element);
- }
- else if (element instanceof Operation) {
- partInfo = getPartInfo(((WSDLElementImpl) element).getContainer());
- }
- else if (element instanceof MessageReferenceImpl) {
- partInfo = getPartInfo(((WSDLElementImpl) element).getContainer());
- }
-
- if (partInfo == null) {
- partInfo = CreateWSDLElementHelper.PART_INFO_TYPE_DEFINITION;
- }
-
- return partInfo;
- }
-
- private static String getPartInfo(PortType portType) {
- String partInfo = null;
-
- if (portType.getOperations() != null) {
- Iterator operationIt = portType.getOperations().iterator();
- while (operationIt.hasNext()) {
- Operation op = (Operation) operationIt.next();
-
- if (op.getEInput() != null) {
- partInfo = getMessageRefPartInfo((MessageReferenceImpl) op.getEInput());
- }
-
- if (partInfo == null && op.getEOutput() != null) {
- partInfo = getMessageRefPartInfo((MessageReferenceImpl) op.getEOutput());
- }
-
- if (op.getEFaults() != null) {
- Iterator faultIt = op.getEFaults().iterator();
- while (partInfo == null && faultIt.hasNext()) {
- Fault fault = (Fault) faultIt.next();
- partInfo = getMessageRefPartInfo((MessageReferenceImpl) fault);
- }
- }
-
- if (partInfo != null)
- break;
- }
- }
-
- return partInfo;
- }
-
- private static String getMessageRefPartInfo(MessageReferenceImpl iof) {
- String partInfo = null;
-
- if (iof.getEMessage() != null && iof.getEMessage().getEParts() != null) {
- Iterator partIt = iof.getEMessage().getEParts().iterator();
-
- while (partInfo == null && partIt.hasNext()) {
- Part part = (Part) partIt.next();
-
- if (part.getTypeDefinition() != null) {
- partInfo = CreateWSDLElementHelper.PART_INFO_TYPE_DEFINITION;
- }
- else if (part.getElementDeclaration() != null) {
- partInfo = CreateWSDLElementHelper.PART_INFO_ELEMENT_DECLARATION;
- }
- }
- }
-
- return partInfo;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/NameUtil.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/NameUtil.java
deleted file mode 100644
index 1778c8c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/NameUtil.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-
-public class NameUtil
-{
- /**
- * Return a name which is not used by any other fault in the operation.
- * @return String
- */
- public static String buildUniqueFaultName(Operation operation)
- {
- return buildUniqueFaultName(operation, "NewFault");
- }
-
- public static String buildUniqueFaultName(Operation operation, String baseName) {
- if (baseName == null)
- baseName = "NewFault";
-
- List names = getUsedFaultNames(operation);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper(baseName, names);
- }
-
- /**
- * Return a name which is not used by any other input in the portType. Returned name will be of the form:
- * <operationName> + <ending> [+ unique Integer]
- * @return String
- */
- public static String buildUniqueInputName(PortType portType, String operationName, String ending)
- {
- String name = null;
- String candidate = operationName + ending;
-
- int i = 0;
-
- // loop until we find a unique name (the name will consist of the operationName + ending + an integer)
- while (name == null)
- {
- boolean unique = true;
-
- // determine if this combination is unique within the current porttype
- for (Iterator it = portType.getEOperations().iterator(); it.hasNext() && unique;)
- {
- Operation current = (Operation) it.next();
- // TODO : port check
- // old if(current.isSetEInput() && current.getEInput().isSetName()) {
- if (current.getEInput() != null && current.getEInput().getName() != null)
- {
- if (current.getEInput().getName().equals(candidate))
- unique = false;
- }
- }
- if (unique)
- name = candidate;
- else
- candidate = operationName + ending + i;
- i++;
- }
- return name;
- }
-
- /**
- * Return a name which is not used by any other message in the definition.
- * @return String
- */
- public static String buildUniqueMessageName(Definition definition, String baseName)
- {
- if (baseName == null)
- {
- baseName = "NewMessage";
- }
-
- List names = getUsedMessageNames(definition);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper(baseName, names);
- }
-
- /**
- * Return a name which is not used by any other operation in the port type.
- * @return String
- */
- public static String buildUniqueOperationName(PortType portType)
- {
- return buildUniqueOperationName(portType, "NewOperation");
- }
-
- public static String buildUniqueOperationName(PortType portType, String baseName)
- {
- if (baseName == null) {
- baseName = "NewOperation";
- }
-
- List names = getUsedOperationNames(portType);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper(baseName, names);
- }
-
- /**
- * Return a name which is not used by any other output in the portType. Returned name will be of the form:
- * <operationName> + <ending> [+ unique Integer]
- * @return String
- */
- public static String buildUniqueOutputName(PortType portType, String operationName, String ending)
- {
- String name = null;
- String candidate = operationName + ending;
-
- int i = 0;
-
- // loop until we find a unique name (the name will consist of the operationName + ending + an integer)
- while (name == null)
- {
- boolean unique = true;
-
- // determine if this combination is unique within the current porttype
- for (Iterator it = portType.getEOperations().iterator(); it.hasNext() && unique;)
- {
- Operation current = (Operation) it.next();
- // TODO: port check
- // old if(current.isSetEOutput() && current.getEOutput().isSetName()) {
- if (current.getEOutput() != null && current.getEOutput().getName() != null)
- {
- if (current.getEOutput().getName().equals(candidate))
- unique = false;
- }
- }
- if (unique)
- name = candidate;
- else
- candidate = operationName + ending + i;
- i++;
- }
- return name;
- }
-
- /**
- * Return a name which is not used by any other part in the message.
- * @return String
- */
- public static String buildUniquePartName(Message message)
- {
- List names = getUsedPartNames(message);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper("NewPart", names);
- }
-
- public static String buildUniquePartName(Message message, String baseName)
- {
- if (baseName == null)
- {
- baseName = "NewPart";
- }
-
- List names = getUsedPartNames(message);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper(baseName, names);
- }
-
- /**
- * Return a name which is not used by any other port type in the definition.
- * @return String
- */
- public static String buildUniquePortTypeName(Definition definition, String baseName)
- {
- if (baseName == null)
- {
- baseName = "NewPortType";
- }
-
- List names = getUsedPortTypeNames(definition);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper(baseName, names);
- }
-
- public static String getUniqueNameHelper(String baseName, List names)
- {
- int i = 0;
-
- String name = baseName;
- while (true)
- {
- if (!names.contains(name))
- {
- break;
- }
- i++;
- name = baseName + i;
- }
-
- return name;
- }
-
- /**
- * Return a name which is not used by any other service in the definition.
- * @return String
- */
- public static String buildUniqueServiceName(Definition definition)
- {
- List names = getUsedServiceNames(definition);
-
- // Now search the list until we find an unused name
- return getUniqueNameHelper("NewService", names);
- }
-
- /**
- * Return a name which is not used by any other binding in the definition.
- * @return String
- */
- public static String buildUniqueBindingName(Definition definition, String baseName)
- {
- if (baseName == null)
- {
- baseName = "NewBinding";
- }
-
- List names = getUsedBindingNames(definition);
-
- return getUniqueNameHelper(baseName, names);
- }
-
- public static String buildUniquePrefix(Definition definition, String basePrefix)
- {
- String prefix = basePrefix;
- for (int i = 1; definition.getNamespace(prefix) != null; i++)
- {
- prefix = basePrefix + i;
- }
- return prefix;
- }
-
- public static String buildUniquePortName(Service service, String baseName)
- {
- if (baseName == null)
- {
- baseName = "NewPort";
- }
-
- List names = getUsedPortNames(service);
-
- return getUniqueNameHelper(baseName, names);
- }
-
- public static String buildUniqueMessageName(Definition definition, MessageReference messRef)
- {
- String name = null;
- if (messRef instanceof Input)
- {
- name = createOperationName(messRef, "Request");
- }
- else if (messRef instanceof Output)
- {
- name = createOperationName(messRef, "Response");
- }
- else if (messRef instanceof Fault)
- {
- String faultName = ((Fault) messRef).getName();
- if (faultName == null || faultName.length() == 0)
- {
- faultName = "Fault";
- }
- name = createOperationName(messRef, faultName);
- }
-
- return NameUtil.buildUniqueMessageName(definition, name);
- }
-
-
- public static List getUsedFaultNames(Operation operation) {
- ArrayList names = new ArrayList();
- for (Iterator i = operation.getEFaults().iterator(); i.hasNext();)
- {
- Fault fault = (Fault) i.next();
- names.add(fault.getName());
- }
-
- return names;
- }
-
- public static List getUsedOperationNames(PortType portType) {
- ArrayList names = new ArrayList();
- for (Iterator i = portType.getEOperations().iterator(); i.hasNext();)
- {
- Operation op = (Operation) i.next();
- names.add(op.getName());
- }
-
- return names;
- }
-
- public static List getUsedPartNames(Message message) {
- ArrayList names = new ArrayList();
- for (Iterator i = message.getEParts().iterator(); i.hasNext();)
- {
- Part part = (Part) i.next();
- names.add(part.getName());
- }
- return names;
- }
-
- public static List getUsedPortTypeNames(Definition definition) {
- ArrayList names = new ArrayList();
- for (Iterator i = definition.getEPortTypes().iterator(); i.hasNext();)
- {
- PortType portType = (PortType) i.next();
- // TODO: port check
- // if (portType.isSetQName())
- if (portType.getQName() != null)
- {
- names.add(portType.getQName().getLocalPart());
- }
- }
-
- return names;
-
- }
- public static List getUsedServiceNames(Definition definition) {
- // First build a list of names already used
- ArrayList names = new ArrayList();
- for (Iterator i = definition.getEServices().iterator(); i.hasNext();)
- {
- Service service = (Service) i.next();
- // TODO: port check
- // if(service.isSetQName())
- if (service.getQName() != null)
- names.add(service.getQName().getLocalPart());
- }
-
- return names;
- }
-
- public static List getUsedMessageNames(Definition definition) {
- ArrayList names = new ArrayList();
- for (Iterator i = definition.getEMessages().iterator(); i.hasNext();)
- {
- Message msg = (Message) i.next();
- // TODO: port check
- if (msg.getQName() != null)
- // if(msg.isSetQName())
- names.add(msg.getQName().getLocalPart());
- }
-
- return names;
- }
-
- public static List getUsedBindingNames(Definition definition) {
- ArrayList names = new ArrayList();
- for (Iterator i = definition.getEBindings().iterator(); i.hasNext();)
- {
- Binding binding = (Binding) i.next();
- // TODO: port check
- // if (binding.isSetQName())
- if (binding.getQName() != null)
- {
- names.add(binding.getQName().getLocalPart());
- }
- }
-
- return names;
- }
-
- public static List getUsedPortNames(Service service) {
- // First build a list of names already used
- ArrayList names = new ArrayList();
- for (Iterator i = service.getEPorts().iterator(); i.hasNext();)
- {
- Port port = (Port) i.next();
-
- if (port.getName() != null)
- {
- names.add(port.getName());
- }
- }
-
- return names;
- }
-
- private static String createOperationName(Object object, String suffix)
- {
- String result = null;
- if (object instanceof EObject)
- {
- EObject parent = ((EObject)object).eContainer();
- if (parent instanceof Operation)
- {
- result = ((Operation)parent).getName();
- }
- }
- if (result != null)
- {
- result += suffix;
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/NodeAssociationManager.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/NodeAssociationManager.java
deleted file mode 100644
index 2c5e954..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/NodeAssociationManager.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.INodeAssociationProvider;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtensionRegistry;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class NodeAssociationManager
-{
- protected WSDLEditorExtension[] extensions;
- protected INodeAssociationProvider[] providers;
-
- public NodeAssociationManager()
- {
- WSDLEditorExtensionRegistry registry = WSDLEditorPlugin.getInstance().getWSDLEditorExtensionRegistry();
- extensions = registry.getRegisteredExtensions(WSDLEditorExtension.NODE_ASSOCIATION_PROVIDER);
- providers = new INodeAssociationProvider[extensions.length];
- for (int i = 0; i < extensions.length; i++)
- {
- providers[i] = (INodeAssociationProvider)extensions[i].createExtensionObject(WSDLEditorExtension.NODE_ASSOCIATION_PROVIDER, null);
- }
- }
-
- protected INodeAssociationProvider getAppicableProvider(Object object)
- {
- INodeAssociationProvider provider = null;
- for (int i = 0; i < extensions.length; i++)
- {
- if (extensions[i].isApplicable(object))
- {
- provider = providers[i];
- if (provider != null)
- {
- break;
- }
- }
- }
- return provider;
- }
-
-
- public Object getModelObjectForNode(Object rootObject, Element targetNode)
- {
- int currentIndex = 0;
-
- Element[] elementChain = getParentElementChain((Element)targetNode);
-
- INodeAssociationProvider p = getAppicableProvider(rootObject);
- if (p != null)
- {
- Node rootObjectNode = p.getNode(rootObject);
-
- while (currentIndex < elementChain.length)
- {
- Element e = elementChain[currentIndex];
- if (e == rootObjectNode)
- {
- currentIndex++;
- break;
- }
- currentIndex++;
- }
- }
-
- Object currentObject = rootObject;
- int end[] = new int[1];
-
- while (currentIndex < elementChain.length)
- {
- p = getAppicableProvider(currentObject);
- if (p != null)
- {
- end[0] = elementChain.length;
- currentObject = p.getModelObject(currentObject, elementChain, currentIndex, end);
-
- if (currentObject == null)
- {
- // failure
- break;
- }
- else
- {
- currentIndex = Math.max(end[0], currentIndex + 1);
- }
- }
- else
- {
- break;
- }
- }
-
- return (currentIndex == elementChain.length) ? currentObject : null;
- }
-
-
- public Node getNode(Object modelObject)
- {
- Node result = null;
- if (modelObject instanceof Node)
- {
- result = (Node)modelObject;
- }
- else
- {
- INodeAssociationProvider p = getAppicableProvider(modelObject);
- if (p != null)
- {
- result = p.getNode(modelObject);
- }
- }
- return result;
- }
-
- protected Element[] getParentElementChain(Element element)
- {
- List list = new ArrayList();
- while (element != null)
- {
- list.add(0, element);
- Node node = element.getParentNode();
- element = (node != null && node.getNodeType() == Node.ELEMENT_NODE) ? (Element)node : null;
- }
-
- int listSize = list.size();
- Element[] result = new Element[listSize];
- for (int i = 0; i < listSize; i++)
- {
- result[i] = (Element)list.get(i);
- }
- return result;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/OpenOnSelectionHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/OpenOnSelectionHelper.java
deleted file mode 100644
index 160a69e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/OpenOnSelectionHelper.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import java.lang.reflect.Method;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.INavigationLocation;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.internal.impl.ImportImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class OpenOnSelectionHelper extends WSDLSwitch
-{
- Definition definition;
- Attr attr = null;
- Element element = null;
-
- public OpenOnSelectionHelper(Definition definition)
- {
- this.definition = definition;
- }
-
- public void openEditor(EObject eObject)
- {
- String[] array = computeSpecification(eObject);
- if (array != null)
- {
- openEditor(array[0], array[1]);
- }
- }
-
- public void openEditor(Node node)
- {
- String[] array = computeSpecification(node);
- if (array != null)
- {
- openEditor(array[0], array[1]);
- }
- }
-
- protected void openEditor(String resource, String spec)
- {
- String pattern = "platform:/resource";
- if (resource != null && resource.startsWith(pattern))
- {
- try
- {
- Path path = new Path(resource.substring(pattern.length()));
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-
- IWorkbenchPage workbenchPage = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editorPart = workbenchPage.getActiveEditor();
-
- if (editorPart.getEditorInput() instanceof IFileEditorInput &&
- ((IFileEditorInput)editorPart.getEditorInput()).getFile().equals(file))
- {
- INavigationLocation current = workbenchPage.getNavigationHistory().getCurrentLocation();
- workbenchPage.getNavigationHistory().markLocation(editorPart);
- }
- else
- {
- try
- {
- if (resource.endsWith("xsd"))
- {
- editorPart = workbenchPage.openEditor(new FileEditorInput(file), WSDLEditorPlugin.XSD_EDITOR_ID);
- }
- else
- {
- // Since we are already in the wsdleditor
- editorPart = workbenchPage.openEditor(new FileEditorInput(file), editorPart.getEditorSite().getId());
- }
- }
- catch (PartInitException initEx)
- {
- }
- }
-
- Class theClass = editorPart.getClass();
- Class[] methodArgs = { String.class };
- Method method = theClass.getMethod("openOnSelection", methodArgs);
- Object args[] = { spec };
- method.invoke(editorPart, args);
- workbenchPage.getNavigationHistory().markLocation(editorPart);
- }
- catch (Exception e)
- {
- }
- }
- }
-
- public String[] computeSpecification(EObject eObject)
- {
- String[] result = null;
- Object referencedObject = doSwitch(eObject);
- if (referencedObject instanceof EObject)
- {
- EObject referencedEObject = (EObject)referencedObject;
- if (referencedEObject != eObject ||
- referencedEObject.eResource() != definition.eResource())
- {
-
- Resource resource = referencedEObject.eResource();
- if (resource != null)
- {
- result = new String[2];
- result[0] = resource.getURI().toString();
- result[1] = resource.getURIFragment(referencedEObject);
- }
- }
- }
- return result;
- }
-
- public String[] computeSpecification(Node node)
- {
- String[] result = null;
- switch (node.getNodeType())
- {
- case Node.ELEMENT_NODE :
- {
- element = (Element)node;
- break;
- }
- case Node.ATTRIBUTE_NODE :
- {
- attr = (Attr)node;
- element = attr.getOwnerElement();
- break;
- }
- case Node.TEXT_NODE :
- {
- Node parent = node.getParentNode();
- element = (parent instanceof Element) ? (Element)parent : null;
- break;
- }
- }
- if (element != null)
- {
- Object object = WSDLEditorUtil.getInstance().findModelObjectForElement(definition, element);
- if (object instanceof EObject)
- {
- result = computeSpecification((EObject)object);
- }
- }
- return result;
- }
-
- public Object caseBinding(Binding binding)
- {
- Object result = binding;
- if (isMatchingAttribute(WSDLConstants.TYPE_ATTRIBUTE))
- {
- result = binding.getEPortType();
- }
- return result;
- }
-
- public Object caseDefinition(Definition definition)
- {
- return definition;
- }
-
- public Object casePart(Part part)
- {
- Object result = part;
- if (attr != null)
- {
- if (isMatchingAttribute(WSDLConstants.TYPE_ATTRIBUTE))
- {
- result = part.getTypeDefinition();
- }
- else if (isMatchingAttribute(WSDLConstants.ELEMENT_ATTRIBUTE))
- {
- result = part.getElement();
- }
- }
- else if (part.getEnclosingDefinition() == definition)
- {
- result = part.getTypeDefinition() != null ? (Object)part.getTypeDefinition() : (Object)part.getElement();
- }
- return result;
- }
-
- public Object casePort(Port port)
- {
- Object result = port;
- if (isMatchingAttribute(WSDLConstants.BINDING_ATTRIBUTE))
- {
- result = port.getEBinding();
-
- }
- return result;
- }
-
- public Object caseFault(Fault fault)
- {
- Object result = fault;
- if (isMatchingAttribute(WSDLConstants.MESSAGE_ATTRIBUTE))
- {
- result = fault.getMessage();
- }
- return result;
- }
-
- public Object caseInput(Input input)
- {
- Object result = input;
- if (isMatchingAttribute(WSDLConstants.MESSAGE_ATTRIBUTE))
- {
- result = input.getMessage();
- }
- return result;
- }
-
- public Object caseOutput(Output output)
- {
- Object result = output;
-
- if (isMatchingAttribute(WSDLConstants.MESSAGE_ATTRIBUTE))
- {
- result = output.getMessage();
- }
- return result;
- }
-
- public Object caseImport(Import theImport)
- {
- Object result = theImport.getEDefinition();
- if (result == null)
- {
- result = theImport.getESchema();
- if (result == null)
- {
- // Need to resolve imports because the model doesn't automatically
- // do it for us
- ((ImportImpl)theImport).importDefinitionOrSchema();
- result = theImport.getESchema();
- }
- }
- return result;
- }
-
- public Object caseWSDLElement(WSDLElement wsdlElement)
- {
- return wsdlElement;
- }
-
- private boolean isMatchingAttribute(String value)
- {
- return attr != null && value.equals(attr.getName());
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ReferenceManager.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ReferenceManager.java
deleted file mode 100644
index 96607ef..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ReferenceManager.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLPackage;
-import org.eclipse.wst.wsdl.internal.util.WSDLSwitch;
-
-
-public class ReferenceManager
-{
- protected static InternalAdapterFactory internalAdapterFactory = new InternalAdapterFactory();
-
-
- public interface Listener
- {
- public void bindingsChanged( Operation operation);
- }
-
-
- public static void adaptDefinition(Definition definition)
- {
- internalAdapterFactory.adapt(definition);
- for (Iterator i = definition.getEBindings().iterator(); i.hasNext(); )
- {
- Binding binding = (Binding)i.next();
- internalAdapterFactory.adaptBinding(binding);
- }
- }
-
-
- public static void addBindingListener(Operation operation, Listener listener)
- {
- OperationAdapter adapter = (OperationAdapter)internalAdapterFactory.adapt(operation);
- if (adapter != null)
- {
- adapter.addListener(listener);
- }
- }
-
-
- public static void removeBindingListener(Operation operation, Listener listener)
- {
- OperationAdapter adapter = (OperationAdapter)internalAdapterFactory.adapt(operation);
- if (adapter != null)
- {
- adapter.removeListener(listener);
- }
- }
-
- protected static void fireNotificationForPortType(PortType portType)
- {
- // get the adapter for each operation and notify listeners
- if (portType != null)
- {
- for (Iterator i = portType.getEOperations().iterator(); i.hasNext(); )
- {
- fireNotificationForOperation((Operation)i.next());
- }
- }
- }
-
-
- protected static void fireNotificationForOperation(Operation operation)
- {
- if (operation != null)
- {
- OperationAdapter adapter = (OperationAdapter)internalAdapterFactory.adapt(operation);
- adapter.fireBindingsChanged();
- }
- }
-
-
- public static class InternalAdapterFactory extends AdapterFactoryImpl
- {
- public Adapter createAdapter(Notifier target)
- {
- WSDLSwitch wsdlSwitch = new WSDLSwitch()
- {
- public Object caseBinding(Binding binding)
- {
- return createBindingAdapter();
- }
-
- public Object caseBindingFault(BindingFault bindingFault)
- {
- return createBindingFaultAdapter();
- }
-
- public Object caseBindingOperation(BindingOperation bindingOperation)
- {
- return createBindingOperationAdapter();
- }
-
- public Object caseDefinition(Definition definition)
- {
- return createDefinitionAdapter();
- }
-
- public Object caseOperation(Operation operation)
- {
- return createOperationAdapter();
- }
- };
-
- Object o = wsdlSwitch.doSwitch((EObject)target);
-
- Adapter result = null;
- if (o instanceof Adapter)
- {
- result = (Adapter)o;
- }
- else
- {
- System.out.println("did not create adapter for target : " + target);
- Thread.dumpStack();
- }
- //System.out.println("createAdapter(" + target + ") " + result);
- return result;
- }
-
-
- public Adapter createBindingAdapter()
- {
- return new BindingAdapter();
- }
-
- public Adapter createBindingFaultAdapter()
- {
- return new BindingFaultAdapter();
- }
-
- public Adapter createBindingOperationAdapter()
- {
- return new BindingOperationAdapter();
- }
-
- public Adapter createDefinitionAdapter()
- {
- return new DefinitionAdapter();
- }
-
- public Adapter createOperationAdapter()
- {
- return new OperationAdapter();
- }
-
- public Adapter adapt(Notifier target)
- {
- return target != null ? adapt(target, internalAdapterFactory) : null;
- }
-
- protected void adaptBinding(Binding binding)
- {
- adapt(binding);
- for (Iterator i = binding.getEBindingOperations().iterator(); i.hasNext(); )
- {
- BindingOperation bindingOperation = (BindingOperation)i.next();
- adapt(bindingOperation);
- for (Iterator j = bindingOperation.getEBindingFaults().iterator(); j.hasNext(); )
- {
- BindingFault bindingFault = (BindingFault)j.next();
- adapt(bindingFault);
- }
- }
- }
- }
-
-
- protected static abstract class BaseAdapter extends AdapterImpl
- {
- public boolean isAdapterForType(Object type)
- {
- return type == internalAdapterFactory;
- }
-
- public WSDLPackage getPackage()
- {
- return WSDLPackage.eINSTANCE;
- }
- }
-
-
- // DefinitionAdapter
- //
- protected static class DefinitionAdapter extends BaseAdapter
- {
- public void notifyChanged(Notification msg)
- {
- Definition definition = (Definition)getTarget();
-
- if ((EStructuralFeature)msg.getFeature() == getPackage().getDefinition_EBindings())
- {
- Object newValue = msg.getNewValue();
- switch (msg.getEventType())
- {
- case Notification.ADD:
- {
- handleAdd((Binding)newValue);
- break;
- }
- case Notification.ADD_MANY:
- {
- for (Iterator newValues = ((Collection)newValue).iterator(); newValues.hasNext(); )
- {
- handleAdd((Binding)newValues.next());
- }
- break;
- }
- }
- }
- }
-
- protected void handleAdd(Binding binding)
- {
- internalAdapterFactory.adaptBinding(binding);
- PortType portType = binding.getEPortType();
- if (portType != null)
- {
- fireNotificationForPortType(portType);
- }
- }
- }
-
-
- protected static class BindingAdapter extends BaseAdapter
- {
- public void notifyChanged(Notification msg)
- {
- if ((EStructuralFeature)msg.getFeature() == getPackage().getBinding_EPortType())
- {
- // fireNotifcation for all of the operation of the old and new portType
- fireNotificationForPortType((PortType)msg.getNewValue());
- fireNotificationForPortType((PortType)msg.getOldValue());
- }
- else if ((EStructuralFeature)msg.getFeature() == getPackage().getBinding_EBindingOperations())
- {
- // fireNotifcation for all operations that were added or removed
- Object newValue = msg.getNewValue();
- Object oldValue = msg.getNewValue();
- switch (msg.getEventType())
- {
- case Notification.ADD:
- {
- handleAdd((BindingOperation)newValue);
- break;
- }
- case Notification.ADD_MANY:
- {
- for (Iterator newValues = ((Collection)newValue).iterator(); newValues.hasNext(); )
- {
- handleAdd((BindingOperation)newValues.next());
- }
- break;
- }
- case Notification.REMOVE:
- {
- handleRemove((BindingOperation)oldValue);
- break;
- }
- case Notification.REMOVE_MANY:
- {
- for (Iterator oldValues = ((Collection)oldValue).iterator(); oldValues.hasNext(); )
- {
- handleRemove((BindingOperation)oldValues.next());
- }
- break;
- }
- }
- }
- }
-
- protected void handleAdd(BindingOperation bindingOperation)
- {
- internalAdapterFactory.adapt(bindingOperation);
- Operation operation = ComponentReferenceUtil.computeOperation(bindingOperation);
- fireNotificationForOperation(operation);
- }
-
- protected void handleRemove(BindingOperation bindingOperation)
- {
- if (bindingOperation != null)
- {
- Operation operation = ComponentReferenceUtil.computeOperation(bindingOperation);
- fireNotificationForOperation(operation);
- }
- }
- }
-
-
-
- protected static class BindingOperationAdapter extends BaseAdapter
- {
- public void notifyChanged(Notification msg)
- {
- BindingOperation bindingOperation = (BindingOperation)getTarget();
- Operation operation = ComponentReferenceUtil.computeOperation(bindingOperation);
- fireNotificationForOperation(operation);
- }
- }
-
-
- protected static class BindingFaultAdapter extends BaseAdapter
- {
- public void notifyChanged(Notification msg)
- {
- BindingFault bindingFault = (BindingFault)getTarget();
- BindingOperation bindingOperation = (BindingOperation)bindingFault.eContainer();
- Operation operation = ComponentReferenceUtil.computeOperation(bindingOperation);
- fireNotificationForOperation(operation);
- }
- }
-
-
- protected static class OperationAdapter extends BaseAdapter
- {
- protected Definition definition;
- protected List listeners = new ArrayList();
-
- public void addListener(Listener listener)
- {
- listeners.add(listener);
- }
-
- public void removeListener(Listener listener)
- {
- listeners.remove(listener);
- }
-
- public void fireBindingsChanged()
- {
- Operation operation = (Operation)getTarget();
- for (Iterator i = listeners.iterator(); i.hasNext(); )
- {
- Listener listener = (Listener)i.next();
- listener.bindingsChanged(operation);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/SelectionAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/SelectionAdapter.java
deleted file mode 100644
index 9f1fda4..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/SelectionAdapter.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-// This class is used to help syncronize selections between two models.
-//
-public abstract class SelectionAdapter implements ISelectionProvider
-{
- protected List listenerList = new ArrayList();
- protected ISelection selection = new StructuredSelection();
- protected ISelectionProvider eventSource;
-
- public void setEventSource(ISelectionProvider eventSource)
- {
- this.eventSource = eventSource;
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.add(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.remove(listener);
- }
-
- public ISelection getSelection()
- {
- return selection;
- }
-
- /**
- * This method should be specialized to return the correct object that corresponds to the 'other' model
- */
- abstract protected Object getObjectForOtherModel(Object object);
-
-
- public void setSelection(ISelection modelSelection)
- {
- List otherModelObjectList = new ArrayList();
- if (modelSelection instanceof IStructuredSelection)
- {
- for (Iterator i = ((IStructuredSelection)modelSelection).iterator(); i.hasNext(); )
- {
- Object modelObject = i.next();
- Object otherModelObject = getObjectForOtherModel(modelObject);
- if (otherModelObject != null)
- {
- otherModelObjectList.add(otherModelObject);
- }
- }
- }
-
- StructuredSelection nodeSelection = new StructuredSelection(otherModelObjectList);
- selection = nodeSelection;
- SelectionChangedEvent event = new SelectionChangedEvent(eventSource != null ? eventSource : this, nodeSelection);
-
- for (Iterator i = listenerList.iterator(); i.hasNext(); )
- {
- ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
- listener.selectionChanged(event);
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ValidateHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ValidateHelper.java
deleted file mode 100644
index 9f8c775..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ValidateHelper.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import org.eclipse.wst.common.ui.UIPlugin;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class ValidateHelper
-{
- // XML Lang can have many different valid formats
- // 1) xx ie. en, fr, de
- // 2) xx-xx ie. en-US, en-FR
- // 3) I-xx ie. I-en
- // 4) X-xx ie. X-en
- public static String checkXMLLang(String lang)
- {
- if (lang.length() == 0)
- return null;
-
- if (lang.length() == 1)
- {
- char ch0 = lang.charAt(0);
- if ((ch0 >= 'a' && ch0 <= 'z') || (ch0 >= 'A' && ch0 <= 'Z'))
- return UIPlugin.getResourceString("_WARN_LANG_TOO_SHORT");
- else
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch0 +
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END");
- }
-
- int offset;
-
- char ch0 = lang.charAt(0);
- if (lang.charAt(1) == '-')
- {
- if (ch0 == 'i' || ch0 == 'I' || ch0 == 'x' || ch0 == 'X')
- offset = 1;
- else
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch0 +
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END");
- }
- else
- {
- char ch1 = lang.charAt(1);
- if ((ch0 >= 'a' && ch0 <= 'z') || (ch0 >= 'A' && ch0 <= 'Z'))
- if ((ch1 >= 'a' && ch1 <= 'z') || (ch1 >= 'A' && ch1 <= 'Z'))
- offset = 2;
- else
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch1 +
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END");
- else
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch0 +
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END");
- }
-
- if (lang.length() > offset)
- {
- char ch = lang.charAt(offset++);
- if (ch != '-')
- return UIPlugin.getResourceString("_WARN_HYPHEN_NEEDED") + Integer.toString(offset-1);
- else
- {
- while (true)
- {
- if (ch == '-')
- {
- if (lang.length() == offset)
- return UIPlugin.getResourceString("_WARN_HYPHEN_ENDING");
-
- ch = lang.charAt(offset++);
- if ((ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z'))
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch +
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END");
-
- if (lang.length() == offset)
- return null;
- }
- else if ((ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z'))
- return UIPlugin.getResourceString("_WARN_NAME_INVALID_CHAR") + ch +
- UIPlugin.getResourceString("_UI_NAME_INVALID_CHAR_END");
- else if (lang.length() == offset)
- return null;
- ch = lang.charAt(offset++);
- }
- }
- }
-
- return null;
- }
-
- /**
- * Check to see if the min value is correct.
- * A minimum value must be non-negative and < maxValue
- */
- public static String isValidMinValue(String minValue, String maxValue)
- {
- int min;
-
- if (minValue == null || minValue.equals(""))
- {
- // Nothing to check
- return null;
- }
-
- try
- {
- min = Integer.parseInt(minValue);
- }
- catch (NumberFormatException ex)
- {
- return UIPlugin.getResourceString("_ERROR_MIN_NOT_POSITIVE");
- }
-
- if (min < 0)
- {
- return UIPlugin.getResourceString("_ERROR_MIN_NOT_POSITIVE");
- }
-
- try
- {
- int max = Integer.parseInt(maxValue);
- if (min > max)
- {
- return UIPlugin.getResourceString("_ERROR_MIN_VALUE");
- }
- }
- catch (NumberFormatException ex)
- {
- // Max is not accurate. Don't compare it.
- }
- return null;
- }
-
- /**
- * Check to see if the max value is correct.
- * A maximum value must be non-negative and > minValue
- *
- * It can also be set the string "unbounded"
- */
- public static String isValidMaxValue(String maxValue, String minValue)
- {
- int max;
-
- if (maxValue == null || maxValue.equals(""))
- {
- // Nothing to check
- return null;
- }
-
- if (maxValue.equals("unbounded"))
- {
- return null;
- }
-
- try
- {
- max = Integer.parseInt(maxValue);
- }
- catch (NumberFormatException ex)
- {
- return UIPlugin.getResourceString("_ERROR_MAX_NOT_POSITIVE");
- }
-
- if (max < 0)
- {
- return UIPlugin.getResourceString("_ERROR_MAX_NOT_POSITIVE");
- }
-
- try
- {
- int min = Integer.parseInt(minValue);
- if (max < min)
- {
- return UIPlugin.getResourceString("_ERROR_MAX_VALUE");
- }
- }
- catch (NumberFormatException ex)
- {
- // Min is not accurate. Don't compare it.
- }
- return null;
- }
-
- /**
- * Validate the name conforms to the XML spec
- */
- public static String checkXMLName(String name, boolean allowEntityRef)
- {
- int length = name.length();
- char character;
-
- if (length == 0)
- {
- return WSDLEditorPlugin.getWSDLString("_WARN_NAME_MUST_CONTAIN_AT_LEAST_ONE_CHAR");
- }
-
- if (name.indexOf(" ") >= 0)
- {
- return(WSDLEditorPlugin.getWSDLString("_WARN_NAME_HAS_SPACE"));
- }
-
- int index = 0;
- if (length > 0 &&
- name.charAt(0) == '%')
- {
- if (allowEntityRef)
- {
- // skip over the first character
- index++;
- } // end of if ()
- else
- {
- return WSDLEditorPlugin.getWSDLString("_WARN_NAME_INVALID_FIRST");
- } // end of else
- }
-
- for(; index < length; index++)
- {
- character = name.charAt(index);
-
- if(index == 0)
- {
- if( !isXMLNameStart(character) )
- {
- return WSDLEditorPlugin.getWSDLString("_WARN_NAME_INVALID_FIRST");
- }
- }
- else
- {
- if(!isXMLNameChar(character))
- {
- if ((index == length - 1) && //check if the last character is a ';'
- allowEntityRef &&
- character == ';')
- {
- // we're still ok then
- continue;
- } // end of if ()
- else
- {
- return WSDLEditorPlugin.getWSDLString("_WARN_NAME_INVALID_CHAR") + character +
- WSDLEditorPlugin.getWSDLString("_UI_NAME_INVALID_CHAR_END");
- } // end of else
- }
- }
- }
- return null;
- }
-
- /**
- * Validate the name conforms to the XML spec
- */
- public static String checkXMLName(String name)
- {
- return checkXMLName(name, false);
- }
-
- /**
- * isXMLNameStart
- **/
- private static boolean isXMLNameStart(char ch)
- {
- return (ch == '_' || ch == ':' || Character.isLetter(ch) );
- }
-
- /**
- * isXMLNameChar
- **/
- private static boolean isXMLNameChar(char ch)
- {
- return (Character.isLetterOrDigit(ch) || ch == '.' || ch == '-' || ch == '_' || ch == ':');
- }
-
- /**
- * isXMLPrefixStart
- **/
- private static boolean isXMLPrefixStart(char ch)
- {
- return (ch == '_' || Character.isLetter(ch) );
- }
-
- /**
- * isXMLPrefixChar
- **/
- private static boolean isXMLPrefixChar(char ch)
- {
- return (Character.isLetterOrDigit(ch) || ch == '.' || ch == '-' || ch == '_');
- }
-
- /**
- * parseElementText
- */
- public static String parseElementText(String text)
- {
- if (text.indexOf('<') != -1 || text.indexOf('>') != -1)
- {
- return UIPlugin.getResourceString("_WARN_ELEMENT_INVALID_CHAR");
- }
- return null;
- }
-
- /**
- * parseAttributeValue
- */
- public static String parseAttributeValue(String value)
- {
- if (value.indexOf('"') != -1 || value.indexOf('<') != -1 || value.indexOf('>') != -1)
- {
- return UIPlugin.getResourceString("_WARN_ATTRIBUTE_INVALID_CHAR");
-
- }
- return null;
- }
-
- /**
- * parseADATASection
- */
- public static String parseCDATASection(String section)
- {
- if (section.indexOf("]]>") != -1)
- {
- return UIPlugin.getResourceString("_WARN_CDATA_INVALID_STRING");
-
- }
- return null;
- }
-
- /**
- * parseProcessiingInstruction
- */
- public static String parseProcessingInstructionData(String data)
- {
- if (data.indexOf("?>") != -1)
- {
- return UIPlugin.getResourceString("_WARN_PROCESSING_INVALID_STRING");
-
- }
- return null;
- }
-
- /**
- * parseProcessingInstructionTarget
- */
- public static String parseProcessingInstructionTarget(String target)
- {
- if (target.length() == 3 && (target.indexOf("XML") != -1 || target.indexOf("XMl") != -1 || target.indexOf("XmL") != -1 ||
- target.indexOf("xML") != -1 || target.indexOf("Xml") != -1 || target.indexOf("xMl") != -1 ||
- target.indexOf("xmL") != -1 || target.indexOf("xml") != -1))
- {
- return UIPlugin.getResourceString("_WARN_PROCESSING_TARGET_INVALID_STRING");
-
- }
- return checkXMLName(target);
- }
-
- /**
- * parsComment
- */
- public static String parseComment(String comment)
- {
- if (comment.indexOf("--") != -1)
- {
- return UIPlugin.getResourceString("_WARN_COMMENT_INVALID_STRING");
- }
- return null;
- }
-
- /**
- * Validate the prefix conforms to the XML spec
- */
- public static String checkXMLPrefix(String prefix)
- {
- int length = prefix.length();
- if (length == 0)
- {
- return null;
- }
- char character;
-
- if (prefix.indexOf(" ") >= 0)
- {
- return(UIPlugin.getResourceString("_WARN_PREFIX_HAS_SPACE"));
- }
-
- for(int index = 0; index < length; index++)
- {
- character = prefix.charAt(index);
-
- if(!isXMLPrefixChar(character))
- {
- return UIPlugin.getDefault().getString("_WARN_PREFIX_INVALID_CHAR", String.valueOf(character));
- }
- }
- return null;
- }
-
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLEditorUtil.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLEditorUtil.java
deleted file mode 100644
index 0d228d6..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLEditorUtil.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibleElement;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.ui.internal.extension.ITypeSystemProvider;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class WSDLEditorUtil extends WSDLConstants
-{
- protected static WSDLEditorUtil instance;
- protected NodeAssociationManager nodeAssociationManager = new NodeAssociationManager();
-
- protected HashMap elementNameToTypeMap = new HashMap();
-
- public static WSDLEditorUtil getInstance()
- {
- if (instance == null)
- {
- instance = new WSDLEditorUtil();
- }
- return instance;
- }
-
- public WSDLEditorUtil()
- {
- elementNameToTypeMap.put(BINDING_ELEMENT_TAG, new Integer(BINDING));
- elementNameToTypeMap.put(DEFINITION_ELEMENT_TAG, new Integer(DEFINITION));
- elementNameToTypeMap.put(DOCUMENTATION_ELEMENT_TAG, new Integer(DOCUMENTATION));
- elementNameToTypeMap.put(FAULT_ELEMENT_TAG, new Integer(FAULT));
- elementNameToTypeMap.put(IMPORT_ELEMENT_TAG, new Integer(IMPORT));
- elementNameToTypeMap.put(INPUT_ELEMENT_TAG, new Integer(INPUT));
- elementNameToTypeMap.put(MESSAGE_ELEMENT_TAG, new Integer(MESSAGE));
- elementNameToTypeMap.put(OPERATION_ELEMENT_TAG, new Integer(OPERATION));
- elementNameToTypeMap.put(OUTPUT_ELEMENT_TAG, new Integer(OUTPUT));
- elementNameToTypeMap.put(PART_ELEMENT_TAG, new Integer(PART));
- elementNameToTypeMap.put(PORT_ELEMENT_TAG, new Integer(PORT));
- elementNameToTypeMap.put(PORT_TYPE_ELEMENT_TAG, new Integer(PORT_TYPE));
- elementNameToTypeMap.put(SERVICE_ELEMENT_TAG, new Integer(SERVICE));
- elementNameToTypeMap.put(TYPES_ELEMENT_TAG, new Integer(TYPES));
- }
-
- public int getWSDLType(Element element)
- {
- int result = -1;
-
- Integer integer = (Integer)elementNameToTypeMap.get(element.getLocalName());
- if (integer != null)
- {
- result = integer.intValue();
- }
- return result;
- }
-
- protected List getParentElementChain(Element element)
- {
- List list = new ArrayList();
- while (element != null)
- {
- list.add(0, element);
- Node node = element.getParentNode();
- element = (node != null && node.getNodeType() == Node.ELEMENT_NODE) ? (Element)node : null;
- }
- return list;
- }
-
- public Object findModelObjectForElement(Definition definition, Element targetElement)
- {
- Object o = nodeAssociationManager.getModelObjectForNode(definition, targetElement);
- return o;
- }
-
- public Element getElementForObject(Object o)
- {
- return ((org.eclipse.wst.wsdl.WSDLElement)o).getElement();
- }
-
- public Node getNodeForObject(Object o)
- {
- return nodeAssociationManager.getNode(o);
- }
-
- // Provide a mapping between Definitions and ITypeSystemProviders
- private Hashtable typeSystemProviders = new Hashtable();
-
- public ITypeSystemProvider getTypeSystemProvider(Definition definition)
- {
- return (ITypeSystemProvider)typeSystemProviders.get(definition);
- }
-
- public void setTypeSystemProvider(Definition definition, ITypeSystemProvider typeSystemProvider)
- {
- typeSystemProviders.put(definition,typeSystemProvider);
- }
-
- public static QName createQName(Definition definition, String prefixedName)
- {
- QName qname = null;
- if (prefixedName != null)
- {
- int index = prefixedName.indexOf(":");
- String prefix = (index == -1) ? null : prefixedName.substring(0, index);
- if (prefix != null)
- {
- String namespace = definition.getNamespace(prefix);
- if (namespace != null)
- {
- String localPart = prefixedName.substring(index + 1);
- qname = new QName(namespace, localPart);
- }
- }
- }
- return qname;
- }
-
- public List getExtensibilityElementNodes(ExtensibleElement extensibleElement)
- {
- // For Types, I need to get all the schemas
- if (extensibleElement instanceof Types)
- {
- Types xsdEE = (Types)extensibleElement;
- return xsdEE.getSchemas();
- }
- /*
- List childList = new ArrayList();
-
- Element parentElement = getElementForObject(extensibleElement);
- if (parentElement != null)
- {
-
- NodeList nodeList = parentElement.getChildNodes();
- int nodeListLength = nodeList.getLength();
- for (int i = 0; i < nodeListLength; i++)
- {
- childList.add(nodeList.item(i));
- }
- HashMap extensibleElementTable = new HashMap();
- for (Iterator i = extensibleElement.getEExtensibilityElements().iterator(); i.hasNext();)
- {
- ExtensibilityElement extensibilityElement = (ExtensibilityElement)i.next();
- if (extensibilityElement != null)
- {
- Element element = getElementForObject(extensibilityElement);
- if (element != null)
- {
- extensibleElementTable.put(element, element);
- }
- }
- }
-
- for (Iterator i = childList.iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (extensibleElementTable.get(o) == null)
- {
- i.remove();
- }
- }
- }
- return childList;
- */
- return extensibleElement.getEExtensibilityElements();
- }
-
- /*
- * Returns a list of 'children' of the given object model (WSDLElement).
- */
- public static List getModelGraphViewChildren(Object object) {
- List childList = new ArrayList();
-
- if (object instanceof PortType) {
- PortType portType = (PortType) object;
- childList.addAll(portType.getOperations());
- }
- else if (object instanceof Operation) {
- Operation operation = (Operation) object;
-
- if (operation.getEInput() != null) {
- childList.add(operation.getEInput());
- }
- if (operation.getEOutput() != null) {
- childList.add(operation.getEOutput());
- }
- childList.addAll(operation.getFaults().values());
- }
- else if (object instanceof MessageReference) {
- MessageReference messageReference = (MessageReference) object;
- childList.add(messageReference.getEMessage());
- }
-
- return childList;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLModelLocatorAdapterFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLModelLocatorAdapterFactory.java
deleted file mode 100644
index af9630a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLModelLocatorAdapterFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.common.uriresolver.URIResolverPlugin;
-import org.eclipse.wst.wsdl.internal.util.WSDLModelLocator;
-
-public class WSDLModelLocatorAdapterFactory extends AdapterFactoryImpl
-{
- protected CustomWSDLModelLocator customWSDLModelLocator = new CustomWSDLModelLocator();
-
- class CustomWSDLModelLocator extends AdapterImpl implements WSDLModelLocator
- {
- public String resolveURI(String baseLocation, String namespace, String location)
- {
- return URIResolverPlugin.createResolver().resolve(baseLocation, namespace, location);
- }
-
- public boolean isAdatperForType(Object type)
- {
- return type == WSDLModelLocator.class;
- }
- }
-
- public boolean isFactoryForType(Object type)
- {
- return type == WSDLModelLocator.class;
- }
-
- public Adapter adaptNew(Notifier target, Object type)
- {
- return customWSDLModelLocator;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLNodeAssociationProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLNodeAssociationProvider.java
deleted file mode 100644
index 92bb530..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLNodeAssociationProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.extension.INodeAssociationProvider;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.xsd.impl.XSDComponentImpl;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class WSDLNodeAssociationProvider implements INodeAssociationProvider
-{
- public Object getModelObject(Object parentModelObject, Element[] elementChain, int start, int[] end)
- {
- Object currentObject = parentModelObject;
- for (int i = start; i < elementChain.length; i++)
- {
- Object o = getModelObjectHelper(currentObject, elementChain[i]);
- if (o == null)
- {
- end[0] = i;
- break;
- }
- else
- {
- currentObject = o;
- }
- }
- return currentObject != parentModelObject ? currentObject : null;
- }
-
- public Node getNode(Object modelObject)
- {
- if (modelObject instanceof WSDLElement)
- return ((WSDLElementImpl)modelObject).getElement();
- else
- return null;
- }
-
- protected Object getModelObjectHelper(Object parentObject, Element elementNode)
- {
- Object result = null;
- Collection childComponentList = ((WSDLElementImpl) parentObject).getModelObjects(parentObject);
- for (Iterator i = childComponentList.iterator(); i.hasNext();)
- {
- Object o = i.next();
- Element element = null;
-
- if (o != null)
- {
- if (o instanceof WSDLElementImpl)
- {
- element = ((WSDLElementImpl)o).getElement();
- }
- else if (o instanceof XSDComponentImpl)
- {
- element = ((XSDComponentImpl)o).getElement();
- }
- }
-
- if (element == elementNode)
- {
- result = o;
- break;
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLPreferencePage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLPreferencePage.java
deleted file mode 100644
index b8ef64f..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLPreferencePage.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-//import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-public class WSDLPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
- public WSDLPreferencePage()
- {
- super(FieldEditorPreferencePage.FLAT);
- setPreferenceStore(WSDLEditorPlugin.getInstance().getPreferenceStore());
- }
-
- public void init(IWorkbench workbench)
- {
- }
-
- protected void createFieldEditors()
- {
- Composite parent = getFieldEditorParent();
- GridLayout parentLayout = new GridLayout();
- parentLayout.marginWidth = 0;
- parent.setLayout(parentLayout);
-
-// WorkbenchHelp.setHelp(getControl(), some context id here);
-
- Group group = new Group(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.numColumns = 2;
- group.setLayout(layout);
- group.setText(WSDLEditorPlugin.getWSDLString("_UI_PREF_PAGE_CREATING_FILES"));
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- group.setLayoutData(data);
-
- Composite composite = new Composite(group, SWT.NULL);
- GridData data1 = new GridData();
- data1.verticalAlignment = GridData.FILL;
- data1.horizontalAlignment = GridData.FILL;
- data1.grabExcessHorizontalSpace = true;
- composite.setLayoutData(data1);
-
- StringFieldEditor targetNamespace = new StringFieldEditor(WSDLEditorPlugin.getWSDLString("_UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE"), WSDLEditorPlugin.getWSDLString("_UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE"), composite); // Externalize
- GridLayout compositeLayout = (GridLayout)composite.getLayout();
- compositeLayout.marginWidth = 5; // Default value
- compositeLayout.numColumns = 2;
- addField(targetNamespace);
- targetNamespace.setFocus();
-
-
- /* Do we need this preference below? If so, change WSDLEditorPlugin.java and use this preference in:
- HttpContentGenerator.java
- SoapContentGenerator.java
- SoapPortOptionsPage.java
- */
-// HttpPortOptionsPage.java StringFieldEditor location = new StringFieldEditor("Defualt Location:", "Default Location:", editorGroup1); // Externalize
-// addField(location);
-
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLResourceUtil.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLResourceUtil.java
deleted file mode 100644
index 2e72975..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/WSDLResourceUtil.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import java.io.InputStream;
-import java.util.Iterator;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.wst.common.uriresolver.URIResolverPlugin;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
-import org.eclipse.wst.wsdl.internal.impl.WSDLElementImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLModelLocator;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl;
-import org.eclipse.wst.xml.uriresolver.util.URIHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-public class WSDLResourceUtil
-{
- public static Resource createWSDLResource(ResourceSet resourceSet, Definition definition, String uri)
- {
- WSDLResourceFactoryImpl resourceFactory = new WSDLResourceFactoryImpl();
- Resource resource = resourceFactory.createResource(URI.createURI(uri));
- resourceSet.getResources().add(resource);
- resource.getContents().add(definition);
- resource.setModified(false);
- return resource;
- }
-
- public static Definition lookupAndLoadDefinition(ResourceSet resourceSet, String uri) {
- Definition definition = null;
- Resource resource = null;
- try {
- InputStream inputStream = resourceSet.getURIConverter().createInputStream(URI.createURI(uri));
- resource = resourceSet.createResource(URI.createURI(uri));
- resource.load(inputStream, resourceSet.getLoadOptions());
- }
- catch(Exception e) {}
-
- if (resource == null)
- {
- try
- {
- definition = parse(resourceSet, uri);
- }
- catch (Exception e)
- {
- }
- }
- else
- {
- Object o = resource.getContents().size() > 0 ? resource.getContents().get(0) : null;
- if (o instanceof Definition)
- {
- definition = (Definition) o;
- }
- }
- return definition;
-}
-
- public static Definition lookupOrCreateDefinition(ResourceSet resourceSet, String uri)
- {
- Definition definition = null;
- Resource resource = resourceSet.getResource(URI.createURI(uri), false);
- if (resource == null)
- {
- try
- {
- definition = parse(resourceSet, uri);
- }
- catch (Exception e)
- {
- }
- }
- else
- {
- Object o = resource.getContents().size() > 0 ? resource.getContents().get(0) : null;
- if (o instanceof Definition)
- {
- definition = (Definition) o;
- }
- }
- return definition;
- }
-
- public static Definition createDefinition(ResourceSet resourceSet, IFile file, Document document)
- {
- Definition definition = WSDLFactory.eINSTANCE.createDefinition();
- ((DefinitionImpl)definition).setUseExtensionFactories(false);
- String baseURI = URI.createPlatformResourceURI(file.getFullPath().toString()).toString();
- definition.setDocumentBaseURI(baseURI);
- try
- {
- Element element = document.getDocumentElement();
- if (element != null)
- {
- definition.setElement(element);
- }
- }
- catch (Exception e)
- {
- }
- WSDLResourceUtil.createWSDLResource(resourceSet, definition, baseURI);
- ((DefinitionImpl)definition).reconcileReferences(true);
- return definition;
- }
-
- public static Definition parse(ResourceSet resourceSet, String uri) throws Exception
- {
- Definition definition = null;
- Document document = null;
- ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
-
- try
- {
- Thread.currentThread().setContextClassLoader(WSDLResourceUtil.class.getClassLoader());
-// DOMParser builder = new DOMParser();
-// builder.parse(uri);
-// document = builder.getDocument();
-
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
- document = builder.parse(uri);
-
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(prevClassLoader);
- }
-
- definition = ((org.eclipse.wst.wsdl.WSDLPackage) EPackage.Registry.INSTANCE.getEPackage(org.eclipse.wst.wsdl.WSDLPackage.eNS_URI)).getWSDLFactory().createDefinition();
- definition.setDocumentBaseURI(uri);
- if (document != null)
- {
- Element element = document.getDocumentElement();
- if (element != null)
- {
- definition.setElement(element);
- }
- }
- WSDLResourceUtil.createWSDLResource(resourceSet, definition, uri);
- ((DefinitionImpl)definition).reconcileReferences(true);
- return definition;
- }
-
- public static void reloadDirectives(Definition definition)
- {
- Resource rootResource = definition.eResource();
- ResourceSet resourceSet = rootResource.getResourceSet();
-
- for (Iterator i = resourceSet.getResources().iterator(); i.hasNext();)
- {
- Resource resource = (Resource) i.next();
- if (resource != rootResource)
- {
- // TODO... consider unloading the resources
- // resource.unload();
- i.remove();
- }
- }
- ReloadDirectiveVisitor visitor = new ReloadDirectiveVisitor();
- visitor.visitDefinition(definition);
- }
-
- static class ReloadDirectiveVisitor
- {
-
- public void visitImport(Import theImport)
- {
- // force the import to reload
- Element element = WSDLEditorUtil.getInstance().getElementForObject(theImport);
- if (element != null)
- {
- ((WSDLElementImpl)theImport).elementChanged(element);
- }
- }
-
- public void visitXSDSchemaDirective(XSDSchemaDirective directive)
- {
- // force the schema directive to reload
- Element element = directive.getElement();
- if (element != null)
- {
- directive.elementAttributesChanged(element);
- }
- }
-
- public void visitDefinition(Definition definition)
- {
- if (definition != null)
- {
- for (Iterator i = definition.getEImports().iterator(); i.hasNext();)
- {
- visitImport((Import) i.next());
- }
- Types types = definition.getETypes();
- if (types != null)
- {
-
- for (Iterator i = types.getEExtensibilityElements().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement e = (XSDSchemaExtensibilityElement) o;
- if (e.getSchema() != null)
- {
- visitSchema(e.getSchema());
- }
- }
- }
- }
- }
- }
-
- public void visitSchema(XSDSchema schema)
- {
- for (Iterator i = schema.getContents().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaDirective)
- {
- visitXSDSchemaDirective((XSDSchemaDirective) o);
- }
- }
- }
- }
-
- public static WSDLModelLocator getURIResolver(Definition definition)
- {
- return ((WSDLResourceImpl)definition.eResource()).getURIResolver();
- }
-
- public static class InternalURIResolver implements WSDLModelLocator
- {
- //IdResolver idResolver = new IdResolverImpl(null, true);
- org.eclipse.wst.common.uriresolver.URIResolver resolver = URIResolverPlugin.createResolver();
-
- InternalURIResolver()
- {
- }
-
- public String resolveURI(String baseLocation, String namespace, String location)
- {
- String resolvedLocation = resolver.resolve(baseLocation, namespace, location);
-
- // here's an ugly hack... Platform.resolve() returns Windows files with the pattern "file:D:/hello.xsd"
- // but EMF's URI class expects a pattern like this "file:///D:/hello.xsd"
- //
- if (resolvedLocation != null)
- {
- String fileProtocol = "file:";
- if (resolvedLocation.startsWith(fileProtocol) && !resolvedLocation.startsWith(fileProtocol + "/"))
- {
- resolvedLocation = resolvedLocation.substring(fileProtocol.length());
- }
- resolvedLocation = URIHelper.addImpliedFileProtocol(resolvedLocation);
- }
- // end ugly hack
- return resolvedLocation;
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/XMLQuickScan.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/XMLQuickScan.java
deleted file mode 100644
index 3cd3940..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/XMLQuickScan.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import java.io.InputStream;
-import java.net.URL;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- *
- */
-public class XMLQuickScan
-{
- public static String getTargetNamespaceURIForSchema(String uri)
- {
- String result = null;
- try
- {
- URL url = new URL(uri);
- InputStream inputStream = url.openStream();
- result = XMLQuickScan.getTargetNamespaceURIForSchema(inputStream);
- }
- catch (Exception e)
- {
- }
- return result;
- }
-
- public static String getTargetNamespaceURIForSchema(InputStream input)
- {
- TargetNamespaceURIContentHandler handler = new TargetNamespaceURIContentHandler();
- ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- XMLReader reader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
- reader.setContentHandler(handler);
- reader.parse(new InputSource(input));
- }
- catch (Exception e)
- {
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(prevClassLoader);
- }
- return handler.targetNamespaceURI;
- }
-
- protected static class TargetNamespaceURIContentHandler extends DefaultHandler
- {
- public String targetNamespaceURI;
-
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- {
- if (localName.equals("schema") || localName.equals("definitions"))
- {
- int nAttributes = attributes.getLength();
- for (int i = 0; i < nAttributes; i++)
- {
- if (attributes.getLocalName(i).equals("targetNamespace"))
- {
- targetNamespaceURI = attributes.getValue(i);
- break;
- }
- }
- }
- // todo there's a ice way to do this I'm sure
- // here I intentially cause an exception...
- String x = null;
- x.length();
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java
deleted file mode 100644
index 64b9ae8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.xsd.util.XSDSchemaLocationResolver;
-
-public class XSDSchemaLocationResolverAdapterFactory extends AdapterFactoryImpl
-{
- protected XSDSchemaLocationResolverImpl schemaLocator = new XSDSchemaLocationResolverImpl();
-
- public boolean isFactoryForType(Object type)
- {
- return type == XSDSchemaLocationResolver.class;
- }
-
- public Adapter adaptNew(Notifier target, Object type)
- {
- return schemaLocator;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/XSDSchemaLocationResolverImpl.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/XSDSchemaLocationResolverImpl.java
deleted file mode 100644
index d2b7a92..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/XSDSchemaLocationResolverImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.common.uriresolver.URIResolverPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDSchemaLocationResolver;
-import org.eclipse.xsd.util.XSDSchemaLocator;
-
-public class XSDSchemaLocationResolverImpl extends AdapterImpl implements XSDSchemaLocationResolver
-{
- public String resolveSchemaLocation(XSDSchema xsdSchema, String namespaceURI, String schemaLocationURI)
- {
- String baseLocation = xsdSchema.getSchemaLocation();
- return URIResolverPlugin.createResolver().resolve(baseLocation, namespaceURI, schemaLocationURI);
- }
-
- public boolean isAdatperForType(Object type)
- {
- return type == XSDSchemaLocator.class;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/FlatPageHeader.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/FlatPageHeader.java
deleted file mode 100644
index af1ada4..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/FlatPageHeader.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util.flatui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-
-public class FlatPageHeader extends Canvas implements IPropertyChangeListener
-{
- private Image backgroundImage;
- private String text;
- private Image buttonImage;
- private Color imageBackgroundColor;
- private Color textForegroundColor;
- private int textHMargin = 10;
- private int textVMargin = 5;
- private Font headerFont;
- private int widthHint;
-
- private List listeners;
- private int buttonImageX;
- private int buttonImageY;
-
- // Usage:
- // See org.eclipse.wst.common.ui.FlatViewUtility.createFlatPageHeader()
- // methods.
- //
- // Ex)
- // Composite parent = ... ;
- // Image image = ... ;
- // Layout layout = ... ;
- // String title = ... ;
- // WidgetFactory factory = ... ;
- //
- // header = new FlatPageHeader(parent,SWT.NONE);
- // header.setLayout(layout);
- // header.setBackgroundImage(image);
- // header.setText(title);
- // Composite formParent = factory.createComposite(header);
- //
- // GridLayout gl = new GridLayout();
- // gl.numColumns = 1;
- // formParent.setLayout(gl);
- // formParent.setLayoutData(new GridData(GridData.FILL_BOTH));
- //
- public FlatPageHeader(Composite parent, int style)
- {
- super(parent, style);
-
- // The default image background color is white
- // The default text forekground color is black
- imageBackgroundColor = new Color(null, 255, 255, 255);
- textForegroundColor = new Color(null, 0, 0, 0);
- setBackground(imageBackgroundColor);
-
- // The default text font is Header font
- headerFont = JFaceResources.getHeaderFont();
-
- // Need to dispose the Color
- addDisposeListener
- (new DisposeListener()
- {
- public void widgetDisposed(DisposeEvent e)
- {
- FlatPageHeader.this.widgetDisposed(e);
- }
- }
- );
-
- // need to paint
- addPaintListener
- (new PaintListener()
- {
- public void paintControl(PaintEvent e)
- {
- FlatPageHeader.this.paintControl(e);
- }
- }
- );
-
- // create a list of listeners
- listeners = new ArrayList();
-
- // add a mouse listener
- this.addMouseListener
- (new MouseAdapter()
- {
- public void mouseDown(MouseEvent event)
- {
- handleMouseDown(event);
- }
- }
- );
-
- JFaceResources.getFontRegistry().addListener(this);
- }
-
- // Compute size of the widget
- public Point computeSize(int wHint, int hHint, boolean changed)
- {
- widthHint = wHint;
- int width = getParent().getClientArea().width;
- int height = 0;
- if (backgroundImage != null)
- {
- Rectangle bounds = backgroundImage.getBounds();
- height = bounds.height;
- }
- if (text != null)
- {
- GC gc = new GC(this);
- int textWidth = getTextWidth(gc);
- int textHeight = getTextHeight(gc);
- gc.dispose();
- height = Math.max(height, textHeight);
- }
- if (buttonImage != null)
- {
- Rectangle bounds = buttonImage.getBounds();
- if (height < bounds.height)
- height = bounds.height;
- }
- if (wHint != SWT.DEFAULT) width = wHint;
- if (hHint != SWT.DEFAULT) height = hHint;
- return new Point(width + 2, height + 2);
- }
-
- protected void paintControl(PaintEvent e)
- {
- GC gc = e.gc;
- int height = getTextHeight(gc);
- if (backgroundImage != null)
- {
- Rectangle imageBounds = backgroundImage.getBounds();
- int y = 0;
- int x = 0;
-
- if (imageBackgroundColor != null)
- {
- gc.setBackground(imageBackgroundColor);
- gc.fillRectangle(0, 0, imageBounds.width, imageBounds.height);
- }
-
- if (SWT.getPlatform().equals("motif")==false)
- {
- gc.drawImage(backgroundImage, x, y);
- }
- if (textForegroundColor != null)
- gc.setForeground(textForegroundColor);
- gc.setFont(headerFont);
-// gc.setFont(getFont());
- gc.drawText(text, textHMargin, textVMargin, true);
- if (buttonImage != null)
- {
- Rectangle parentBounds = getParent().getClientArea();
- Rectangle buttonBounds = buttonImage.getBounds();
- int p = parentBounds.x + parentBounds.width;
- buttonImageX = p - buttonBounds.width - 4;
- buttonImageY = 4;
- gc.drawImage(buttonImage, buttonImageX, buttonImageY);
- }
- }
- }
-
- public void addSelectionListener(SelectionListener listener)
- {
- listeners.add(listener);
- }
-
- public void removeSelectionListener(SelectionListener listener)
- {
- listeners.remove(listener);
- }
-
- protected void handleMouseDown(MouseEvent event)
- {
- if (buttonImage == null)
- return;
- // chekc if the Button image is clicked
- int x = event.x;
- int y = event.y;
- if (x < buttonImageX || x > buttonImageX + buttonImage.getBounds().width)
- {
- return;
- }
- if (y < buttonImageY || y > buttonImageY + buttonImage.getBounds().height)
- {
- return;
- }
-
- int size = listeners.size();
- for (int i = 0; i < size; i++)
- {
- SelectionListener listener = (SelectionListener)listeners.get(i);
- listener.widgetSelected(null);
- }
- }
-
- protected void widgetDisposed(DisposeEvent e)
- {
- if (imageBackgroundColor != null) imageBackgroundColor.dispose();
- if (textForegroundColor != null) textForegroundColor.dispose();
- if (backgroundImage != null) backgroundImage.dispose();
- }
-
- // getters and setters
- public Image getBackgroundImage()
- {
- return backgroundImage;
- }
-
- public void setBackgroundImage(Image backgroundImage)
- {
- this.backgroundImage = backgroundImage;
- redraw();
- }
-
- public Image getButtonImage()
- {
- return buttonImage;
- }
-
- public void setButtonImage(Image buttonImage)
- {
- this.buttonImage = buttonImage;
- redraw();
- }
-
- public String getText()
- {
- return text;
- }
-
- public void setText(String text)
- {
- this.text = text;
- redraw();
- }
-
- public int getTextHMargin()
- {
- return textHMargin;
- }
-
- public void setTextHMargin(int textHMargin)
- {
- this.textHMargin = textHMargin;
- }
-
- public int getTextVMargin()
- {
- return textVMargin;
- }
-
- public void setTextVMargin(int textVMargin)
- {
- this.textVMargin = textVMargin;
- }
-
- public Color getImageBackgroundColor()
- {
- return imageBackgroundColor;
- }
-
- public void setImageBackgroundColor(Color imageBackgroundColor)
- {
- if (imageBackgroundColor == null)
- return;
- this.imageBackgroundColor = imageBackgroundColor;
- redraw();
- }
-
- public Color getTextForegroundColor()
- {
- return textForegroundColor;
- }
-
- public void setTextForegroundColor(Color textForegroundColor)
- {
- if (textForegroundColor == null)
- return;
- this.textForegroundColor = textForegroundColor;
- redraw();
- }
-
- private int getTextHeight(GC gc)
- {
- int imageHeight = 0;
- if (backgroundImage!= null && SWT.getPlatform().equals("motif")==false)
- {
- imageHeight = backgroundImage.getBounds().height;
- }
- gc.setFont(headerFont);
-// gc.setFont(getFont());
- FontMetrics fm = gc.getFontMetrics();
- int fontHeight = fm.getHeight();
- int height = fontHeight + textVMargin + textVMargin;
- return Math.max(height, imageHeight);
- }
-
- private int getTextWidth(GC gc)
- {
- int imageWidth = 0;
- if (backgroundImage!= null && SWT.getPlatform().equals("motif")==false)
- {
- imageWidth = backgroundImage.getBounds().width;
- }
- gc.setFont(headerFont);
-// gc.setFont(getFont());
- FontMetrics fm = gc.getFontMetrics();
- int fontWidth = fm.getAverageCharWidth() + 5;
- int width = fontWidth * text.length() + textHMargin + textHMargin;
- return Math.max(width, imageWidth);
- }
-
- public void handleEvent(Event e)
- {
-// Widget source = e.widget;
- }
-
- public void propertyChange(PropertyChangeEvent event)
- {
- if(event.getProperty() == JFaceResources.HEADER_FONT && this.isDisposed() == false)
- {
- headerFont = JFaceResources.getFontRegistry().get(JFaceResources.HEADER_FONT);
- this.layout(true);
- this.redraw();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/FlatPageSection.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/FlatPageSection.java
deleted file mode 100644
index a38c324..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/FlatPageSection.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util.flatui;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ViewForm;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-
-//public abstract class FormSection implements IPropertyChangeListener, IModelChangedListener {
-public abstract class FlatPageSection extends ViewForm implements IPropertyChangeListener {
- public static final int SELECTION = 1;
-// private PDEFormPage formPage;
- private String headerColorKey = WidgetFactory.DEFAULT_HEADER_COLOR;
- private String headerText;
- private Control client;
- protected Label header;
- protected Control separator;
-// private SectionChangeManager sectionManager;
- private java.lang.String description;
- private boolean dirty;
- protected Label descriptionLabel;
- private ToggleControl toggle;
- private boolean readOnly;
- private boolean titleAsHyperlink;
- private boolean addSeparator=true;
- private boolean descriptionPainted=true;
- private boolean headerPainted=true;
- private boolean collapsable=false;
- private Composite control;
-
-
-/*
- * This is a special layout for the section. Both the
- * header and the description labels will wrap and
- * they will use client's size to calculate needed
- * height. This kind of behaviour is not possible
- * with stock grid layout.
- */
-class SectionLayout extends Layout {
- int vspacing = 3;
- int sepHeight = 2;
-
-
- protected Point computeSize(Composite parent, int wHint, int hHint, boolean flush) {
- int width = 0;
- int height = 0;
- int cwidth = 0;
- int collapsedHeight = 0;
-
- if (wHint != SWT.DEFAULT)
- width = wHint;
- if (hHint != SWT.DEFAULT)
- height = hHint;
-
- cwidth = width;
-
- if (client != null) {
- Point csize = client.computeSize(SWT.DEFAULT, SWT.DEFAULT, flush);
- if (width == 0) {
- width = csize.x;
- cwidth = width;
- }
- if (height==0) height = csize.y;
- }
-
- Point toggleSize = null;
-
- if (collapsable && toggle!=null)
- toggleSize = toggle.computeSize(SWT.DEFAULT, SWT.DEFAULT, flush);
-
- if (hHint== SWT.DEFAULT && headerPainted && header!=null) {
- int hwidth = cwidth;
- if (toggleSize!=null)
- hwidth = cwidth - toggleSize.x - 5;
- Point hsize = header.computeSize(hwidth, SWT.DEFAULT, flush);
- height += hsize.y;
- collapsedHeight = hsize.y;
- height += vspacing;
- }
-
- if (hHint==SWT.DEFAULT && addSeparator) {
- height += sepHeight;
- height += vspacing;
- collapsedHeight += vspacing + sepHeight;
- }
- if (hHint == SWT.DEFAULT && descriptionPainted && descriptionLabel!=null) {
- Point dsize = descriptionLabel.computeSize(cwidth, SWT.DEFAULT, flush);
- height += dsize.y;
- height += vspacing;
- }
- if (toggle!=null && toggle.getSelection()) {
- // collapsed state
- height = collapsedHeight;
- }
- return new Point(width, height);
- }
- protected void layout(Composite parent, boolean flush) {
- int width = parent.getClientArea().width;
- int height = parent.getClientArea().height;
- int y = 0;
- Point toggleSize=null;
-
- if (collapsable) {
- toggleSize = toggle.computeSize(SWT.DEFAULT, SWT.DEFAULT, flush);
- }
-
- if (headerPainted && header!=null) {
- Point hsize;
-
- if (titleAsHyperlink) {
- hsize = header.computeSize(SWT.DEFAULT, SWT.DEFAULT, flush);
- header.setBounds(0, y, hsize.x, hsize.y);
- }
- else {
- int availableWidth = width;
- if (toggleSize!=null)
- availableWidth = width - toggleSize.x - 5;
- hsize = header.computeSize(availableWidth, SWT.DEFAULT, flush);
-
- int hx = 0;
- if (toggle!=null) {
- int ty = y + hsize.y - toggleSize.y; // + vspacing;
- toggle.setBounds(0, ty, toggleSize.x, toggleSize.y);
- hx = toggleSize.x;
- }
- header.setBounds(hx, y, availableWidth, hsize.y);
- }
- y += hsize.y + vspacing;
- }
- if (addSeparator && separator!=null) {
- separator.setBounds(0, y, width, 2);
- y += sepHeight + vspacing;
- }
- if (toggle!=null && toggle.getSelection()) {
- return;
- }
- if (descriptionPainted && descriptionLabel!=null) {
- Point dsize = descriptionLabel.computeSize(width, SWT.DEFAULT, flush);
- descriptionLabel.setBounds(0, y, width, dsize.y);
- y += dsize.y + vspacing;
- }
- if (client!=null) {
- client.setBounds(0, y, width, height - y);
- }
- }
-}
-
-
-public FlatPageSection(Composite parent) {
- // Description causes problems re word wrapping
- // and causes bad layout in schema and
- // component editors when in Motif - turning off
-
- super(parent, SWT.FLAT);
- if (SWT.getPlatform().equals("motif")) {
- descriptionPainted = false;
- }
- JFaceResources.getFontRegistry().addListener(this);
-}
-public void commitChanges(boolean onSave) {
-}
-public abstract Composite createClient(Composite parent, WidgetFactory factory);
-public final Control createControl(
- Composite parent,
- WidgetFactory factory) {
- Composite section = factory.createComposite(parent);
- SectionLayout slayout = new SectionLayout();
- section.setLayout(slayout);
- section.setData(this);
-
- GridData gd;
- if (headerPainted) {
- Color headerColor = factory.getColor(getHeaderColorKey());
- header = factory.createHeadingLabel(section, getHeaderText(), headerColor, SWT.WRAP);
- if (titleAsHyperlink) {
- factory.turnIntoHyperlink(header, new HyperlinkAdapter() {
- public void linkActivated(Control label) {
- titleActivated();
- }
- });
- }
- if (collapsable) {
- toggle = new ToggleControl(section, SWT.NULL);
- toggle.setBackground(factory.getBackgroundColor());
- toggle.setActiveDecorationColor(factory.getHyperlinkColor());
- toggle.setDecorationColor(factory.getColor(WidgetFactory.COLOR_COMPOSITE_SEPARATOR));
- toggle.setActiveCursor(factory.getHyperlinkCursor());
- toggle.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
-
- boolean collapsed = toggle.getSelection();
- reflow();
- if (descriptionLabel!=null)
- descriptionLabel.setVisible(!collapsed);
- if (client!=null)
- client.setVisible(!collapsed);
- }
- });
- }
- }
-
-
- if (addSeparator) {
- //separator = factory.createSeparator(section, SWT.HORIZONTAL);
- separator = factory.createCompositeSeparator(section);
- }
-
- if (descriptionPainted && description != null) {
- descriptionLabel = factory.createLabel(section, description, SWT.WRAP);
- }
- client = createClient(section, factory);
- section.setData(this);
- control = section;
- return section;
-}
-
-protected void reflow() {
- control.layout(true);
- control.getParent().layout(true);
-
- Widget grandParent = control.getParent().getParent();
- if (grandParent != null && grandParent instanceof Composite)
- ((Composite)grandParent).layout(true);
-/*
- SectionForm form = formPage.getForm();
- if (form instanceof ScrollableSectionForm) {
- ((ScrollableSectionForm)form).updateScrollBars();
- }
-*/
-}
-
-protected Text createText(Composite parent, String label, WidgetFactory factory) {
- return createText(parent, label, factory, 1);
-}
-protected Text createText(Composite parent, String label, WidgetFactory factory, int span) {
- factory.createLabel(parent, label);
- Text text = factory.createText(parent, "");
- GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
- gd.grabExcessHorizontalSpace = true;
- gd.horizontalSpan=span;
- text.setLayoutData(gd);
- return text;
-}
-protected Text createText(Composite parent, WidgetFactory factory, int span) {
- Text text = factory.createText(parent, "");
- GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
- gd.grabExcessHorizontalSpace = true;
- gd.horizontalSpan=span;
- text.setLayoutData(gd);
- return text;
-}
-public void dispose() {
- JFaceResources.getFontRegistry().removeListener(this);
- super.dispose();
-}
-public void doGlobalAction(String actionId) {}
-public void expandTo(Object object) {}
-/*
-public final void fireChangeNotification(int changeType, Object changeObject) {
- if (sectionManager == null)
- return;
- sectionManager.dispatchNotification(this, changeType, changeObject);
-}
-public final void fireSelectionNotification(Object changeObject) {
- fireChangeNotification(SELECTION, changeObject);
-}
-*/
-public java.lang.String getDescription() {
- return description;
-}
-/*
-public PDEFormPage getFormPage() {
- return formPage;
-}
-*/
-
-public java.lang.String getHeaderColorKey() {
- return headerColorKey;
-}
-public java.lang.String getHeaderText() {
- return headerText;
-}
-public void initialize(Object input) {}
-
-public boolean isDirty() {
- return dirty;
-}
-
-public boolean isReadOnly() {
- return readOnly;
-}
-public boolean isTitleAsHyperlink() {
- return titleAsHyperlink;
-}
-/*
-public void modelChanged(IModelChangedEvent e) {
-}
-*/
-public void sectionChanged(FlatPageSection source, int changeType, Object changeObject) {}
-public void setAddSeparator(boolean newAddSeparator) {
- addSeparator = newAddSeparator;
-}
-
-
-private String trimNewLines(String text) {
- StringBuffer buff = new StringBuffer();
- for (int i=0; i<text.length(); i++) {
- char c = text.charAt(i);
- if (c=='\n')
- buff.append(' ');
- else
- buff.append(c);
- }
- return buff.toString();
-}
-
-public void setDescription(java.lang.String newDescription) {
- // we will trim the new lines so that we can
- // use layout-based word wrapping instead
- // of hard-coded one
- description = trimNewLines(newDescription);
- //description = newDescription;
- if (descriptionLabel!=null) descriptionLabel.setText(newDescription);
-}
-public void setDescriptionPainted(boolean newDescriptionPainted) {
- descriptionPainted = newDescriptionPainted;
-}
-public void setDirty(boolean newDirty) {
- dirty = newDirty;
-}
-/*
-public void setFocus() {
-}
-*/
-public void setHeaderColorKey(java.lang.String newHeaderColorKey) {
- headerColorKey = newHeaderColorKey;
-}
-public void setHeaderPainted(boolean newHeaderPainted) {
- headerPainted = newHeaderPainted;
-}
-public void setHeaderText(java.lang.String newHeaderText) {
- headerText = newHeaderText;
- if (header!=null) header.setText(headerText);
-}
-/*
-void setManager(SectionChangeManager manager) {
- this.sectionManager = manager;
-}
-*/
-public void setReadOnly(boolean newReadOnly) {
- readOnly = newReadOnly;
-}
-public void setTitleAsHyperlink(boolean newTitleAsHyperlink) {
- titleAsHyperlink = newTitleAsHyperlink;
-}
-public void titleActivated() {
-}
-/*
-public void update() {}
-*/
-
-public void propertyChange(PropertyChangeEvent arg0) {
- if (control!=null && header!=null) {
- if (!header.isDisposed())
- header.setFont(JFaceResources.getBannerFont());
- if (!control.isDisposed())
- control.layout(true);
- }
-}
-
-
- /**
- * Gets the collapsable.
- * @return Returns a boolean
- */
- public boolean getCollapsable() {
- return collapsable;
- }
-
- /**
- * Sets the collapsable.
- * @param collapsable The collapsable to set
- */
- public void setCollapsable(boolean collapsable) {
- this.collapsable = collapsable;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/HyperlinkAdapter.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/HyperlinkAdapter.java
deleted file mode 100644
index 4e52bb9..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/HyperlinkAdapter.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util.flatui;
-
-public class HyperlinkAdapter implements IHyperlinkListener{
-
-public HyperlinkAdapter() {
- super();
-}
-public void linkActivated(org.eclipse.swt.widgets.Control linkLabel) {}
-public void linkEntered(org.eclipse.swt.widgets.Control linkLabel) {}
-public void linkExited(org.eclipse.swt.widgets.Control linkLabel) {}
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/HyperlinkHandler.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/HyperlinkHandler.java
deleted file mode 100644
index bcd3c33..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/HyperlinkHandler.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util.flatui;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseTrackListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-
-public class HyperlinkHandler implements MouseListener, MouseTrackListener, PaintListener {
-
- public static final int UNDERLINE_NEVER = 1;
- public static final int UNDERLINE_ROLLOVER = 2;
- public static final int UNDERLINE_ALWAYS = 3;
-
- private static Cursor hyperlinkCursor;
- private static Cursor busyCursor;
- private boolean hyperlinkCursorUsed=true;
- private int hyperlinkUnderlineMode=UNDERLINE_ALWAYS;
- private Color background;
- private Color foreground;
- private Color activeBackground;
- private Color activeForeground;
- private Hashtable hyperlinkListeners;
- private Control lastLink;
-
-public HyperlinkHandler() {
- hyperlinkListeners = new Hashtable();
- if (hyperlinkCursor == null)
- {
- hyperlinkCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
- busyCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_WAIT);
- }
-}
-public void dispose() {
- hyperlinkCursor.dispose();
- busyCursor.dispose();
-}
-public org.eclipse.swt.graphics.Color getActiveBackground() {
- return activeBackground;
-}
-public org.eclipse.swt.graphics.Color getActiveForeground() {
- return activeForeground;
-}
-public org.eclipse.swt.graphics.Color getBackground() {
- return background;
-}
-public org.eclipse.swt.graphics.Cursor getBusyCursor() {
- return busyCursor;
-}
-public org.eclipse.swt.graphics.Color getForeground() {
- return foreground;
-}
-public org.eclipse.swt.graphics.Cursor getHyperlinkCursor() {
- return hyperlinkCursor;
-}
-public int getHyperlinkUnderlineMode() {
- return hyperlinkUnderlineMode;
-}
-public org.eclipse.swt.widgets.Control getLastLink() {
- return lastLink;
-}
-public boolean isHyperlinkCursorUsed() {
- return hyperlinkCursorUsed;
-}
- public void mouseDoubleClick(MouseEvent e) {
- }
-public void mouseDown(MouseEvent e) {
- if (e.button == 1)
- return;
- lastLink = (Control)e.widget;
-}
-public void mouseEnter(MouseEvent e) {
- Control control = (Control) e.widget;
- if (isHyperlinkCursorUsed())
- control.setCursor(hyperlinkCursor);
- if (activeBackground != null)
- control.setBackground(activeBackground);
- if (activeForeground != null)
- control.setForeground(activeForeground);
- if (hyperlinkUnderlineMode==UNDERLINE_ROLLOVER) underline(control, true);
-
- IHyperlinkListener action =
- (IHyperlinkListener) hyperlinkListeners.get(control);
- if (action != null)
- action.linkEntered(control);
-}
-public void mouseExit(MouseEvent e) {
- Control control = (Control) e.widget;
- if (isHyperlinkCursorUsed())
- control.setCursor(null);
- if (hyperlinkUnderlineMode==UNDERLINE_ROLLOVER)
- underline(control, false);
- if (background != null)
- control.setBackground(background);
- if (foreground != null)
- control.setForeground(foreground);
- IHyperlinkListener action =
- (IHyperlinkListener) hyperlinkListeners.get(control);
- if (action != null)
- action.linkExited(control);
-}
- public void mouseHover(MouseEvent e) {
- }
-public void mouseUp(MouseEvent e) {
- if (e.button != 1)
- return;
- IHyperlinkListener action =
- (IHyperlinkListener) hyperlinkListeners.get(e.widget);
- if (action != null) {
- Control c = (Control) e.widget;
- c.setCursor(busyCursor);
- action.linkActivated(c);
- if (!c.isDisposed())
- c.setCursor(isHyperlinkCursorUsed()?hyperlinkCursor:null);
- }
-}
-public void paintControl(PaintEvent e) {
- Control label = (Control) e.widget;
- if (hyperlinkUnderlineMode == UNDERLINE_ALWAYS)
- HyperlinkHandler.underline(label, true);
-}
-public void registerHyperlink(Control control, IHyperlinkListener listener) {
- if (background != null)
- control.setBackground(background);
- if (foreground != null)
- control.setForeground(foreground);
- control.addMouseListener(this);
- control.addMouseTrackListener(this);
- if (hyperlinkUnderlineMode == UNDERLINE_ALWAYS)
- control.addPaintListener(this);
- hyperlinkListeners.put(control, listener);
- removeDisposedLinks();
-}
-private void removeDisposedLinks() {
- for (Enumeration keys = hyperlinkListeners.keys(); keys.hasMoreElements();) {
- Control control = (Control)keys.nextElement();
- if (control.isDisposed()) {
- hyperlinkListeners.remove(control);
- }
- }
-}
-public void reset() {
- hyperlinkListeners.clear();
-}
-public void setActiveBackground(org.eclipse.swt.graphics.Color newActiveBackground) {
- activeBackground = newActiveBackground;
-}
-public void setActiveForeground(org.eclipse.swt.graphics.Color newActiveForeground) {
- activeForeground = newActiveForeground;
-}
-public void setBackground(org.eclipse.swt.graphics.Color newBackground) {
- background = newBackground;
-}
-public void setForeground(org.eclipse.swt.graphics.Color newForeground) {
- foreground = newForeground;
-}
-public void setHyperlinkCursorUsed(boolean newHyperlinkCursorUsed) {
- hyperlinkCursorUsed = newHyperlinkCursorUsed;
-}
-public void setHyperlinkUnderlineMode(int newHyperlinkUnderlineMode) {
- hyperlinkUnderlineMode = newHyperlinkUnderlineMode;
-}
-public static void underline(Control control, boolean inside) {
- if (!(control instanceof Label))
- return;
- Composite parent = control.getParent();
- Rectangle bounds = control.getBounds();
- GC gc = new GC(parent);
- Color color = inside? control.getForeground() : control.getBackground();
- gc.setForeground(color);
- int y = bounds.y + bounds.height;
- gc.drawLine(bounds.x, y, bounds.x+bounds.width, y);
- gc.dispose();
-}
-}
-
-
-
-
-
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/IHyperlinkListener.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/IHyperlinkListener.java
deleted file mode 100644
index 03dfbad..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/IHyperlinkListener.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util.flatui;
-
-import org.eclipse.swt.widgets.Control;
-
-public interface IHyperlinkListener {
-
- public void linkActivated(Control linkLabel);
- public void linkEntered(Control linkLabel);
- public void linkExited(Control linkLabel);
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/ToggleControl.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/ToggleControl.java
deleted file mode 100644
index 672cf2a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/ToggleControl.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util.flatui;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlEvent;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.TypedListener;
-
-public class ToggleControl extends Canvas {
- private boolean fCollapsed;
- private Color fDecorationColor;
- private Color fActiveColor;
- private Cursor fActiveCursor;
- private boolean fHasFocus;
- private boolean fHover = false;
- private static final int MARGIN_WIDTH = 2;
- private static final int MARGIN_HEIGHT = 2;
-
- private static final int DEFAULT_HEIGHT = 8;
- private static final int[] EXPANDED_POINTS = { 0, 2, 8, 2, 4, 6 };
- private static final int[] COLLAPSED_POINTS = { 2, 0, 2, 8, 6, 4 };
- private int fMultiplier = 2;
- private int fHeight = DEFAULT_HEIGHT;
-
- /* accessibility */
- private String fName;
- private String fDescription;
-
- public ToggleControl(Composite parent, int style) {
- super(parent, style);
- initAccessible();
-
- addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- paint(e);
- }
- });
- addMouseListener(new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- notifyListeners(SWT.Selection);
- }
- });
- addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if (e.character == '\r' || e.character == ' ') {
- // Activation
- notifyListeners(SWT.Selection);
- }
- }
- });
- addListener(SWT.Traverse, new Listener() {
- public void handleEvent(Event e) {
- if (e.detail != SWT.TRAVERSE_RETURN)
- e.doit = true;
- }
- });
- addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
- if (!fHasFocus) {
- fHasFocus = true;
- redraw();
- }
- }
- public void focusLost(FocusEvent e) {
- if (fHasFocus) {
- fHasFocus = false;
- redraw();
- }
- }
- });
-
- addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fCollapsed = !fCollapsed;
- redraw();
- }
- });
-
- addMouseTrackListener(new MouseTrackAdapter() {
- public void mouseEnter(MouseEvent e) {
- fHover = true;
- if (fActiveCursor != null)
- setCursor(fActiveCursor);
- redraw();
- }
- public void mouseExit(MouseEvent e) {
- fHover = false;
- if (fActiveCursor != null)
- setCursor(null);
- redraw();
- }
- });
- }
-
- public void addSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener != null)
- addListener(SWT.Selection, new TypedListener(listener));
- }
-
- public void setDecorationColor(Color decorationColor) {
- this.fDecorationColor = decorationColor;
- }
-
- public Color getDecorationColor() {
- return fDecorationColor;
- }
-
- public void setActiveDecorationColor(Color activeColor) {
- this.fActiveColor = activeColor;
- }
-
- public void removeSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener != null)
- removeListener(SWT.Selection, listener);
- }
-
- public void setActiveCursor(Cursor activeCursor) {
- this.fActiveCursor = activeCursor;
- }
-
- public Color getActiveDecorationColor() {
- return fActiveColor;
- }
-
- public Point computeSize(int wHint, int hHint, boolean changed) {
-
- return new Point((wHint != SWT.DEFAULT ? wHint : fHeight + 2 * MARGIN_WIDTH), (hHint != SWT.DEFAULT ? hHint : fHeight + 2 * MARGIN_HEIGHT));
- }
-
- protected void paint(PaintEvent e) {
- GC gc = e.gc;
- Point size = getSize();
- gc.setFont(getFont());
- paint(gc);
- if (fHasFocus) {
- gc.setForeground(getForeground());
- gc.drawFocus(0, 0, size.x, size.y);
- }
- }
-
- /*
- * @see SelectableControl#paint(GC)
- */
- protected void paint(GC gc) {
- if (fHover && fActiveColor != null)
- gc.setBackground(fActiveColor);
- else if (fDecorationColor != null)
- gc.setBackground(fDecorationColor);
- else
- gc.setBackground(getForeground());
- Point size = getSize();
- gc.fillPolygon(translate((fCollapsed ? COLLAPSED_POINTS : EXPANDED_POINTS), ((size.x - fHeight) / 2), ((size.y - fHeight) / 2)));
- gc.setBackground(getBackground());
- }
-
- private int[] translate(int[] data, int x, int y) {
- int[] target = new int[data.length];
- for (int i = 0; i < data.length; i += 2) {
- target[i] = data[i]*fHeight/DEFAULT_HEIGHT + x;
- }
- for (int i = 1; i < data.length; i += 2) {
- target[i] = data[i]*fHeight/DEFAULT_HEIGHT + y;
- }
- return target;
- }
-
- public void setHeight(int y) {
- fHeight = y;
- }
-
- private void notifyListeners(int eventType) {
- Event event = new Event();
- event.type = eventType;
- event.widget = this;
- notifyListeners(eventType, event);
- }
-
- public boolean getSelection() {
- return fCollapsed;
- }
-
- public void setSelection(boolean selection) {
- this.fCollapsed = selection;
- }
-
- public void setName(String name) {
- fName = name;
- }
-
- public void setDescription(String description) {
- fDescription = description;
- }
-
- private void initAccessible() {
- getAccessible().addAccessibleListener(new AccessibleAdapter() {
-
- public void getName(AccessibleEvent e) {
- e.result = fName;
- }
-
- public void getDescription(AccessibleEvent e) {
- e.result = fDescription;
- }
- });
-
- getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
-
- public void getLocation(AccessibleControlEvent e) {
- Rectangle location = getBounds();
- Point pt = toDisplay(new Point(location.x, location.y));
- e.x = pt.x;
- e.y = pt.y;
- e.width = location.width;
- e.height = location.height;
- }
-
- public void getChildCount(AccessibleControlEvent e) {
- e.detail = 0;
- }
-
- public void getRole(AccessibleControlEvent e) {
- e.detail = ACC.ROLE_TREE;
- }
-
- public void getState(AccessibleControlEvent e) {
- e.detail = fCollapsed ? ACC.STATE_COLLAPSED : ACC.STATE_EXPANDED;
- }
-
- });
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/WidgetFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/WidgetFactory.java
deleted file mode 100644
index 958fe64..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/flatui/WidgetFactory.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util.flatui;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.custom.TableTree;
-import org.eclipse.swt.custom.ViewForm;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-
-public class WidgetFactory {
- public static final String DEFAULT_HEADER_COLOR = "__default__header__";
- public static final String COLOR_BACKGROUND = "__bg";
- public static final String COLOR_BORDER = "__border";
- public static final String COLOR_COMPOSITE_SEPARATOR = "__compSep";
- public static final String COLOR_HYPERLINK="__hyperlink";
-
- private Hashtable colorRegistry = new Hashtable();
- private Color backgroundColor;
- private Color clientAreaColor;
- private KeyListener deleteListener;
- private Color foregroundColor;
- private Color fReadOnlyColor;
- private Display fDisplay;
- public static final int BORDER_STYLE = SWT.NONE;
- private BorderPainter borderPainter;
- private Color borderColor;
- private HyperlinkHandler hyperlinkHandler;
- private static Image fBanner;
-
-
- class BorderPainter implements PaintListener {
- public void paintControl(PaintEvent event) {
- Composite composite = (Composite) event.widget;
- Control[] children = composite.getChildren();
- for (int i = 0; i < children.length; i++) {
- Control c = children[i];
- //if (c.isEnabled()==false) continue;
- if (c instanceof Text
- || c instanceof Canvas
- || c instanceof CCombo) {
- Rectangle b = c.getBounds();
- GC gc = event.gc;
- gc.setForeground(c.getBackground());
- gc.drawRectangle(b.x - 1, b.y - 1, b.width + 1, b.height + 1);
- gc.setForeground(foregroundColor);
- gc.drawRectangle(b.x - 2, b.y - 2, b.width + 3, b.height + 3);
- }
- else if (c instanceof Table
- || c instanceof Tree
- || c instanceof TableTree) {
- Rectangle b = c.getBounds();
- GC gc = event.gc;
- gc.setForeground(borderColor);
- //gc.drawRectangle(b.x - 2, b.y - 2, b.width + 3, b.height + 3);
- gc.drawRectangle(b.x-1, b.y-1, b.width+2, b.height+2);
- }
- }
- }
- }
-
-
-public WidgetFactory() {
- fDisplay = Display.getDefault();
- initialize();
-}
-
-public Button createButton(Composite parent, String text, int style) {
- int flatStyle = BORDER_STYLE == SWT.BORDER ? SWT.NULL : SWT.FLAT;
- //int flatStyle = SWT.NULL;
- Button button = new Button(parent, style | flatStyle);
- button.setBackground(backgroundColor);
- button.setForeground(foregroundColor);
- if (text!=null) button.setText(text);
- return button;
-}
-public Composite createComposite(Composite parent) {
- return createComposite(parent, SWT.NULL);
-}
-public Composite createComposite(Composite parent, int style) {
- Composite composite = new Composite(parent, style);
- composite.setBackground(backgroundColor);
- return composite;
-}
-public Composite createCompositeSeparator(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setBackground(getColor(COLOR_COMPOSITE_SEPARATOR));
- return composite;
-}
-public Group createGroup(Composite parent, String text) {
- Group group = new Group(parent, SWT.SHADOW_NONE);
- group.setText(text);
- group.setBackground(backgroundColor);
- group.setForeground(foregroundColor);
- return group;
-}
-public Label createHeadingLabel(Composite parent, String text, Color bg) {
- return createHeadingLabel(parent, text, bg, SWT.NONE);
-}
-public Label createHeadingLabel(Composite parent, String text, Color bg, int style) {
- Label label = new Label(parent, style);
- label.setText(text);
- label.setBackground(backgroundColor);
- label.setForeground(foregroundColor);
- label.setFont(JFaceResources.getFontRegistry().get(JFaceResources.BANNER_FONT));
- return label;
-}
-public Label createHyperlinkLabel(Composite parent, String text, IHyperlinkListener listener) {
- return createHyperlinkLabel(parent, text, listener, SWT.NULL);
-}
-public Label createHyperlinkLabel(Composite parent, String text, IHyperlinkListener listener, int style) {
- Label label = createLabel(parent, text, style);
- turnIntoHyperlink(label, listener);
- return label;
-}
-public Label createLabel(Composite parent, String text) {
- return createLabel(parent, text, SWT.NONE);
-}
-public Label createLabel(Composite parent, String text, int style) {
- Label label = new Label(parent, style);
- if (text!=null) label.setText(text);
- label.setBackground(backgroundColor);
- label.setForeground(foregroundColor);
- return label;
-}
-public Label createSeparator(Composite parent, int style) {
- Label label = new Label(parent, SWT.SEPARATOR | style);
- label.setBackground(backgroundColor);
- label.setForeground(borderColor);
- return label;
-}
-public ScrolledComposite createScrolledComposite (Composite parent) {
- ScrolledComposite scrolledcomposite = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
- scrolledcomposite.setBackground(backgroundColor);
- scrolledcomposite.setForeground(foregroundColor);
- return scrolledcomposite;
-}
-public Table createTable(Composite parent, int style) {
- Table table = new Table(parent, BORDER_STYLE | style);
- table.setBackground(backgroundColor);
- table.setForeground(foregroundColor);
- //hookDeleteListener(table);
- return table;
-}
-public Text createText(Composite parent, String value) {
- return createText(parent, value, BORDER_STYLE | SWT.SINGLE);
-}
-public Text createText(Composite parent, String value, int style) {
- Text text = new Text(parent, style);
- text.setText(value);
- text.setBackground(clientAreaColor);
- text.setForeground(foregroundColor);
- if ((style & SWT.READ_ONLY) != 0)
- text.setForeground(fReadOnlyColor);
- return text;
-}
-public Tree createTree(Composite parent, int style) {
- Tree tree = new Tree(parent, BORDER_STYLE | style);
- tree.setBackground(backgroundColor);
- tree.setForeground(foregroundColor);
- //hookDeleteListener(tree);
- return tree;
-}
-/*
-private void deleteKeyPressed(Widget widget) {
- if (!(widget instanceof Control)) return;
- Control control = (Control)widget;
- for (Control parent = control.getParent();
- parent != null;
- parent = parent.getParent()) {
- if (parent.getData() instanceof FormSection) {
- FormSection section = (FormSection) parent.getData();
- section.doGlobalAction(IWorkbenchActionConstants.DELETE);
- break;
- }
- }
-}
-*/
-public ViewForm createViewForm(Composite parent) {
- ViewForm viewForm = new ViewForm(parent, SWT.NULL);
- viewForm.setBackground(clientAreaColor);
- viewForm.setForeground(foregroundColor);
- return viewForm;
-}
-public void dispose() {
- Enumeration colors= colorRegistry.elements();
- while (colors.hasMoreElements()) {
- Color c = (Color)colors.nextElement();
- c.dispose();
- }
- hyperlinkHandler.dispose();
- colorRegistry=null;
- if (fBanner != null)
- {
- fBanner.dispose();
- fBanner = null;
- }
-}
-public Color getBackgroundColor() {
- return backgroundColor;
-}
-public Image getBanner() {
- if (fBanner == null)
- {
- try {
- fBanner = (ImageDescriptor.createFromURL(new URL((WSDLEditorPlugin.getInstance().getDescriptor().getInstallURL()), "icons\form_banner.gif"))).createImage();
- System.out.println("Created Image!!!! ");
- } catch (MalformedURLException e) {
- System.out.println("Exception!!!! " + e);
- }
- }
- return fBanner;
-}
-public Color getBorderColor() {
- return borderColor;
-}
-public Cursor getBusyCursor() {
- return hyperlinkHandler.getBusyCursor();
-}
-public Color getClientAreaColor() {
- return clientAreaColor;
-}
-public Color getColor(String key) {
- return (Color)colorRegistry.get(key);
-}
-public Color getForegroundColor() {
- return foregroundColor;
-}
-public Color getHyperlinkColor() {
- return hyperlinkHandler.getForeground();
-}
-public Cursor getHyperlinkCursor() {
- return hyperlinkHandler.getHyperlinkCursor();
-}
-public Color getHyperlinkHoverColor() {
- return hyperlinkHandler.getActiveForeground();
-}
-public int getHyperlinkUnderlineMode() {
- return hyperlinkHandler.getHyperlinkUnderlineMode();
-}
-/*
-public void hookDeleteListener(Control control) {
- if (deleteListener == null) {
- deleteListener = new KeyAdapter() {
- public void keyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- deleteKeyPressed(event.widget);
- }
- }
- };
- }
- control.addKeyListener(deleteListener);
-}
-*/
- private void initStaticColors()
- {
- if (colorRegistry == null)
- {
- colorRegistry = new Hashtable();
- registerColor(COLOR_BACKGROUND, 0xff, 0xfe, 0xf9);
- registerColor(COLOR_BORDER, 195, 191, 179);
- registerColor(COLOR_COMPOSITE_SEPARATOR, 152, 170, 203);
- registerColor(DEFAULT_HEADER_COLOR, 0x48, 0x70, 0x98);
- registerColor(COLOR_HYPERLINK, 0, 0, 153);
- }
- }
-
-private void initialize() {
- clientAreaColor = fDisplay.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
- fReadOnlyColor = fDisplay.getSystemColor(SWT.COLOR_DARK_GRAY);
- initStaticColors();
- backgroundColor = clientAreaColor;
- borderColor = getColor(COLOR_BORDER);
- foregroundColor = fDisplay.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- hyperlinkHandler = new HyperlinkHandler();
- hyperlinkHandler.setForeground(getColor(COLOR_HYPERLINK));
- hyperlinkHandler.setBackground(backgroundColor);
-}
-public void paintBordersFor(Composite parent) {
- if (BORDER_STYLE == SWT.BORDER) return;
- if (borderPainter==null) borderPainter = new BorderPainter();
- parent.addPaintListener(borderPainter);
-}
-public Color registerColor(String key, int r, int g, int b) {
- Color c = new Color(fDisplay, r, g, b);
- colorRegistry.put(key, c);
- return c;
-}
-
-public void setClientAreaColor(Color color)
-{
- clientAreaColor = color;
- backgroundColor = clientAreaColor;
-}
-
-public void setHyperlinkColor(Color color) {
- hyperlinkHandler.setForeground(color);
-}
-public void setHyperlinkHoverColor(org.eclipse.swt.graphics.Color hoverColor) {
- hyperlinkHandler.setActiveForeground(hoverColor);
-}
-public void setHyperlinkUnderlineMode(int newHyperlinkUnderlineMode) {
- hyperlinkHandler.setHyperlinkUnderlineMode(newHyperlinkUnderlineMode);
-}
-public void turnIntoHyperlink(Control control, IHyperlinkListener listener) {
- hyperlinkHandler.registerHyperlink(control, listener);
-}
-
-}
-
-
-
-
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ui/BaseDesignWindow.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ui/BaseDesignWindow.java
deleted file mode 100644
index 997198b..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ui/BaseDesignWindow.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util.ui;
-
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.part.EditorActionBarContributor;
-
-import org.eclipse.wst.common.ui.UIPlugin;
-
-abstract public class BaseDesignWindow extends Viewer
-{
- private Font font;
-
- protected ScrolledComposite mainUIComponent;
- protected Composite controlsContainer;
-
- protected boolean pageComplete = true;
- protected Object input;
-
- private IStatusLineManager statusLine;
-
- public BaseDesignWindow(IStatusLineManager statusLine)
- {
- this.statusLine = statusLine;
- }
-
- protected void setStatusLine(IStatusLineManager statusLine)
- {
- this.statusLine = statusLine;
- }
-
- protected IStatusLineManager getStatusLine()
- {
- if (statusLine == null)
- {
- //statusLine = WorkbenchUtility.getStatusLineManager();
-
- IWorkbench workbench = UIPlugin.getDefault().getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-
- try
- {
- EditorActionBarContributor contributor = (EditorActionBarContributor)editorPart.getEditorSite().getActionBarContributor();
- statusLine = contributor.getActionBars().getStatusLineManager();
- }
- catch (Exception e)
- {
- }
- }
- return statusLine;
- }
-
- public Object getInput()
- {
- return input;
- }
-
- public void setInput(Object input)
- {
- if (this.input != input)
- {
- setErrorMessage("");
- }
-
- this.input = input;
- }
-
- public ISelection getSelection()
- {
- return null;
- }
-
- public void setSelection(ISelection selection, boolean reveal)
- {
- }
-
- public void refresh()
- {
- }
-
- /**
- * A design view that has a main area for controls, and a message line at
- * the bottom
- */
- protected Control createDesignPane(Composite parent, int numColumns)
- {
- GridData gd;
-
- // Create the main UI container
- mainUIComponent= new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL)
- {
- public void setVisible(boolean visible)
- {
- super.setVisible(visible);
- if (visible == false && !currentMessage.equals(""))
- {
- showMessageInStatusLine(visible == true);
- }
- }
- };
-
-// mainUIComponent.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- controlsContainer = new Composite(mainUIComponent, SWT.NONE);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- controlsContainer.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- controlsContainer.setLayoutData(data);
-
- // TODO: Remove above line and uncomment the following two when XSDEditor views
- // are rewritten. Also refer do related TODO in DTDEditor's BaseWindow.
- // FlatViewUtility flatViewUtility = new FlatViewUtility();
- // controlsContainer = flatViewUtility.createComposite(mainUIComponent, numColumns);
-
- mainUIComponent.setContent(controlsContainer);
-
- return mainUIComponent;
- }
-
- public void setScrollComposite()
- {
- Point p = controlsContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- mainUIComponent.setExpandHorizontal(true);
- mainUIComponent.setExpandVertical(true);
- mainUIComponent.setMinSize(p);
- }
-
- public Composite getControlsContainer()
- {
- return controlsContainer;
- }
-
- /**
- * Sets the complete state of the page.
- * If false, then client is not allowed to move to next page
- */
- public void setPageComplete(boolean complete)
- {
- pageComplete= complete;
- }
-
- /**
- * Returns whether the page is complete or not.
- */
- public boolean isPageComplete()
- {
- return pageComplete;
- }
-
- private String currentMessage = "";
- protected void showMessageInStatusLine(boolean show)
- {
- if (getStatusLine() == null)
- return;
-
- if (show)
- {
- getStatusLine().setErrorMessage(currentMessage);
- }
- else
- {
- getStatusLine().setErrorMessage("");
- }
-
-
- getStatusLine().update(false);
- }
-
- /**
- * Sets the message line
- */
- public void setMessage(String message)
- {
- currentMessage = message;
- if (getStatusLine() != null)
- {
- getStatusLine().setErrorMessage(currentMessage);
- getStatusLine().update(false);
- }
- }
-
- /**
- * Clears a message.
- */
- public void clearMessage()
- {
- currentMessage = "";
- if (getStatusLine() != null)
- {
- getStatusLine().setErrorMessage(currentMessage);
- getStatusLine().update(false);
- }
- }
-
- public void setErrorMessage(String message)
- {
- setMessage(message);
- setPageComplete(false);
- }
-
- public void clearErrorMessage()
- {
- clearMessage();
- setPageComplete(true);
- }
-
- public String getErrorMessage()
- {
- return currentMessage;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ui/BorderPainter.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ui/BorderPainter.java
deleted file mode 100644
index 47bdeb5..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ui/BorderPainter.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util.ui;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.TableTree;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-
-public class BorderPainter implements PaintListener
-{
- Color backgroundColor, foregroundColor;
- static Color borderColor;
-
- public BorderPainter()
- {
- Display display = Display.getCurrent();
- if (borderColor == null)
- {
- borderColor = new Color(Display.getCurrent(), 195, 191, 179);
- }
- backgroundColor = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
- foregroundColor = display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- }
-
- public void paintControl(PaintEvent event)
- {
- Composite composite = (Composite) event.widget;
- Control[] children = composite.getChildren();
- for (int i = 0; i < children.length; i++)
- {
- Control c = children[i];
- if (c.isEnabled()==false)
- {
- if (c instanceof Text
- || c instanceof Canvas
- || c instanceof List
- || c instanceof CCombo)
- {
- Rectangle b = c.getBounds();
- GC gc = event.gc;
- gc.setForeground(backgroundColor);
-// gc.drawRectangle(b.x - 1, b.y - 1, b.width + 1, b.height + 1);
- gc.setForeground(borderColor);
- gc.drawRectangle(b.x - 2, b.y - 2, b.width + 3, b.height + 3);
- }
- continue;
- }
- if (c instanceof Text
-// || c instanceof Canvas
- || c instanceof List
- || c instanceof CCombo)
- {
- Rectangle b = c.getBounds();
- GC gc = event.gc;
- gc.setForeground(backgroundColor);
- gc.drawRectangle(b.x - 1, b.y - 1, b.width + 1, b.height + 1);
- gc.setForeground(foregroundColor);
- gc.drawRectangle(b.x - 2, b.y - 2, b.width + 3, b.height + 3);
- }
- else if (c instanceof Table
- || c instanceof Tree
- || c instanceof TableTree) {
- Rectangle b = c.getBounds();
- GC gc = event.gc;
- gc.setForeground(foregroundColor);
- //gc.drawRectangle(b.x - 2, b.y - 2, b.width + 3, b.height + 3);
- gc.drawRectangle(b.x-1, b.y-1, b.width+2, b.height+2);
- }
- }
- }
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ui/FlatViewUtility.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ui/FlatViewUtility.java
deleted file mode 100644
index a6b666c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/util/ui/FlatViewUtility.java
+++ /dev/null
@@ -1,922 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.util.ui;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-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.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.internal.misc.Workbook;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.flatui.FlatPageHeader;
-import org.eclipse.wst.wsdl.ui.internal.util.flatui.WidgetFactory;
-
-public class FlatViewUtility implements PaintListener
-{
- Color backgroundColor, foregroundColor;
- Color comboBackgroundColor, comboDisabledColor;
- static Color borderColor;
-
- // Added for createFlatPageHeader()
- private boolean headingVisible=true;
- private Image headingImage = null;
- private Composite headerControl = null;
- private int TITLE_VMARGIN = 5;
- private FlatPageHeader flatPageHeader = null;
-
- private KeyboardHandler keyboardHandler;
-
- public static final int H_SCROLL_INCREMENT = 5;
- public static final int V_SCROLL_INCREMENT = 64;
-
- // this defaults to the flat style, but users can change it if they wish
- private int flatStyle = SWT.FLAT;
- private int border = 0;
-
- public FlatViewUtility()
- {
- Display display = Display.getCurrent();
- if (borderColor == null)
- {
- borderColor = new Color(Display.getCurrent(), 195, 191, 179);
- }
- backgroundColor = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
- foregroundColor = display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- comboBackgroundColor = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
- comboDisabledColor = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
- keyboardHandler = new KeyboardHandler();
- }
-
- public FlatViewUtility(boolean isFlat)
- {
- this();
-
- setFlat(isFlat);
- }
-
- public void setFlat(boolean flat)
- {
- Display display = Display.getCurrent();
- if (flat)
- {
- flatStyle = SWT.FLAT;
- backgroundColor = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
- foregroundColor = display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- }
- else
- {
- flatStyle = 0;
- border = SWT.BORDER;
- backgroundColor = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
- foregroundColor = display.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND);
- }
- }
-
- public void setColor(Control c)
- {
- if (flatStyle == SWT.FLAT)
- {
- c.setBackground(backgroundColor);
- }
- }
-
- public void paintControl(PaintEvent event)
- {
- Control c = (Control) event.widget;
- if (c.isEnabled()==false)
- {
- if (c instanceof Text
-// || c instanceof Canvas
- || c instanceof List
- || c instanceof CCombo)
- {
- Rectangle b = c.getParent().getBounds();
- GC gc = event.gc;
- gc.setForeground(backgroundColor);
-// gc.drawRectangle(b.x - 1, b.y - 1, b.width + 1, b.height + 1);
- gc.setForeground(borderColor);
-// gc.drawRectangle(b.x - 2, b.y - 2, b.width + 3, b.height + 3);
- }
- }
-
- // Defect 252891 : this causes some major problems on Linux GTK
- // This looks rather dodgy in any case since an cyclic painting behaviour
- // is likely occuring here
- //if (c.getParent() != null)
- //{
- // c.getParent().redraw();
- //}
- }
-
- private static Font font;
-
- public static Font getFont()
- {
- if (font == null)
- {
- font = new Font(Display.getCurrent(), "ms sans serif", 8, SWT.NORMAL);
- }
- return font;
- }
-
- public static void setFont(Font newFont)
- {
- font = newFont;
- }
-
- public static void setComposite(Composite comp)
- {
- // deprecated. Remove later
- }
-
- public Composite createSimpleComposite(Composite parent, int style)
- {
- Composite composite = new Composite(parent, style | flatStyle);
- composite.setFont(getFont());
- setColor(composite);
-
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
- return composite;
- }
-
- public Composite createComposite(Composite parent, int numColumns)
- {
- Composite composite = new Composite(parent, SWT.NONE | flatStyle);
- composite.setFont(getFont());
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- setColor(composite);
- if (flatStyle == SWT.FLAT)
- {
- composite.addPaintListener(new BorderPainter());
- }
- return composite;
- }
-
- public Composite createComposite(Composite parent, int numColumns, boolean horizontalFill)
- {
- if (!horizontalFill)
- {
- createComposite(parent, numColumns);
- }
-
- Composite composite = new Composite(parent, SWT.NONE | flatStyle);
- composite.setFont(getFont());
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- composite.setLayoutData(data);
- setColor(composite);
- if (flatStyle == SWT.FLAT)
- {
- composite.addPaintListener(new BorderPainter());
- }
- return composite;
- }
-
- public Composite createComposite(Composite parent, int numColumns, boolean horizontalFill, boolean verticalFill)
- {
- if (!horizontalFill && !verticalFill)
- {
- createComposite(parent, numColumns);
- }
-
- Composite composite = new Composite(parent, SWT.NONE | flatStyle);
- composite.setFont(getFont());
-
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- composite.setLayoutData(data);
- setColor(composite);
- if (flatStyle == SWT.FLAT)
- {
- composite.addPaintListener(new BorderPainter());
- }
- return composite;
- }
-
- public SashForm createSashForm(Composite parent, int style)
- {
- SashForm sashForm = new SashForm(parent, style | flatStyle);
- setColor(sashForm);
- return sashForm;
- }
-
- public PageBook createPageBook(Composite parent, int style)
- {
- PageBook pageBook = new PageBook(parent, style | flatStyle);
- setColor(pageBook);
- if (flatStyle == SWT.FLAT)
- {
- pageBook.addPaintListener(new BorderPainter());
- }
- return pageBook;
- }
-
- public Workbook createWorkbook(Composite parent, int style)
- {
- Workbook workbook = new Workbook(parent, style | flatStyle);
- TabFolder tabFolder = workbook.getTabFolder();
- tabFolder.setBackground(backgroundColor);
-// TODO 3.0: Port
-// PageBook pageBook = workbook.getPageBook();
-// setColor(pageBook);
-// if (flatStyle == SWT.FLAT)
-// {
-// pageBook.addPaintListener(new BorderPainter());
-// }
- return workbook;
- }
-
- public Label createHeadingLabel(Composite parent, String text, Color bg) {
- return createHeadingLabel(parent, text, bg, SWT.NONE);
- }
- public Label createHeadingLabel(Composite parent, String text, Color bg, int style) {
- Label label = new Label(parent, style);
- label.setText(text);
- setColor(label);
- if (flatStyle == SWT.FLAT)
- {
- label.setForeground(foregroundColor);
- }
- label.setFont(JFaceResources.getFontRegistry().get(JFaceResources.BANNER_FONT));
- return label;
- }
-
- public Label createHorizontalFiller(Composite parent, int horizontalSpan)
- {
- Label label = new Label(parent, SWT.LEFT | flatStyle);
- setColor(label);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = horizontalSpan;
- label.setLayoutData(data);
- return label;
- }
-
- /**
- * Helper method for creating labels.
- */
- public Label createLabel(Composite parent, int style, String text)
- {
- Label label = new Label(parent, style | flatStyle);
- setColor(label);
- label.setText(text);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
- }
-
- public Label createLabel(Composite parent, String text)
- {
- Label label = new Label(parent, SWT.LEFT | flatStyle);
- setColor(label);
- label.setText(text);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
- }
-
- public Label createLabel(Composite parent, String text, int alignment)
- {
- Label label = new Label(parent, SWT.LEFT | flatStyle);
- label.setText(text);
- setColor(label);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = alignment;
- label.setLayoutData(data);
- return label;
- }
-
- /**
- * Helper method for creating buttons.
- */
- public Button createPushButton(Composite parent, String label)
- {
- Button button = new Button(parent, SWT.PUSH | flatStyle);
- button.setText(label);
- setColor(button);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
- button.addKeyListener(keyboardHandler);
-
- return button;
- }
-
- public Table createTable(Composite parent)
- {
- Table table = new Table(parent, SWT.SINGLE | SWT.BORDER | flatStyle);
- setColor(table);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- table.setLayoutData(data);
- return table;
- }
-
- /**
- * Create radio button
- */
- public Button createRadioButton(Composite parent, String label)
- {
- Button button = new Button(parent, SWT.RADIO | flatStyle);
- button.setText(label);
- setColor(button);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
- button.addKeyListener(keyboardHandler);
-
- return button;
- }
-
- /**
- * Helper method for creating check box
- */
- public Button createCheckBox(Composite parent, String label)
- {
- Button button = new Button(parent, SWT.CHECK | flatStyle);
- button.setText(label);
- setColor(button);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
- return button;
- }
-
- public Combo createComboBox(Composite parent)
- {
- return createComboBox(parent, true);
- }
-
- public Combo createComboBox(Composite parent, boolean isReadOnly)
- {
- int style = isReadOnly == true ? SWT.READ_ONLY : SWT.DROP_DOWN;
-
- Combo combo = new Combo(parent, style | flatStyle | border);
- setColor(combo);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- combo.setLayoutData(data);
- return combo;
- }
-
- public CCombo createCComboBox(Composite parent)
- {
- return createCComboBox(parent, true);
- }
-
- public CCombo createCComboBox(Composite parent, boolean isReadOnly)
- {
- int style = isReadOnly == true ? SWT.READ_ONLY : SWT.DROP_DOWN;
-
- CCombo combo = new CCombo(parent, style | flatStyle | border);
- // setColor(combo);
- // Always use List Background
- combo.setBackground(comboBackgroundColor);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- combo.setLayoutData(data);
- if (flatStyle == SWT.FLAT)
- {
- combo.addPaintListener(this);
- }
- else
- {
- /*
- // Defect 252891 : I'm not sure if this code will also cause problems on Linux GTK
- // But since its potentially cyclic ... I'm commenting it out for now
- combo.addPaintListener(new PaintListener()
- {
- public void paintControl(PaintEvent event)
- {
- Control c = (Control) event.widget;
- if (c.isEnabled()==true)
- {
- c.setBackground(comboBackgroundColor);
- }
- else
- {
- c.setBackground(comboDisabledColor);
- }
- final Control con = c;
- Runnable delayedUpdate = new Runnable()
- {
- public void run()
- {
- if (con != null)
- {
- if (!con.isDisposed()) // it gets disposed
- {
- con.redraw();
- }
- }
- }
- };
- Display.getCurrent().asyncExec(delayedUpdate);
- }
- });*/
- }
- return combo;
- }
-
- public List createListBox(Composite parent, int width, boolean isMultiSelect)
- {
- int style = isMultiSelect ? SWT.MULTI : SWT.SINGLE;
- List list = new List(parent, style | flatStyle | border);
- setColor(list);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = width;
- list.setLayoutData(data);
- if (flatStyle == SWT.FLAT)
- {
- list.addPaintListener(this);
- }
- return list;
- }
-
- public List createListBox(Composite parent, int width, boolean isMultiSelect, boolean verticalFill)
- {
- int style = isMultiSelect ? SWT.MULTI : SWT.SINGLE;
- List list = new List(parent, style | flatStyle | border);
- setColor(list);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = verticalFill;
- data.widthHint = width;
- list.setLayoutData(data);
- if (flatStyle == SWT.FLAT)
- {
- list.addPaintListener(this);
- }
- return list;
- }
-
- public List createListBox(Composite parent, int style)
- {
- List list = new List(parent, style | flatStyle | border);
- setColor(list);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- list.setLayoutData(data);
- if (flatStyle == SWT.FLAT)
- {
- list.addPaintListener(this);
- }
- return list;
- }
-
- public Text createTextField(Composite parent)
- {
- Text text = new Text(parent, SWT.SINGLE | flatStyle | border);
- setColor(text);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- text.setLayoutData(data);
- if (flatStyle == SWT.FLAT)
- {
- text.addPaintListener(this);
- }
- text.addKeyListener(keyboardHandler);
- return text;
- }
-
- public Text createTextField(Composite parent, int width)
- {
- Text text = new Text(parent, SWT.SINGLE | flatStyle | border);
- setColor(text);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = width;
- text.setLayoutData(data);
- if (flatStyle == SWT.FLAT)
- {
- text.addPaintListener(this);
- }
- text.addKeyListener(keyboardHandler);
- return text;
- }
-
- public Text createTextField(Composite parent, int width, int style)
- {
- Text text = new Text(parent, style | SWT.SINGLE | flatStyle | border);
- setColor(text);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = width;
- text.setLayoutData(data);
- if (flatStyle == SWT.FLAT)
- {
- text.addPaintListener(this);
- }
- return text;
- }
-
- /**
- * <code>createWrappedMultiTextField</code> creates a wrapped multitext field
- *
- * @param parent a <code>Composite</code> value
- * @param width an <code>int</code> value
- * @param numLines an <code>int</code> value representing number of characters in height
- * @param verticalFill a <code>boolean</code> value
- * @return a <code>Text</code> value
- */
- public Text createWrappedMultiTextField(Composite parent, int width, int numLines, boolean verticalFill)
- {
- Text text = new Text(parent, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | flatStyle | border);
- setColor(text);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- if (verticalFill)
- {
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- }
- data.widthHint = width;
- FontData[] fontData = getFont().getFontData();
- // hack for now where on Windows, only 1 fontdata exists
- data.heightHint = numLines * fontData[0].getHeight();
- text.setLayoutData(data);
- if (flatStyle == SWT.FLAT)
- {
- text.addPaintListener(this);
- }
- return text;
- }
-
- public Text createMultiTextField(Composite parent, int width, int height, boolean verticalFill)
- {
- Text text = new Text(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | flatStyle | border);
- setColor(text);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- if (verticalFill)
- {
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- }
- data.widthHint = width;
- data.heightHint = height;
- text.setLayoutData(data);
- if (flatStyle == SWT.FLAT)
- {
- text.addPaintListener(this);
- }
- return text;
- }
-
- public Text createMultiTextField(Composite parent, boolean verticalFill)
- {
- Text text = new Text(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | flatStyle | border);
- setColor(text);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- if (verticalFill)
- {
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- }
- text.setLayoutData(data);
- if (flatStyle == SWT.FLAT)
- {
- text.addPaintListener(this);
- }
- return text;
- }
-
- public Group createGroup(Composite parent, int numColumns, String text, boolean verticalFill)
- {
- Group group = new Group(parent, SWT.SHADOW_ETCHED_IN | flatStyle);
- group.setText(text);
- setColor(group);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- if (verticalFill)
- {
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- }
- group.setLayoutData(data);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- group.setLayout(layout);
- if (flatStyle == SWT.FLAT)
- {
- group.addPaintListener(new BorderPainter());
- }
- return group;
- }
-
- public Group createGroup(Composite parent, int numColumns, String text, boolean verticalFill, int alignment)
- {
- Group group = new Group(parent, SWT.SHADOW_ETCHED_IN | flatStyle);
- group.setText(text);
- setColor(group);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.verticalAlignment = alignment;
- if (verticalFill)
- {
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- }
- group.setLayoutData(data);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- group.setLayout(layout);
- if (flatStyle == SWT.FLAT)
- {
- group.addPaintListener(new BorderPainter());
- }
- return group;
- }
-
- public Label createVerticalFiller(Composite parent, int verticalSpan)
- {
- Label label = new Label(parent, SWT.LEFT | flatStyle);
- label.setFont(getFont());
- setColor(label);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.verticalSpan = verticalSpan;
- label.setLayoutData(data);
-
- return label;
- }
-
- //
- // FlatPageHeader
- //
-
- // This will use the default background image.
- public Composite createFlatPageHeader
- (Composite parent,
- String title)
- {
- Image bgImage = createDefaultImage();
- return createFlatPageHeader(parent,bgImage,title);
- }
-
- // Provide your own background image.
- public Composite createFlatPageHeader
- (Composite parent,
- Image bgImage,
- String title)
- {
- FlatPageHeader header = new FlatPageHeader(parent,SWT.NONE);
- header.setLayout(new PageLayout());
- header.setBackgroundImage(bgImage);
- header.setText(title);
- WidgetFactory factory = new WidgetFactory();
- Composite formParent = factory.createComposite(header);
- //Composite formParent = createComposite(header,1);
- createPageContent(formParent);
- headerControl = header; // this is used in getTitleHeight()
- return formParent;
- }
-
- public void updateFlatPageHeaderTitle(String title)
- {
- ((FlatPageHeader)headerControl).setText(title);
- }
-
- private void createPageContent(Composite parent)
- {
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- parent.setLayout(layout);
- parent.setLayoutData(new GridData(GridData.FILL_BOTH));
- }
-
- class PageLayout extends Layout
- {
- protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache)
- {
- if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
- return new Point(wHint, hHint);
- int x = 0;
- Control client = composite.getChildren()[0];
- Point csize = client.computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache);
- if (headingVisible) csize.y += getTitleHeight();
-
- return csize;
- }
-
- protected void layout(Composite composite, boolean flushCache)
- {
- Rectangle clientArea = composite.getClientArea();
- Control client = composite.getChildren()[0];
- int theight = headingVisible ? getTitleHeight() : 0;
- client.setBounds(clientArea.x, clientArea.y + theight, clientArea.width, clientArea.height - theight);
- }
- }
-
- private int getTitleHeight()
- {
- int imageHeight = 0;
- // Note - Find out why headingImage is always null.
- if (headingImage != null && SWT.getPlatform().equals("motif") == false)
- imageHeight = headingImage.getBounds().height;
-
- GC gc = new GC(headerControl);
- gc.setFont(JFaceResources.getHeaderFont());
- FontMetrics fm = gc.getFontMetrics();
- int fontHeight = fm.getHeight();
- gc.dispose();
-
- int height = fontHeight + TITLE_VMARGIN + TITLE_VMARGIN;
- return Math.max(height,imageHeight);
- }
-
-
- private Image createDefaultImage()
- {
- return ImageDescriptor.createFromFile
- (WSDLEditorPlugin.class,
- "icons/page_banner.gif").createImage();
- }
- /**
- * Returns the backgroundColor.
- * @return Color
- */
- public Color getBackgroundColor()
- {
- return backgroundColor;
- }
-
- public class KeyboardHandler extends KeyAdapter
- {
- public void keyPressed(KeyEvent e)
- {
- Widget w = e.widget;
- if (w instanceof Control)
- {
- processKey(e.keyCode, (Control) w);
- }
- }
-
- private void scrollVertical(ScrolledComposite scomp, boolean up)
- {
- scroll(scomp, 0, up ? -V_SCROLL_INCREMENT : V_SCROLL_INCREMENT);
- }
-
- private void scrollHorizontal(ScrolledComposite scomp, boolean left)
- {
- scroll(scomp, left ? -H_SCROLL_INCREMENT : H_SCROLL_INCREMENT, 0);
- }
-
- private void scrollPage(ScrolledComposite scomp, boolean up)
- {
- Point origin = scomp.getOrigin();
- Rectangle clientArea = scomp.getClientArea();
- int increment = up ? -clientArea.height : clientArea.height;
- scroll(scomp, 0, increment);
- }
-
- private void scroll(ScrolledComposite scomp, int xoffset, int yoffset)
- {
- Point origin = scomp.getOrigin();
- Point contentSize = scomp.getContent().getSize();
- int xorigin = origin.x + xoffset;
- int yorigin = origin.y + yoffset;
- xorigin = Math.max(xorigin, 0);
- xorigin = Math.min(xorigin, contentSize.x - 1);
- yorigin = Math.max(yorigin, 0);
- yorigin = Math.min(yorigin, contentSize.y - 1);
- scomp.setOrigin(xorigin, yorigin);
- }
-
- protected ScrolledComposite getScrolledComposite(Control c)
- {
- Composite parent = c.getParent();
-
- while (parent != null)
- {
- if (parent instanceof ScrolledComposite)
- {
- return (ScrolledComposite) parent;
- }
- parent = parent.getParent();
- }
- return null;
- }
-
- protected void processKey(int keyCode, Control c)
- {
- ScrolledComposite scomp = getScrolledComposite(c);
- if (scomp != null)
- {
- switch (keyCode)
- {
- case SWT.ARROW_DOWN :
- scrollVertical(scomp, false);
- break;
- case SWT.ARROW_UP :
- scrollVertical(scomp, true);
- break;
- case SWT.ARROW_LEFT :
- scrollHorizontal(scomp, true);
- break;
- case SWT.ARROW_RIGHT :
- scrollHorizontal(scomp, false);
- break;
- case SWT.PAGE_UP :
- scrollPage(scomp, true);
- break;
- case SWT.PAGE_DOWN :
- scrollPage(scomp, false);
- break;
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BaseViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BaseViewer.java
deleted file mode 100644
index 13faa4d..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BaseViewer.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
-import org.eclipse.wst.wsdl.ui.internal.util.ui.BaseDesignWindow;
-import org.eclipse.wst.wsdl.ui.internal.util.ui.BorderPainter;
-import org.eclipse.wst.wsdl.ui.internal.util.ui.FlatViewUtility;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.format.FormatProcessorXML;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public abstract class BaseViewer extends BaseDesignWindow implements Listener, SelectionListener
-{
-// protected Object input;
-
- // for use in subclasses
- protected FlatViewUtility flatViewUtility = new FlatViewUtility(true);
-
- public BaseViewer(IStatusLineManager statusLine)
- {
- super(statusLine);
- }
-
- public Object getInput()
- {
- return input;
- }
-
- // gets called only if we currently are not handling an event
- abstract public void doSetInput(Object input);
-
- /**
- * @see org.eclipse.jface.viewers.Viewer#setInput(Object)
- */
- static Object oldInput = null;
- ModelAdapterListener oldModelAdapterListener = null;
-
- public void setInput(Object input)
- {
- super.setInput(input);
-
- doSetInput(input);
-/*
- if (!isInDoHandle() && !getControl().isDisposed())
- {
- final Object obj = input;
- getControl().getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- doSetInput(obj);
- }
- });
- }
-*/
- }
-
-
- boolean listenerEnabled = true;
- /**
- * Get the value of listenerEnabled.
- * @return value of listenerEnabled.
- */
- public boolean isListenerEnabled()
- {
- return listenerEnabled;
- }
-
- /**
- * Set the value of listenerEnabled.
- * @param v Value to assign to listenerEnabled.
- */
- public void setListenerEnabled(boolean v)
- {
- this.listenerEnabled = v;
- }
-
-
- public void handleEvent(Event event)
- {
- if (isListenerEnabled() &&
- getInput() != null &&
- !isInDoHandle)
- {
- isInDoHandle = true;
- startDelayedEvent(event);
- isInDoHandle = false;
- } // end of if ()
- }
-
- abstract public void doHandleEvent(Event event);
- abstract public void createControl(Composite parent);
-
- protected DelayedEvent delayedTask;
-
- protected void startDelayedEvent(Event e)
- {
- if (delayedTask == null ||
- delayedTask.getEvent() == null)
- {
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500,delayedTask);
- }
- else
- {
- Event delayedEvent = delayedTask.getEvent();
-
- if (e.widget == delayedEvent.widget &&
- e.type == delayedEvent.type)
- {
- // same event, just different data, delay new event
- delayedTask.setEvent(null);
- }
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500,delayedTask);
- }
- }
-
- class DelayedEvent implements Runnable
- {
- protected Event event;
-
- /*
- * @see Runnable#run()
- */
- public void run()
- {
- if (event != null)
- {
- isInDoHandle = true;
- doHandleEvent(event);
- isInDoHandle = false;
- event = null;
- }
- }
-
- /**
- * Gets the event.
- * @return Returns a Event
- */
- public Event getEvent()
- {
- return event;
- }
-
- /**
- * Sets the event.
- * @param event The event to set
- */
- public void setEvent(Event event)
- {
- this.event = event;
- }
-
- }
-
-
- boolean isInDoHandle;
- /**
- * Get the value of isInDoHandle.
- * @return value of isInDoHandle.
- */
- public boolean isInDoHandle()
- {
- return isInDoHandle;
- }
-
- /*
- * @see Viewer#getControl()
- */
- public Control getControl()
- {
- return mainUIComponent;
- }
-
-
- /*
- * @see BaseDesignWindow#createDesignPane(Composite, int)
- */
- protected Control createDesignPane(Composite arg0, int arg1)
- {
- Control control = super.createDesignPane(arg0, arg1);
-
- Composite client = super.getControlsContainer();
-
- client.addPaintListener(new BorderPainter());
-
- client.setBackground(new Color(Display.getCurrent(),255,255,255));
-
- return control;
- }
-
-
- public ISelection getSelection()
- {
- return null;
- }
-
- public void refresh()
- {
- }
-
- public void setSelection(ISelection selection, boolean reveal)
- {
- }
-
-
-// public abstract Control getControl();
-
-
- public Node getNode()
- {
- return (Node) getInput();
- }
-
-
- public void doWidgetDefaultSelected(SelectionEvent e)
- {}
-
- public void doWidgetSelected(SelectionEvent e)
- {}
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e)
- {
- if (isListenerEnabled() &&
- getInput() != null &&
- !isInDoHandle)
- {
- isInDoHandle = true;
- doWidgetDefaultSelected(e);
- isInDoHandle = false;
- }
-
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e)
- {
- if (isListenerEnabled() &&
- getInput() != null &&
- !isInDoHandle)
- {
- isInDoHandle = true;
- doWidgetSelected(e);
- isInDoHandle = false;
- }
-
- }
-
- public Node getChildNode(Element parent, String childName)
- {
- NodeList list = null;
- if (parent != null)
- {
- list = parent.getChildNodes();
- }
-
- String name = null;
- if (list != null)
- {
- // Performance issue perhaps?
- for (int i = 0; i < list.getLength(); i++)
- {
- if (list.item(i) instanceof Element)
- {
- if (list.item(i).getLocalName().equals(childName))
- {
- return list.item(i);
- }
- }
- }
- }
- return null;
- }
-
-
- protected Element performAddElement(Node parentNode, String namespaceName, String localName)
- {
- if (parentNode != null)
- {
- Element newElement = createElement(parentNode, namespaceName, localName);
- parentNode.appendChild(newElement);
- format(parentNode);
- return newElement;
- }
- return null;
- }
-
- protected Element createElement(Node parentNode, String namespaceName, String localName)
- {
- Document document = parentNode.getOwnerDocument();
- Element element = document.createElement(localName);
- return element;
- }
-
- protected void addAttributes(Element newElement, String attr, String value)
- {
- newElement.setAttribute(attr, value);
- }
-
- protected void format(Node parentNode)
- {
- if (parentNode instanceof XMLNode)
- {
- // format selected node
- FormatProcessorXML formatProcessorXML = new FormatProcessorXML();
- formatProcessorXML.formatNode((XMLNode)parentNode);
- }
- }
-
- static protected IEditorPart getActiveEditor()
- {
- IWorkbench workbench = WSDLEditorPlugin.getInstance().getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-
- return editorPart;
- }
-
- static protected IStatusLineManager getStatusLineManager(IEditorPart editorPart)
- {
- IStatusLineManager result = null;
- try
- {
- EditorActionBarContributor contributor = (EditorActionBarContributor)editorPart.getEditorSite().getActionBarContributor();
- result = contributor.getActionBars().getStatusLineManager();
- }
- catch (Exception e)
- {
- }
- return result;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BindingInputOutputFaultViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BindingInputOutputFaultViewer.java
deleted file mode 100644
index 5c7d396..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BindingInputOutputFaultViewer.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class BindingInputOutputFaultViewer extends NamedComponentViewer
-{
- public BindingInputOutputFaultViewer(Composite parent, IEditorPart editorPart)
- {
- super(parent, editorPart);
- }
-
- protected String getHeadingText()
- {
- String result = "";
- if (input instanceof BindingInput)
- {
- result = WSDLEditorPlugin.getWSDLString("_UI_LABEL_BINDING_INPUT");
- }
- else if (input instanceof BindingOutput)
- {
- result = WSDLEditorPlugin.getWSDLString("_UI_LABEL_BINDING_OUTPUT");
- }
- else if (input instanceof BindingFault)
- {
- result = WSDLEditorPlugin.getWSDLString("_UI_LABEL_BINDING_FAULT");
- }
- return result;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BindingOperationViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BindingOperationViewer.java
deleted file mode 100644
index f10337b..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BindingOperationViewer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class BindingOperationViewer extends NamedComponentViewer
-{
- public BindingOperationViewer(Composite parent, IEditorPart editorPart)
- {
- super(parent, editorPart);
- }
-
- protected String getHeadingText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_LABEL_BINDING_OPERATION"); //$NON-NLS-1$
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BindingViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BindingViewer.java
deleted file mode 100644
index bbad404..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/BindingViewer.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import java.util.List;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.viewers.widgets.ComponentNameComboHelper;
-import org.eclipse.wst.wsdl.ui.internal.viewers.widgets.InvokeDialogButton;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.w3c.dom.Element;
-
-public class BindingViewer extends NamedComponentViewer
-{
- protected CCombo componentNameCombo;
- protected ComponentNameComboHelper componentNameComboHelper;
- InvokeDialogButton button;
-
- public BindingViewer(Composite parent, IEditorPart editorPart)
- {
- super(parent, editorPart);
- }
-
- protected String getHeadingText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_LABEL_BINDING"); //$NON-NLS-1$
- }
-
- protected Composite populatePrimaryDetailsSection(Composite parent)
- {
- Composite composite = super.populatePrimaryDetailsSection(parent);
-
- Label portTypeLabel = flatViewUtility.createLabel(composite, 0, WSDLEditorPlugin.getWSDLString("_UI_LABEL_PORTTYPE")); //$NON-NLS-1$
-
- componentNameCombo = flatViewUtility.createCComboBox(composite);
- componentNameCombo.addListener(SWT.Modify, this);
-
-
- componentNameComboHelper = new ComponentNameComboHelper(componentNameCombo)
- {
- protected List getComponentNameList(ComponentReferenceUtil util)
- {
- return util.getPortTypeNames();
- }
-
- protected String getAttributeName()
- {
- return WSDLConstants.TYPE_ATTRIBUTE;
- }
- };
-
- button = new InvokeDialogButton(composite, getInput());
- button.setEditor(editorPart);
-
- return composite;
- }
-
- protected void update()
- {
- super.update();
- componentNameComboHelper.update(input);
- button.setInput(input);
- }
-
- protected void handleEventHelper(Element element, Event event)
- {
- super.handleEventHelper(element, event);
- componentNameComboHelper.handleEventHelper(element, event);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/DefinitionViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/DefinitionViewer.java
deleted file mode 100644
index 0a3ece8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/DefinitionViewer.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.EditNamespacesAction;
-
-public class DefinitionViewer extends NamedComponentViewer
-{
- public DefinitionViewer(Composite parent, IEditorPart editorPart)
- {
- super(parent, editorPart);
- }
-
- protected String getHeadingText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_LABEL_DEFINITION"); //$NON-NLS-1$
- }
-
- protected Composite populatePrimaryDetailsSection(Composite parent)
- {
- Composite composite = super.populatePrimaryDetailsSection(parent);
- Label label = flatViewUtility.createLabel(composite, 0, WSDLEditorPlugin.getWSDLString("_UI_NAMESPACES")); //$NON-NLS-1$
- Button button = flatViewUtility.createPushButton(composite, WSDLEditorPlugin.getWSDLString("_UI_EDIT_NAMESPACES"));
- SelectionListener listener = new SelectionListener()
- {
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- EditNamespacesAction action = new EditNamespacesAction((Definition)getInput());
- action.run();
- }
- };
- button.addSelectionListener(listener);
- return composite;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/EmptyViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/EmptyViewer.java
deleted file mode 100644
index e4e2541..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/EmptyViewer.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-
-public class EmptyViewer extends BaseViewer
-{
- protected Composite control;
-
- public EmptyViewer(Composite parent, int style)
- {
- super(getStatusLineManager(getActiveEditor()));
- createControl(parent);
- }
-
- public void createControl(Composite parent)
- {
- control = new Composite(parent, SWT.NONE);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- control.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- control.setLayoutData(data);
- }
-
- public Control getControl()
- {
- return control;
- }
-
- public void doSetInput(Object input)
- {
-
- }
-
- /*
- * @see BaseWindow#doHandleEvent(Event)
- */
- public void doHandleEvent(Event event)
- {
- if (event.type == SWT.Modify)
- {
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ExtensibilityElementViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ExtensibilityElementViewer.java
deleted file mode 100644
index 0f3a170..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ExtensibilityElementViewer.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.viewers.widgets.AttributesTable;
-import org.w3c.dom.Node;
-
-public class ExtensibilityElementViewer extends BaseViewer implements ModelAdapterListener
-{
- protected Composite control;
- protected IEditorPart editorPart;
- protected AttributesTable attributesTable;
- boolean isForTabbedProperties = false;
-
- public ExtensibilityElementViewer(Composite parent, IEditorPart editorPart)
- {
- super(getStatusLineManager(editorPart));
- this.editorPart = editorPart;
-
- createControl(parent);
- }
-
- public ExtensibilityElementViewer(Composite parent, IEditorPart editorPart, boolean isForTabbedProperties)
- {
- super(getStatusLineManager(editorPart));
- this.editorPart = editorPart;
- this.isForTabbedProperties = isForTabbedProperties;
- if (isForTabbedProperties)
- {
- createControlForTabbedPropertySheet(parent);
- }
- else
- {
- createControl(parent);
- }
- }
-
- protected String getHeadingText()
- {
- String result = "";
- if (input != null)
- {
- Node node = ((WSDLElement)input).getElement();
- result = node.getNodeName();
- if (result == null || result.length() == 0)
- {
- result = WSDLEditorPlugin.getWSDLString("_UI_LABEL_UNKNOWN_EXTENSIBILITY_ELEMENT"); //$NON-NLS-1$
- }
- }
- return result;
- }
-
- // TODO... move this method down to BaseViewer!
- public void doHandleEvent(Event event)
- {
- }
-
- public void createControlForTabbedPropertySheet(Composite parent)
- {
- attributesTable = new AttributesTable(editorPart, parent);
- }
-
- public void createControl(Composite parent)
- {
- control = flatViewUtility.createComposite(parent, 1, true);
- control.setBackground (new Color(null,255,0,0));
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
- gd.verticalAlignment= GridData.FILL;
- gd.grabExcessVerticalSpace= true;
-
- control.setLayoutData(gd);
-
-
- GridLayout layout = (GridLayout)control.getLayout();
- layout.verticalSpacing = 0;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
-
- flatViewUtility.createFlatPageHeader(control, "");
-
- Composite c = flatViewUtility.createComposite(control, 1, true);
- GridData cGD= new GridData();
- cGD.horizontalAlignment= GridData.FILL;
- cGD.grabExcessHorizontalSpace= true;
- cGD.verticalAlignment= GridData.FILL;
- cGD.grabExcessVerticalSpace= true;
-
- c.setLayoutData(cGD);
- attributesTable = new AttributesTable(editorPart, c);
-
- GridData attributesTableGD= new GridData();
- attributesTableGD.horizontalAlignment= GridData.FILL;
- attributesTableGD.grabExcessHorizontalSpace= true;
- attributesTableGD.verticalAlignment= GridData.FILL;
- attributesTableGD.grabExcessVerticalSpace= true;
-
- attributesTable.getControl().setLayoutData(attributesTableGD);
- }
-
- public Control getControl()
- {
- return control;
- }
-
-
- public void doSetInput(Object input)
- {
- if (!isForTabbedProperties)
- {
- flatViewUtility.updateFlatPageHeaderTitle(getHeadingText());
- }
- setListenerEnabled(false);
-
- attributesTable.setInput(((WSDLElement)input).getElement());
-
- setListenerEnabled(true);
-
- if (oldInput != null)
- {
- WSDLModelAdapterFactory.removeModelAdapterListener(oldInput, this);
- }
- WSDLModelAdapterFactory.addModelAdapterListener(input, this);
-
- oldInput = input;
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (isListenerEnabled())
- {
- setListenerEnabled(false);
- update();
- setListenerEnabled(true);
- }
- }
-
- protected void update()
- {
- Runnable runnable = new Runnable()
- {
- public void run()
- {
- if (!attributesTable.getControl().isDisposed())
- {
- attributesTable.refresh();
- }
- }
- };
- Display.getCurrent().asyncExec(runnable);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ExtensibleDetailsViewerProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ExtensibleDetailsViewerProvider.java
deleted file mode 100644
index 2c6057f..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ExtensibleDetailsViewerProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.IDetailsViewerProvider;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtensionRegistry;
-
-public class ExtensibleDetailsViewerProvider implements IDetailsViewerProvider
-{
- protected WSDLEditorExtension[] extensions;
- protected IDetailsViewerProvider[] detailsViewerProviders;
-
- protected final static Object[] EMPTY_ARRAY = {};
-
- public ExtensibleDetailsViewerProvider(WSDLEditor wsdlEditor)
- {
- WSDLEditorExtensionRegistry registry = WSDLEditorPlugin.getInstance().getWSDLEditorExtensionRegistry();
-
- extensions = registry.getRegisteredExtensions(WSDLEditorExtension.DETAILS_VIEWER_PROVIDER);
- detailsViewerProviders = new IDetailsViewerProvider[extensions.length];
- for (int i = 0; i < extensions.length; i++)
- {
- detailsViewerProviders[i] = (IDetailsViewerProvider)extensions[i].createExtensionObject(WSDLEditorExtension.DETAILS_VIEWER_PROVIDER, wsdlEditor);
- }
- }
-
-
- protected IDetailsViewerProvider getApplicableDetailsProvider(Object object)
- {
- IDetailsViewerProvider provider = null;
- for (int i = 0; i < extensions.length; i++)
- {
- if (extensions[i].isApplicable(object))
- {
- provider = detailsViewerProviders[i];
- if (provider != null)
- {
- break;
- }
- }
- }
- return provider;
- }
-
-
- public Object getViewerKey(Object object)
- {
- IDetailsViewerProvider provider = getApplicableDetailsProvider(object);
- return provider != null ? provider.getViewerKey(object) : null;
- }
-
-
- public Viewer createViewer(Object object, Composite parent, IEditorPart editorPart)
- {
- IDetailsViewerProvider provider = getApplicableDetailsProvider(object);
- return provider != null ? provider.createViewer(object, parent, editorPart) : null;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ImportViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ImportViewer.java
deleted file mode 100644
index 49027da..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ImportViewer.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import java.util.Map;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-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.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.ui.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.XMLQuickScan;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class ImportViewer extends BaseViewer implements ModelAdapterListener
-{
- protected Composite control;
- protected IEditorPart editorPart;
-
- protected Text namespaceText;
- protected Text prefixText;
- protected Text locationText;
- Button selectButton;
-
- /**
- * Constructor for ImportViewer.
- * @param parent
- * @param editorPart
- */
- public ImportViewer(Composite parent, IEditorPart editorPart)
- {
- super(getStatusLineManager(editorPart));
- this.editorPart = editorPart;
- createControl(parent);
- }
- /**
- * @see org.eclipse.wst.wsdl.ui.internal.viewers.NamedComponentViewer#getHeadingText()
- */
- protected String getHeadingText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_LABEL_IMPORT"); //$NON-NLS-1$
- }
-
- public void createControl(Composite parent)
- {
- control = flatViewUtility.createComposite(parent, 1, true);
- GridLayout layout = (GridLayout)control.getLayout();
- layout.verticalSpacing = 0;
-
- flatViewUtility.createFlatPageHeader(control, getHeadingText());
-
- Composite c = flatViewUtility.createComposite(control, 1, true);
-
- Label bogus = flatViewUtility.createLabel(c, 0, "");
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
-
- bogus.setLayoutData(gd);
-
- Composite composite = flatViewUtility.createComposite(c, 2, true);
- GridLayout layout2 = new GridLayout();
- layout2.makeColumnsEqualWidth = false;
- layout2.numColumns = 3;
- layout2.marginHeight = 3;
- composite.setLayout(layout2);
-
- Label namespaceLabel = flatViewUtility.createLabel(composite, 0, WSDLEditorPlugin.getWSDLString("_UI_LABEL_NAMESPACE")); //$NON-NLS-1$
- namespaceText = flatViewUtility.createTextField(composite);
- namespaceText.setEnabled(false);
-
- // place holder
- Control con= flatViewUtility.createLabel(composite, 0, "");
- gd = new GridData();
- gd.grabExcessHorizontalSpace = false;
- con.setLayoutData(gd);
-
- Label prefixLabel = flatViewUtility.createLabel(composite, 0, WSDLEditorPlugin.getWSDLString("_UI_LABEL_PREFIX")); //$NON-NLS-1$
- prefixText = flatViewUtility.createTextField(composite);
- prefixText.addListener(SWT.Modify,this);
- prefixText.setEnabled(false);
-
- // place holder
- Control con2= flatViewUtility.createLabel(composite, 0, "");
- gd = new GridData();
- gd.grabExcessHorizontalSpace = false;
- con2.setLayoutData(gd);
-
- Label locationLabel = flatViewUtility.createLabel(composite, 0, WSDLEditorPlugin.getWSDLString("_UI_LABEL_LOCATION")); //$NON-NLS-1$
- locationText = flatViewUtility.createTextField(composite);
- locationText.setEnabled(false);
-
- selectButton = flatViewUtility.createPushButton(composite, "...");
- gd = new GridData();
- gd.horizontalAlignment = GridData.BEGINNING;
- gd.grabExcessHorizontalSpace = false;
- selectButton.setLayoutData(gd);
- selectButton.addSelectionListener(this);
- }
-
- public void doSetInput(Object input)
- {
- setListenerEnabled(false);
- try
- {
- Node node = WSDLEditorUtil.getInstance().getNodeForObject(input);
- update();
- }
- finally
- {
- setListenerEnabled(true);
- }
-
- if (oldInput != null)
- {
- WSDLModelAdapterFactory.getWSDLModelAdapterFactory().removeModelAdapterListener(oldInput, this);
- }
-
- WSDLModelAdapterFactory.getWSDLModelAdapterFactory().addModelAdapterListener(input, this);
- oldInput = input;
- }
-
- protected void handleEventHelper(Element element, Event event)
- {
- if (event.type == SWT.Modify)
- {
- }
- }
-
- protected void update()
- {
- Element element = ((WSDLElement)input).getElement();
- flatViewUtility.updateFlatPageHeaderTitle(getHeadingText());
- prefixText.setText("");
- locationText.setText("");
- namespaceText.setText(" ");
- namespaceText.getParent().layout();
- namespaceText.setText("");
- String locationValue = element.getAttribute("location");
- locationText.setText(locationValue != null ? locationValue : "");
-
- String namespaceValue = element.getAttribute("namespace");
- namespaceText.setText(namespaceValue != null ? namespaceValue : "");
-
- String prefix = ((Import)input).getEnclosingDefinition().getPrefix(namespaceValue);
- prefixText.setText(prefix != null ? prefix : "");
- }
-
- public Control getControl()
- {
- return control;
- }
-
- /*
- * @see BaseWindow#doHandleEvent(Event)
- */
- public void doHandleEvent(Event event)
- {
-// if (event.widget == prefixText)
-// {
-// String newPrefix = prefixText.getText();
-// String errorMessage = ValidateHelper.checkXMLPrefix(newPrefix);
-//
-// if (errorMessage == null || errorMessage.length() == 0)
-// {
-// Import importObj = (Import)input;
-// org.w3c.dom.Element importElement = WSDLUtil.getInstance().getElementForObject(importObj);
-//
-// Definition definition = importObj.getEnclosingDefinition();
-// org.w3c.dom.Element definitionElement = WSDLUtil.getInstance().getElementForObject(definition);
-//
-// String nsFromModel = importObj.getNamespaceURI();
-// String nsFromDOM = importElement.getAttribute("namespace");
-// System.out.println(nsFromModel);
-// System.out.println(nsFromDOM);
-//
-// String oldPrefix = definition.getPrefix(nsFromModel);
-// definitionElement.removeAttribute("xmlns:" + oldPrefix);
-// definitionElement.setAttribute("xmlns:" + newPrefix, nsFromModel);
-// }
-// }
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (isListenerEnabled())
- {
- setListenerEnabled(false);
- update();
- setListenerEnabled(true);
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
-
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == selectButton)
- {
- ResourceSet resourceSet = null;
-// TODO: port check
- resourceSet = ((org.eclipse.emf.ecore.EObject)input).eResource().getResourceSet();
-
- WSDLEditor editor = (WSDLEditor)editorPart;
- IFile currentWSDLFile = ((IFileEditorInput)editor.getEditorInput()).getFile();
-
- SelectSingleFileDialog dialog = new SelectSingleFileDialog(WSDLEditorPlugin.getShell(), null, true);
- String [] filters = { "xsd", "wsdl" };
- IFile [] excludedFiles = { currentWSDLFile };
-
- dialog.addFilterExtensions(filters, excludedFiles);
- dialog.create();
- dialog.getShell().setText(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT")); //$NON-NLS-1$
- dialog.setTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT_FILE")); //$NON-NLS-1$
- dialog.setMessage(WSDLEditorPlugin.getWSDLString("_UI_DESCRIPTION_SELECT_WSDL_OR_XSD")); //$NON-NLS-1$
- int rc = dialog.open();
- if (rc == IDialogConstants.OK_ID)
- {
- IFile selectedFile = dialog.getFile();
-
- //if (selectedFile.getLocation().toOSString().equals(currentWSDLFile.getLocation().toOSString()))
- //{
- // System.out.println("SAME FILE:" + currentWSDLFile.getLocation());
- //}
-
- String location = ComponentReferenceUtil.computeRelativeURI(selectedFile, currentWSDLFile, true);
-
- Import importObj = (Import)input;
- org.w3c.dom.Element importElement = WSDLEditorUtil.getInstance().getElementForObject(importObj);
- Definition definition = importObj.getEnclosingDefinition();
- org.w3c.dom.Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
-
- String importTargetNamespace = "";
- String prefix = prefixText.getText();
- String uniquePrefix = "";
-
- URI uri = URI.createPlatformResourceURI(selectedFile.getFullPath().toString());
-
- // note that the getTargetNamespaceURIForSchema works for both schema and wsdl files
- // I should change the name of this convenience method
- importTargetNamespace = XMLQuickScan.getTargetNamespaceURIForSchema(uri.toString());
-
- if (prefix.trim().equals(""))
- {
- uniquePrefix = getUniquePrefix(definition, uri.fileExtension());
- }
- else
- {
- uniquePrefix = prefix;
- }
-
-
- if (importTargetNamespace == null ||
- (importTargetNamespace != null && importTargetNamespace.trim().length() == 0))
- {
- return; // what to do with no namespace docs?
- }
-
- importElement.setAttribute("location", location);
- importElement.setAttribute("namespace", importTargetNamespace);
-
- definitionElement.setAttribute("xmlns:" + uniquePrefix, importTargetNamespace);
-
- namespaceText.setText(importTargetNamespace);
- locationText.setText(location);
- prefixText.setText(uniquePrefix);
- }
- }
- }
-
- private String getUniquePrefix(Definition definition, String initPrefix)
- {
- String uniquePrefix;
- Map map = definition.getNamespaces();
-
- if (definition.getNamespace(initPrefix) == null)
- {
- uniquePrefix = initPrefix;
- }
- else // if used, then try to create a unique one
- {
- String tempPrefix = initPrefix;
- int i = 1;
- while(map.containsKey(tempPrefix + i))
- {
- i++;
- }
- uniquePrefix = tempPrefix + i;
- }
- return uniquePrefix;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/InputOutputFaultViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/InputOutputFaultViewer.java
deleted file mode 100644
index 2f13d07..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/InputOutputFaultViewer.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import java.util.List;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.viewers.widgets.ComponentNameComboHelper;
-import org.eclipse.wst.wsdl.ui.internal.viewers.widgets.InvokeDialogButton;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.w3c.dom.Element;
-
-public class InputOutputFaultViewer extends NamedComponentViewer
-{
- protected CCombo componentNameCombo;
- protected ComponentNameComboHelper componentNameComboHelper;
- InvokeDialogButton button;
-
- public InputOutputFaultViewer(Composite parent, IEditorPart editorPart)
- {
- super(parent, editorPart);
- }
-
- protected String getHeadingText()
- {
- String result = "";
-
- if (input instanceof Input)
- {
- result = WSDLEditorPlugin.getWSDLString("_UI_LABEL_INPUT"); //$NON-NLS-1$
- }
- else if (input instanceof Output)
- {
- result = WSDLEditorPlugin.getWSDLString("_UI_LABEL_OUTPUT"); //$NON-NLS-1$
- }
- else if (input instanceof Fault)
- {
- result = WSDLEditorPlugin.getWSDLString("_UI_LABEL_FAULT"); //$NON-NLS-1$
- }
-
- return result;
- }
-
- public boolean isObjectExtensible()
- {
- return false;
- }
-
- protected Composite populatePrimaryDetailsSection(Composite parent)
- {
- Composite composite = super.populatePrimaryDetailsSection(parent);
-
- Label messageLabel = flatViewUtility.createLabel(composite, 0, WSDLEditorPlugin.getWSDLString("_UI_LABEL_MESSAGE")); //$NON-NLS-1$
-
- componentNameCombo = flatViewUtility.createCComboBox(composite);
- componentNameCombo.addListener(SWT.Modify, this);
-
- componentNameComboHelper = new ComponentNameComboHelper(componentNameCombo)
- {
- protected List getComponentNameList(ComponentReferenceUtil util)
- {
- return util.getMessageNames();
- }
-
- protected String getAttributeName()
- {
- return WSDLConstants.MESSAGE_ATTRIBUTE;
- }
- };
-
- button = new InvokeDialogButton(composite, getInput());
- button.setEditor(editorPart);
-
- return composite;
- }
-
-
- protected void update()
- {
- super.update();
- componentNameComboHelper.update(input);
- button.setInput(input);
- }
-
- protected void handleEventHelper(Element element, Event event)
- {
- super.handleEventHelper(element, event);
- componentNameComboHelper.handleEventHelper(element, event);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/MessageViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/MessageViewer.java
deleted file mode 100644
index 3a8e0c8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/MessageViewer.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-
-public class MessageViewer extends NamedComponentViewer
-{
- public MessageViewer(Composite parent, IEditorPart editorPart)
- {
- super(parent, editorPart);
- }
-
- protected String getHeadingText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_LABEL_MESSAGE"); //$NON-NLS-1$
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/NamedComponentViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/NamedComponentViewer.java
deleted file mode 100644
index e05c075..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/NamedComponentViewer.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.SmartRenameAction;
-import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLModelAdapterFactory;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public abstract class NamedComponentViewer extends BaseViewer implements ModelAdapterListener
-{
- protected Composite control;
- protected Text nameField;
- protected IEditorPart editorPart;
-
- public NamedComponentViewer(Composite parent, IEditorPart editorPart)
- {
- super(getStatusLineManager(editorPart));
- this.editorPart = editorPart;
-
- createControl(parent);
- }
-
- protected abstract String getHeadingText();
-
- protected Composite populatePrimaryDetailsSection(Composite parent)
- {
- Composite group = flatViewUtility.createComposite(parent, 2, true);
-
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- Composite nameFieldComposite = flatViewUtility.createComposite(group, 2, true);
- ((GridLayout)nameFieldComposite.getLayout()).marginWidth = 0;
- ((GridLayout)nameFieldComposite.getLayout()).marginHeight = 0;
-
- GridLayout layout = new GridLayout();
- layout.makeColumnsEqualWidth = false;
- layout.numColumns = 3;
- layout.marginHeight = 4;
- layout.marginWidth = 0;
-
- nameFieldComposite.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 1;
- gd.verticalAlignment = GridData.BEGINNING;
- nameFieldComposite.setLayoutData(gd);
-
-
- Label nameLabel = flatViewUtility.createLabel(nameFieldComposite, 0, WSDLEditorPlugin.getWSDLString("_UI_LABEL_NAME")); //$NON-NLS-1$
- nameField = flatViewUtility.createTextField(nameFieldComposite);
- nameField.addListener(SWT.Modify, this);
-
- // place holder
- Control c = flatViewUtility.createLabel(nameFieldComposite, 0, "");
- c.setBackground(new Color(null, 0, 255, 100));
- gd = new GridData();
- gd.grabExcessHorizontalSpace = false;
- gd.heightHint = 0;
- gd.widthHint = 0;
- c.setLayoutData(gd);
-
- return nameFieldComposite;
- }
-
- public void createControl(Composite parent)
- {
- SashForm sashForm = new SashForm(parent, SWT.BORDER);
- sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
- control = sashForm;
- sashForm.setOrientation(SWT.HORIZONTAL);
-
- Composite composite = flatViewUtility.createComposite(sashForm, 1, true);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout layout = (GridLayout)composite.getLayout();
- layout.verticalSpacing = 0;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
-
- flatViewUtility.createFlatPageHeader(composite, getHeadingText());
-
- populatePrimaryDetailsSection(composite);
-
- TabbedViewer tabbedViewer = new TabbedViewer((WSDLEditor)editorPart);
-
- Control c = tabbedViewer.createControl(sashForm);
- c.setLayoutData(new GridData(GridData.FILL_BOTH));
- }
-
- public void doSetInput(Object input)
- {
- setListenerEnabled(false);
- try
- {
- Node node = WSDLEditorUtil.getInstance().getNodeForObject(input);
- update();
- }
- finally
- {
- setListenerEnabled(true);
- }
-
- if (oldInput != null)
- {
- WSDLModelAdapterFactory.getWSDLModelAdapterFactory().removeModelAdapterListener(oldInput, this);
- }
-
- WSDLModelAdapterFactory.getWSDLModelAdapterFactory().addModelAdapterListener(input, this);
- oldInput = input;
- }
-
- protected void update()
- {
- Element element = ((WSDLElement)input).getElement();
- flatViewUtility.updateFlatPageHeaderTitle(getHeadingText());
-
- nameField.setText("");
- String nameValue = element.getAttribute(WSDLConstants.NAME_ATTRIBUTE);
- nameField.setText(nameValue != null ? nameValue : "");
- }
-
- public Control getControl()
- {
- return control;
- }
-
- /*
- * @see BaseWindow#doHandleEvent(Event)
- */
- public void doHandleEvent(Event event)
- {
- setListenerEnabled(false);
- Element element = WSDLEditorUtil.getInstance().getElementForObject(input);
- handleEventHelper(element, event);
- setListenerEnabled(true);
- }
-
- protected void handleEventHelper(Element element, Event event)
- {
- if (event.type == SWT.Modify)
- {
- if (event.widget == nameField)
- {
- new SmartRenameAction(input, nameField.getText()).run();
- }
- }
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (isListenerEnabled())
- {
- setListenerEnabled(false);
- if (!control.isDisposed())
- {
- update();
- }
- setListenerEnabled(true);
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/OperationViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/OperationViewer.java
deleted file mode 100644
index 0b9ea56..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/OperationViewer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class OperationViewer extends NamedComponentViewer
-{
- public OperationViewer(Composite parent, IEditorPart editorPart)
- {
- super(parent, editorPart);
- }
-
- protected String getHeadingText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_LABEL_OPERATION"); //$NON-NLS-1$
- }
-
- protected Composite populatePrimaryDetailsSection(Composite parent)
- {
- Composite composite = super.populatePrimaryDetailsSection(parent);
-
- Label parameterOrderLabel = flatViewUtility.createLabel(composite, 0, WSDLEditorPlugin.getWSDLString("_UI_LABEL_PARAMETER_ORDER")); //$NON-NLS-1$
- Text parameterOrderField = flatViewUtility.createTextField(composite);
- parameterOrderField.addListener(SWT.Modify, this);
-
- //Button button = new Button(composite, SWT.FLAT);
- //button.setText("...");
-
- return composite;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/PartViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/PartViewer.java
deleted file mode 100644
index 9e997cc..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/PartViewer.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import java.util.Iterator;
-import java.util.List;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.viewers.widgets.InvokeDialogButton;
-import org.w3c.dom.Element;
-
-public class PartViewer extends NamedComponentViewer
-{
- protected CCombo componentNameCombo;
- protected CCombo referenceKindCombo;
- protected Label componentNameLabel;
- InvokeDialogButton button;
-// Button importButton;
-
-
- public PartViewer(Composite parent, IEditorPart editorPart)
- {
- super(parent, editorPart);
- }
-
- protected String getHeadingText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_LABEL_PART"); //$NON-NLS-1$
- }
-
- public boolean isObjectExtensible()
- {
- return false;
- }
-
- protected Composite populatePrimaryDetailsSection(Composite parent)
- {
- Composite composite = super.populatePrimaryDetailsSection(parent);
-
- Label componentTypeLabel = flatViewUtility.createLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_REFERENCE_KIND")); //$NON-NLS-1$
- referenceKindCombo = flatViewUtility.createCComboBox(composite);
- referenceKindCombo.add("element");
- referenceKindCombo.add("type");
- referenceKindCombo.setText("type");
- referenceKindCombo.addListener(SWT.Modify, this);
-
- Label ph = flatViewUtility.createLabel(composite, "");
-
- componentNameLabel = flatViewUtility.createLabel(composite, WSDLEditorPlugin.getWSDLString("_UI_LABEL_ELEMENT")); //$NON-NLS-1$
-
- componentNameCombo = flatViewUtility.createCComboBox(composite);
- componentNameCombo.addListener(SWT.Modify, this);
- componentNameCombo.addSelectionListener(this);
-
- button = new InvokeDialogButton(composite, getInput());
-
- return composite;
- }
-
- protected void update()
- {
- try
- {
- Part part = (Part)input;
- boolean isType = ComponentReferenceUtil.isType(part);
- String value = ComponentReferenceUtil.getPartComponentReference(part);
-
- // update the combo-box content
- //
- componentNameCombo.removeAll();
- List compList = ComponentReferenceUtil.getComponentNameList(part, isType);
- if (compList != null)
- {
- for (Iterator iterator = compList.iterator(); iterator.hasNext();)
- {
- componentNameCombo.add((String)iterator.next());
- }
- }
-
- if (isType)
- {
- referenceKindCombo.setText("type");
- componentNameLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_TYPE")); //$NON-NLS-1$
- componentNameCombo.setText(value != null ? value : "");
- button.setReferenceKind("type");
- }
- else
- {
- referenceKindCombo.setText("element");
- componentNameLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_ELEMENT")); //$NON-NLS-1$
- componentNameCombo.setText(value != null ? value : "");
- button.setReferenceKind("element");
- }
- button.setInput(input);
- button.setEditor(editorPart);
- super.update();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
-
- protected void handleEventHelper(Element element, Event event)
- {
- super.handleEventHelper(element, event);
- if (event.type == SWT.Modify)
- {
- if (event.widget == referenceKindCombo)
- {
- // TODO... I have no idea why we need to use a delayed runnable to get
- // updating working properly .... this is something we need to revisit
- DelayedRenameRunnable runnable = new DelayedRenameRunnable((Part)input);
- Display.getCurrent().asyncExec(runnable);
- }
- }
- }
-
- protected class DelayedRenameRunnable implements Runnable
- {
- Part part;
-
- DelayedRenameRunnable(Part part)
- {
- this.part = part;
- }
-
- public void run()
- {
- boolean isType = referenceKindCombo.getText().equals("type");
- ComponentReferenceUtil.setComponentReference(part, isType, null);
- }
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == componentNameCombo)
- {
- Part part = (Part)input;
- boolean isType = referenceKindCombo.getText().equals("type");
- ComponentReferenceUtil.setComponentReference(part, isType, componentNameCombo.getText());
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/PortTypeViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/PortTypeViewer.java
deleted file mode 100644
index d85fdfc..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/PortTypeViewer.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class PortTypeViewer extends NamedComponentViewer
-{
- public PortTypeViewer(Composite parent, IEditorPart editorPart)
- {
- super(parent, editorPart);
- }
-
- protected String getHeadingText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_LABEL_PORTTYPE"); //$NON-NLS-1$
- }
-
- public boolean isObjectExtensible()
- {
- return false;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/PortViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/PortViewer.java
deleted file mode 100644
index ee46224..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/PortViewer.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import java.util.List;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.viewers.widgets.ComponentNameComboHelper;
-import org.eclipse.wst.wsdl.ui.internal.viewers.widgets.InvokeDialogButton;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.w3c.dom.Element;
-
-public class PortViewer extends NamedComponentViewer
-{
- protected CCombo componentNameCombo;
- protected ComponentNameComboHelper componentNameComboHelper;
- InvokeDialogButton button;
-
- public PortViewer(Composite parent, IEditorPart editorPart)
- {
- super(parent, editorPart);
- }
-
- protected String getHeadingText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_LABEL_PORT"); //$NON-NLS-1$
- }
-
- protected Composite populatePrimaryDetailsSection(Composite parent)
- {
- Composite composite = super.populatePrimaryDetailsSection(parent);
-
- Label bindingLabel = flatViewUtility.createLabel(composite, 0, WSDLEditorPlugin.getWSDLString("_UI_LABEL_BINDING")); //$NON-NLS-1$
-
- componentNameCombo = flatViewUtility.createCComboBox(composite);
- componentNameCombo.addListener(SWT.Modify, this);
-
- componentNameComboHelper = new ComponentNameComboHelper(componentNameCombo)
- {
- protected List getComponentNameList(ComponentReferenceUtil util)
- {
- return util.getBindingNames();
- }
-
- protected String getAttributeName()
- {
- return WSDLConstants.BINDING_ATTRIBUTE;
- }
- };
-
- button = new InvokeDialogButton(composite, getInput());
- button.setEditor(editorPart);
-
- return composite;
- }
-
- protected void update()
- {
- super.update();
- componentNameComboHelper.update(input);
- button.setInput(input);
- }
-
- protected void handleEventHelper(Element element, Event event)
- {
- super.handleEventHelper(element, event);
- componentNameComboHelper.handleEventHelper(element, event);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ServiceViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ServiceViewer.java
deleted file mode 100644
index 01b23cc..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/ServiceViewer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class ServiceViewer extends NamedComponentViewer
-{
- public ServiceViewer(Composite parent, IEditorPart editorPart)
- {
- super(parent, editorPart);
- }
-
- protected String getHeadingText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_LABEL_SERVICE"); //$NON-NLS-1$
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/TabbedViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/TabbedViewer.java
deleted file mode 100644
index 98cf328..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/TabbedViewer.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddElementAction;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.xsd.XSDComponent;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class TabbedViewer implements ISelectionChangedListener
-{
- protected WSDLEditor editor;
- protected CTabFolder tabFolder;
- protected Text documentationField;
- protected DocumentationListener documentationListener;
- protected boolean listenerEnabled;
-
- public TabbedViewer(WSDLEditor editor)
- {
- this.editor = editor;
- }
-
- public Control createControl(Composite parent)
- {
- tabFolder = new CTabFolder(parent, 0);
-
- CTabItem tab = new CTabItem(tabFolder, SWT.NONE);
- tab.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_DOCUMENTION")); //$NON-NLS-1$
- documentationField = new Text(tabFolder, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP);
- tab.setControl(documentationField);
- tabFolder.setSelection(tab);
-
- documentationListener = new DocumentationListener();
- listenerEnabled = true;
- documentationField.addModifyListener(documentationListener);
-
- editor.getSelectionManager().addSelectionChangedListener(this);
-
- return tabFolder;
- }
-
- public void setInput(Object object)
- {
- listenerEnabled = false;
- documentationListener.setInput(object);
- documentationField.setEnabled(true);
- documentationField.setText("");
-
- if (object instanceof XSDComponent || !(object instanceof WSDLElement))
- {
- documentationField.setEnabled(false);
- listenerEnabled = true;
- return;
- }
-
- Element element = WSDLEditorUtil.getInstance().getElementForObject(object);
- if (element != null)
- {
- if (element.getLocalName().equals("documentation"))
- {
- documentationField.setEnabled(false);
- listenerEnabled = true;
- return;
- }
-
- Node docNode = getChildNode(element, element.getPrefix(), "documentation");
- if (docNode != null)
- {
- Node textNode = docNode.getFirstChild();
- if (textNode != null)
- {
- String textNodeValue = textNode.getNodeValue();
- documentationField.setText(textNodeValue != null ? textNodeValue : "");
- }
- }
- }
- listenerEnabled = true;
-// There appears to be a defect in the model...it doesn't return
-// the documentationElement even though it exists
-// if (object instanceof WSDLElement)
-// {
-// WSDLElement elem = (WSDLElement)object;
-// System.out.println("elem = " + elem);
-//
-// if (elem != null)
-// {
-// Element doc = elem.getDocumentationElement();
-// System.out.println("docNode = " + doc);
-// if (doc != null)
-// {
-// Node textNode = doc.getFirstChild();
-// if (textNode != null)
-// {
-// documentationField.setText(textNode.getNodeValue());
-// }
-// }
-// }
-// }
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection)
- {
- Object o = ((IStructuredSelection)selection).getFirstElement();
- if (o != null)
- {
- setInput(o);
- }
- }
- }
-
- public Node getChildNode(Element parent, String prefix, String childName)
- {
- NodeList list = null;
- if (parent != null)
- {
- list = parent.getChildNodes();
- }
- String targetName;
- if (prefix != null && prefix.length() > 0)
- {
- targetName = prefix + ":" + childName;
- }
- else
- {
- targetName = childName;
- }
-
- String name = null;
- if (list != null)
- {
- // Performance issue perhaps?
- for (int i = 0; i < list.getLength(); i++)
- {
- if (list.item(i) instanceof Element)
- {
- if (list.item(i).getNodeName().equals(targetName))
- {
- return list.item(i);
- }
- }
- }
- }
- return null;
- }
-
-
-
- class DocumentationListener implements ModifyListener
- {
- Object object;
-
- public void setInput(Object object)
- {
- this.object = object;
- }
-
- /**
- * @see org.eclipse.swt.events.ModifyListener#modifyText(ModifyEvent)
- */
- public void modifyText(ModifyEvent e)
- {
- if (listenerEnabled)
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(object);
- if (element != null)
- {
- Node docNode = getChildNode(element, element.getPrefix(), "documentation");
- if (docNode != null)
- {
- Node textNode = docNode.getFirstChild();
- if (textNode != null)
- {
- textNode.setNodeValue(documentationField.getText());
- }
- else
- {
- if (documentationField.getText() != null && documentationField.getText().length() > 0)
- {
- Document document = docNode.getOwnerDocument();
- org.w3c.dom.Text newTextNode = document.createTextNode(documentationField.getText());
- docNode.appendChild(newTextNode);
- }
- }
- }
- else
- {
- AddElementAction action = new AddElementAction(element, element.getPrefix(), "documentation", element.getFirstChild());
- action.run();
- Element newDocumentation = action.getNewElement();
-
- Document document = newDocumentation.getOwnerDocument();
- org.w3c.dom.Text newTextNode = document.createTextNode(documentationField.getText());
- newDocumentation.appendChild(newTextNode);
- }
- }
- }
- }
- }
-}
-
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/WSDLDetailsViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/WSDLDetailsViewer.java
deleted file mode 100644
index f63aed1..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/WSDLDetailsViewer.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import java.util.HashMap;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class WSDLDetailsViewer implements ISelectionChangedListener
-{
- protected WSDLEditor editor;
- protected Composite client;
- protected PageBook pageBook;
- protected ExtensibleDetailsViewerProvider detailsViewerProvider;
- protected HashMap viewerMap = new HashMap();
-
- protected final static String EMPTY_VIEWER_KEY = "EMPTY_VIEWER_KEY";
- protected Viewer emptyViewer;
-
- public WSDLDetailsViewer(WSDLEditor editor)
- {
- this.editor = editor;
- detailsViewerProvider = new ExtensibleDetailsViewerProvider(editor);
- editor.getSelectionManager().addSelectionChangedListener(this);
- }
-
- public Control createControl(Composite parent)
- {
- client = pageBook = new PageBook(parent, 0);
- pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
- emptyViewer = new EmptyViewer(pageBook, SWT.NONE);
- viewerMap.put(EMPTY_VIEWER_KEY, emptyViewer);
- pageBook.showPage(emptyViewer.getControl());
- return client;
- }
-
- public void setInput(Object object)
- {
- try
- {
- Object key = detailsViewerProvider.getViewerKey(object);
-
- if (key == null)
- {
- key = EMPTY_VIEWER_KEY;
- }
- Viewer viewer = (Viewer)viewerMap.get(key);
- if (viewer == null)
- {
- viewer = detailsViewerProvider.createViewer(object, pageBook, editor);
- if (viewer != null)
- {
- viewerMap.put(key, viewer);
- if (viewer instanceof OperationViewer)
- {
-
- }
- }
- }
-
- if (viewer != null)
- {
- if (object instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement schema = (XSDSchemaExtensibilityElement)object;
- XSDSchema xsdSchema = schema.getSchema();
- if (xsdSchema != null)
- {
- viewer.setInput(xsdSchema.getElement());
- }
- }
- else
- {
- viewer.setInput(object);
- }
- pageBook.showPage(viewer.getControl());
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public void selectionChanged(SelectionChangedEvent event)
- {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection)
- {
- Object o = ((IStructuredSelection)selection).getFirstElement();
- if (o instanceof WSDLGroupObject)
- {
- o = ((WSDLGroupObject)o).getDefinition();
- }
- setInput(o);
- }
- }
-}
-
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/WSDLDetailsViewerProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/WSDLDetailsViewerProvider.java
deleted file mode 100644
index 216af1e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/WSDLDetailsViewerProvider.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingFault;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.ui.internal.extension.IDetailsViewerProvider;
-
-public class WSDLDetailsViewerProvider implements IDetailsViewerProvider
-{
- public Object getViewerKey(Object modelObject)
- {
- Object result = null;
-
- // todo.... use a switch
- if (modelObject instanceof Message)
- {
- result = "message";
- }
- else if (modelObject instanceof Binding)
- {
- result = "binding";
- }
- else if (modelObject instanceof BindingOperation)
- {
- result = "bindingOperation";
- }
- else if (modelObject instanceof Operation)
- {
- result = "operation";
- }
- else if (modelObject instanceof Definition)
- {
- result = "definition";
- }
- else if (modelObject instanceof Part)
- {
- result = "part";
- }
- else if (modelObject instanceof Port)
- {
- result = "port";
- }
- else if (modelObject instanceof Input ||
- modelObject instanceof Output ||
- modelObject instanceof Fault)
- {
- result = "inputOutputFault";
- }
- else if (modelObject instanceof BindingInput ||
- modelObject instanceof BindingOutput ||
- modelObject instanceof BindingFault)
- {
- result = "bindingInputOutputFault";
- }
- else if (modelObject instanceof PortType)
- {
- result = "portType";
- }
- else if (modelObject instanceof Service)
- {
- result = "service";
- }
- else if (modelObject instanceof ExtensibilityElement)
- {
- result = "extensibilityElement";
- }
- else if (modelObject instanceof Import)
- {
- result = "import";
- }
- else
- {
- result = "empty";
- }
- return result;
- }
-
-
- public Viewer createViewer(Object modelObject, Composite parent, IEditorPart editorPart)
- {
- Viewer viewer = null;
- Object key = getViewerKey(modelObject);
- if (key != null)
- {
- if (key.equals("message"))
- {
- viewer = new MessageViewer(parent, editorPart);
- }
- else if (key.equals("binding"))
- {
- viewer = new BindingViewer(parent, editorPart);
- }
- else if (key.equals("definition"))
- {
- viewer = new DefinitionViewer(parent, editorPart);
- }
- else if (key.equals("bindingOperation"))
- {
- viewer = new BindingOperationViewer(parent, editorPart);
- }
- else if (key.equals("operation"))
- {
- viewer = new OperationViewer(parent, editorPart);
- }
- else if (key.equals("part"))
- {
- viewer = new PartViewer(parent, editorPart);
- }
- else if (key.equals("port"))
- {
- viewer = new PortViewer(parent, editorPart);
- }
- else if (key.equals("inputOutputFault"))
- {
- viewer = new InputOutputFaultViewer(parent, editorPart);
- }
- else if (key.equals("bindingInputOutputFault"))
- {
- viewer = new BindingInputOutputFaultViewer(parent, editorPart);
- }
- else if (key.equals("service"))
- {
- viewer = new ServiceViewer(parent, editorPart);
- }
- else if (key.equals("extensibilityElement"))
- {
- viewer = new ExtensibilityElementViewer(parent, editorPart);
- }
- else if (key.equals("portType"))
- {
- viewer = new PortTypeViewer(parent, editorPart);
- }
- else if (key.equals("import"))
- {
- viewer = new ImportViewer(parent, editorPart);
- }
- else
- {
- viewer = new EmptyViewer(parent, 0);
- }
- }
- return viewer;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/AttributesTable.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/AttributesTable.java
deleted file mode 100644
index 1fb2f94..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/AttributesTable.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers.widgets;
-
-import java.text.Collator;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.w3c.dom.Element;
-
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.xml.core.document.XMLElement;
-
-public class AttributesTable extends TableViewer implements ICellModifier
-{
- protected static final String PROPERTY = WSDLEditorPlugin.getWSDLString("_UI_LABEL_PROPERTY"); //$NON-NLS-1$
- protected static final String VALUE = WSDLEditorPlugin.getWSDLString("_UI_LABEL_VALUE"); //$NON-NLS-1$
-
- protected IEditorPart editorPart;
- protected String[] columnProperties = {PROPERTY, VALUE};
- protected PropertyTableProvider tableProvider = new PropertyTableProvider(this);
- protected CellEditor textCellEditor;
- //protected StringComboBoxCellEditor comboCellEditor;
- protected IPropertySource propertySource;
-
-
- public AttributesTable(IEditorPart editorPart, Composite parent)
- {
- super(new Table(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.FLAT));
- this.editorPart = editorPart;
- getTable().setLinesVisible(true);
- getTable().setHeaderVisible(true);
-
- setContentProvider(tableProvider);
- setLabelProvider(tableProvider);
- setColumnProperties(columnProperties);
-
- for (int i = 0; i < columnProperties.length; i++)
- {
- TableColumn column = new TableColumn(getTable(), SWT.NONE, i);
- column.setText(columnProperties[i]);
- column.setAlignment(SWT.LEFT);
- }
-
- TableLayout layout = new TableLayout();
- ColumnWeightData data = new ColumnWeightData(40, 40, true);
- layout.addColumnData(data);
-
- ColumnWeightData data2 = new ColumnWeightData(80, 80, true);
- layout.addColumnData(data2);
-
- getTable().setLayout(layout);
-
- textCellEditor = new TextCellEditor(getTable());
- resetCellEditors();
-
- setCellModifier(this);
- }
-
- protected void hookControl(Control control) {
- // we need to hook up our own mouse listener first
- // so that we can update the cellEditors before
- // the 'internal' listener tries to get hold of them
- Table tableControl = (Table)control;
- tableControl.addMouseListener(new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- updateCellEditors();
- }
- });
- super.hookControl(control);
- }
-
- // ICellModifier
- public boolean canModify(Object element, String property)
- {
- return property.equals(VALUE);
- }
-
- public Object getValue(Object element, String property)
- {
- int column = 0;
- if (property.equals(columnProperties[0]))
- {
- column = 0;
- }
- else if (property.equals(columnProperties[1]))
- {
- column = 1;
- }
- return tableProvider.getColumnText(element, column);
- }
-
- public void modify(Object element, String property, Object value)
- {
- TableItem item = (TableItem)element;
- IPropertyDescriptor propertyDescriptor = (IPropertyDescriptor)item.getData();
-
- // if the new value is the same as the old value, the user has only clicked
- // on the cell in the course of 'browsing' ... so don't edit the value
- Object oldValue = getValue(propertyDescriptor, property);
- if (value != null && !value.equals(oldValue))
- {
- // we assume the value is empty that the attribute should be removed
- // todo... we probably need to look at this in more detail
- if (value instanceof String && ((String)value).length() == 0)
- {
- value = null;
- }
- propertySource.setPropertyValue(propertyDescriptor.getId(), value);
- refresh(item.getData());
- }
- }
-
-
- protected void updateCellEditors()
- {
- CellEditor[] cellEditors = new CellEditor[2];
- cellEditors[0] = textCellEditor;
- cellEditors[1] = textCellEditor;
-
- Element element = (Element)getInput();
-
- IPropertyDescriptor[] propertyDescriptors = propertySource.getPropertyDescriptors();
- int index = getTable().getSelectionIndex();
- if (index >= 0 && index < propertyDescriptors.length)
- {
- CellEditor[] oldCellEditors = getCellEditors();
- CellEditor oldCellEditor = (oldCellEditors.length > 1) ? oldCellEditors[1] : null;
- if (oldCellEditor != null && oldCellEditor != textCellEditor)
- {
- oldCellEditor.deactivate();
- oldCellEditor.dispose();
- }
- cellEditors[1] = propertyDescriptors[index].createPropertyEditor(getTable());
- }
- setCellEditors(cellEditors);
- }
-
-
- public String[] getStringArray(List list)
- {
- String[] result = new String[list.size()];
- for (int i = 0; i < result.length; i++)
- {
- result[i] = (String)list.get(i);
- }
- return result;
- }
-
- protected void resetCellEditors()
- {
- CellEditor[] cellEditors = new CellEditor[2];
- cellEditors[0] = textCellEditor;
- cellEditors[1] = textCellEditor;
- setCellEditors(cellEditors);
- }
-
-
- class PropertyTableProvider extends LabelProvider implements ITableLabelProvider, IStructuredContentProvider
- {
- protected TableViewer viewer;
-
- PropertyTableProvider(TableViewer viewer)
- {
- this.viewer = viewer;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- resetCellEditors();
- if (newInput instanceof XMLElement)
- {
- propertySource = new ExtensiblePropertySource(editorPart, (XMLElement)newInput);
- }
- else if (newInput instanceof Element)
- {
- propertySource = new ReadOnlyPropertySource(editorPart, (Element)newInput);
- }
- else
- {
- propertySource = null;
- }
- }
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- return null;
- }
-
- public String getColumnText(Object o, int columnIndex)
- {
- IPropertyDescriptor propertyDescriptor = (IPropertyDescriptor)o;
- return (columnIndex == 0) ? propertyDescriptor.getId().toString() : propertySource.getPropertyValue(propertyDescriptor.getId()).toString();
- }
-
- public Object[] getElements(Object o)
- {
- Object[] result = propertySource.getPropertyDescriptors();
- // For some strange reson the ViewerSorter doesn't seem to be working for this table
- // As a workaround we sort them in this method before returning them to the viewer
- if (result.length > 0)
- {
- Arrays.sort(result, new InternalComparator());
- }
- return result;
- }
- }
-
- class InternalComparator implements Comparator
- {
- public int compare(Object e1, Object e2)
- {
- IPropertyDescriptor p1 = (IPropertyDescriptor)e1;
- IPropertyDescriptor p2 = (IPropertyDescriptor)e2;
- String p1Name = p1.getDisplayName();
- String p2Name = p2.getDisplayName();
- return Collator.getInstance().compare(p1.getDisplayName(), p2.getDisplayName());
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ComponentNameComboHelper.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ComponentNameComboHelper.java
deleted file mode 100644
index 224ce56..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ComponentNameComboHelper.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers.widgets;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.w3c.dom.Element;
-
-
-// A convenience class
-//
-public abstract class ComponentNameComboHelper
-{
- protected CCombo componentNameCombo;
-
- public ComponentNameComboHelper(CCombo componentNameCombo)
- {
- this.componentNameCombo = componentNameCombo;
- }
-
- public void update(Object input)
- {
- Element element = ((WSDLElement)input).getElement();
- componentNameCombo.removeAll();
- String value = element.getAttribute(getAttributeName());
- componentNameCombo.setText(value != null ? value : "");
-
- if (input instanceof WSDLElement)
- {
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
- ComponentReferenceUtil componentReferenceUtil = new ComponentReferenceUtil(definition);
- java.util.List list = getComponentNameList(componentReferenceUtil);
- for (Iterator iter = list.iterator(); iter.hasNext();)
- {
- componentNameCombo.add((String)iter.next());
- }
- }
- }
-
- public void handleEventHelper(Element element, Event event)
- {
- if (event.type == SWT.Modify)
- {
- if (event.widget == componentNameCombo)
- {
- element.setAttribute(getAttributeName(), componentNameCombo.getText());
- }
- }
- }
-
- protected abstract List getComponentNameList(ComponentReferenceUtil util);
-
- protected abstract String getAttributeName();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ComponentsSection.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ComponentsSection.java
deleted file mode 100644
index 57225be..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ComponentsSection.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers.widgets;
-
-import org.eclipse.swt.custom.CCombo;
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.flatui.FlatPageSection;
-import org.eclipse.wst.wsdl.ui.internal.util.flatui.WidgetFactory;
-import org.eclipse.wst.wsdl.ui.internal.util.ui.FlatViewUtility;
-
-public class ComponentsSection extends FlatPageSection
-{
- protected CCombo namesCombo;
- protected Button newButton;
- protected Button importButton;
- protected String title;
-
- public ComponentsSection(Composite parent, FlatViewUtility flatViewUtility, String title)
- {
- this(parent, title);
-
- WidgetFactory factory = new WidgetFactory();
- factory.setClientAreaColor(flatViewUtility.getBackgroundColor());
-
- Control section = createControl(this, factory);
- setContent(section);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- setLayoutData(gridData);
- }
-
-
- public ComponentsSection(Composite parent, String title)
- {
- super(parent);
- setCollapsable(true);
- setHeaderText(title);
- setAddSeparator(true);
- }
-
- public CCombo getNamesCombo()
- {
- return namesCombo;
- }
-
- public Button getNewMessageButton()
- {
- return newButton;
- }
-
- public Button getImportMessageButton()
- {
- return importButton;
- }
-
- /*
- * @see FlatPageSection#createClient(Composite, WidgetFactory)
- */
- public Composite createClient(Composite parent, WidgetFactory factory)
- {
- FlatViewUtility flatViewUtility = new FlatViewUtility(true);
-
- Composite client = flatViewUtility.createComposite(parent, 1);
-
- namesCombo = flatViewUtility.createCComboBox(client);
-
- Composite buttonComposite = flatViewUtility.createComposite(client, 3, true);
- GridLayout gridLayout = (GridLayout)buttonComposite.getLayout();
- gridLayout.marginWidth = 3;
- gridLayout.marginHeight = 3;
- gridLayout.makeColumnsEqualWidth = true;
-
- Label filler = flatViewUtility.createHorizontalFiller(buttonComposite, 1);
- GridData gd = (GridData)filler.getLayoutData();
- gd.grabExcessHorizontalSpace = true;
- newButton = flatViewUtility.createPushButton(buttonComposite, WSDLEditorPlugin.getWSDLString("_UI_BUTTON_NEW")); //$NON-NLS-1$
- importButton = flatViewUtility.createPushButton(buttonComposite, WSDLEditorPlugin.getWSDLString("_UI_BUTTON_IMPORT")); //$NON-NLS-1$
-
- return client;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ExtensiblePropertySource.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ExtensiblePropertySource.java
deleted file mode 100644
index 98d245b..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ExtensiblePropertySource.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers.widgets;
-
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.w3c.dom.Element;
-
-import org.eclipse.wst.common.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.properties.section.IPropertyDescriptorProvider;
-import org.eclipse.wst.xml.ui.views.properties.XMLPropertySourceAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-
-public class ExtensiblePropertySource extends XMLPropertySourceAdapter
-{
- protected IEditorPart editorPart;
-
- public ExtensiblePropertySource(IEditorPart editorPart, INodeNotifier target)
- {
- super(target);
- this.editorPart = editorPart;
- }
-
-
-
- protected IPropertyDescriptor createPropertyDescriptor(CMAttributeDeclaration attrDecl)
- {
- IPropertyDescriptor result = null;
- CMDocument cmDocument = (CMDocument)attrDecl.getProperty("CMDocument");
- if (cmDocument != null)
- {
- String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");
- if (namespaceURI != null)
- {
- IPropertyDescriptorProvider provider = (IPropertyDescriptorProvider)WSDLEditorPlugin.getInstance().getPropertyDescriptorProviderRegistry().get(namespaceURI);
- if (provider != null)
- {
- result = provider.getPropertyDescriptor(editorPart, (Element)fNode, namespaceURI, attrDecl.getNodeName());
- }
- }
- }
- if (result == null)
- {
- result = super.createPropertyDescriptor(attrDecl);
- }
- return result;
- }
-
-
- // TODO... I've asked Nitin to consider changing a couple of lines in
- // DOMPropertySource (to handle valueString == null). With this change
- // the method below would not be needed.
-// KC: Looks like he made the change in the sse version
-//
-// public void setPropertyValue(Object nameObject, Object value) {
-// // Avoid cycling - can happen if a closing cell editor causes a refresh
-// // on the PropertySheet page and the setInput again asks the editor to
-// // close; besides, why apply the same value twice?
-// if (!settingObjects.isEmpty() && settingObjects.peek() == nameObject)
-// return;
-// settingObjects.push(nameObject);
-// String name = nameObject.toString();
-// String valueString = null;
-// if (value != null)
-// valueString = value.toString();
-// NamedNodeMap attrMap = fNode.getAttributes();
-// try {
-// if (attrMap != null) {
-// Attr attr = (Attr) attrMap.getNamedItem(name);
-// if (attr != null) {
-// // EXISTING VALUE
-// // potential out of control loop if updating the value triggers a viewer update, forcing the
-// // active cell editor to save its value and causing the loop to continue
-//
-// if (attr.getValue() == null || !attr.getValue().equals(valueString)) {
-// if (valueString == null)
-// {
-// attr.getOwnerElement().removeAttributeNode(attr);
-// }
-// else
-// {
-//
-// if (attr instanceof XMLNode)
-// ((XMLNode) attr).setValueSource(valueString);
-//
-// else
-// attr.setValue(valueString);
-// }
-// }
-//
-// }
-// else {
-// // NEW(?) value
-// if (value != null) { // never create an empty attribute
-// Attr newAttr = fNode.getOwnerDocument().createAttribute(name);
-// if (newAttr instanceof XMLNode)
-// ((XMLNode) newAttr).setValueSource(valueString);
-// else
-// newAttr.setValue(valueString);
-// attrMap.setNamedItem(newAttr);
-// }
-// }
-// }
-// else {
-// if (fNode instanceof Element) {
-// ((Element) fNode).setAttribute(name, valueString);
-// }
-// }
-// }
-// catch (DOMException e) {
-// Display.getCurrent().beep();
-// }
-// settingObjects.pop();
-// }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/InvokeDialogButton.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/InvokeDialogButton.java
deleted file mode 100644
index 5b1906b..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/InvokeDialogButton.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers.widgets;
-
-import org.eclipse.swt.SWT;
-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.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.dialogs.InvokeSetDialog;
-
-// instead of using a Button directly (which causes sizing/layout problems)
-// we use this class
-public class InvokeDialogButton extends Composite implements SelectionListener
-{
- protected Button button;
- protected Object input;
- protected Composite parent;
- protected IEditorPart editorPart;
- protected String kind;
-
- public InvokeDialogButton(Composite parent, Object input)
- {
- super(parent, SWT.NONE);
- this.parent = parent;
- this.input = input;
- GridData gd = new GridData();
- gd.grabExcessHorizontalSpace = false;
- gd.grabExcessVerticalSpace = false;
- setLayoutData(gd);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- setLayout(layout);
-
- button = new Button(this, SWT.NONE);
- gd = new GridData();
- gd.grabExcessHorizontalSpace = false;
- gd.heightHint = 17;
- gd.widthHint = 24;
- button.setLayoutData(gd);
- button.setText("...");
- button.addSelectionListener(this);
- }
-
- public Button getButton()
- {
- return button;
- }
-
- public void setInput(Object input)
- {
- this.input = input;
- }
-
- public void setEditor(IEditorPart editorPart)
- {
- this.editorPart = editorPart;
- }
-
- public void setReferenceKind(String kind)
- {
- this.kind = kind;
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == button)
- {
- InvokeSetDialog dialog = new InvokeSetDialog();
- if (input instanceof Part)
- {
- dialog.setReferenceKind(kind);
- }
- dialog.run(input, editorPart);
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
-
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ReadOnlyPropertySource.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ReadOnlyPropertySource.java
deleted file mode 100644
index 7f48c94..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/viewers/widgets/ReadOnlyPropertySource.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.viewers.widgets;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-public class ReadOnlyPropertySource implements IPropertySource
-{
- protected Element element;
-
- public ReadOnlyPropertySource(IEditorPart editPart, Element element)
- {
- this.element = element;
- }
-
- public Object getEditableValue()
- {
- return null;
- }
-
- public IPropertyDescriptor[] getPropertyDescriptors()
- {
- List list = new ArrayList();
- NamedNodeMap map = element.getAttributes();
- int mapLength = map.getLength();
- for (int i = 0; i < mapLength; i++)
- {
- Attr attr = (Attr) map.item(i);
- list.add(new PropertyDescriptor(attr.getName(), attr.getName()));
- }
- IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
- list.toArray(result);
- return result;
- }
-
- public Object getPropertyValue(Object id)
- {
- Object result = null;
- if (id instanceof String)
- {
- result = element.getAttribute((String) id);
- }
- return result != null ? result : "";
- }
-
- public boolean isPropertySet(Object id)
- {
- return false;
- }
-
- public void resetPropertyValue(Object id)
- {
- }
-
- public void setPropertyValue(Object id, Object value)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/BaseRenamer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/BaseRenamer.java
deleted file mode 100644
index f92d942..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/BaseRenamer.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.visitor;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-
-public abstract class BaseRenamer extends WSDLVisitor
-{
- protected String newName;
- protected WSDLElement globalComponent;
-
- public BaseRenamer(WSDLElement globalComponent, String newName)
- {
- super(globalComponent.getEnclosingDefinition());
- this.globalComponent = globalComponent;
- this.newName = newName;
- }
-
- public String getNewQName()
- {
- String qName = null;
- if (newName != null)
- {
- Definition definition = globalComponent.getEnclosingDefinition();
- qName = definition.getPrefix(definition.getTargetNamespace());
- qName += ":" + newName;
- }
- else
- {
- qName = newName;
- }
-
- return qName;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/BindingRenamer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/BindingRenamer.java
deleted file mode 100644
index b85cf04..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/BindingRenamer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.visitor;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-public class BindingRenamer extends BaseRenamer
-{
- /**
- * Constructor for BindingRenamer.
- * @param globalComponent
- * @param newName
- */
- public BindingRenamer(WSDLElement globalComponent, String newName)
- {
- super(globalComponent, newName);
- }
-
- public void visitPort(Port port)
- {
- super.visitPort(port);
- Binding binding = port.getEBinding();
- if (globalComponent.equals(binding))
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(port);
- element.setAttribute("binding", getNewQName());
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/MessageRenamer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/MessageRenamer.java
deleted file mode 100644
index 030d22e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/MessageRenamer.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.visitor;
-
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-public class MessageRenamer extends BaseRenamer
-{
- /**
- * Constructor for MessageRenamer.
- * @param globalComponent
- * @param newName
- */
- public MessageRenamer(WSDLElement globalComponent, String newName)
- {
- super(globalComponent, newName);
- }
-
- public void visitInput(Input input)
- {
- super.visitInput(input);
- Message message = input.getEMessage();
- if (globalComponent.equals(message))
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(input);
- element.setAttribute("message", getNewQName());
- }
- }
-
- public void visitOutput(Output output)
- {
- super.visitOutput(output);
- Message message = output.getEMessage();
- if (globalComponent.equals(output))
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(output);
- element.setAttribute("message", getNewQName());
- }
- }
-
- public void visitFault(Fault fault)
- {
- super.visitFault(fault);
- Message message = fault.getEMessage();
- if (globalComponent.equals(fault))
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(fault);
- element.setAttribute("message", getNewQName());
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/PortTypeRenamer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/PortTypeRenamer.java
deleted file mode 100644
index da4d029..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/PortTypeRenamer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.visitor;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.w3c.dom.Element;
-
-public class PortTypeRenamer extends BaseRenamer
-{
- /**
- * Constructor for PortTypeRenamer.
- * @param globalComponent
- * @param newName
- */
- public PortTypeRenamer(WSDLElement globalComponent, String newName)
- {
- super(globalComponent, newName);
- }
-
- public void visitBinding(Binding binding)
- {
- super.visitBinding(binding);
- PortType portType = binding.getEPortType();
-
- if (globalComponent.equals(portType))
- {
- Element element = WSDLEditorUtil.getInstance().getElementForObject(binding);
- element.setAttribute("type", getNewQName());
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/WSDLVisitor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/WSDLVisitor.java
deleted file mode 100644
index 4b6d79a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/visitor/WSDLVisitor.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.visitor;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.BindingInput;
-import org.eclipse.wst.wsdl.BindingOperation;
-import org.eclipse.wst.wsdl.BindingOutput;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Fault;
-import org.eclipse.wst.wsdl.Input;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.Operation;
-import org.eclipse.wst.wsdl.Output;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class WSDLVisitor
-{
- protected Definition definition;
-
-
- public WSDLVisitor(Definition definition)
- {
- this.definition = definition;
- }
-
-
- public void visitDefinition()
- {
- visitBindings();
- visitMessages();
- visitPortTypes();
- visitServices();
- }
-
- public void visitBindings()
- {
- for (Iterator iterator = definition.getEBindings().iterator(); iterator.hasNext(); )
- {
- Binding binding = (Binding)iterator.next();
- visitBinding(binding);
- }
- }
-
- public void visitMessages()
- {
- for (Iterator iterator = definition.getEMessages().iterator(); iterator.hasNext(); )
- {
- Message message = (Message)iterator.next();
- visitMessage(message);
- }
- }
-
- public void visitPortTypes()
- {
- for (Iterator iterator = definition.getEPortTypes().iterator(); iterator.hasNext(); )
- {
- PortType portType = (PortType)iterator.next();
- visitPortType(portType);
- }
- }
-
- public void visitServices()
- {
- for (Iterator iterator = definition.getEServices().iterator(); iterator.hasNext(); )
- {
- Service service = (Service)iterator.next();
- visitService(service);
- }
- }
-
- public void visitBinding(Binding binding)
- {
- PortType portType = binding.getEPortType();
- if (portType != null)
- {
- visitPortType(portType);
- }
-
- for (Iterator iterator = binding.getEBindingOperations().iterator(); iterator.hasNext(); )
- {
- BindingOperation bindingOperation = (BindingOperation)iterator.next();
- visitBindingOperation(bindingOperation);
- }
- }
-
- public void visitPortType(PortType portType)
- {
- for (Iterator iterator = portType.getEOperations().iterator(); iterator.hasNext(); )
- {
- Operation operation = (Operation)iterator.next();
- visitOperation(operation);
- }
- }
-
- public void visitBindingOperation(BindingOperation bindingOperation)
- {
- BindingInput bindingInput = bindingOperation.getEBindingInput();
- BindingOutput bindingOutput = bindingOperation.getEBindingOutput();
- }
-
- public void visitOperation(Operation operation)
- {
- Input input = operation.getEInput();
- Output output = operation.getEOutput();
-
- if (input != null)
- {
- visitInput(input);
- }
- if (output != null)
- {
- visitOutput(output);
- }
-
- for (Iterator iterator = operation.getEFaults().iterator(); iterator.hasNext(); )
- {
- Fault fault = (Fault)iterator.next();
- if (fault != null)
- {
- visitFault(fault);
- }
- }
-
- }
-
- public void visitPart(Part part)
- {
- XSDTypeDefinition type = part.getTypeDefinition();
- }
-
- public void visitMessage(Message message)
- {
- for (Iterator iterator = message.getEParts().iterator(); iterator.hasNext(); )
- {
- Part part = (Part)iterator.next();
- visitPart(part);
- }
- }
-
- public void visitInput(Input input)
- {
- Message message = input.getEMessage();
- if (message != null)
- {
- visitMessage(message);
- }
- }
-
- public void visitOutput(Output output)
- {
- Message message = output.getEMessage();
- if (message != null)
- {
- visitMessage(message);
- }
- }
-
- public void visitFault(Fault fault)
- {
- Message message = fault.getEMessage();
- if (message != null)
- {
- visitMessage(message);
- }
- }
-
- public void visitPort(Port port)
- {
- Binding binding = port.getEBinding();
- if (binding != null)
- {
- visitBinding(binding);
- }
- }
-
- public void visitService(Service service)
- {
- for (Iterator iterator = service.getEPorts().iterator(); iterator.hasNext(); )
- {
- Port port = (Port)iterator.next();
- visitPort(port);
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/widgets/NewComponentDialog.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/widgets/NewComponentDialog.java
deleted file mode 100644
index d9595b1..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/widgets/NewComponentDialog.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.widgets;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class NewComponentDialog extends Dialog implements ModifyListener
-{
- protected Text nameField;
- protected Button okButton;
- protected String name;
- protected String title;
- protected Label errorMessageLabel;
- protected List usedNames;
-
- public NewComponentDialog(Shell parentShell, String title, String defaultName)
- {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- name = defaultName;
- this.title = title;
- }
-
- public NewComponentDialog(Shell parentShell, String title, String defaultName, List usedNames)
- {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- name = defaultName;
- this.title = title;
- this.usedNames = usedNames;
- }
-
- public int createAndOpen()
- {
- create();
- getShell().setText(title);
- setBlockOnOpen(true);
- return open();
- }
-
- protected Control createContents(Composite parent)
- {
- Control control = super.createContents(parent);
- nameField.forceFocus();
- nameField.selectAll();
- updateErrorMessage();
- return control;
- }
-
-
- protected void createButtonsForButtonBar(Composite parent)
- {
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected void createExtendedContent(Composite parent)
- {
- }
-
-
- protected Control createDialogArea(Composite parent)
- {
- Composite dialogArea = (Composite)super.createDialogArea(parent);
-
- Composite composite = new Composite(dialogArea, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- GridData gdFill= new GridData();
- gdFill.horizontalAlignment= GridData.FILL;
- gdFill.grabExcessHorizontalSpace= true;
- gdFill.verticalAlignment= GridData.FILL;
- gdFill.grabExcessVerticalSpace= true;
- composite.setLayoutData(gdFill);
-
- Label nameLabel = new Label(composite, SWT.NONE);
- nameLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_NAME")); //$NON-NLS-1$
-
- nameField = new Text(composite, SWT.SINGLE | SWT.BORDER);
- GridData gd= new GridData();
- gd.horizontalAlignment= GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
- gd.widthHint = 200;
- nameField.setLayoutData(gd);
- nameField.setText(name);
- nameField.addModifyListener(this);
-
- createExtendedContent(dialogArea);
-
- // error message
- errorMessageLabel = new Label(dialogArea, SWT.NONE);
- errorMessageLabel.setText("error message goes here");
- GridData gd2 = new GridData();
- gd2.horizontalAlignment= GridData.FILL;
- gd2.grabExcessHorizontalSpace= true;
- gd2.widthHint = 200;
- errorMessageLabel.setLayoutData(gd2);
-// Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
-// errorMessageLabel.setForeground(color);
-
- return dialogArea;
- }
-
- public void modifyText(ModifyEvent e)
- {
- updateErrorMessage();
- }
-
- protected String computeErrorMessage(String name)
- {
- if (usedNames == null)
- return null;
-
- Iterator iterator = usedNames.iterator();
- while (iterator.hasNext()) {
- if (name.equalsIgnoreCase((String) iterator.next())) {
- return WSDLEditorPlugin.getWSDLString("_UI_LABEL_WARNING_DUPLICATE_NAME_EXISTS");
- }
- }
-
- return null;
- }
-
- protected void updateErrorMessage()
- {
- String errorMessage = null;
- String name = nameField.getText().trim();
- if (name.length() > 0)
- {
- errorMessage = computeErrorMessage(name);
- }
- else
- {
- errorMessage = "";
- }
- errorMessageLabel.setText(errorMessage != null ? errorMessage : "");
-// okButton.setEnabled(errorMessage == null);
- }
-
- protected void buttonPressed(int buttonId)
- {
- if (buttonId == IDialogConstants.OK_ID)
- {
- name = nameField.getText();
- }
- super.buttonPressed(buttonId);
- }
-
- public String getName()
- {
- return name;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/widgets/NewComponentWithChildDialog.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/widgets/NewComponentWithChildDialog.java
deleted file mode 100644
index 4c50919..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/widgets/NewComponentWithChildDialog.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.widgets;
-
-import java.util.List;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-
-/*
- * This class extends NewComponentDialog to allow additional widgets. More
- * specifically, the 'create sub-components' checkbox
- */
-public class NewComponentWithChildDialog extends NewComponentDialog {
- protected Button createMessageCheckBox;
- private boolean createMessageBoolean;
-
- public NewComponentWithChildDialog(Shell parentShell, String title, String defaultName) {
- super(parentShell, title, defaultName);
- }
-
- public NewComponentWithChildDialog(Shell parentShell, String title, String defaultName, List usedNames) {
- super(parentShell, title, defaultName, usedNames);
- }
-
- protected void createExtendedContent(Composite parent) {
- Composite child = new Composite (parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- child.setLayout(layout);
-
- createMessageCheckBox = new Button(child, SWT.CHECK);
- createMessageCheckBox.setSelection(true);
- createMessageCheckBox.setText(WSDLEditorPlugin.getWSDLString("_UI_CREATE_MESSAGE_CHECKBOX_LABEL"));
- }
-
- public boolean createSubComponents() {
- return createMessageBoolean;
- }
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- createMessageBoolean = createMessageCheckBox.getSelection();
- }
- super.buttonPressed(buttonId);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/widgets/ProtocolComponentControl.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/widgets/ProtocolComponentControl.java
deleted file mode 100644
index 10b9a2e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/widgets/ProtocolComponentControl.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.widgets;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.AbstractGenerator;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.ContentGeneratorOptionsPage;
-
-public abstract class ProtocolComponentControl extends Composite implements SelectionListener, ModifyListener
-{
- protected AbstractGenerator generator;
-
- protected Text componentNameField;
- protected Combo refNameCombo;
- protected Button refBrowseButton;
- protected Combo protocolCombo;
- protected Button overwriteButton;
- protected PageBook pageBook;
- protected Composite emptySettingsPage;
- protected Map pageMap = new HashMap();
-
- //protected boolean isBindingComponent = true;
- //protected boolean isNewComponent = true;
- protected String name;
- protected String refName;
-
- protected String UNSPECIFIED = WSDLEditorPlugin.getWSDLString("_UI_UNSPECIFIED");
- //protected BindingGenerator bindingGenerator;
-
- public ProtocolComponentControl(Composite parent, AbstractGenerator generator, boolean showOverwriteButton)
- {
- super(parent, SWT.NONE);
- this.generator = generator;
- //this.isBindingComponent = isBindingComponent;
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- setLayout(layout);
- setLayoutData(createGridData(true, 1));
-
- Composite labelValueComposite = new Composite(this, SWT.NONE);
- labelValueComposite.setLayout(new GridLayout(2, false));
- labelValueComposite.setLayoutData(createGridData(false, 1));
-
- // row 1
- //
- Label componentNameLabel = new Label(labelValueComposite, SWT.NONE);
- componentNameLabel.setText(getComponentNameLabelText()); //$NON-NLS-1$
-
- componentNameField = new Text(labelValueComposite, SWT.BORDER);
- GridData gdName= new GridData();
- gdName.horizontalAlignment= GridData.FILL;
- gdName.grabExcessHorizontalSpace= true;
- componentNameField.setLayoutData(gdName);
- componentNameField.addModifyListener(this);
- //createPlaceHolder(labelValueComposite);
-
- // row 2
- //
- Label refNameLabel = new Label(labelValueComposite, SWT.NONE);
- refNameLabel.setText(getRefNameLabelText()); //$NON-NLS-1$
- refNameCombo = new Combo(labelValueComposite, SWT.READ_ONLY);
- GridData gdRefName= new GridData();
- gdRefName.horizontalAlignment= GridData.FILL;
- gdRefName.grabExcessHorizontalSpace= true;
- refNameCombo.setLayoutData(gdRefName);
- refNameCombo.addSelectionListener(this);
-
- //refBrowseButton = new Button(labelValueComposite, SWT.NONE);
- //refBrowseButton.setText(" ... ");
- //GridData gd = new GridData();
- //gd.grabExcessHorizontalSpace = false;
- //gd.heightHint = 17;
- //gd.widthHint = 24;
- //refBrowseButton.setLayoutData(gd);
- //refBrowseButton.addSelectionListener(this);
- //createPlaceHolder(labelValueComposite);
-
- // row 3
- //
- Label protocolLabel = new Label(labelValueComposite, SWT.NONE);
- protocolLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_BINDING_PROTOCOL")); //$NON-NLS-1$
- protocolCombo = new Combo(labelValueComposite, SWT.READ_ONLY);
- GridData gdProtocol= new GridData();
- gdProtocol.horizontalAlignment= GridData.FILL;
- gdProtocol.grabExcessHorizontalSpace= true;
- protocolCombo.setLayoutData(gdProtocol);
- protocolCombo.addSelectionListener(this);
- //createPlaceHolder(labelValueComposite);
-
- // optional overwrite button
- //
- if (showOverwriteButton)
- {
- overwriteButton = new Button(this, SWT.CHECK);
- overwriteButton.setText(WSDLEditorPlugin.getWSDLString("_UI_CHECKBOX_OVERWRITE")); //$NON-NLS-1$
- overwriteButton.addSelectionListener(this);
- }
-
- // protocol specific settings
- //
- pageBook = new PageBook(this, SWT.NONE);
- GridData gdFill= new GridData();
- gdFill.horizontalAlignment= GridData.FILL;
- gdFill.grabExcessHorizontalSpace= true;
- gdFill.verticalAlignment= GridData.FILL;
- gdFill.grabExcessVerticalSpace= true;
- pageBook.setLayoutData(gdFill);
-
- emptySettingsPage = new Composite(pageBook, SWT.NONE);
- for (int i = 0; i < 6; i++)
- {
- Label placeHolder = new Label(emptySettingsPage, SWT.NONE);
- }
-
- updatePageBook(generator.getProtocol());
- }
-
- public void initFields()
- {
- // prime the fields
- //
- componentNameField.setText(getDefaultName());
- updateRefNameCombo();
- updateProtocolCombo();
- }
-
- public Text getComponentNameField()
- {
- return componentNameField;
- }
-
- public String getComponentNameLabelText()
- {
- return "Name";
- }
-
- private GridData createGridData(boolean both, int span)
- {
- GridData gd = new GridData(both ? GridData.FILL_BOTH : GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = span;
- return gd;
- }
-
- private Control createPlaceHolder(Composite parent)
- {
- Label label = new Label(parent, SWT.NONE);
- return label;
- }
- public AbstractGenerator getGenerator()
- {
- return generator;
- }
-
- // implements SelectionListener
- //
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- if (event.widget == overwriteButton && overwriteButton != null)
- {
- getGenerator().setOverwrite(overwriteButton.getSelection());
- }
- else if (event.widget == refNameCombo)
- {
- int index = refNameCombo.getSelectionIndex();
- String refName = refNameCombo.getItem(index);
- getGenerator().setRefName(refName);
- }
- else if (event.widget == protocolCombo)
- {
- int index = protocolCombo.getSelectionIndex();
- String protocol = (index != -1) ? protocolCombo.getItem(index) : null;
- getGenerator().setProtocol(protocol);
- getGenerator().setOptions(null);
- updatePageBook(protocol);
- }
- }
-
- private static final String IS_OVERWRITE_APPLICABLE = "IS_OVERWRITE_APPLICABLE";
- protected void updatePageBook(String protocol)
- {
- if (protocol != null)
- {
- Control control = (Control) pageMap.get(protocol);
- if (control == null)
- {
- ContentGeneratorOptionsPage optionsPage = createContentGeneratorOptionsPage(protocol);
-
- if (optionsPage != null)
- {
- optionsPage.init(getGenerator());
- control = optionsPage.createControl(pageBook);
- control.setData(IS_OVERWRITE_APPLICABLE, new Boolean(optionsPage.isOverwriteApplicable()));
- pageMap.put(protocol, control);
- }
-
- if (control != null)
- {
- pageMap.put(protocol, control);
- }
- }
-
- boolean enableOverwriteButton = true;
- if (control != null)
- {
- if (overwriteButton != null)
- {
- Boolean data = (Boolean) control.getData(IS_OVERWRITE_APPLICABLE);
- enableOverwriteButton = data == null || data.equals(Boolean.TRUE);
- }
- pageBook.showPage(control);
- pageBook.layout();
- pageBook.getParent().layout();
- }
- else
- {
- pageBook.showPage(emptySettingsPage);
- }
-
- if (overwriteButton != null)
- {
- if (enableOverwriteButton)
- {
- overwriteButton.setEnabled(true);
- overwriteButton.setSelection(generator.getOverwrite());
- }
- else
- {
- overwriteButton.setEnabled(false);
- overwriteButton.setSelection(true);
- }
- }
- }
- }
-
- protected void updateProtocolCombo()
- {
- protocolCombo.removeAll();
-
- List list = new ArrayList();
- list.add(UNSPECIFIED);
- list.addAll(WSDLEditorPlugin.getInstance().getContentGeneratorExtensionRegistry().getBindingExtensionNames());
-
- String protocolText = generator.getProtocol();
-
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- String protocol = (String) i.next();
- protocolCombo.add(protocol);
- }
-
- if (protocolText == null && protocolCombo.getItemCount() > 0)
- {
- protocolText = protocolCombo.getItem(0);
- generator.setProtocol(!UNSPECIFIED.equals(protocolText) ? protocolText : null);
- }
- protocolCombo.setText(protocolText);
- }
-
- protected void updateRefNameCombo()
- {
- refNameCombo.removeAll();
-
- refNameCombo.add(UNSPECIFIED);
- for (Iterator i = getRefNames().iterator(); i.hasNext();)
- {
- refNameCombo.add((String) i.next());
- }
-
- if (refNameCombo.getItemCount() > 0)
- {
- String refText = generator.getRefName();
- refNameCombo.setText(refText != null ? refText : UNSPECIFIED);
- }
- }
-
- public void modifyText(ModifyEvent e)
- {
- generator.setName(componentNameField.getText());
- }
-
- public abstract List getRefNames();
- public abstract String getRefNameLabelText();
- public abstract String getDefaultName();
- public abstract ContentGeneratorOptionsPage createContentGeneratorOptionsPage(String protocol);
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/BindingWizard.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/BindingWizard.java
deleted file mode 100644
index 6d7ff19..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/BindingWizard.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.sse.core.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.AbstractGenerator;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.BindingGenerator;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.ContentGeneratorExtension;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.ContentGeneratorOptionsPage;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.wsdl.ui.internal.widgets.ProtocolComponentControl;
-import org.eclipse.wst.xml.core.XMLModelPlugin;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class BindingWizard extends Wizard
-{
- protected BindingGenerator bindingGenerator;
- protected BindingWizardOptionsPage specifyBindingPage;
-
- protected Document document;
- protected int kind;
-
- public static final int KIND_NEW_BINDING = 1;
- public static final int KIND_REGENERATE_BINDING = 2;
-
- /**
- * Constructor for BindingWizard.
- */
- public BindingWizard(Definition definition)
- {
- this(definition, KIND_NEW_BINDING);
- }
-
- public BindingWizard(Definition definition, Document document)
- {
- this(definition, KIND_NEW_BINDING);
- this.document = document;
- }
-
- public BindingWizard(Definition definition, int kind)
- {
- super();
- this.kind = kind;
- bindingGenerator = new BindingGenerator(definition);
- setWindowTitle(WSDLEditorPlugin.getWSDLString("_UI_BINDING_WIZARD")); //$NON-NLS-1$
- //setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(WSDLEditorPlugin.class, "icons/NewXML.gif"));
- }
-
- public void setBindingName(String bindingName)
- {
- bindingGenerator.setName(bindingName);
-
- Definition definition = bindingGenerator.getDefinition();
- QName qname = new QName(definition.getTargetNamespace(), bindingName);
- Binding binding = (Binding) definition.getBinding(qname);
- if (binding != null)
- {
- List eeList = binding.getEExtensibilityElements();
- if (eeList.size() > 0)
- {
- ExtensibilityElement ee = (ExtensibilityElement) eeList.get(0);
- Element element = WSDLEditorUtil.getInstance().getElementForObject(ee);
- String namespace = element.getNamespaceURI();
- if (namespace != null)
- {
- ContentGeneratorExtension extension = WSDLEditorPlugin.getInstance().getContentGeneratorExtensionRegistry().getExtensionForNamespace(namespace);
-
- if (extension != null)
- {
- bindingGenerator.setProtocol(extension.getName());
- }
- }
- }
- }
- }
-
- public void setPortTypeName(String portTypeName)
- {
- bindingGenerator.setPortTypeName(portTypeName);
- }
-
- public BindingGenerator getBindingGenerator()
- {
- return bindingGenerator;
- }
-
- /**
- * Return true if wizard setup is successful, false otherwise
- */
- public boolean setup()
- {
- return true;
- }
-
- public void addPages()
- {
- specifyBindingPage = new BindingWizardOptionsPage();
- addPage(specifyBindingPage);
- }
-
- public boolean performFinish()
- {
- Definition definition = bindingGenerator.getDefinition();
- boolean recordingStarted = false;
- if (definition.getElement() == null || (document != null && document.getChildNodes().getLength() == 0)) {
- recordingStarted = true;
- beginRecording();
-
- // Create the Definitions element with proper namespace
- Preferences preference = XMLModelPlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonModelPreferenceNames.OUTPUT_CODESET);
- if (charSet == null || charSet.trim().equals(""))
- {
- charSet = "UTF-8";
- }
- document.appendChild(document.createProcessingInstruction("xml", "version=\"1.0\" encoding=\"" + charSet + "\""));
- Element root = document.createElement("wsdl:definitions");
- document.appendChild(root);
-
- // Add various namespace attributes here.
- root.setAttribute("xmlns:soap", "http://schemas.xmlsoap.org/wsdl/soap/");
- root.setAttribute("xmlns:tns", getDefaultNamespace(definition));
- root.setAttribute("xmlns:wsdl", "http://schemas.xmlsoap.org/wsdl/");
- root.setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
- root.setAttribute("name", getFileName(definition));
- root.setAttribute("targetNamespace", getDefaultNamespace(definition));
-
- definition.setElement(root);
- }
-
- bindingGenerator.generate();
-
- try
- {
- Object object = bindingGenerator.getNewComponent();
- if (object != null)
- {
- IEditorPart editorPart = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ISelectionProvider selectionProvider = (ISelectionProvider) editorPart.getAdapter(ISelectionProvider.class);
- if (selectionProvider != null)
- {
- selectionProvider.setSelection(new StructuredSelection(object));
- }
- }
- }
- catch (Exception e)
- {
- }
- finally {
- if (recordingStarted)
- endRecording();
- }
-
- return true;
- }
-
- private String getDefaultNamespace(Definition definition)
- {
- String namespace = WSDLEditorPlugin.getInstance().getPreferenceStore().getString(WSDLEditorPlugin.getWSDLString("_UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE"));
- if (!namespace.endsWith("/")) {
- namespace = namespace.concat("/");
- }
-
- namespace += getFileName(definition) + "/";
-
- return namespace;
- }
-
- private String getFileName(Definition definition) {
- String fileLocation = definition.getLocation();
- IPath filePath = new Path(fileLocation);
- return filePath.removeFileExtension().lastSegment().toString();
- }
-
- private void beginRecording() {
- Node node = document;
- if (node instanceof XMLNode)
- {
- ((XMLNode)node).getModel().beginRecording(this, WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_BINDING"));
- }
- }
-
- private void endRecording() {
- Node node = document;
- if (node instanceof XMLNode)
- {
- ((XMLNode)node).getModel().endRecording(this);
- }
- }
-
- class BindingWizardOptionsPage extends WizardPage
- {
- protected ProtocolComponentControl protocolComponentControl;
-
- public BindingWizardOptionsPage()
- {
- super("SpecifyBindingPage");
- setTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_BINDING_DETAILS"));
- setDescription(WSDLEditorPlugin.getWSDLString("_UI_SPECIFY_BINDING_DETAILS_LABEL"));
- }
-
- protected BindingGenerator getBindingGenerator()
- {
- return ((BindingWizard) getWizard()).getBindingGenerator();
- }
-
- public void createControl(Composite parent)
- {
- ProtocolComponentControl protocolComponentControl = new BindingProtocolComponentControl(parent, bindingGenerator, kind == KIND_REGENERATE_BINDING);
- protocolComponentControl.initFields();
- setControl(protocolComponentControl);
- }
- }
-
- public static class BindingProtocolComponentControl extends ProtocolComponentControl
- {
- public BindingProtocolComponentControl(Composite parent, AbstractGenerator generator)
- {
- this(parent, generator, false);
- }
-
- public BindingProtocolComponentControl(Composite parent, AbstractGenerator generator, boolean showOverwriteButton)
- {
- super(parent, generator, showOverwriteButton);
-
- if (generator.getName() != null)
- {
- componentNameField.setEditable(false);
- }
- }
-
- public String getRefNameLabelText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_PORT_TYPE");
- }
-
- public List getRefNames()
- {
- return new ComponentReferenceUtil(generator.getDefinition()).getPortTypeNames();
- }
-
- public String getDefaultName()
- {
- String bindingName = generator.getName();
- return bindingName != null ? bindingName : NameUtil.buildUniqueBindingName(generator.getDefinition(), null);
- }
-
- public ContentGeneratorOptionsPage createContentGeneratorOptionsPage(String protocol)
- {
- ContentGeneratorOptionsPage optionsPage = null;
- ContentGeneratorExtension extension = WSDLEditorPlugin.getInstance().getContentGeneratorExtensionRegistry().getContentGeneratorExtension(protocol);
- if (extension != null)
- {
- optionsPage = extension.createBindingContentGeneratorOptionsPage();
- }
- return optionsPage;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/NamespaceTable.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/NamespaceTable.java
deleted file mode 100644
index aa312fb..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/NamespaceTable.java
+++ /dev/null
@@ -1,701 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckboxCellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-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.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.common.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.common.ui.viewers.NavigableTableViewer;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.xml.ui.dialogs.EditNamespaceInfoDialog;
-import org.eclipse.wst.xml.ui.dialogs.UpdateListener;
-import org.eclipse.wst.xml.ui.util.XMLCommonResources;
-
-public class NamespaceTable extends Composite
-{
- protected static final String NAMESPACE_URI = XMLCommonResources.getInstance().getString("_UI_LABEL_NAMESPACE_NAME"); //$NON-NLS-1$
- protected static final String PREFIX = XMLCommonResources.getInstance().getString("_UI_LABEL_PREFIX"); //$NON-NLS-1$
- protected static final String INCLUDE = WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT"); //$NON-NLS-1$
-
- protected List namespaceInfoList = new Vector();
- protected List checkedList = new Vector();
- protected NamespaceNavigableTableViewer tableViewer;
- protected Button addButton;
-
- protected NamespaceInfoTableLabelProvider provider;
- protected UpdateListener updateListener;
- protected IPath resourceLocation;
- protected int visibleRows = -1;
- protected boolean dummyRowsRemoved = false;
- Table table;
-
- public NamespaceTable(Composite parent)
- {
- this(parent, -1, -1, -1);
- }
-
- public NamespaceTable(Composite parent, int visibleRows)
- {
- this(parent, -1, -1, visibleRows);
- }
-
- public NamespaceTable(Composite parent, int widthHint, int heightHint)
- {
- this(parent, widthHint, heightHint, -1);
- }
-
- public NamespaceTable(Composite parent, int widthHint, int heightHint, int visibleRows)
- {
- super(parent, SWT.NONE);
- setLayout(createGridLayout());
- GridData fillGD= new GridData();
- fillGD.horizontalAlignment= GridData.FILL;
- fillGD.grabExcessHorizontalSpace= true;
- fillGD.verticalAlignment= GridData.FILL;
- fillGD.grabExcessVerticalSpace= true;
-
- setLayoutData(fillGD);
-
- Group namespaceInfoGroup = new Group(this, SWT.NONE);
- namespaceInfoGroup.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_NAMESPACE_URIS_TO_BE_INCLUDED")); //$NON-NLS-1$
- namespaceInfoGroup.setLayout(new GridLayout());
- GridData gd = fillGD;
- if (widthHint != -1)
- {
- gd.widthHint = widthHint;
- }
- if (heightHint != -1)
- {
- gd.heightHint = heightHint;
- }
- namespaceInfoGroup.setLayoutData(gd);
- //WorkbenchHelp.setHelp(namespaceInfoGroup, new ControlContextComputer(namespaceInfoGroup, XMLBuilderContextIds.XMLC_NAMESPACE_GROUP));
-
- String[] titleArray = {INCLUDE, PREFIX, NAMESPACE_URI};
-
- table = new Table(namespaceInfoGroup, SWT.FULL_SELECTION);
- table.setHeaderVisible(true);
-
- table.setLayoutData(fillGD);
- table.setLinesVisible(true);
- table.addMouseListener(new MouseAdapter()
- {
- public void mouseDown(MouseEvent e)
- {
- TableItem item = table.getItem(new Point(e.x, e.y));
- if (item != null)
- {
- Object obj = item.getData();
- if (obj != null)
- {
- TableElement holder = (TableElement)obj;
- TableColumn col = table.getColumn(0);
- if (e.x < col.getWidth()) // if the point falls within the Select column then perform check/uncheck
- {
- String currentState = holder.getChecked();
- if (currentState.equals("true")) //$NON-NLS-1$
- {
- holder.setChecked("false"); //$NON-NLS-1$
- checkedList.set(holder.getIndex(), "false"); //$NON-NLS-1$
- }
- else if (currentState.equals("false")) //$NON-NLS-1$
- {
- holder.setChecked("true"); //$NON-NLS-1$
- checkedList.set(holder.getIndex(), "true"); //$NON-NLS-1$
- }
- tableViewer.refresh();
- if (updateListener != null)
- {
- updateListener.updateOccured(this, namespaceInfoList);
- }
- }
- }
- }
- }
- });
-
- tableViewer = new NamespaceNavigableTableViewer(table);
- provider = new NamespaceInfoTableLabelProvider();
- tableViewer.setContentProvider(provider);
- tableViewer.setLabelProvider(provider);
- tableViewer.setColumnProperties(titleArray);
- tableViewer.setCellModifier(new NamespaceInfoCellModifier());
-
-
- int[] widthArray = {10, 20, 50};
- TableLayout layout = new TableLayout();
-
- for (int i = 0; i < titleArray.length; i++)
- {
- TableColumn column = new TableColumn(table, i);
- column.setText(titleArray[i]);
- column.setAlignment(SWT.LEFT);
- layout.addColumnData(new ColumnWeightData(widthArray[i], true));
- }
- this.visibleRows = visibleRows;
- for (int i = 0; i < visibleRows; i++)
- {
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText("#######"); //$NON-NLS-1$
- }
- table.setLayout(layout);
-
- CellEditor[] cellEditors = new CellEditor[titleArray.length];
- cellEditors[0] = new NamespaceInfoCheckboxCellEditor(table);
- cellEditors[1] = new TextCellEditor(table);
- tableViewer.setCellEditors(cellEditors);
-
-// createButtons(namespaceInfoGroup);
-
- initialize();
- }
-
- public void setUpdateListener(UpdateListener updateListener)
- {
- this.updateListener = updateListener;
- }
-
- public void setNamespaceInfoList(List namespaceInfoList)
- {
- this.namespaceInfoList = namespaceInfoList;
- update();
- }
-
- public List getNamespaceInfoList()
- {
- return namespaceInfoList;
- }
-
- public List getNamespaceCheckedList()
- {
- return checkedList;
- }
-
- public String getWSDLPrefix()
- {
- return ((NamespaceInfo)(namespaceInfoList.get(0))).prefix;
- }
-
- public void setResourceLocation(IPath resourceLocation)
- {
- this.resourceLocation = resourceLocation;
- }
-
- public GridLayout createGridLayout()
- {
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginWidth = 0;
- gridLayout.horizontalSpacing = 0;
- return gridLayout;
- }
-
- protected void initialize()
- {
- // better way to do this....
- NamespaceInfo info1 = new NamespaceInfo();
- info1.prefix = "wsdl"; //$NON-NLS-1$
- info1.uri = "http://schemas.xmlsoap.org/wsdl/"; //$NON-NLS-1$
- namespaceInfoList.add(info1);
- checkedList.add("true"); //$NON-NLS-1$
- NamespaceInfo info2 = new NamespaceInfo();
- info2.prefix = "soap"; //$NON-NLS-1$
- info2.uri = "http://schemas.xmlsoap.org/wsdl/soap/"; //$NON-NLS-1$
- namespaceInfoList.add(info2);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info3 = new NamespaceInfo();
- info3.prefix = "http"; //$NON-NLS-1$
- info3.uri = "http://schemas.xmlsoap.org/wsdl/http/"; //$NON-NLS-1$
- namespaceInfoList.add(info3);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info4 = new NamespaceInfo();
- info4.prefix = "mime"; //$NON-NLS-1$
- info4.uri = "http://schemas.xmlsoap.org/wsdl/mime/"; //$NON-NLS-1$
- namespaceInfoList.add(info4);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info5 = new NamespaceInfo();
- info5.prefix = "soapenc"; //$NON-NLS-1$
- info5.uri = "http://schemas.xmlsoap.org/soap/encoding/"; //$NON-NLS-1$
- namespaceInfoList.add(info5);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info6 = new NamespaceInfo();
- info6.prefix = "soapenv"; //$NON-NLS-1$
- info6.uri = "http://schemas.xmlsoap.org/soap/envelope/"; //$NON-NLS-1$
- namespaceInfoList.add(info6);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info7 = new NamespaceInfo();
- info7.prefix = "xsi"; //$NON-NLS-1$
- info7.uri = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
- namespaceInfoList.add(info7);
- checkedList.add("false"); //$NON-NLS-1$
- NamespaceInfo info8 = new NamespaceInfo();
- info8.prefix = "xsd"; //$NON-NLS-1$
- info8.uri = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
- namespaceInfoList.add(info8);
- checkedList.add("true"); //$NON-NLS-1$
- update();
- }
-
- protected void createButtons(Composite parent)
- {
- Composite composite = new Composite(parent, SWT.NONE);
- GridData hFillGD = new GridData();
- hFillGD.horizontalAlignment= GridData.FILL;
- hFillGD.grabExcessHorizontalSpace= true;
-
- composite.setLayoutData(hFillGD);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- composite.setLayout(gridLayout);
-
- GridData gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace= true;
-
- Button hiddenButton = new Button(composite, SWT.NONE);
- hiddenButton.setLayoutData(gd);
- hiddenButton.setVisible(false);
- hiddenButton.setEnabled(false);
-
- SelectionListener selectionListener = new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == addButton)
- {
- performNew();
- }
- }
- };
-
- // create a composite to hold the three buttons
- Composite buttonComposite = new Composite(composite, SWT.NONE);
-
- buttonComposite.setLayoutData(hFillGD);
- GridLayout buttonGridLayout = new GridLayout();
- buttonGridLayout.numColumns = 1;
- buttonGridLayout.makeColumnsEqualWidth = true;
- buttonComposite.setLayout(buttonGridLayout);
-
- // add the New button
- //
- gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
-
- addButton = new Button(buttonComposite, SWT.NONE);
- addButton.setText(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD")); //$NON-NLS-1$
- addButton.setLayoutData(gd);//ViewUtility.createHorizontalFill());
- addButton.addSelectionListener(selectionListener);
- }
-
- public void performNew()
- {
- NamespaceInfo info = new NamespaceInfo();
- EditNamespaceInfoDialog dialog = invokeDialog(XMLCommonResources.getInstance().getString("_UI_LABEL_NEW_NAMESPACE_INFORMATION"), info); //$NON-NLS-1$
- if (dialog.getReturnCode() == Dialog.OK)
- {
- namespaceInfoList.add(info);
- checkedList.add("true"); //$NON-NLS-1$
- performDelayedUpdate();
- }
- }
-
- protected EditNamespaceInfoDialog invokeDialog(String title, NamespaceInfo info)
- {
- Shell shell = XMLCommonResources.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- EditNamespaceInfoDialog dialog = new EditNamespaceInfoDialog(shell, info);
- dialog.create();
- dialog.getShell().setText(title);
- dialog.setBlockOnOpen(true);
- dialog.setResourceLocation(resourceLocation);
- dialog.open();
- return dialog;
- }
-
- protected void performDelayedUpdate()
- {
- Runnable delayedUpdate = new Runnable()
- {
- public void run()
- {
- update();
- }
- };
- Display.getCurrent().asyncExec(delayedUpdate);
-
- if (updateListener != null)
- {
- updateListener.updateOccured(this, namespaceInfoList);
- }
- }
-
- protected NamespaceInfo getTargetNamespaceInfo()
- {
- return (namespaceInfoList != null && namespaceInfoList.size() > 0) ?
- (NamespaceInfo)namespaceInfoList.get(0) :
- null;
- }
-
-
- public void update()
- {
- updateHelper(namespaceInfoList);
- }
-
- public void updateHelper(List namespaceInfoList)
- {
- if (visibleRows != -1 && !dummyRowsRemoved)
- {
-// dummyRowsRemoved = true;
-// tableViewer.getTable().removeAll();
- }
- ISelection selection = tableViewer.getSelection();
- tableViewer.setInput(namespaceInfoList);
- if (selection.isEmpty())
- {
- if (namespaceInfoList.size() > 0)
- {
- tableViewer.setSelection(new StructuredSelection(namespaceInfoList.get(0)));
- }
- }
- else
- {
- tableViewer.setSelection(selection);
- }
- }
-
- protected class NamespaceInfoCheckboxCellEditor extends CheckboxCellEditor implements MouseListener
- {
- public NamespaceInfoCheckboxCellEditor(Composite parent)
- {
- super(parent);
- }
-
- protected void doSetValue(Object value)
- {
- }
-
- public void activate()
- {
- super.activate();
- deactivate();
- Display.getCurrent().getFocusControl().redraw();
- }
-
- public void mouseDown(MouseEvent e)
- {
- if (tableViewer.getTable().getItem(new Point(e.x, e.y)) != null)
- {
- }
- }
- public void mouseDoubleClick(MouseEvent e) {}
- public void mouseUp(MouseEvent e) {}
-
-
- }
-
-
- protected class NamespaceInfoCellModifier implements ICellModifier
- {
- public NamespaceInfoCellModifier()
- {
-
- }
-
- public boolean canModify(Object element, String property)
- {
- if (property.equals(INCLUDE))
- {
- return true;
- }
- else if (property.equals(PREFIX))
- {
- return true;
- }
- return false;
- }
-
- public Object getValue(Object element, String property)
- {
- int column = 0;
- if (property.equals(INCLUDE))
- {
- column = 0;
- }
- else if (property.equals(PREFIX))
- {
- column = 1;
- }
- else if (property.equals(NAMESPACE_URI))
- {
- column = 2;
- }
-
- if (element instanceof TableElement)
- {
- return provider.getColumnText(element, column);
- }
- else
- {
- return null;
- }
- }
-
- public void modify(Object element, String property, Object value)
- {
- TableItem item = (TableItem)element;
- if (item != null)
- {
- Object obj = item.getData();
- if (obj != null)
- {
- TableElement holder = (TableElement)obj;
- NamespaceInfo info = holder.getNamespaceInfo();
- if (property.equals(INCLUDE))
- {
- if (value instanceof Boolean)
- {
- if (((Boolean)value).booleanValue())
- {
- holder.setChecked("true");
- checkedList.set(holder.getIndex(), "true");
- }
- else
- {
- holder.setChecked("false");
- checkedList.set(holder.getIndex(), "false");
- }
- }
- }
- else if (property.equals(PREFIX))
- {
- info.prefix = ((String)value).trim();
- }
-
- Runnable delayedUpdate = new Runnable()
- {
- public void run()
- {
- tableViewer.refresh();
- }
- };
- Display.getCurrent().asyncExec(delayedUpdate);
- if (updateListener != null)
- {
- updateListener.updateOccured(this, namespaceInfoList);
- }
-
-// performDelayedUpdate();
- }
- }
- }
- }
-
- protected class TableElement
- {
- NamespaceInfo info;
- int index;
- String checked = "true";
-
- TableElement(NamespaceInfo info, int index)
- {
- this.info = info;
- this.index = index;
- }
-
- public NamespaceInfo getNamespaceInfo()
- {
- return info;
- }
-
- public int getIndex()
- {
- return index;
- }
-
- public String getChecked()
- {
- return checked;
- }
-
- public void setChecked(String checked)
- {
- this.checked = checked;
- }
- }
-
- /**
- * NamespaceInfoTableLabelProvider
- */
- protected class NamespaceInfoTableLabelProvider implements ITableLabelProvider, IStructuredContentProvider
- {
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return false;
- }
-
- public boolean isDeleted(Object element)
- {
- return false;
- }
-
- public Object[] getElements(Object inputElement)
- {
- Vector v = new Vector();
- for (int i = 0; i < namespaceInfoList.size(); i++)
- {
- NamespaceInfo info = (NamespaceInfo)namespaceInfoList.get(i);
- TableElement holder = new TableElement(info, i);
- holder.setChecked((String)checkedList.get(i));
- v.add(holder);
- }
- return v.toArray();
- }
-
- public String getColumnText(Object object, int column)
- {
- TableElement holder = (TableElement)object;
- NamespaceInfo info = holder.getNamespaceInfo();
- String result = null;
- switch (column)
- {
- case 1: { result = info.prefix; break; }
- case 2: { result = info.uri; break; }
- }
- result = result != null ? result.trim() : "";
- if (result.equals(""))
- {
- switch (column)
- {
- case 2:
- {
- result = XMLCommonResources.getInstance().getString("_UI_NO_NAMESPACE_NAME"); //$NON-NLS-1$
- break;
- }
- }
- }
- return result;
- }
-
-// private String getDefaultPrefix()
-// {
-// String defaultPrefix = "p";
-// if (namespaceInfoList == null)
-// return defaultPrefix;
-//
-// Vector v = new Vector();
-// for (int i=0; i<namespaceInfoList.size(); i++)
-// {
-// NamespaceInfo nsinfo = (NamespaceInfo)namespaceInfoList.get(i);
-// if (nsinfo.prefix != null)
-// v.addElement(nsinfo.prefix);
-// }
-//
-// if (v.contains(defaultPrefix))
-// {
-// String s = defaultPrefix;
-// for (int j=0; v.contains(s); j++)
-// {
-// s = defaultPrefix + Integer.toString(j);
-// }
-// return s;
-// }
-// else
-// return defaultPrefix;
-// }
-
- public Image getColumnImage(Object object, int columnIndex)
- {
- if (columnIndex == 0) // Output Column
- {
- if (object instanceof TableElement)
- {
- TableElement holder = (TableElement) object;
- String result = holder.getChecked();
- if (result.equals("true")) //$NON-NLS-1$
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/output_yes.gif"); //$NON-NLS-1$
- }
- else
- {
- return WSDLEditorPlugin.getInstance().getImage("icons/output_no.gif"); //$NON-NLS-1$
- }
- }
- }
- return null;
- }
-
- public boolean isLabelProperty(Object object, Object property)
- {
- return false;
- }
-
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- }
-
- public void dispose()
- {
- }
- }
-
- class NamespaceNavigableTableViewer extends NavigableTableViewer
- {
- public NamespaceNavigableTableViewer(Table parent)
- {
- super(parent);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/NewWSDLWizard.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/NewWSDLWizard.java
deleted file mode 100644
index 984af7a..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/NewWSDLWizard.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.common.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.common.contentmodel.CMDataType;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.common.contentmodel.CMGroup;
-import org.eclipse.wst.common.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.common.contentmodel.CMNodeList;
-import org.eclipse.wst.common.contentmodel.internal.util.DOMValidator;
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.common.contentmodel.util.CMVisitor;
-import org.eclipse.wst.common.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.common.ui.UIPlugin;
-import org.eclipse.wst.sse.core.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.wsdl.Port;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddUnknownExtensibilityElementCommand;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.BindingGenerator;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.CreateWSDLElementHelper;
-import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
-import org.eclipse.wst.wsdl.internal.impl.WSDLFactoryImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl;
-import org.eclipse.wst.xml.core.XMLModelPlugin;
-import org.w3c.dom.Element;
-
-public class NewWSDLWizard extends Wizard implements INewWizard
-{
- private WSDLNewFilePage newFilePage;
- private WSDLNewFileOptionsPage optionsPage;
- private IStructuredSelection selection;
- private IWorkbench workbench;
-
- /**
- * Constructor for NewWSDLWizard.
- */
- public NewWSDLWizard()
- {
- super();
- }
- /**
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish()
- {
- IFile file = newFilePage.createNewFile();
-
- Preferences preference = XMLModelPlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonModelPreferenceNames.OUTPUT_CODESET);
- if (charSet == null || charSet.trim().equals(""))
- {
- charSet = "UTF-8";
- }
-
- String wsdlPrefix = "wsdl";
- Vector namespaces = optionsPage.getNamespaceInfo();
-
- String prefix = optionsPage.getPrefix();
- String definitionName = optionsPage.getDefinitionName();
-
- WSDLFactoryImpl factory = new WSDLFactoryImpl();
- DefinitionImpl definition = (DefinitionImpl) factory.createDefinition();
-
- definition.setTargetNamespace(optionsPage.getTargetNamespace());
- definition.setLocation(file.getLocation().toString());
- definition.setEncoding(charSet);
- definition.setQName(new QName(wsdlPrefix, definitionName));
- definition.addNamespace(prefix, optionsPage.getTargetNamespace());
-
- for (int i=0; i<namespaces.size(); i++)
- {
- NamespaceInfo info = (NamespaceInfo)namespaces.get(i);
-
- if (info.prefix.length() > 0)
- {
- definition.addNamespace(info.prefix, info.uri);
- }
- else
- {
- definition.addNamespace(null, info.uri);
- }
- }
-
- try {
- if (optionsPage.getCreateSkeletonBoolean()) {
- if (optionsPage.isSoapDocLiteralProtocol()) {
- CreateWSDLElementHelper.PART_TYPE_OR_DEFINITION = CreateWSDLElementHelper.PART_INFO_ELEMENT_DECLARATION;
- }
- else {
- CreateWSDLElementHelper.PART_TYPE_OR_DEFINITION = CreateWSDLElementHelper.PART_INFO_TYPE_DEFINITION;
- }
-
- CreateWSDLElementHelper.serviceName = definitionName;
- CreateWSDLElementHelper.portName = definitionName + optionsPage.getProtocol();
- Service service = CreateWSDLElementHelper.createService(definition);
- definition.updateElement(true);
-
- // Generate Binding
- BindingGenerator bindingGenerator = new BindingGenerator(definition);
- Port port = (Port) service.getEPorts().iterator().next();
- bindingGenerator.setName(ComponentReferenceUtil.getName(port.getEBinding()));
- bindingGenerator.setPortTypeName(ComponentReferenceUtil.getPortTypeReference(port.getEBinding()));
- bindingGenerator.setProtocol(optionsPage.getProtocol());
- bindingGenerator.setOverwrite(true);
- bindingGenerator.setOptions(optionsPage.getProtocolOptions());
- bindingGenerator.generate();
-
- // Generate address
- String addressName = optionsPage.getProtocol().toLowerCase() + ":address";
- Map table = new Hashtable(1);
- String uri = WSDLEditorPlugin.getInstance().getPluginPreferences().getString(WSDLEditorPlugin.getWSDLString("_UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE"));
- table.put("location", uri);
- AddUnknownExtensibilityElementCommand addEECommand = new AddUnknownExtensibilityElementCommand(port, "", addressName, table);
- addEECommand.run();
-
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- WSDLResourceImpl.serialize(outputStream, definition.getDocument(), charSet);
- ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
- file.setContents(inputStream,true,false,null);
- }
- else {
- URI uri = URI.createPlatformResourceURI(file.getFullPath().toOSString());
- definition.updateElement(true);
- ResourceSet resourceSet = new ResourceSetImpl();
- WSDLResourceImpl resource = (WSDLResourceImpl)resourceSet.createResource(URI.createURI("*.wsdl"));
- resource.setURI(uri);
- resource.getContents().add(definition);
- resource.save(null);
- }
- }
- catch (Exception e) {
- System.out.println("\nCould not write new WSDL file in WSDL Wizard: " + e);
- }
-
-/*
- if (file != null)
- {
- final ISelection selection = new StructuredSelection(file);
- if (selection != null)
- {
- IWorkbench workbench = UIPlugin.getDefault().getWorkbench();
- final IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- final IWorkbenchPart focusPart = workbenchWindow.getActivePage().getActivePart();
- if (focusPart instanceof ISetSelectionTarget)
- {
- Display.getCurrent().asyncExec
- (new Runnable()
- {
- public void run()
- {
- ((ISetSelectionTarget)focusPart).selectReveal(selection);
- }
- });
- }
- }
- }
-*/
- openEditor(file);
-
- return true;
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection)
- {
- this.selection = selection;
- this.workbench = workbench;
-
-// Need new icon
- this.setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(WSDLEditor.class, "icons/new_wsdl_wiz.gif"));
- this.setWindowTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_NEW_WSDL_FILE")); //$NON-NLS-1$
- }
-
- public void addPages()
- {
- newFilePage = new WSDLNewFilePage(selection);
- optionsPage = new WSDLNewFileOptionsPage(WSDLEditorPlugin.getWSDLString("_UI_TITLE_OPTIONS"), WSDLEditorPlugin.getWSDLString("_UI_TITLE_OPTIONS"), null); //$NON-NLS-1$ //$NON-NLS-2$
- addPage(newFilePage);
- addPage(optionsPage);
- }
-
- public IPath getNewFilePath()
- {
- String fileName = newFilePage.getFileName();
- return fileName != null ? new Path(fileName) : null;
- }
-
- public boolean canFinish()
- {
- if (newFilePage.isPageComplete() && optionsPage.isPageComplete())
- {
- return true;
- }
- return false;
- }
-
- static public void openEditor(final IFile iFile)
- {
- if (iFile != null)
- {
- IWorkbench workbench = UIPlugin.getDefault().getWorkbench();
- final IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-
- Display.getDefault().asyncExec
- (new Runnable()
- {
- public void run()
- {
- try
- {
- workbenchWindow.getActivePage().openEditor(new FileEditorInput(iFile), "org.eclipse.wst.wsdl.ui.internal.WSDLEditor");
- }
- catch (PartInitException ex)
- {
-// B2BGUIPlugin.getPlugin().getMsgLogger().write("Exception encountered when attempting to open file: " + iFile + "\n\n" + ex);
- }
- }
- });
- }
- }
-
- public class AvailableContentCMVisitor extends CMVisitor
- {
- public static final int INCLUDE_ATTRIBUTES = ModelQuery.INCLUDE_ATTRIBUTES;
- public static final int INCLUDE_CHILD_NODES = ModelQuery.INCLUDE_CHILD_NODES;
- public static final int INCLUDE_SEQUENCE_GROUPS = ModelQuery.INCLUDE_SEQUENCE_GROUPS;
-
- public Hashtable childNodeTable = new Hashtable();
- public Hashtable attributeTable = new Hashtable();
- public Element rootElement;
- public CMElementDeclaration rootElementDeclaration;
- public boolean isRootVisited;
- protected boolean includeSequenceGroups;
- public DOMValidator validator;
-
- public AvailableContentCMVisitor(Element rootElement, CMElementDeclaration rootElementDeclaration)
- {
- this.rootElement = rootElement;
- this.rootElementDeclaration = rootElementDeclaration;
- validator = new DOMValidator();
- }
-
- protected String getKey(CMNode cmNode)
- {
- String key = cmNode.getNodeName();
- CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument");
- if (cmDocument != null)
- {
- String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");
- if (namespaceURI != null)
- {
- key = "[" + namespaceURI + "]" + key;
- }
- }
- return key;
- }
-
- public List computeAvailableContent(int includeOptions)
- {
- Vector v = new Vector();
-
- int contentType = rootElementDeclaration.getContentType();
- includeSequenceGroups = ((includeOptions & INCLUDE_SEQUENCE_GROUPS) != 0);
- visitCMNode(rootElementDeclaration);
-
- if ((includeOptions & INCLUDE_ATTRIBUTES) != 0)
- {
- v.addAll(attributeTable.values());
- CMAttributeDeclaration nillableAttribute = (CMAttributeDeclaration)rootElementDeclaration.getProperty("http://org.eclipse.wst/cm/properties/nillable");
- if (nillableAttribute != null)
- {
- v.add(nillableAttribute);
- }
- }
-
- if ((includeOptions & INCLUDE_CHILD_NODES) != 0)
- {
- if (contentType == CMElementDeclaration.MIXED ||
- contentType == CMElementDeclaration.ELEMENT)
- {
- v.addAll(childNodeTable.values());
- }
- else if (contentType == CMElementDeclaration.ANY)
- {
- CMDocument cmDocument = (CMDocument)rootElementDeclaration.getProperty("CMDocument");
- if (cmDocument != null)
- {
- CMNamedNodeMap elements = cmDocument.getElements();
- for (Iterator i = elements.iterator(); i.hasNext(); )
- {
- v.add((CMElementDeclaration)i.next());
- }
- }
- }
-
- if (contentType == CMElementDeclaration.MIXED ||
- contentType == CMElementDeclaration.PCDATA ||
- contentType == CMElementDeclaration.ANY)
- {
- CMDataType dataType = rootElementDeclaration.getDataType();
- if (dataType != null)
- {
- v.add(dataType);
- }
- }
- }
- return v;
- }
-/*
- public void visitCMAnyElement(CMAnyElement anyElement)
- {
- String uri = anyElement.getNamespaceURI();
- List list = getCMDocumentList(rootElement, rootElementDeclaration, uri);
- for (Iterator iterator = list.iterator(); iterator.hasNext(); )
- {
- CMDocument cmdocument = (CMDocument)iterator.next();
- if (cmdocument != null)
- {
- CMNamedNodeMap map = cmdocument.getElements();
- int size = map.getLength();
- for (int i = 0; i < size; i++)
- {
- CMNode ed = map.item(i);
-
- childNodeTable.put(getKey(ed), ed);
- }
- }
- }
- }
-*/
- public void visitCMAttributeDeclaration(CMAttributeDeclaration ad)
- {
- super.visitCMAttributeDeclaration(ad);
- attributeTable.put(ad.getNodeName(), ad);
- }
-
- public void visitCMElementDeclaration(CMElementDeclaration ed)
- {
- if (ed == rootElementDeclaration && !isRootVisited)
- {
- isRootVisited = true;
- super.visitCMElementDeclaration(ed);
- }
- else
- {
- if (!Boolean.TRUE.equals(ed.getProperty("Abstract")))
- {
- childNodeTable.put(getKey(ed), ed);
- }
-
- CMNodeList substitutionGroup = (CMNodeList)ed.getProperty("SubstitutionGroup");
- if (substitutionGroup != null)
- {
- handleSubstitutionGroup(substitutionGroup);
- }
- }
- }
-
- protected void handleSubstitutionGroup(CMNodeList substitutionGroup)
- {
- int substitutionGroupLength = substitutionGroup.getLength();
- if (substitutionGroupLength > 1)
- {
- for (int i = 0; i < substitutionGroupLength; i++)
- {
- CMNode ed = substitutionGroup.item(i);
- if (!Boolean.TRUE.equals(ed.getProperty("Abstract")))
- {
- childNodeTable.put(getKey(ed), ed);
- }
- }
- }
- }
-
- public void visitCMGroup(CMGroup group)
- {
- if (includeSequenceGroups)
- {
- if (group.getOperator() == CMGroup.SEQUENCE &&
- group.getChildNodes().getLength() > 1 &&
- includesRequiredContent(group))
- {
- childNodeTable.put(group, group);
- }
- }
- super.visitCMGroup(group);
- }
-
- public boolean includesRequiredContent(CMGroup group)
- {
- List list = getValidator().createContentSpecificationList(group);
- return list.size() > 1;
- }
-
- public DOMValidator getValidator() {
- return validator;
- }
- } /////////////////////////// here
-}
-
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/PortWizard.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/PortWizard.java
deleted file mode 100644
index 7ae69db..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/PortWizard.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import java.util.List;
-
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Service;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.AbstractGenerator;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.ContentGeneratorExtension;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.PortGenerator;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.ui.ContentGeneratorOptionsPage;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.widgets.ProtocolComponentControl;
-
-public class PortWizard extends Wizard
-{
- protected final static int STYLE_NEW_BINDING = 1;
- protected final static int STYLE_EXISTING_BINDING = 1 << 1;
- protected final static int STYLE_DEFAULT = STYLE_NEW_BINDING | STYLE_EXISTING_BINDING;
-
- protected PortGenerator portGenerator;
- protected PortWizardOptionsPage specifyBindingPage;
- protected int style;
-
- /**
- * Constructor for PortWizard.
- */
- public PortWizard(Service service)
- {
- this(service, 0);
- }
-
- public PortWizard(Service service, int style)
- {
- super();
- portGenerator = new PortGenerator(service);
- setWindowTitle(WSDLEditorPlugin.getWSDLString("_UI_PORT_WIZARD")); //$NON-NLS-1$
- //setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(WSDLEditorPlugin.class, "icons/NewXML.gif"));
- }
-
- /**
- * Return true if wizard setup is successful, false otherwise
- */
- public boolean setup()
- {
- return true;
- }
-
- public void addPages()
- {
- specifyBindingPage = new PortWizardOptionsPage(style);
- addPage(specifyBindingPage);
- }
-
- public boolean performFinish()
- {
- portGenerator.generate();
-
- try
- {
- Object object = portGenerator.getNewComponent();
- if (object != null)
- {
- IEditorPart editorPart = WSDLEditorPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ISelectionProvider selectionProvider = (ISelectionProvider) editorPart.getAdapter(ISelectionProvider.class);
- if (selectionProvider != null)
- {
- selectionProvider.setSelection(new StructuredSelection(object));
- }
- }
- }
- catch (Exception e)
- {
- }
- return true;
- }
-
- class PortWizardOptionsPage extends WizardPage
- {
-
- protected ProtocolComponentControl protocolComponentControl;
-
- public PortWizardOptionsPage(int style)
- {
- super("SpecifyPortPage");
- setTitle(WSDLEditorPlugin.getWSDLString("_UI_SPECIFY_PORT_DETAILS"));
- setDescription(WSDLEditorPlugin.getWSDLString("_UI_SPECIFY_PORT_DETAILS_TO_BE_CREATED"));
- }
-
- public AbstractGenerator getGenerator()
- {
- return portGenerator;
- }
-
- public void createControl(Composite parent)
- {
- ProtocolComponentControl protocolComponentControl = new PortProtocolComponentControl(parent, portGenerator);
- protocolComponentControl.initFields();
- setControl(protocolComponentControl);
- }
- }
-
- class PortProtocolComponentControl extends ProtocolComponentControl
- {
-
- public PortProtocolComponentControl(Composite parent, AbstractGenerator generator)
- {
- super(parent, generator, false);
- }
-
- public String getRefNameLabelText()
- {
- return WSDLEditorPlugin.getWSDLString("_UI_BINDING");
- }
-
- public List getRefNames()
- {
- return new ComponentReferenceUtil(portGenerator.getDefinition()).getBindingNames();
- }
-
- public String getDefaultName()
- {
- Service service = portGenerator.getService();
- return NameUtil.buildUniquePortName(service, null);
- }
-
- public ContentGeneratorOptionsPage createContentGeneratorOptionsPage(String protocol)
- {
- ContentGeneratorOptionsPage optionsPage = null;
- ContentGeneratorExtension extension = WSDLEditorPlugin.getInstance().getContentGeneratorExtensionRegistry().getContentGeneratorExtension(protocol);
- if (extension != null)
- {
- optionsPage = extension.createPortContentGeneratorOptionsPage();
- }
- return optionsPage;
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetBindingOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetBindingOptionsPage.java
deleted file mode 100644
index d6e8480..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetBindingOptionsPage.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-import javax.wsdl.Binding;
-import javax.wsdl.Port;
-
-
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.ui.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.contentgenerator.BindingGenerator;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-import org.eclipse.wst.wsdl.ui.internal.widgets.ProtocolComponentControl;
-
-public class SetBindingOptionsPage
- extends SetOptionsPage
-{
- public BindingGenerator bindingGenerator;
- /**
- * Constructor for NewBindingOptionsPage.
- * @param pageName
- * @param title
- * @param titleImage
- */
- public SetBindingOptionsPage(
- IEditorPart editorPart,
- String pageName,
- String title,
- ImageDescriptor titleImage)
- {
- super(editorPart, pageName, title, titleImage, "binding");
- }
-
- public void createPage1(Composite pageBook)
- {
- page1 = new Composite(pageBook, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- page1.setLayout(layout);
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
- bindingGenerator = new BindingGenerator(definition);
- ProtocolComponentControl control = new BindingWizard.BindingProtocolComponentControl(page1, bindingGenerator);
- control.initFields();
- newNameText = control.getComponentNameField();
- initNewNameTextField();
- }
-
- protected void initNewNameTextField()
- {
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
- Port port = (Port)input;
- if (port.getName() == null || (port.getName() != null && port.getName().length() ==0))
- {
- newNameText.setText(NameUtil.buildUniqueBindingName(definition, null));
- }
- else
- {
- newNameText.setText(port.getName());
- }
- }
-
- protected void initExistingNameList()
- {
- if (componentNameList.getItemCount() == 0)
- {
- componentNameList.removeAll();
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
-
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
- java.util.List currentList = util.getBindingNames();
- if (currentList.size() > 0)
- {
- for (Iterator it = currentList.iterator(); it.hasNext(); )
- {
- componentNameList.add((String)it.next());
- }
- componentNameList.select(0);
- existingListSelection = (componentNameList.getSelection())[0];
- }
- }
- }
-
- protected void handleImport()
- {
- ResourceSet resourceSet = null;
-// TODO: port check
-// resourceSet = ((org.eclipse.emf.ecore.EObject)input).getResourceSet();
- resourceSet = ((org.eclipse.emf.ecore.EObject)input).eResource().getResourceSet();
-
-
- SelectSingleFileDialog dialog = new SelectSingleFileDialog(getShell(), null, true);
- String [] filters = { "wsdl" };
- dialog.addFilterExtensions(filters);
- dialog.create();
- dialog.setTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT_WSDL_FILE")); //$NON-NLS-1$
- dialog.getShell().setText(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT")); //$NON-NLS-1$
- dialog.setMessage(WSDLEditorPlugin.getWSDLString("_UI_DESCRIPTION_SELECT_WSDL_FILE_TO_IMPORT")); //$NON-NLS-1$
- int rc = dialog.open();
- if (rc == IDialogConstants.OK_ID)
- {
- selectedFile = dialog.getFile();
- importComponents = loadFile(selectedFile, resourceSet);
- importList.removeAll();
- for (Iterator i = importComponents.iterator(); i.hasNext(); )
- {
- Binding msg = (Binding)i.next();
- importList.add(msg.getQName().getLocalPart());
- }
- fileText.setText(dialog.getFile().getFullPath().toString());
- }
- }
-
- public Collection getModelObjects(Object rootModelObject)
- {
- if (rootModelObject instanceof Definition)
- {
- Definition definition = (Definition)rootModelObject;
- return ((Definition)definition).getBindings().values();
- }
- return Collections.EMPTY_LIST;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetBindingWizard.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetBindingWizard.java
deleted file mode 100644
index 107b41d..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetBindingWizard.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-
-public class SetBindingWizard extends Wizard
-{
- protected final static int STYLE_NEW_BINDING = 1;
- protected final static int STYLE_EXISTING_BINDING = 1<<1;
- protected final static int STYLE_DEFAULT = STYLE_NEW_BINDING | STYLE_EXISTING_BINDING;
-
-
- protected Object input;
- private IEditorPart editorPart;
- private String kind;
- SetBindingOptionsPage newBindingOptionsPage;
-
- /**
- * Constructor for NewBindingWizard.
- */
- public SetBindingWizard(Object input, IEditorPart editorPart)
- {
- super();
- this.input = input;
- this.editorPart = editorPart;
-// setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(WSDLEditor.class, "icons/wsdl_file_obj.gif"));
- }
-
- /**
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish()
- {
- org.w3c.dom.Element wsdlElement = WSDLEditorUtil.getInstance().getElementForObject((WSDLElement)input);
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
- org.w3c.dom.Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- if (newBindingOptionsPage.getChoice() == 2)
- {
- String choice = newBindingOptionsPage.getExistingListSelection();
- if (choice != null)
- {
- wsdlElement.setAttribute("binding", choice);
- }
- }
- else if (newBindingOptionsPage.getChoice() == 1)
- {
- newBindingOptionsPage.bindingGenerator.generate();
- String newName = newBindingOptionsPage.bindingGenerator.getName();
-
- /*
- String prefix = definitionElement.getPrefix();
- // Use AddMessageAction in WSDLMenuActionContributor
- AddElementAction addBindingAction = new AddElementAction("", "icons/message_obj.gif", definitionElement, prefix, "binding");
- addBindingAction.setComputeTopLevelRefChild(true);
- addBindingAction.run();
- org.w3c.dom.Element newMessage = addBindingAction.getNewElement();
- newMessage.setAttribute("name", newName);
- // need to get the prefix for the item
- // could get list of updated messages and then select but currently we only have the local name
- *
- */
- String itemPrefix = definition.getPrefix(definition.getTargetNamespace());
- if (itemPrefix == null)
- {
- itemPrefix = "";
- }
- wsdlElement.setAttribute("binding", itemPrefix.length() == 0 ? newName : itemPrefix + ":" + newName);
-
- }
- else if (newBindingOptionsPage.getChoice() == 3)
- {
- javax.wsdl.Binding selection = (javax.wsdl.Binding)newBindingOptionsPage.getSelection();
- String namespaceURI = selection.getQName().getNamespaceURI();
- String uniquePrefix = newBindingOptionsPage.addWSDLImport(definition, definitionElement, namespaceURI);
- wsdlElement.setAttribute("binding", uniquePrefix + ":" + selection.getQName().getLocalPart());
- }
-
- WSDLEditor editor = (WSDLEditor)editorPart;
- editor.getSelectionManager().setSelection(new StructuredSelection(input));
-
- return true;
- }
-
- public boolean canFinish()
- {
- if (newBindingOptionsPage.isPageComplete())
- {
- return true;
- }
- return false;
- }
-
- public Object getInput()
- {
- return input;
- }
-
- public void addPages()
- {
- newBindingOptionsPage = new SetBindingOptionsPage(editorPart, WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_BINDING"), WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_BINDING"), null);
- newBindingOptionsPage.setEditorPart(editorPart);
- newBindingOptionsPage.setInput(input);
- addPage(newBindingOptionsPage);
- setWindowTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_BINDING"));
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetComponentOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetComponentOptionsPage.java
deleted file mode 100644
index 68782d2..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetComponentOptionsPage.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.ui.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class SetComponentOptionsPage extends SetOptionsPage
-{
- protected String kind;
- protected Button importStyleCheckBox;
- boolean isWSIStyleSchemaImport;
-// Support for choosing which schema to add element/type to
-// protected String schemaSelection;
-// protected org.eclipse.swt.widgets.List schemaList;
-
- public SetComponentOptionsPage(
- IEditorPart editorPart,
- String pageName,
- String title,
- ImageDescriptor titleImage,
- String kind)
- {
- super(editorPart, pageName, title, titleImage, kind);
- this.kind = kind;
- }
-
- public boolean isWSIStyleSchemaImport()
- {
- return isWSIStyleSchemaImport;
- }
-
- public void createControl(Composite parent)
- {
- super.createControl(parent);
- importStyleCheckBox = new Button(page3, SWT.CHECK);
- importStyleCheckBox.setText(WSDLEditorPlugin.getWSDLString("_UI_USE_WS-I_STYLE_SCHEMA_IMPORT"));
- importStyleCheckBox.setSelection(true);
- isWSIStyleSchemaImport = true;
- importStyleCheckBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
-
- SelectionListener selectionListener = new SelectionListener()
- {
- public void widgetSelected(SelectionEvent event)
- {
- isWSIStyleSchemaImport = importStyleCheckBox.getSelection();
- }
-
- public void widgetDefaultSelected(SelectionEvent event)
- {
- }
- };
- importStyleCheckBox.addSelectionListener(selectionListener);
- }
-
- protected void initNewNameTextField()
- {
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
- // TODO: generate new unique schema component name
- if (kind.equalsIgnoreCase("type"))
- {
- newNameText.setText(getNewNameHelper("NewComplexType", true));
- }
- else
- {
- newNameText.setText(getNewNameHelper("NewElement", false));
- }
- }
-
- protected Hashtable createNameTable(boolean isType)
- {
- // TODO ... instead of using ComponentReferenceUtil, we should locate the specific schema
- // that will be used to create the component and ask it for its component names.
- // The code below is rather gross... we really need to fix this up!
- Hashtable table = new Hashtable();
- if (input != null)
- {
- Part part = (Part)input;
- for (Iterator iterator = ComponentReferenceUtil.getComponentNameList(part, isType).iterator(); iterator.hasNext();)
- {
- String name = (String)iterator.next();
- int index = name.indexOf(":");
- if (index != -1 && name.length() > index)
- {
- name = name.substring(index + 1);
- }
- table.put(name, name);
- //System.out.println("Name -> " + name);
- }
- }
- return table;
- }
-
- protected String getNewNameHelper(String base, boolean isType)
- {
- String name = base;
- int count = 0;
- Hashtable table = createNameTable(isType);
- while (true)
- {
- if (table.get(name) == null)
- {
- break;
- }
- else
- {
- count++;
- name = base + count;
- }
- }
- return name;
- }
-
- protected void initExistingNameList()
- {
- if (componentNameList.getItemCount() == 0)
- {
- componentNameList.removeAll();
- boolean isType = kind.equalsIgnoreCase("type") ? true : false;
- if (input != null)
- {
- Part part = (Part)input;
- for (Iterator iterator = ComponentReferenceUtil.getComponentNameList(part, isType).iterator(); iterator.hasNext();)
- {
- componentNameList.add((String)iterator.next());
- }
- }
- if (componentNameList.getItemCount() > 0)
- {
- componentNameList.select(0);
- existingListSelection = (componentNameList.getSelection())[0];
- }
- }
- }
-
-// Support for choosing which schema to add element/type to
-// protected void initSchemaList()
-// {
-// if (schemaList.getItemCount() == 0)
-// {
-// schemaList.removeAll();
-// if (part != null)
-// {
-// javax.wsdl.Types types = definition.getTypes();
-// java.util.List schemas = types.getExtensibilityElements();
-//
-// for (Iterator iterator = schemas.iterator(); iterator.hasNext();)
-// {
-// XSDSchemaExtensibilityElement schema = (XSDSchemaExtensibilityElement)iterator.next();
-// Element schemaElement = schema.getSchemaElement();
-// String targetNamespace = schemaElement.getAttribute("targetNamespace");
-// String prefix = definition.getPrefix(targetNamespace);
-// if (prefix != null)
-// {
-// schemaList.add(prefix + ":" + targetNamespace);
-// }
-// else
-// {
-// schemaList.add(targetNamespace);
-// }
-// }
-// }
-// if (componentNameList.getItemCount() > 0)
-// {
-// schemaList.select(0);
-// schemaSelection = (schemaList.getSelection())[0];
-// }
-// }
-// }
-
-// public void widgetSelected(SelectionEvent e)
-// {
-// else if (e.widget == createNewRadio)
-// {
-// pageBook.showPage(page2);
-// choice = 2;
-// Support for choosing which schema to add element/type to
-// initSchemaList();
-// setDescription("Specify name of " + kind + " to create");
-// setPageComplete(isPageComplete());
-// }
-// Support for choosing which schema to add element/type to
-// else if (e.widget == schemaList)
-// {
-// schemaSelection = (schemaList.getSelection())[0];
-// }
-// }
-
- protected void handleImport()
- {
- ResourceSet resourceSet = null;
- resourceSet = ((org.eclipse.emf.ecore.EObject)input).eResource().getResourceSet();
-
- Resource resource = ((org.eclipse.emf.ecore.EObject)input).eResource();
- URI uri = resource.getURI();
-
- Path path = new Path(uri.path());
- path = (Path) path.removeFirstSegments(1);
- int segments = path.segmentCount();
-
- Object container = null;
- if (segments > 2) {
- container = ResourcesPlugin.getWorkspace().getRoot().getFolder(path.removeLastSegments(1));
- }
- else {
- container = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(path.segmentCount() - 2).toString());
- }
-
- SelectSingleFileDialog dialog = new SelectSingleFileDialog(getShell(), new StructuredSelection(container), true);
- String [] filters = { "xsd", "wsdl" };
- dialog.addFilterExtensions(filters);
- dialog.create();
- dialog.setTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT_FILE")); //$NON-NLS-1$
- dialog.getShell().setText(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT")); //$NON-NLS-1$
- dialog.setMessage(WSDLEditorPlugin.getWSDLString("_UI_DESCRIPTION_SELECT_WSDL_OR_XSD")); //$NON-NLS-1$
- int rc = dialog.open();
- if (rc == IDialogConstants.OK_ID)
- {
- selectedFile = dialog.getFile();
- importComponents = loadFile(selectedFile, resourceSet);
- importList.removeAll();
- for (Iterator i = importComponents.iterator(); i.hasNext(); )
- {
- XSDNamedComponent comp = (XSDNamedComponent)i.next();
- importList.add(comp.getName());
- }
- fileText.setText(dialog.getFile().getFullPath().toString());
- }
- }
-
- public Collection getModelObjects(Object rootModelObject)
- {
- ArrayList objects = new ArrayList();
-
- if (rootModelObject instanceof XSDSchema)
- {
- XSDSchema xsdSchema = (XSDSchema)rootModelObject;
- if (kind.equalsIgnoreCase("type"))
- {
- objects.addAll(((XSDSchema) xsdSchema).getTypeDefinitions());
- }
- else if (kind.equalsIgnoreCase("element"))
- {
- objects.addAll(((XSDSchema) xsdSchema).getElementDeclarations());
- }
- }
- else if (rootModelObject instanceof Definition)
- {
- Definition definition = (Definition)rootModelObject;
- Types types = (Types)definition.getTypes();
- if (types != null)
- {
- for (Iterator iter = types.getSchemas().iterator(); iter.hasNext();)
- {
- XSDSchema schema = (XSDSchema) iter.next();
- if (kind.equalsIgnoreCase("type"))
- {
- objects.addAll(schema.getTypeDefinitions());
- }
- else if (kind.equalsIgnoreCase("element"))
- {
- objects.addAll(schema.getElementDeclarations());
- }
- }
- }
- }
- return objects;
- }
-
-// Support for choosing which schema to add element/type to
-// public String getSchemaSelection()
-// {
-// return schemaSelection;
-// }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetComponentWizard.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetComponentWizard.java
deleted file mode 100644
index 0e4bdf3..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetComponentWizard.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Part;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddXSDElementDeclarationCommand;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddXSDTypeDefinitionCommand;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddElementDeclarationAction;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddWSISchemaImportAction;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.xsd.XSDNamedComponent;
-
-public class SetComponentWizard extends Wizard
-{
- protected Object input;
- private IEditorPart editorPart;
- private String kind;
- SetComponentOptionsPage newComponentOptionsPage;
-
- /**
- * Constructor for NewComponentWizard.
- */
- public SetComponentWizard(Object input, IEditorPart editorPart)
- {
- super();
- this.input = input;
- this.editorPart = editorPart;
-// setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(WSDLEditor.class, "icons/wsdl_file_obj.gif"));
- }
- /**
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish()
- {
- Part part = (Part)input;
- Definition definition = part.getEnclosingDefinition();
- org.w3c.dom.Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- boolean isType = kind.equalsIgnoreCase("type"); //$NON-NLS-1$
- if (newComponentOptionsPage.getChoice() == 2)
- {
- String choice = newComponentOptionsPage.getExistingListSelection();
- if (choice != null)
- {
- ComponentReferenceUtil.setComponentReference(part, isType, choice);
- }
- }
- else if (newComponentOptionsPage.getChoice() == 1)
- {
-/*
- String newName = newComponentOptionsPage.getNewName();
- javax.wsdl.Types types = definition.getTypes();
- org.w3c.dom.Node typesNode;
- org.w3c.dom.Element schemaElement;
- String xsdPrefix;
- String wsdlDocTargetNamespace = definition.getTargetNamespace();
- // for now the new prefix is the same as the targetNamespace's prefix
- String referencingPrefix = definition.getPrefix(wsdlDocTargetNamespace);
-
- if (!(definition.getNamespaces().containsValue("http://www.w3.org/2001/XMLSchema"))) //$NON-NLS-1$
- {
- // try to use xsd as the index
- if (definition.getNamespace("xsd") == null) //$NON-NLS-1$
- {
- xsdPrefix = "xsd"; //$NON-NLS-1$
- }
- else // if used, then try to create a unique one
- {
- String tempPrefix = "xsd"; //$NON-NLS-1$
- int i = 1;
- while(definition.getNamespace(tempPrefix + i) != null)
- {
- i++;
- }
- xsdPrefix = tempPrefix + i;
- }
- // Add the namespace to the definition element
- definition.addNamespace(xsdPrefix, "http://www.w3.org/2001/XMLSchema"); //$NON-NLS-1$
- definitionElement.setAttribute("xmlns:" + xsdPrefix, "http://www.w3.org/2001/XMLSchema"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else
- {
- xsdPrefix = definition.getPrefix("http://www.w3.org/2001/XMLSchema"); //$NON-NLS-1$
- }
- // if the types element is not present
- if (types == null)
- {
- AddElementAction addTypesAction = new AddElementAction("", "icons/xsd_obj.gif", definitionElement, definitionElement.getPrefix(), "types"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- addTypesAction.setComputeTopLevelRefChild(true);
- addTypesAction.run();
- typesNode = addTypesAction.getNewElement();
-
- AddElementAction addSchemaAction = new AddElementAction("", "icons/xsd_obj.gif", typesNode, xsdPrefix, "schema"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- addSchemaAction.run();
- schemaElement = addSchemaAction.getNewElement();
-
- schemaElement.setAttribute("xmlns:" + xsdPrefix, "http://www.w3.org/2001/XMLSchema"); //$NON-NLS-1$ //$NON-NLS-2$
- schemaElement.setAttribute("elementFormDefault", "qualified"); //$NON-NLS-1$ //$NON-NLS-2$
- schemaElement.setAttribute("targetNamespace", wsdlDocTargetNamespace); //$NON-NLS-1$
- }
- else // if the types element is present
- {
- typesNode = WSDLEditorUtil.getInstance().getElementForObject(types);
- java.util.List schemaList = types.getExtensibilityElements();
- if (schemaList.size() > 0) // if there is a schema
- {
- if (schemaList.get(0) instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement schema = (XSDSchemaExtensibilityElement)schemaList.get(0);
- schemaElement = schema.getElement();
- String schemaNS = schemaElement.getAttribute("targetNamespace"); //$NON-NLS-1$
- referencingPrefix = definition.getPrefix(schemaNS);
- }
- else
- {
- return true; // TODO: check for UnknownExtensibilityElement
- }
- }
- else // if there is no schema then we'll create one
- {
- AddElementAction addSchemaAction = new AddElementAction("", "icons/xsd_obj.gif", typesNode, xsdPrefix, "schema"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- addSchemaAction.run();
- schemaElement = addSchemaAction.getNewElement();
- schemaElement.setAttribute("xmlns:" + xsdPrefix, "http://www.w3.org/2001/XMLSchema"); //$NON-NLS-1$ //$NON-NLS-2$
- schemaElement.setAttribute("elementFormDefault", "qualified"); //$NON-NLS-1$ //$NON-NLS-2$
- schemaElement.setAttribute("targetNamespace", wsdlDocTargetNamespace); //$NON-NLS-1$
- }
- }
-
-
- String xsdComp;
- if (isType)
- {
- xsdComp = "complexType"; //$NON-NLS-1$
- }
- else
- {
- xsdComp = "element"; //$NON-NLS-1$
- }
- AddElementAction addCompAction = new AddElementAction("", "icons/xsd_obj.gif", schemaElement, xsdPrefix, xsdComp); //$NON-NLS-1$ //$NON-NLS-2$
- addCompAction.run();
- Element newElement = addCompAction.getNewElement();
- newElement.setAttribute("name", newName); //$NON-NLS-1$
- if (!isType)
- {
- newElement.setAttribute("type", xsdPrefix + ":string"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (referencingPrefix == null)
- {
- referencingPrefix = ""; //$NON-NLS-1$
- }
- ComponentReferenceUtil.setComponentReference(part, isType, referencingPrefix.equals("") ? newName : referencingPrefix + ":" + newName); //$NON-NLS-1$ //$NON-NLS-2$
- */
-
- String newName = newComponentOptionsPage.getNewName();
- String targetNamespace = definition.getTargetNamespace();
- String referencingPrefix = definition.getPrefix(targetNamespace);
- if (isType)
- {
- AddXSDTypeDefinitionCommand command = new AddXSDTypeDefinitionCommand(definition, targetNamespace, newName);
- command.run();
- }
- else
- {
- AddXSDElementDeclarationCommand command = new AddXSDElementDeclarationCommand(definition, targetNamespace, newName);
- command.run();
- }
- ComponentReferenceUtil.setComponentReference(part, isType, referencingPrefix.equals("") ? newName : referencingPrefix + ":" + newName); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (newComponentOptionsPage.getChoice() == 3)
- {
- XSDNamedComponent selection = (XSDNamedComponent)newComponentOptionsPage.getSelection();
- String namespaceURI = selection.getTargetNamespace();
- String prefix = "";
-
- boolean useWSIImportPattern = true;
- if (newComponentOptionsPage.isWSIStyleSchemaImport())
- {
- AddElementDeclarationAction action = new AddElementDeclarationAction(definition, namespaceURI, "xsd");
- action.run();
- prefix = action.getPrefix();
-
- String location = newComponentOptionsPage.getRelativeLocationOfSelectedFile(false);
- AddWSISchemaImportAction addImport = new AddWSISchemaImportAction(definition, namespaceURI, location);
- addImport.run();
- }
- else
- {
- prefix = newComponentOptionsPage.addWSDLImport(definition, definitionElement, namespaceURI, "xsd");
- }
- ComponentReferenceUtil.setComponentReference(part, isType, prefix.length() == 0 ? selection.getName() : prefix + ":" + selection.getName());
- }
- return true;
- }
-
- public boolean canFinish()
- {
- if (newComponentOptionsPage.isPageComplete())
- {
- return true;
- }
- return false;
- }
-
- public void setReferenceKind(String kind)
- {
- this.kind = kind;
- }
-
- public Object getInput()
- {
- return input;
- }
-
- public void addPages()
- {
- String title = kind.equalsIgnoreCase("type") ? WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_TYPE") : WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_ELEMENT");
- newComponentOptionsPage = new SetComponentOptionsPage(editorPart, WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_TYPE"), title, null, kind);
- newComponentOptionsPage.setEditorPart(editorPart);
- newComponentOptionsPage.setInput(input);
- addPage(newComponentOptionsPage);
- setWindowTitle(title);
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetMessageOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetMessageOptionsPage.java
deleted file mode 100644
index 5eea298..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetMessageOptionsPage.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.ui.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.MessageReference;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-public class SetMessageOptionsPage extends SetOptionsPage
-{
- public static String BUILTIN_MESSAGES_LOCATION_URI = "platform:/plugin/org.eclipse.wst.ctc.services/wsdl/org/xmlsoap/schemas/wsdl/wsadie/messages/BuiltinMessages.wsdl"; //$NON-NLS-1$
-
- /**
- * Constructor for NewMessageOptionsPage.
- * @param pageName
- * @param title
- * @param titleImage
- */
- public SetMessageOptionsPage(
- IEditorPart editorPart,
- String pageName,
- String title,
- ImageDescriptor titleImage)
- {
- super(editorPart, pageName, title, titleImage, "message");
- }
-
- protected void initNewNameTextField()
- {
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
- String name = NameUtil.buildUniqueMessageName(definition, (MessageReference) input);
- newNameText.setText(name);
- }
-
- protected void initExistingNameList()
- {
- if (componentNameList.getItemCount() == 0)
- {
- componentNameList.removeAll();
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
-
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
- java.util.List currentList = util.getMessageNames();
- if (currentList.size() > 0)
- {
- for (Iterator it = currentList.iterator(); it.hasNext(); )
- {
- componentNameList.add((String)it.next());
- }
- componentNameList.select(0);
- existingListSelection = (componentNameList.getSelection())[0];
- }
- }
- }
-
- protected void handleImport()
- {
- ResourceSet resourceSet = null;
-// TODO: port check
-// resourceSet = ((org.eclipse.emf.ecore.EObject)input).getResourceSet();
- resourceSet = ((org.eclipse.emf.ecore.EObject)input).eResource().getResourceSet();
-
- SelectSingleFileDialog dialog = new SelectSingleFileDialog(getShell(), null, true);
- String [] filters = { "wsdl" };
- dialog.addFilterExtensions(filters);
- dialog.create();
- dialog.setTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT_WSDL_FILE")); //$NON-NLS-1$
- dialog.getShell().setText(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT")); //$NON-NLS-1$
- dialog.setMessage(WSDLEditorPlugin.getWSDLString("_UI_DESCRIPTION_SELECT_WSDL_FILE_TO_IMPORT")); //$NON-NLS-1$
- int rc = dialog.open();
- if (rc == IDialogConstants.OK_ID)
- {
- selectedFile = dialog.getFile();
- importComponents = loadFile(selectedFile, resourceSet);
- importList.removeAll();
- for (Iterator i = importComponents.iterator(); i.hasNext(); )
- {
- Message msg = (Message)i.next();
- importList.add(msg.getQName().getLocalPart());
- }
- fileText.setText(dialog.getFile().getFullPath().toString());
- }
- }
-
- public Collection getModelObjects(Object rootModelObject)
- {
- if (rootModelObject instanceof Definition)
- {
- Definition definition = (Definition)rootModelObject;
- return ((Definition)definition).getMessages().values();
- }
- return Collections.EMPTY_LIST;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetMessageWizard.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetMessageWizard.java
deleted file mode 100644
index 3814a5d..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetMessageWizard.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Message;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.commands.AddMessageCommand;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.CreateWSDLElementHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-
-public class SetMessageWizard extends Wizard
-{
- protected Object input;
- private IEditorPart editorPart;
- private String kind;
- SetMessageOptionsPage newMessageOptionsPage;
-
- /**
- * Constructor for NewMessageWizard.
- */
- public SetMessageWizard(Object input, IEditorPart editorPart)
- {
- super();
- this.input = input;
- this.editorPart = editorPart;
-// setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(WSDLEditor.class, "icons/wsdl_file_obj.gif"));
- }
-
- /**
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish()
- {
- org.w3c.dom.Element wsdlElement = WSDLEditorUtil.getInstance().getElementForObject((WSDLElement)input);
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
- org.w3c.dom.Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- if (newMessageOptionsPage.getChoice() == 2)
- {
- String choice = newMessageOptionsPage.getExistingListSelection();
- if (choice != null)
- {
- wsdlElement.setAttribute("message", choice); //$NON-NLS-1$
- }
- }
- else if (newMessageOptionsPage.getChoice() == 1)
- {
- String newName = newMessageOptionsPage.getNewName();
-
- AddMessageCommand action = new AddMessageCommand(definition, newName);
- action.run();
- Message message = (Message) action.getWSDLElement();
- CreateWSDLElementHelper.PART_TYPE_OR_DEFINITION = CreateWSDLElementHelper.getPartInfo(message);
- CreateWSDLElementHelper.createPart(message);
-
-/*
- String prefix = definitionElement.getPrefix();
- // Use AddMessageAction in WSDLMenuActionContributor
- AddElementAction addMessageAction = new AddElementAction("", "icons/message_obj.gif", definitionElement, prefix, "message"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- addMessageAction.setComputeTopLevelRefChild(true);
- addMessageAction.run();
- org.w3c.dom.Element newMessage = addMessageAction.getNewElement();
- newMessage.setAttribute("name", newName); //$NON-NLS-1$
-*/
-
- // need to get the prefix for the item
- // could get list of updated messages and then select but currently we only have the local name
- String itemPrefix = definition.getPrefix(definition.getTargetNamespace());
- if (itemPrefix == null)
- {
- itemPrefix = ""; //$NON-NLS-1$
- }
- wsdlElement.setAttribute("message", itemPrefix.length() == 0 ? newName : itemPrefix + ":" + newName); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (newMessageOptionsPage.getChoice() == 3)
- {
- javax.wsdl.Message selection = (javax.wsdl.Message)newMessageOptionsPage.getSelection();
- String namespaceURI = selection.getQName().getNamespaceURI();
- String uniquePrefix = newMessageOptionsPage.addWSDLImport(definition, definitionElement, namespaceURI);
- wsdlElement.setAttribute("message", uniquePrefix + ":" + selection.getQName().getLocalPart());
- }
-
- WSDLEditor editor = (WSDLEditor)editorPart;
- editor.getSelectionManager().setSelection(new StructuredSelection(input));
-
- return true;
- }
-
- public boolean canFinish()
- {
- if (newMessageOptionsPage.isPageComplete())
- {
- return true;
- }
- return false;
- }
-
- public Object getInput()
- {
- return input;
- }
-
- public void addPages()
- {
- newMessageOptionsPage = new SetMessageOptionsPage(editorPart, WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_MESSAGE"), WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_MESSAGE"), null); //$NON-NLS-1$ //$NON-NLS-2$
- newMessageOptionsPage.setEditorPart(editorPart);
- newMessageOptionsPage.setInput(input);
- addPage(newMessageOptionsPage);
- setWindowTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_MESSAGE")); //$NON-NLS-1$
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetOptionsPage.java
deleted file mode 100644
index c8bcf69..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetOptionsPage.java
+++ /dev/null
@@ -1,525 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jface.resource.ImageDescriptor;
-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.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.List;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddElementDeclarationAction;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddImportAction;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.ValidateHelper;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLResourceUtil;
-import org.eclipse.wst.wsdl.internal.impl.ImportImpl;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.w3c.dom.Element;
-
-public abstract class SetOptionsPage extends WizardPage implements ModifyListener, SelectionListener
-{
- protected IEditorPart editorPart;
- protected Object input;
-
- protected Button selectExistingRadio;
- protected Button createNewRadio;
- protected Button importRadio;
- protected int choice = 1; // radio button choice
- protected PageBook pageBook;
-
- protected Composite page1;
- protected Text newNameText;
- protected String newName;
-
- protected Composite page2;
- protected org.eclipse.swt.widgets.List componentNameList;
- protected String existingListSelection;
-
- protected Composite page3;
- protected Button importButton;
- protected Text fileText;
- protected org.eclipse.swt.widgets.List importList;
- protected java.util.List importComponents;
-
- protected Object selection;
-
- protected IFile selectedFile; // the imported file
-
- private String wsdlItemName;
- String selectExistingRadioString;
- String createNewRadioString;
- String importRadioString;
- String newNameString;
- String pageOneDescription;
- String pageTwoDescription;
- String pageThreeDescription;
-
- /**
- * Constructor for NewOptionsPage.
- * @param pageName
- * @param title
- * @param titleImage
- */
- public SetOptionsPage(IEditorPart editorPart, String pageName, String title, ImageDescriptor titleImage, String wsdlItemName)
- {
- super(pageName, title, titleImage);
- this.editorPart = editorPart;
- this.wsdlItemName = wsdlItemName;
-
- // Alternate way of doing this?
- createNewRadioString = WSDLEditorPlugin.getWSDLString("_UI_RADIO_CREATE_NEW", wsdlItemName); //$NON-NLS-1$
- selectExistingRadioString = WSDLEditorPlugin.getWSDLString("_UI_RADIO_SELECT_EXISTING", wsdlItemName); //$NON-NLS-1$
- importRadioString = WSDLEditorPlugin.getWSDLString("_UI_RADIO_IMPORT_FROM_FILE", wsdlItemName); //$NON-NLS-1$
- newNameString = WSDLEditorPlugin.getWSDLString("_UI_LABEL_NAME_OF_ITEM", wsdlItemName); //$NON-NLS-1$
-
- pageOneDescription = WSDLEditorPlugin.getWSDLString("_UI_DESCRIPTION_PROVIDE_NAME", wsdlItemName); //$NON-NLS-1$
- pageTwoDescription = WSDLEditorPlugin.getWSDLString("_UI_DESCRIPTION_CHOOSE_FROM_EXISTING", wsdlItemName); //$NON-NLS-1$
- pageThreeDescription = WSDLEditorPlugin.getWSDLString("_UI_DESCRIPTION_IMPORT_FILE", wsdlItemName); //$NON-NLS-1$
- }
-
- public void setEditorPart(IEditorPart editorPart)
- {
- this.editorPart = editorPart;
- }
-
- public void setInput(Object input)
- {
- this.input = input;
- }
-
- protected void createPage1(Composite pageBook)
- {
- page1 = new Composite(pageBook, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- page1.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- page1.setLayoutData(data);
-
- Label newNameLabel = new Label(page1, SWT.LEFT);
- newNameLabel.setText(newNameString);
-
- GridData labelData = new GridData();
- labelData.horizontalAlignment = GridData.FILL;
- newNameLabel.setLayoutData(labelData);
-
- newNameText = new Text(page1, SWT.SINGLE | SWT.BORDER);
- GridData newNameTextData = new GridData();
- newNameTextData.horizontalAlignment = GridData.FILL;
- newNameTextData.grabExcessHorizontalSpace = true;
- newNameTextData.widthHint = 30;
- newNameText.setLayoutData(newNameTextData);
-
- newNameText.addModifyListener(this);
- initNewNameTextField();
- }
-
- /**
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite)
- */
- public void createControl(Composite parent)
- {
- Composite base = new Composite(parent, SWT.NONE);
- WorkbenchHelp.setHelp(base, WSDLEditorPlugin.getWSDLString("_UI_HELP")); //$NON-NLS-1$
- base.setLayout(new GridLayout());
-
- Composite radioGroup = new Composite(base, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- radioGroup.setLayout(layout);
-
- GridData radioGroupData = new GridData();
- radioGroupData.verticalAlignment = GridData.FILL;
- radioGroupData.horizontalAlignment = GridData.FILL;
- radioGroup.setLayoutData(radioGroupData);
-
- createNewRadio = createRadioButton(radioGroup, createNewRadioString);
- selectExistingRadio = createRadioButton(radioGroup, selectExistingRadioString);
- importRadio = createRadioButton(radioGroup, importRadioString);
- selectExistingRadio.addSelectionListener(this);
- createNewRadio.addSelectionListener(this);
- importRadio.addSelectionListener(this);
-
- Label label = new Label(base, SWT.LEFT | SWT.HORIZONTAL | SWT.SEPARATOR);
- GridData data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 1;
- label.setLayoutData(data);
-
- pageBook = new PageBook(base, SWT.NONE);
- GridData dataPB = new GridData();
- dataPB.grabExcessHorizontalSpace = true;
- dataPB.grabExcessVerticalSpace = true;
- dataPB.horizontalAlignment = GridData.FILL;
- dataPB.verticalAlignment = GridData.FILL;
- pageBook.setLayoutData(dataPB);
-
- // ---------------------------------------------------------------
- createPage1(pageBook);
-
- // ---------------------------------------------------------------
- page2 = new Composite(pageBook, SWT.NONE);
-
- GridLayout page2Layout = new GridLayout();
- page2Layout.numColumns = 1;
- page2.setLayout(page2Layout);
-
- GridData page2Data = new GridData();
- page2Data.verticalAlignment = GridData.FILL;
- page2Data.horizontalAlignment = GridData.FILL;
- page2.setLayoutData(page2Data);
-
- componentNameList = new List(page2, SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
- GridData componentNameListData = new GridData();
- componentNameListData.horizontalAlignment = GridData.FILL;
- componentNameListData.verticalAlignment = GridData.FILL;
- componentNameListData.grabExcessHorizontalSpace = true;
- componentNameListData.grabExcessVerticalSpace = true;
- componentNameList.setLayoutData(componentNameListData);
-
- componentNameList.addSelectionListener(this);
-
- // ---------------------------------------------------------------
-
- page3 = new Composite(pageBook, SWT.NONE);
-
- GridLayout page3Layout = new GridLayout();
- page3Layout.numColumns = 1;
- page3.setLayout(page3Layout);
-
- GridData page3Data = new GridData();
- page3Data.verticalAlignment = GridData.FILL;
- page3Data.horizontalAlignment = GridData.FILL;
- page3.setLayoutData(page3Data);
-
- Composite fileComp = new Composite(page3, SWT.NONE);
-
- GridLayout fileCompLayout = new GridLayout();
- fileCompLayout.numColumns = 3;
- fileCompLayout.marginHeight = 0;
- fileCompLayout.marginWidth = 0;
- fileComp.setLayout(fileCompLayout);
-
- GridData fileCompData = new GridData();
- fileCompData.verticalAlignment = GridData.FILL;
- fileCompData.horizontalAlignment = GridData.FILL;
- fileComp.setLayoutData(fileCompData);
-
- Label fileLabel = new Label(fileComp, SWT.LEFT);
- fileLabel.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_FILE")); //$NON-NLS-1$
-
- GridData fileLabelData = new GridData();
- fileLabelData.horizontalAlignment = GridData.FILL;
- fileLabel.setLayoutData(fileLabelData);
-
-
- fileText = new Text(fileComp, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
- GridData dataFile = new GridData();
- dataFile.horizontalAlignment = GridData.FILL;
- dataFile.grabExcessHorizontalSpace = true;
- dataFile.widthHint = 30;
- fileText.setLayoutData(data);
- fileText.setText(""); //$NON-NLS-1$
-
- importButton = new Button(fileComp, SWT.PUSH);
- importButton.setText(WSDLEditorPlugin.getWSDLString("_UI_BUTTON_BROWSE")); //$NON-NLS-1$
-
- GridData importButtonData = new GridData();
- importButtonData.horizontalAlignment = GridData.FILL;
- importButton.setLayoutData(importButtonData);
-
- importButton.addSelectionListener(this);
-
- importList = new List(page3, SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
-
- GridData importListData = new GridData();
- importListData.horizontalAlignment = GridData.FILL;
- importListData.verticalAlignment = GridData.FILL;
- importListData.grabExcessHorizontalSpace = true;
- importListData.grabExcessVerticalSpace = true;
- importList.setLayoutData(importListData);
-
- importList.addSelectionListener(this);
- // ---------------------------------------------------------------
-
- pageBook.showPage(page1);
- choice = 1;
- setControl(base);
- }
-
- private Button createRadioButton(Composite parent, String label)
- {
- Button button = new Button(parent, SWT.RADIO);
- button.setText(label);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
-
- return button;
- }
-
- /**
- * @see org.eclipse.swt.events.ModifyListener#modifyText(ModifyEvent)
- */
- public void modifyText(ModifyEvent e)
- {
- if (e.widget == newNameText)
- {
- newName = newNameText.getText();
- setPageComplete(isPageComplete());
- }
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e)
- {
- }
-
- abstract protected void initExistingNameList();
-
- abstract protected void initNewNameTextField();
-
- public String getExistingListSelection()
- {
- return existingListSelection;
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e)
- {
- if (e.widget == createNewRadio)
- {
- pageBook.showPage(page1);
- choice = 1;
- setDescription(pageOneDescription);
- setPageComplete(isPageComplete());
- newNameText.setFocus();
- newNameText.selectAll();
- }
- else if (e.widget == selectExistingRadio)
- {
- pageBook.showPage(page2);
- choice = 2;
-
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
- // Need to resolve imports because the model doesn't automatically
- // do it for us. See also OpenOnSelectionHelper
- Iterator imports = definition.getEImports().iterator();
- while (imports.hasNext())
- {
- Import theImport = (Import)imports.next();
- ((ImportImpl)theImport).importDefinitionOrSchema();
- }
-
- initExistingNameList();
- setDescription(pageTwoDescription);
- setPageComplete(isPageComplete());
- setErrorMessage(null);
- }
- else if (e.widget == importRadio)
- {
- pageBook.showPage(page3);
- choice = 3;
- setDescription(pageThreeDescription);
- setPageComplete(isPageComplete());
- setErrorMessage(null);
- }
- else if (e.widget == componentNameList)
- {
- existingListSelection = (componentNameList.getSelection())[0];
- setPageComplete(isPageComplete());
- }
- else if (e.widget == importList)
- {
- selection = importComponents.get(importList.getSelectionIndex());
- setPageComplete(isPageComplete());
- }
- else if (e.widget == importButton)
- {
- handleImport();
- if (importList.getItemCount() > 0)
- {
- importList.select(0);
- selection = importComponents.get(0);
- }
- else
- {
- selection = null;
- }
- setPageComplete(isPageComplete());
- }
- }
-
- protected abstract void handleImport();
-
- protected java.util.List loadFile(IFile wsdlFile, ResourceSet modelResourceSet)
- {
- java.util.List modelObjectList = Collections.EMPTY_LIST;
- try
- {
- if (wsdlFile != null)
- {
- URI uri = URI.createPlatformResourceURI(wsdlFile.getFullPath().toString());
-
- Object rootModelObject = null;
- if (uri.toString().endsWith("xsd"))
- {
- ResourceSet resourceSet = new ResourceSetImpl();
- Resource resource = resourceSet.getResource(uri, true);
- if (resource instanceof XSDResourceImpl)
- {
- rootModelObject = ((XSDResourceImpl) resource).getSchema();
- }
- }
- else
- {
- rootModelObject = WSDLResourceUtil.lookupAndLoadDefinition(modelResourceSet, uri.toString());
- }
-
- if (rootModelObject != null)
- {
- modelObjectList = new ArrayList(getModelObjects(rootModelObject));
- }
- }
- else
- {
- modelObjectList = new ArrayList(getModelObjects(null));
- }
-
- }
- catch (Exception e)
- {
- }
- return modelObjectList;
- }
-
- abstract public Collection getModelObjects(Object rootModelObject);
-
- public Object getSelection()
- {
- return selection;
- }
-
- public IFile getSelectedFile()
- {
- return selectedFile;
- }
-
- public String getRelativeLocationOfSelectedFile(boolean enableIEStyleLocation)
- {
- IFile currentWSDLFile = ((IFileEditorInput) editorPart.getEditorInput()).getFile();
- return ComponentReferenceUtil.computeRelativeURI(selectedFile, currentWSDLFile, true);
- }
-
- public int getChoice()
- {
- return choice;
- }
-
- public String getNewName()
- {
- return newName;
- }
-
- public boolean isPageComplete()
- {
- if (selectExistingRadio.getSelection())
- {
- if (componentNameList.getSelectionCount() == 1)
- {
- return true;
- }
- }
- else if (createNewRadio.getSelection())
- {
- if (validateXMLName(newNameText.getText().trim()))
- {
- return true;
- }
- }
- else if (importRadio.getSelection())
- {
- if (importList.getSelectionCount() == 1)
- {
- return true;
- }
- }
- return false;
- }
-
- private boolean validateXMLName(String xmlName)
- {
- String errorMessage = ValidateHelper.checkXMLName(xmlName);
-
- if (errorMessage == null || errorMessage.length() == 0)
- {
- setErrorMessage(null);
- return true;
- }
- setErrorMessage(errorMessage);
- return false;
- }
-
- public String addWSDLImport(Definition definition, Element definitionElement, String namespaceURI)
- {
- return addWSDLImport(definition, definitionElement, namespaceURI, "wsdl");
- }
-
- public String addWSDLImport(Definition definition, Element definitionElement, String namespaceURI, String basePrefix)
- {
- AddElementDeclarationAction action = new AddElementDeclarationAction(definition, namespaceURI, basePrefix);
- action.run();
- String prefix = action.getPrefix();
-
- String location = getRelativeLocationOfSelectedFile(true);
- AddImportAction addImport = new AddImportAction(null, definition, definitionElement, definitionElement.getPrefix(), namespaceURI, location);
- addImport.run();
-
- return prefix;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetPortTypeOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetPortTypeOptionsPage.java
deleted file mode 100644
index f11468f..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetPortTypeOptionsPage.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.common.ui.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.wsdl.Binding;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.PortType;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.ComponentReferenceUtil;
-import org.eclipse.wst.wsdl.ui.internal.util.NameUtil;
-
-public class SetPortTypeOptionsPage extends SetOptionsPage
-{
- /**
- * Constructor for NewPortTypeOptionsPage.
- * @param pageName
- * @param title
- * @param titleImage
- */
- public SetPortTypeOptionsPage(
- IEditorPart editorPart,
- String pageName,
- String title,
- ImageDescriptor titleImage)
- {
- super(editorPart, pageName, title, titleImage, "port type"); //$NON-NLS-1$
- }
-
- protected void initNewNameTextField()
- {
- String name = null;
- if (input instanceof Binding)
- {
- QName qname = ((Binding)input).getQName();
- if (qname != null)
- {
- name = qname.getLocalPart();
- }
- }
- if (name == null)
- {
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
- name = NameUtil.buildUniquePortTypeName(definition, null);
- }
- newNameText.setText(name);
- }
-
- protected void initExistingNameList()
- {
- if (componentNameList.getItemCount() == 0)
- {
- componentNameList.removeAll();
- Definition definition = ((WSDLElement)input).getEnclosingDefinition();
-
- ComponentReferenceUtil util = new ComponentReferenceUtil(definition);
- java.util.List currentList = util.getPortTypeNames();
- if (currentList.size() > 0)
- {
- for (Iterator it = currentList.iterator(); it.hasNext(); )
- {
- componentNameList.add((String)it.next());
- }
- componentNameList.select(0);
- existingListSelection = (componentNameList.getSelection())[0];
- }
- }
- }
-
- protected void handleImport()
- {
- ResourceSet resourceSet = null;
-// TODO: port check
-// resourceSet = ((org.eclipse.emf.ecore.EObject)input).getResourceSet();
- resourceSet = ((org.eclipse.emf.ecore.EObject)input).eResource().getResourceSet();
-
- SelectSingleFileDialog dialog = new SelectSingleFileDialog(getShell(), null, true);
- String [] filters = { "wsdl" }; //$NON-NLS-1$
- dialog.addFilterExtensions(filters);
- dialog.create();
- dialog.setTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT_WSDL_FILE")); //$NON-NLS-1$
- dialog.getShell().setText(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SELECT")); //$NON-NLS-1$
- dialog.setMessage(WSDLEditorPlugin.getWSDLString("_UI_DESCRIPTION_SELECT_WSDL_FILE_TO_IMPORT")); //$NON-NLS-1$
- int rc = dialog.open();
- if (rc == IDialogConstants.OK_ID)
- {
- selectedFile = dialog.getFile();
- importComponents = loadFile(selectedFile, resourceSet);
- importList.removeAll();
- for (Iterator i = importComponents.iterator(); i.hasNext(); )
- {
- PortType msg = (PortType)i.next();
- importList.add(msg.getQName().getLocalPart());
- }
- fileText.setText(dialog.getFile().getFullPath().toString());
- }
- }
-
- public Collection getModelObjects(Object rootModelObject)
- {
- if (rootModelObject instanceof Definition)
- {
- Definition definition = (Definition)rootModelObject;
- return ((Definition)definition).getPortTypes().values();
- }
- return Collections.EMPTY_LIST;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetPortTypeWizard.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetPortTypeWizard.java
deleted file mode 100644
index d029718..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/SetPortTypeWizard.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.WSDLElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddElementAction;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-
-public class SetPortTypeWizard extends Wizard
-{
- protected Object input;
- private IEditorPart editorPart;
- private String kind;
- private Definition definition;
- SetPortTypeOptionsPage newPortTypeOptionsPage;
-
- /**
- * Constructor for NewPortTypeWizard.
- */
- public SetPortTypeWizard(Object input, IEditorPart editorPart)
- {
- this(((WSDLElement)input).getEnclosingDefinition(), editorPart, input);
- }
-
- public SetPortTypeWizard(Definition definition, IEditorPart editorPart)
- {
- this(definition, editorPart, null);
- }
-
- private SetPortTypeWizard(Definition definition, IEditorPart editorPart, Object input)
- {
- super();
- this.input = input;
- this.definition = definition;
- this.editorPart = editorPart;
- // setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(WSDLEditor.class, "icons/wsdl_file_obj.gif"));
- }
-
-
- String portTypeValue = null;
- /**
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish()
- {
- //Definition definition = ((WSDLElement) input).getEnclosingDefinition();
- org.w3c.dom.Element definitionElement = WSDLEditorUtil.getInstance().getElementForObject(definition);
- portTypeValue = null;
- if (newPortTypeOptionsPage.getChoice() == 2)
- {
- portTypeValue = newPortTypeOptionsPage.getExistingListSelection();
- }
- else if (newPortTypeOptionsPage.getChoice() == 1)
- {
- String newName = newPortTypeOptionsPage.getNewName();
- String prefix = definitionElement.getPrefix();
- // Use AddMessageAction in WSDLMenuActionContributor
- AddElementAction addPortTypeAction = new AddElementAction("", "icons/message_obj.gif", definitionElement, prefix, "portType"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- addPortTypeAction.setComputeTopLevelRefChild(true);
- addPortTypeAction.run();
- org.w3c.dom.Element newMessage = addPortTypeAction.getNewElement();
- newMessage.setAttribute("name", newName); //$NON-NLS-1$
- // need to get the prefix for the item
- // could get list of updated messages and then select but currently we only have the local name
- String itemPrefix = definition.getPrefix(definition.getTargetNamespace());
- if (itemPrefix == null)
- {
- itemPrefix = ""; //$NON-NLS-1$
- }
- portTypeValue = itemPrefix.length() == 0 ? newName : itemPrefix + ":" + newName; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else if (newPortTypeOptionsPage.getChoice() == 3)
- {
- javax.wsdl.PortType selection = (javax.wsdl.PortType) newPortTypeOptionsPage.getSelection();
- String namespaceURI = selection.getQName().getNamespaceURI();
- String uniquePrefix = newPortTypeOptionsPage.addWSDLImport(definition, definitionElement, namespaceURI);
- portTypeValue = uniquePrefix + ":" + selection.getQName().getLocalPart();
- }
-
- if (input != null && portTypeValue != null)
- {
- org.w3c.dom.Element wsdlElement = WSDLEditorUtil.getInstance().getElementForObject((WSDLElement) input);
- wsdlElement.setAttribute("type", portTypeValue);
- }
-
- WSDLEditor editor = (WSDLEditor) editorPart;
- editor.getSelectionManager().setSelection(new StructuredSelection(input));
-
- return true;
- }
-
- public String getPortTypeValue()
- {
- return portTypeValue;
- }
-
- public boolean canFinish()
- {
- if (newPortTypeOptionsPage.isPageComplete())
- {
- return true;
- }
- return false;
- }
-
- public Object getInput()
- {
- return input;
- }
-
- public void addPages()
- {
- newPortTypeOptionsPage = new SetPortTypeOptionsPage(editorPart, WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_PORTTYPE"), WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_PORTTYPE"), null); //$NON-NLS-1$ //$NON-NLS-2$
- newPortTypeOptionsPage.setEditorPart(editorPart);
- newPortTypeOptionsPage.setInput(input);
- addPage(newPortTypeOptionsPage);
- setWindowTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_SPECIFY_PORTTYPE")); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFileOptionsPage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFileOptionsPage.java
deleted file mode 100644
index 391c322..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFileOptionsPage.java
+++ /dev/null
@@ -1,638 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.resource.ImageDescriptor;
-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.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Font;
-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.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.common.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.util.ValidateHelper;
-import org.eclipse.wst.xml.ui.dialogs.UpdateListener;
-
-public class WSDLNewFileOptionsPage extends WizardPage implements ModifyListener, UpdateListener, SelectionListener
-{
- protected Text targetNamespaceText;
- protected Text prefixText;
- protected boolean updatePortOpFieldBoolean = true;
-
- protected PageBook protocolPageBook;
- protected Combo protocolCombo;
- protected Composite soapPage;
- protected Composite httpPage;
- protected Button docLitRadio;
- protected Button rpcLitRadio;
- protected Button rpcEncRadio;
- protected Button httpGetRadio;
- protected Button httpPostRadio;
-
-// private BindingGenerator generator;
-
- /**
- * Constructor for WSDLNewFileOptionsPage.
- * @param pageName
- */
- public WSDLNewFileOptionsPage(String pageName)
- {
- super(pageName);
- }
- /**
- * Constructor for WSDLNewFileOptionsPage.
- * @param pageName
- * @param title
- * @param titleImage
- */
- public WSDLNewFileOptionsPage(String pageName, String title, ImageDescriptor titleImage)
- {
- super(pageName, title, titleImage);
- setDescription(WSDLEditorPlugin.getWSDLString("_UI_DESCRIPTION_NEW_WSDL_FILE")); //$NON-NLS-1$
- }
- /**
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite)
- */
- public void createControl(Composite parent)
- {
- Composite base = new Composite(parent, SWT.NONE);
- WorkbenchHelp.setHelp(base, WSDLEditorPlugin.getWSDLString("_UI_HELP")); //$NON-NLS-1$
- base.setLayout(new GridLayout());
-
- // Group wsdlGroup = ViewUtility.createGroup(base, 2, "WSDL", false);
- Composite wsdlGroup = new Composite(base, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- wsdlGroup.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- wsdlGroup.setLayoutData(data);
-
- GridData gd = (GridData)wsdlGroup.getLayoutData();
- gd.grabExcessHorizontalSpace = true;
-
- Label targetNamespace = new Label(wsdlGroup, SWT.LEFT);
- targetNamespace.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_TARGET_NAMESPACE")); //$NON-NLS-1$
- GridData nsData = new GridData();
- nsData.horizontalAlignment = GridData.FILL;
- targetNamespace.setLayoutData(nsData);
-
- targetNamespaceText = new Text(wsdlGroup, SWT.SINGLE | SWT.BORDER);
- GridData textData = new GridData();
- textData.horizontalAlignment = GridData.FILL;
- textData.grabExcessHorizontalSpace = true;
- textData.widthHint = 10;
- targetNamespaceText.setLayoutData(textData);
-
- targetNamespaceText.addModifyListener(this);
-
- Label prefix = new Label(wsdlGroup, SWT.LEFT);
- prefix.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_PREFIX_WITH_COLON")); //$NON-NLS-1$\
-
- GridData prefixData = new GridData();
- prefixData.horizontalAlignment = GridData.FILL;
- prefix.setLayoutData(prefixData);
-
- prefixText = new Text(wsdlGroup, SWT.SINGLE | SWT.BORDER);
- GridData prefixTextData = new GridData();
- prefixTextData.horizontalAlignment = GridData.FILL;
- prefixTextData.grabExcessHorizontalSpace = true;
- prefixTextData.widthHint = 10;
- prefixText.setLayoutData(prefixTextData);
-
- prefixText.addModifyListener(this);
-
- // XMLCatalog xmlCatalog = XMLCatalogRegistry.getInstance().lookupOrCreateXMLCatalog("default");
- // SelectXMLCatalogIdPanel catalog = new SelectXMLCatalogIdPanel(base, xmlCatalog);
-
-// Determine if the user wishes to create a skeleton WSDL. If yes, present the user with input fields.
- createSkeletonCheckBox = new Button(base, SWT.CHECK);
- createSkeletonCheckBox.setText(WSDLEditorPlugin.getWSDLString("_UI_LABEL_CREATE_WSDL_SKELETON"));
- createSkeletonCheckBox.setSelection(true);
-
- wsdlSkeletonGroup = new Composite(base, SWT.NONE);
- GridLayout layout2 = new GridLayout();
- layout2.numColumns = 2;
- wsdlSkeletonGroup.setLayout(layout2);
-
- GridData data2 = new GridData();
- data2.verticalAlignment = GridData.FILL;
- data2.horizontalAlignment = GridData.FILL;
- wsdlSkeletonGroup.setLayoutData(data2);
-
- createLabel(wsdlSkeletonGroup, WSDLEditorPlugin.getWSDLString("_UI_LABEL_BINDING_PROTOCOL"));
- protocolCombo = new Combo(wsdlSkeletonGroup, SWT.READ_ONLY);
- GridData dataC = new GridData();
- dataC.horizontalAlignment = GridData.FILL;
- dataC.grabExcessHorizontalSpace = true;
- protocolCombo.setLayoutData(dataC);
- protocolCombo.add(SOAP_PROTOCOL);
- protocolCombo.add(HTTP_PROTOCOL);
- protocolCombo.select(0);
- protocolCombo.addModifyListener(this);
-
- sepLabel = new Label(base, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData sepData = new GridData();
- sepData.horizontalAlignment = GridData.FILL;
- sepData.grabExcessHorizontalSpace = true;
- sepLabel.setLayoutData(sepData);
-
-
- // Create PageBook and pages/controls for the PageBook
- protocolPageBook = new PageBook(base, SWT.NONE);
-
- ///////////////////////// Soap Page
- soapPage = new Composite(protocolPageBook, SWT.NONE);
- GridLayout pbLayout = new GridLayout();
- soapPage.setLayout(pbLayout);
-
- GridData pbData = new GridData();
- pbData.verticalAlignment = GridData.FILL;
- pbData.horizontalAlignment = GridData.FILL;
- soapPage.setLayoutData(pbData);
-
- createLabel(soapPage, WSDLEditorPlugin.getWSDLString("_UI_LABEL_SOAP_BINDING_OPTIONS"));
- docLitRadio = new Button(soapPage, SWT.RADIO);
- rpcLitRadio = new Button(soapPage, SWT.RADIO);
- rpcEncRadio = new Button(soapPage, SWT.RADIO);
- docLitRadio.setText(SOAP_DOCUMENT_LITERAL);
- rpcLitRadio.setText(SOAP_RPC_LITERAL);
- rpcEncRadio.setText(SOAP_RPC_ENCODED);
- docLitRadio.setSelection(true);
-
- ///////////////////////// Http Page
- httpPage = new Composite(protocolPageBook, SWT.NONE);
- pbLayout = new GridLayout();
- httpPage.setLayout(pbLayout);
-
- pbData = new GridData();
- pbData.verticalAlignment = GridData.FILL;
- pbData.horizontalAlignment = GridData.FILL;
- httpPage.setLayoutData(pbData);
-
- createLabel(httpPage, WSDLEditorPlugin.getWSDLString("_UI_LABEL_HTTP_BINDING_OPTIONS")); // Already Externalized
- httpGetRadio = new Button(httpPage, SWT.RADIO);
- httpPostRadio = new Button(httpPage, SWT.RADIO);
- httpGetRadio.setText(HTTP_GET);
- httpPostRadio.setText(HTTP_POST);
- httpGetRadio.setSelection(true);
-
- wsdlSkeletonGroup.setVisible(true);
- sepLabel.setVisible(true);
- protocolPageBook.showPage(soapPage);
- protocolPageBook.setVisible(true);
-
- ////////////////////////// Add Selection Listeners
- createSkeletonCheckBox.addSelectionListener(this);
-
-// BindingProtocolComponentControl component = new BindingProtocolComponentControl(base, generator, false);
-// component.initFields();
-
- setControl(base);
- }
-
- private NewWSDLWizard getNewWSDLWizard()
- {
- return (NewWSDLWizard)getWizard();
- }
-
- private String computeDefaultDefinitionName()
- {
- String name = "DefaultName";
- IPath path = getNewWSDLWizard().getNewFilePath();
- if (path != null)
- {
- name = path.removeFileExtension().lastSegment().toString();
- }
- return name;
- }
-
- private String computeDefaultNamespaceName()
- {
- String namespace = WSDLEditorPlugin.getInstance().getPreferenceStore().getString(WSDLEditorPlugin.getWSDLString("_UI_PREF_PAGE_DEFAULT_TARGET_NAMESPACE"));
- if (!namespace.endsWith("/")) {
- namespace = namespace.concat("/");
- }
-
- IPath path = getNewWSDLWizard().getNewFilePath();
- if (path != null)
- {
- namespace += path.removeFileExtension().toString() + "/";
- }
- return namespace;
- }
-
- public void setVisible(boolean visible)
- {
- super.setVisible(visible);
-
- if (visible)
- {
- // prime the fields
- targetNamespaceText.setText(computeDefaultNamespaceName());
- prefixText.setText("tns");
- }
- }
-
- public String getTargetNamespace()
- {
- return targetNamespaceText.getText();
- }
-
- public String getPrefix()
- {
- return prefixText.getText().trim();
- }
-
- public String getDefinitionName()
- {
- return computeDefaultDefinitionName();
- }
-
- public void modifyText(ModifyEvent e)
- {
- if (e.widget == targetNamespaceText)
- {
- startDelayedEvent(e);
- }
- else if (e.widget == prefixText)
- {
- setPageComplete(isPageComplete());
- }
- else if (e.widget == protocolCombo) {
- // Update what page/control we show in the PageBook
- if (protocolCombo.getText().equals("SOAP")) {
- protocolPageBook.showPage(soapPage);
- }
- else if (protocolCombo.getText().equals("HTTP")) {
- protocolPageBook.showPage(httpPage);
- }
- }
- }
-
- public void updateOccured(Object arg1, Object arg2)
- {
- setPageComplete(isPageComplete());
- }
-
- public boolean isPageComplete()
- {
- boolean ready = true;
-
- setErrorMessage(null);
-
- // so that the page doesn't immediately show up with an error
- if (targetNamespaceText.getText().trim().equals(""))
- {
- if (ready)
- {
- setErrorMessage(null);
- }
- return false;
- }
-
- if (!validateTargetNamespace(targetNamespaceText.getText()))
- {
- ready = false;
- }
-
- return ready;
- }
-
- protected boolean validatePrefix(String prefix)
- {
- String errorMessage = ValidateHelper.checkXMLPrefix(prefix);
-
- if (errorMessage == null || errorMessage.length() == 0)
- {
- return true;
- }
- return false;
- }
-
- protected boolean validateXMLName(String xmlName)
- {
- String errorMessage = ValidateHelper.checkXMLName(xmlName);
-
- if (errorMessage == null || errorMessage.length() == 0)
- {
- return true;
- }
- setErrorMessage(errorMessage);
- return false;
- }
-
- protected boolean validateTargetNamespace(String ns)
- {
- boolean test = true;
- try
- {
- URI testURI = new URI(ns);
- // if (!testURI.isGenericURI())
- // {
- // setErrorMessage(WSDLEditorPlugin.getInstance().getWSDLString("_UI_ERROR_NAMESPACE_INVALID")); //$NON-NLS-1$
- // test = false;
- // }
- }
- catch (URISyntaxException e)
- {
- // String errorMessage = ValidateHelper.checkXMLName(ns);
- // if (errorMessage == null || errorMessage.length() == 0)
- // {
- // test = true;
- // }
- // else
- // {
- setErrorMessage(WSDLEditorPlugin.getWSDLString("_UI_ERROR_NAMESPACE_INVALID")); //$NON-NLS-1$
- test = false;
- // }
- }
-
- return test;
- }
-
- /*
- private boolean arePrefixesUniqueAndValid()
- {
- java.util.List infoList = namespaceInfo.getNamespaceInfoList();
- java.util.List checkedList = namespaceInfo.getNamespaceCheckedList();
-
- Vector prefixList = new Vector();
- boolean test = true;
- boolean isOneBlank = false;
-
- String currentPrefix = prefixText.getText().trim();
- if (currentPrefix.length() == 0)
- {
- isOneBlank = true;
- }
- else
- {
- if (validatePrefix(currentPrefix))
- {
- prefixList.add(currentPrefix);
- }
- else
- {
- setErrorMessage(WSDLEditorPlugin.getWSDLString("_UI_ERROR_PREFIX_IS_INVALID", currentPrefix)); //$NON-NLS-1$
- return false;
- }
- }
-
- for (int i = 0; i < infoList.size(); i++)
- {
- NamespaceInfo info = (NamespaceInfo)infoList.get(i);
- if (((String)checkedList.get(i)).equals("true")) //$NON-NLS-1$
- {
- String aPrefix = info.prefix.trim();
- if (aPrefix.length() > 0)
- {
- if (!prefixList.contains(aPrefix))
- {
- if (validatePrefix(aPrefix))
- {
- prefixList.add(aPrefix);
- }
- else
- {
- setErrorMessage(WSDLEditorPlugin.getWSDLString("_UI_ERROR_PREFIX_IS_INVALID", info.prefix)); //$NON-NLS-1$
- test = false;
- break;
- }
- }
- else
- {
- setErrorMessage(WSDLEditorPlugin.getWSDLString("_UI_ERROR_PREFIX_IS_A_DUPLICATE", info.prefix)); //$NON-NLS-1$
- test = false;
- break;
- }
- }
- else
- {
- if (!isOneBlank)
- {
- isOneBlank = true;
- }
- else
- {
- setErrorMessage(WSDLEditorPlugin.getWSDLString("_UI_ERROR_MORE_THAN_ONE_PREFIX_IS_BLANK")); //$NON-NLS-1$
- test = false;
- break;
- }
- }
- }
- }
- return test;
- }
- */
-
- protected DelayedEvent delayedTask;
- protected void startDelayedEvent(ModifyEvent e)
- {
- if (delayedTask == null || delayedTask.getEvent() == null)
- {
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500, delayedTask);
- }
- else
- {
- ModifyEvent delayedEvent = delayedTask.getEvent();
-
- if (e.widget == delayedEvent.widget)
- {
- // same event, just different data, delay new event
- delayedTask.setEvent(null);
- }
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500, delayedTask);
- }
- }
-
- class DelayedEvent implements Runnable
- {
- protected ModifyEvent event;
-
- /*
- * @see Runnable#run()
- */
- public void run()
- {
- if (event != null)
- {
- setPageComplete(isPageComplete());
- event = null;
- }
- }
-
- public ModifyEvent getEvent()
- {
- return event;
- }
-
- public void setEvent(ModifyEvent event)
- {
- this.event = event;
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == createSkeletonCheckBox) {
- if (createSkeletonCheckBox.getSelection()) {
- wsdlSkeletonGroup.setVisible(true);
- sepLabel.setVisible(true);
- protocolPageBook.setVisible(true);
- }
- else {
- wsdlSkeletonGroup.setVisible(false);
- sepLabel.setVisible(false);
- protocolPageBook.setVisible(false);
- }
- }
- }
-
- private static final String SOAP_PROTOCOL = "SOAP";
- private static final String HTTP_PROTOCOL = "HTTP";
- private static final String SOAP_RPC_ENCODED = WSDLEditorPlugin.getWSDLString("_UI_RADIO_RPC_ENCODED");
- private static final String SOAP_RPC_LITERAL = WSDLEditorPlugin.getWSDLString("_UI_RADIO_RPC_LITERAL");
- private static final String SOAP_DOCUMENT_LITERAL = WSDLEditorPlugin.getWSDLString("_UI_RADIO_DOCUMENT_LITERAL");
- private static final String HTTP_POST = "HTTP POST";
- private static final String HTTP_GET = "HTTP GET";
-
- Composite wsdlSkeletonGroup;
- Button createSkeletonCheckBox;
-
- Label sepLabel;
-
- private Text createTextField(Composite comp) {
- Text textField = new Text(comp, SWT.SINGLE | SWT.BORDER);
- GridData textData = new GridData();
- textData.horizontalAlignment = GridData.FILL;
- textData.grabExcessHorizontalSpace = true;
- textData.widthHint = 10;
- textField.setLayoutData(textData);
-
- return textField;
- }
-
- private Label createLabel(Composite comp, String labelString) {
- Label label = new Label(comp, SWT.LEFT);
- label.setText(labelString);
- GridData nsData = new GridData();
- nsData.horizontalAlignment = GridData.FILL;
- label.setLayoutData(nsData);
-
- return label;
- }
-
- private Composite createComposite(Composite parent, int numColumns)
- {
- Composite composite = new Composite(parent, SWT.NONE);
-
- composite.setFont(new Font(Display.getCurrent(), "ms sans serif", 8, SWT.NORMAL));
-
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- return composite;
- }
-
- public Vector getNamespaceInfo() {
- Vector namespaces = new Vector();
-
- // Add Default Namespaces
- NamespaceInfo info1 = new NamespaceInfo();
- info1.prefix = "wsdl";
- info1.uri = "http://schemas.xmlsoap.org/wsdl/";
- namespaces.addElement(info1);
-
- NamespaceInfo info8 = new NamespaceInfo();
- info8.prefix = "xsd";
- info8.uri = "http://www.w3.org/2001/XMLSchema";
- namespaces.addElement(info8);
-
- return namespaces;
- }
-
- public boolean getCreateSkeletonBoolean() {
- return createSkeletonCheckBox.getSelection();
- }
-
- public String getProtocol() {
- return protocolCombo.getText();
- }
-
- public Object[] getProtocolOptions() {
- Object bool[] = new Boolean[3];
- if (protocolCombo.getText().equals(SOAP_PROTOCOL)) {
- if (docLitRadio.getSelection()) {
- bool[0] = new Boolean(true);
- }
- else {
- bool[0] = new Boolean(false);
- }
-
- if (rpcLitRadio.getSelection()) {
- bool[2] = new Boolean(true);
- }
- else {
- bool[2] = new Boolean(false);
- }
- }
- else if (protocolCombo.getText().equals(HTTP_PROTOCOL)){
- if (httpGetRadio.getSelection()) {
- bool[0] = new Boolean(false);
- }
- else {
- bool[0] = new Boolean(true);
- }
- }
-
- return bool;
- }
-
- public boolean isSoapDocLiteralProtocol() {
- if (getProtocol().equals(SOAP_PROTOCOL) && docLitRadio.getSelection()) {
- return true;
- }
- else {
- return false;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFilePage.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFilePage.java
deleted file mode 100644
index 1cd8e85..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/wizards/WSDLNewFilePage.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.wizards;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-
-public class WSDLNewFilePage extends WizardNewFileCreationPage
-{
- public WSDLNewFilePage(IStructuredSelection selection)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_TITLE_NEW_WSDL_FILE"), selection); //$NON-NLS-1$
- setTitle(WSDLEditorPlugin.getWSDLString("_UI_TITLE_NEW_WSDL_FILE")); //$NON-NLS-1$
- setDescription(WSDLEditorPlugin.getWSDLString("_UI_LABEL_CREATE_NEW_WSDL_FILE")); //$NON-NLS-1$
- }
-
- public void createControl(Composite parent)
- {
- // inherit default container and name specification widgets
- super.createControl(parent);
- this.setFileName(computeDefaultFileName());
-
- setPageComplete(validatePage());
- }
-
- protected boolean validatePage()
- {
- Path newName = new Path(getFileName());
- String fullFileName = getFileName();
- String extension = newName.getFileExtension();
- if (extension == null || !extension.equalsIgnoreCase("wsdl")) //$NON-NLS-1$
- {
- setErrorMessage(WSDLEditorPlugin.getWSDLString("_UI_ERROR_FILE_MUST_END_WITH_WSDL")); //$NON-NLS-1$
- return false;
- }
- else
- {
- setErrorMessage(null);
- }
-
- // check for file should be case insensitive
- String sameName = existsFileAnyCase(fullFileName);
- if (sameName != null)
- {
- String qualifiedFileName = getContainerFullPath().toString() + '/' + fullFileName;
- setErrorMessage(WSDLEditorPlugin.getWSDLString("_UI_ERROR_FILE_ALREADY_EXISTS", sameName)); //$NON-NLS-1$
- return false;
- }
-
-
- return super.validatePage();
- }
-
- public String defaultName = "NewWSDLFile"; //$NON-NLS-1$
- public String defaultFileExtension = ".wsdl"; //$NON-NLS-1$
- public String[] filterExtensions = { "*.wsdl"}; //$NON-NLS-1$
-
-
- protected String computeDefaultFileName()
- {
- int count = 0;
- String fileName = defaultName + defaultFileExtension;
- IPath containerFullPath = getContainerFullPath();
- if (containerFullPath != null)
- {
- while (true)
- {
- IPath path = containerFullPath.append(fileName);
- // if (WorkbenchUtility.getWorkspace().getRoot().exists(path))
- if (ResourcesPlugin.getWorkspace().getRoot().exists(path))
- {
- count++;
- fileName = defaultName + count + defaultFileExtension;
- }
- else
- {
- break;
- }
- }
- }
- return fileName;
- }
-
- // returns true if file of specified name exists in any case for selected container
- protected String existsFileAnyCase(String fileName)
- {
- if ( (getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false)
- && (fileName.compareTo("") != 0))
- {
- //look through all resources at the specified container - compare in upper case
- IResource parent = ResourcesPlugin.getWorkspace().getRoot().findMember(getContainerFullPath());
- if (parent instanceof IContainer)
- {
- IContainer container = (IContainer) parent;
- try
- {
- IResource[] members = container.members();
- String enteredFileUpper = fileName.toUpperCase();
- for (int i=0; i<members.length; i++)
- {
- String resourceUpperName = members[i].getName().toUpperCase();
- if (resourceUpperName.equals(enteredFileUpper))
- {
- return members[i].getName();
- }
- }
- }
- catch (CoreException e)
- {
- }
- }
- }
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDDetailsViewerProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDDetailsViewerProvider.java
deleted file mode 100644
index 073604d..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDDetailsViewerProvider.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-
-
-public class XSDDetailsViewerProvider // implements IDetailsViewerProvider
-{
-// public Object getViewerKey(Object modelObject)
-// {
-// Object result = null;
-//
-// if (modelObject instanceof XSDConcreteComponent)
-// {
-// Element input = ((XSDConcreteComponent)modelObject).getElement();
-//
-// if (inputEquals(input, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-// {
-// result = "element";
-// }
-// else if (inputEquals(input, XSDConstants.ELEMENT_ELEMENT_TAG, true))
-// {
-// result = "elementRef";
-// }
-// else if (inputEquals(input, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
-// inputEquals(input, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
-// inputEquals(input, XSDConstants.ALL_ELEMENT_TAG, false))
-// {
-// result = "sequenceChoiceAll";
-// }
-// else if (inputEquals(input, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
-// {
-// result = "attribute";
-// }
-// else if (inputEquals(input, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
-// {
-// result = "attributeRef";
-// }
-// else if (inputEquals(input, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
-// {
-// result = "attributeGroup";
-// }
-// else if (inputEquals(input, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true))
-// {
-// result = "attributeGroupRef";
-// }
-// else if (inputEquals(input, XSDConstants.NOTATION_ELEMENT_TAG, false))
-// {
-// result = "notation";
-// }
-// else if (inputEquals(input, XSDConstants.GROUP_ELEMENT_TAG, false))
-// {
-// result = "group";
-// }
-// else if (inputEquals(input, XSDConstants.GROUP_ELEMENT_TAG, true))
-// {
-// result = "groupRef";
-// }
-// else if (inputEquals(input, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-// {
-// result = "schema";
-// }
-// else if (inputEquals(input, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-// {
-// result = "complexType";
-// }
-// else if (inputEquals(input, XSDConstants.DOCUMENTATION_ELEMENT_TAG, false))
-// {
-// result = "documentation";
-// }
-// else if (inputEquals(input, XSDConstants.APPINFO_ELEMENT_TAG, false))
-// {
-// result = "appInfo";
-// }
-// else if (inputEquals(input, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-// {
-// if (input != null && input instanceof Element)
-// {
-// Element parentElement = (Element)input;
-// XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
-// Element derivedByNode = xsdDOMHelper.getDerivedByElement(parentElement);
-// if (derivedByNode != null)
-// {
-// if (inputEquals(derivedByNode, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
-// {
-// result = "simpleContent";
-// }
-// else if (inputEquals(derivedByNode, XSDConstants.EXTENSION_ELEMENT_TAG, false))
-// {
-// result = "simpleContent";
-// }
-// }
-// else
-// {
-// result = "xsd";
-// }
-// }
-// }
-// else if (inputEquals(input, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-// {
-// if (input != null && input instanceof Element)
-// {
-// Element parentElement = (Element)input;
-// XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
-// Element derivedByNode = xsdDOMHelper.getDerivedByElement(parentElement);
-// if (derivedByNode != null)
-// {
-// result = "simpleContent";
-// }
-// else
-// {
-// result = "xsd";
-// }
-// }
-// }
-// else if (inputEquals(input, XSDConstants.INCLUDE_ELEMENT_TAG, false))
-// {
-// result = "includeXSD";
-// }
-// else if (inputEquals(input, XSDConstants.IMPORT_ELEMENT_TAG, false))
-// {
-// result = "importXSD";
-// }
-// else if (inputEquals(input, XSDConstants.REDEFINE_ELEMENT_TAG, false))
-// {
-// result = "redefine";
-// }
-// else if (inputEquals(input, XSDConstants.LIST_ELEMENT_TAG, false))
-// {
-// result = "simpleBase";
-// }
-// else if (inputEquals(input, XSDConstants.UNION_ELEMENT_TAG, false))
-// {
-// result = "simpleBase";
-// }
-// else if (inputEquals(input, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
-// {
-// result = getKeyForRestrictWindow(input);
-// }
-// else if (XSDDOMHelper.isFacet(input))
-// {
-// if (input != null && input instanceof Element)
-// {
-// Node parentElement = ((Element)input).getParentNode();
-// if (inputEquals(parentElement, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
-// {
-// result = getKeyForRestrictWindow(input);
-// }
-// }
-// }
-// else if (inputEquals(input, XSDConstants.EXTENSION_ELEMENT_TAG, false))
-// {
-// if (input != null && input instanceof Element)
-// {
-// Node parentElement = ((Element)input).getParentNode();
-// if (inputEquals(parentElement, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-// {
-// result = "simpleContent";
-// }
-// else if (inputEquals(parentElement, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-// {
-// result = "simpleContent";
-// }
-// else
-// {
-// result = "xsd";
-// }
-// }
-// }
-// else if (inputEquals(input, XSDConstants.PATTERN_ELEMENT_TAG, false))
-// {
-// result = "pattern";
-// }
-// else if (inputEquals(input, XSDConstants.ENUMERATION_ELEMENT_TAG, false))
-// {
-// result = "enum";
-// }
-// else if (inputEquals(input, XSDConstants.ANY_ELEMENT_TAG, false))
-// {
-// result = "anyElement";
-// }
-// else if (inputEquals(input, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false))
-// {
-// result = "anyAttribute";
-// }
-// else if (inputEquals(input, XSDConstants.UNIQUE_ELEMENT_TAG, false))
-// {
-// result = "unique";
-// }
-// else if (inputEquals(input, XSDConstants.KEYREF_ELEMENT_TAG, false))
-// {
-// result = "keyRef";
-// }
-// else if (inputEquals(input, XSDConstants.SELECTOR_ELEMENT_TAG, false))
-// {
-// result = "selector";
-// }
-// else if (inputEquals(input, XSDConstants.FIELD_ELEMENT_TAG, false))
-// {
-// result = "field";
-// }
-// else if (inputEquals(input, XSDConstants.KEY_ELEMENT_TAG, false))
-// {
-// result = "key";
-// }
-// else
-// {
-// result = "xsd";
-// }
-// }
-// else if (modelObject instanceof org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement)
-// {
-// result = "schema";
-// }
-//
-// return result;
-// }
-//
-//
-// public Viewer createViewer(Object modelObject, Composite parent, IEditorPart editorPart)
-// {
-// Viewer viewer = null;
-//
-//
-// DesignViewer designViewer = new DesignViewer(editorPart);
-// designViewer.setControl(parent);
-// if (modelObject instanceof XSDConcreteComponent)
-// {
-// Element elem = ((XSDConcreteComponent)modelObject).getElement();
-// viewer = designViewer.createViewer(elem);
-////TODO port
-//// ((BaseWindow)viewer).setModelObject(modelObject);
-//// viewer.setInput(elem);
-// }
-// else if (modelObject instanceof org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement)
-// {
-// XSDSchemaExtensibilityElement schema = (XSDSchemaExtensibilityElement)modelObject;
-// XSDSchema xsdSchema = schema.getSchema();
-// Element elem = xsdSchema.getElement();
-// viewer = designViewer.createViewer(elem);
-////TODO port
-//// ((BaseWindow)viewer).setModelObject(modelObject);
-//// viewer.setInput(elem);
-// }
-// return viewer;
-// }
-//
-// protected boolean inputEquals(Object input, String tagname, boolean isRef)
-// {
-// return XSDDOMHelper.inputEquals(input, tagname, isRef);
-// }
-//
-// protected String getKeyForRestrictWindow(Object input)
-// {
-// // special case where SimpleType restriction is different than SimpleContent restriction
-//
-// if (input != null && input instanceof Element)
-// {
-// Node parentElement = ((Element)input).getParentNode();
-// if (inputEquals(parentElement, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-// {
-// return "simpleRestrict";
-// }
-// else if (inputEquals(parentElement, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-// {
-// return "simpleRestrict";
-// }
-// else if (inputEquals(parentElement, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-// {
-// return "simpleContent";
-// }
-// }
-// return "xsd";
-// }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDExtension.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDExtension.java
deleted file mode 100644
index d1309da..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDExtension.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-
-// import org.eclipse.emf.edit.provider.ItemProvider;
-// import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-// import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.extension.WSDLEditorExtension;
-import org.eclipse.wst.wsdl.ui.internal.xsd.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
-import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDAdapterFactoryLabelProvider;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-
-//
-//
-public class XSDExtension implements WSDLEditorExtension
-{
- XSDModelAdapterFactoryImpl xsdModelAdapterFactory;
- XSDAdapterFactoryLabelProvider adapterFactoryLabelProvider;
-
- public XSDExtension()
- {
- xsdModelAdapterFactory = new XSDModelAdapterFactoryImpl();
- adapterFactoryLabelProvider = new XSDAdapterFactoryLabelProvider(xsdModelAdapterFactory);
- }
-
- public boolean isExtensionTypeSupported(int type)
- {
- return
- //CS comment these out until the port is complete
- type == OUTLINE_TREE_CONTENT_PROVIDER ||
- type == OUTLINE_LABEL_PROVIDER ||
- type == PROPERTY_SOURCE_PROVIDER ||
- type == PROPERTY_SECTION_DESCRIPTOR_PROVIDER ||
- type == MENU_ACTION_CONTRIBUTOR ||
- type == DETAILS_VIEWER_PROVIDER ||
- type == EDIT_PART_FACTORY ||
- type == TYPE_SYSTEM_PROVIDER ||
- type == NODE_RECONCILER ||
- type == NODE_ASSOCIATION_PROVIDER ||
- type == MODEL_QUERY_CONTRIBUTOR;
- }
-
- public boolean isApplicable(Object object)
- {
- return (object instanceof XSDSchemaExtensibilityElement ||
- object instanceof XSDConcreteComponent ||
- object instanceof CategoryAdapter ||
- object instanceof Category);
- // || object instanceof ItemProvider);
- }
-
- public Object createExtensionObject(int type, WSDLEditor wsdlEditor)
- {
- Object result = null;
- switch (type)
- {
- case OUTLINE_TREE_CONTENT_PROVIDER :
- {
- result = new XSDModelAdapterContentProvider(xsdModelAdapterFactory);
-// result = new XSDModelAdapterContentProvider();
- // result = new AdapterFactoryContentProvider(XSDExtensionPlugin.getXSDSemanticItemProviderAdapterFactory());
- break;
- }
- case OUTLINE_LABEL_PROVIDER :
- {
- result = new XSDLabelProvider(adapterFactoryLabelProvider);
- // result = new AdapterFactoryLabelProvider(XSDExtensionPlugin.getXSDSemanticItemProviderAdapterFactory());
- break;
- }
- case DETAILS_VIEWER_PROVIDER :
- {
- // result = new XSDDetailsViewerProvider();
- result = null;
- break;
- }
- case MENU_ACTION_CONTRIBUTOR :
- {
- result = new XSDMenuActionContributor(wsdlEditor);
- break;
- }
- case TYPE_SYSTEM_PROVIDER :
- {
- result = new XSDTypeSystemProvider();
- break;
- }
- case EDIT_PART_FACTORY :
- {
- result = new XSDExtensionEditPartFactory();
- break;
- }
- case NODE_RECONCILER :
- {
- result = new XSDNodeReconciler();
- break;
- }
- case NODE_ASSOCIATION_PROVIDER :
- {
- result = new XSDNodeAssociationProvider();
- break;
- }
- case MODEL_QUERY_CONTRIBUTOR :
- {
- result = new XSDModelQueryContributor(wsdlEditor);
- break;
- }
- case PROPERTY_SOURCE_PROVIDER:
- {
- result = new XSDPropertySourceProvider();
- break;
- }
- case PROPERTY_SECTION_DESCRIPTOR_PROVIDER:
- {
- result = new XSDSectionDescriptorProvider();
- break;
- }
- case XSD_DELETE_ACTION:
- {
- result = new DeleteAction(XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE"));
- break;
- }
- }
- return result;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDExtensionEditPartFactory.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDExtensionEditPartFactory.java
deleted file mode 100644
index 43c50c1..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDExtensionEditPartFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.wst.wsdl.ui.internal.xsd.graph.editparts.XSDSchemaDrillDownEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.XSDEditPartFactory;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDExtensionEditPartFactory extends XSDEditPartFactory
-{
- public EditPart createEditPart(EditPart parent, Object model)
- {
- EditPart editPart = null;
-
- if (model instanceof XSDSchema && parent.getModel() instanceof WSDLGroupObject)
- {
- editPart = new XSDSchemaDrillDownEditPart();
- editPart.setModel(model);
- editPart.setParent(parent);
- }
- else
- {
- editPart = super.createEditPart(parent, model);
- }
-
- return editPart;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDLabelProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDLabelProvider.java
deleted file mode 100644
index c7b1120..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDLabelProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDAdapterFactoryLabelProvider;
-import org.eclipse.xsd.XSDSchema;
-
-
-
-/**
- * This version of the XSDLabelProvider is a modified version of the one in XSDEditor.
- * This provider only needs to handle nodes in the XML Schema namespace.
- * Other XML nodes (including comments, PIs etc) get handled by the 'main' provider.
- */
-public class XSDLabelProvider extends LabelProvider
-{
- XSDAdapterFactoryLabelProvider adapterFactoryLabelProvider;
- private static final Class ILabelProviderClass = ILabelProvider.class;
-
- /**
- * Constructor for XSDLabelProvider.
- */
- public XSDLabelProvider(XSDAdapterFactoryLabelProvider adapterFactoryLabelProvider)
- {
- super();
- this.adapterFactoryLabelProvider = adapterFactoryLabelProvider;
- }
-
- /*
- * @see ILabelProvider#getImage(Object)
- */
- public Image getImage(Object element)
- {
- if (element instanceof XSDSchemaExtensibilityElement)
- {
- element = ((XSDSchemaExtensibilityElement)element).getSchema().getElement();
- }
- return adapterFactoryLabelProvider.getImage(element);
- }
-
- /*
- * @see ILabelProvider#getText(Object)
- */
- public String getText(Object element)
- {
- // override text for xsd schema
- if (element instanceof XSDSchema)
- {
- return ((XSDSchema)element).getTargetNamespace();
- }
- else
- {
- // We don't call "adapterFactoryLabelProvider.getText(element)" because it will return a object.toString() if
- // there is no labelProvider.... but we don't want to display this 'garbage' info to the user.
- AdapterFactory adapterFactory = adapterFactoryLabelProvider.getAdapterFactory();
- ILabelProvider labelProvider = (ILabelProvider)adapterFactory.adapt(element, ILabelProviderClass);
- String text = "";
- if (labelProvider != null) {
- text = labelProvider.getText(element);
- }
-
- return text;
- }
- }
-
-}
-
-
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDMenuActionContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDMenuActionContributor.java
deleted file mode 100644
index 0112ade..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDMenuActionContributor.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.extension.IMenuActionContributor;
-import org.eclipse.wst.wsdl.ui.internal.graph.WSDLComponentViewer;
-import org.eclipse.wst.wsdl.ui.internal.model.WSDLGroupObject;
-import org.eclipse.wst.wsdl.ui.internal.xsd.actions.AddSchemaAction;
-import org.eclipse.wst.wsdl.ui.internal.xsd.actions.BackAction;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.XSDMenuListener;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateElementAction;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateGroupAction;
-import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.TopLevelComponentEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
-import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import org.eclipse.wst.xsd.ui.internal.gef.util.editparts.AbstractComponentViewerRootEditPart;
-
-public class XSDMenuActionContributor implements IMenuActionContributor
-{
- Element currElement;
- Document currDocument;
- XSDSchema xsdSchema;
-// protected ISelectionProvider iSelectionProvider;
- WSDLEditor wsdlEditor;
-
- public XSDMenuActionContributor(WSDLEditor wsdlEditor)
- {
- this.wsdlEditor = wsdlEditor;
- }
-
- public void contributeMenuActions(IMenuManager manager, Node node, Object object)
- {
- XSDMenuExtensionListener xsdMenuListener = new XSDMenuExtensionListener(wsdlEditor.getSelectionManager());
- xsdMenuListener.contributeMenuActions(manager, node, object);
- }
-
- class XSDMenuExtensionListener extends XSDMenuListener
- {
- public XSDMenuExtensionListener(ISelectionProvider selectionProvider)
- {
- super(selectionProvider);
- }
-
- public void contributeMenuActions(IMenuManager manager, Node node, Object object)
- {
- updateXSDSchema();
- AbstractComponentViewerRootEditPart editPart = (AbstractComponentViewerRootEditPart)wsdlEditor.getGraphViewer().getComponentViewer().getRootEditPart().getContents();
-// iSelectionProvider = ((WSDLContentOutlinePage)(wsdlEditor.getWSDLTextEditor().getContentOutlinePage())).getTreeViewer();
- EditPart focusEditPart = wsdlEditor.getGraphViewer().getComponentViewer().getFocusEditPart();
-
- if (object instanceof WSDLGroupObject)
- {
- WSDLGroupObject group = (WSDLGroupObject)object;
- if (group.getType() == WSDLGroupObject.TYPES_GROUP)
- {
- boolean typesExist = group.getParent().getTypes() != null;
-
- Element typesElement = null;
- if (typesExist)
- {
- Types types = group.getParent().getETypes();
- typesElement = types.getElement();
- }
- if (manager != null)
- {
- Document document = null;
- if (editPart.getViewer() instanceof WSDLComponentViewer) {
- WSDLComponentViewer wsdlComponentViewer = (WSDLComponentViewer) editPart.getViewer();
- document = wsdlComponentViewer.getWSDLEditor().getXMLDocument();
- }
-
- manager.add(new AddSchemaAction(group.getDefinition(), (Element)node, typesElement, document));
- }
- }
- }
- else if (object instanceof Types)
- {
- // IMenuManager menu = manager.findMenuUsingPath("addchild");
-
- if (manager != null)
- {
- Types types = (Types)object;
- manager.add(new AddSchemaAction(types.getEnclosingDefinition(), (Element)node));
- }
- }
-
- if (xsdSchema == null)
- {
- return;
- }
-
- ArrayList attributes = null;
- Node relativeNode = null;
-
- BackAction backAction;
-
- if (object instanceof XSDSchema || focusEditPart instanceof TopLevelComponentEditPart || object instanceof Category)
- {
- backAction = new BackAction(WSDLEditorPlugin.getWSDLString("_UI_BACK_TO", "Definition"));
- backAction.setDefinition(wsdlEditor.getDefinition());
- backAction.setSelectionProvider(selectionProvider);
- backAction.setRootEditPart(editPart);
- backAction.setGraphViewer(wsdlEditor.getGraphViewer());
- manager.add(backAction);
- manager.add(new Separator());
- }
- else if (object instanceof XSDConcreteComponent)
- {
- backAction = new BackAction(XSDEditorPlugin.getXSDString("_UI_ACTION_BACK_TO_SCHEMA_VIEW"));
- // backAction.setXSDSchema(((XSDConcreteComponent)object).getSchema());
- backAction.setXSDSchema(xsdSchema);
- backAction.setSelectionProvider(selectionProvider);
- backAction.setRootEditPart(editPart);
- backAction.setGraphViewer(wsdlEditor.getGraphViewer());
- manager.add(backAction);
- manager.add(new Separator());
- }
-
- // CS: I'm removing the 'object instanceof Element' case from this test
- // for now the menu actions are driven from 'model' objects
- if (object instanceof XSDConcreteComponent || (object instanceof org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement))
- {
- Element parent;
- if (object instanceof XSDConcreteComponent)
- {
- parent = ((XSDConcreteComponent)object).getElement();
- xsdSchema = ((XSDConcreteComponent)object).getSchema();
- }
- else if (object instanceof Element)
- {
- manager.add(new Separator());
- parent = (Element)object;
- }
- else if (object instanceof org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement schema = (XSDSchemaExtensibilityElement)object;
- xsdSchema = schema.getSchema();
- manager.add(new Separator());
- parent = xsdSchema.getElement();
- }
- else
- {
- return;
- }
-
- currElement = parent;
- currDocument = parent.getOwnerDocument();
-
-// if (!(currDocument instanceof DocumentImpl))
-// {
-// return;
-// }
-
- addContextItems(manager, currElement, null);
-
- if (!(object instanceof XSDSchema) ||
- (object instanceof XSDSchema && !(wsdlEditor.getGraphViewer().getComponentViewer().getInput() instanceof XSDSchema))) {
- IStructuredSelection selections = (IStructuredSelection) wsdlEditor.getSelectionManager().getSelection();
- manager.add(new Separator());
- org.eclipse.wst.wsdl.ui.internal.actions.DeleteWSDLAndXSDAction deleteWSDLAndXSDAction = new org.eclipse.wst.wsdl.ui.internal.actions.DeleteWSDLAndXSDAction(selections.toList(), currElement, wsdlEditor);
- deleteWSDLAndXSDAction.setEnabled(!isReadOnly);
- manager.add(deleteWSDLAndXSDAction);
- }
- }
- else if (object instanceof Category
- || object instanceof CategoryAdapter)
- {
- int groupType = -1;
-
- if (object instanceof Category)
- {
- Category cg = (Category)object;
- xsdSchema = cg.getXSDSchema();
- groupType = cg.getGroupType();
- }
- else // CategoryAdapter
- {
- CategoryAdapter category = (CategoryAdapter)object;
- groupType = category.getGroupType();
- xsdSchema = category.getXSDSchema();
- }
- Element parent = xsdSchema.getElement();
- currElement = parent;
- currDocument = parent.getOwnerDocument();
- switch (groupType)
- {
- case Category.TYPES:
- {
- attributes = new ArrayList();
- attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("ComplexType")));
- Action action = addCreateElementAction(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_COMPLEX_TYPE"), attributes, parent, relativeNode);
- ((CreateElementAction)action).setIsGlobal(true);
- attributes = new ArrayList();
- attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("SimpleType")));
- Action action2 = addCreateSimpleTypeAction(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SIMPLE_TYPE"), attributes, parent, relativeNode);
- ((CreateElementAction)action2).setIsGlobal(true);
- break;
- }
- case Category.ELEMENTS:
- {
- attributes = new ArrayList();
- attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE,
- getNewGlobalName(XSDConstants.ELEMENT_ELEMENT_TAG, "GlobalElement")));
- attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
- Action action = addCreateElementAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ELEMENT"), attributes, parent, relativeNode);
- ((CreateElementAction)action).setIsGlobal(true);
- break;
- }
- case Category.GROUPS:
- {
- attributes = new ArrayList();
- attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE,
- getNewGlobalName(XSDConstants.GROUP_ELEMENT_TAG, "Group")));
- CreateGroupAction groupAction = addCreateGroupAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GROUP"), attributes, parent, relativeNode);
- groupAction.setIsGlobal(true);
- break;
- }
- case Category.ATTRIBUTES:
- {
- attributes = new ArrayList();
- attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE,
- getNewGlobalName(XSDConstants.ATTRIBUTE_ELEMENT_TAG, "GlobalAttribute")));
- attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
- Action action = addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GLOBAL_ATTRIBUTE"), attributes, parent, relativeNode);
- ((CreateElementAction)action).setIsGlobal(true);
- break;
- }
- case Category.ATTRIBUTE_GROUPS:
- {
- attributes = new ArrayList();
- attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE,
- getNewGlobalName(XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, "AttributeGroup")));
- Action action = addCreateElementAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP"), attributes, parent, relativeNode);
- ((CreateElementAction)action).setIsGlobal(true);
- break;
- }
- case Category.NOTATIONS:
- {
- attributes = new ArrayList();
- attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE,
- getNewGlobalName(XSDConstants.NOTATION_ELEMENT_TAG, "Notation")));
- attributes.add(new DOMAttribute(XSDConstants.PUBLIC_ATTRIBUTE, ""));
- Action action = addCreateElementAction(manager, XSDConstants.NOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_NOTATION"), attributes, parent, relativeNode);
- ((CreateElementAction)action).setIsGlobal(true);
- break;
- }
- case Category.DIRECTIVES:
- {
- boolean b = true;
- NodeList children = parent.getChildNodes();
- Node effectiveRelativeNode = parent.getFirstChild();
- for (int i=0; i < children.getLength() && b; i++)
- {
- Node child = children.item(i);
- if (child != null && child instanceof Element)
- {
- if (XSDDOMHelper.inputEquals((Element)child, XSDConstants.INCLUDE_ELEMENT_TAG, false) ||
- XSDDOMHelper.inputEquals((Element)child, XSDConstants.IMPORT_ELEMENT_TAG, false) ||
- XSDDOMHelper.inputEquals((Element)child, XSDConstants.REDEFINE_ELEMENT_TAG, false) ||
- XSDDOMHelper.inputEquals((Element)child, XSDConstants.ANNOTATION_ELEMENT_TAG, false))
- {
- effectiveRelativeNode = child;
- }
- else
- {
- b = false;
- }
- }
- }
- relativeNode = effectiveRelativeNode != null ? effectiveRelativeNode.getNextSibling() : null;
- attributes = new ArrayList();
- attributes.add(new DOMAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, ""));
-
- addCreateElementAction(manager, XSDConstants.INCLUDE_ELEMENT_TAG,XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_INCLUDE"), attributes, parent, relativeNode);
- addCreateElementAction(manager, XSDConstants.IMPORT_ELEMENT_TAG,XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_IMPORT"), null, parent, relativeNode);
- addCreateElementAction(manager, XSDConstants.REDEFINE_ELEMENT_TAG,XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_REDEFINE"), attributes, parent, relativeNode);
-
-
- break;
- }
- }
- }
- }
-
- protected IFile getFileResource()
- {
- ///// WSDL TODO
- // if (getEditor() != null)
- // return getEditor().getFileResource();
- return null;
- }
-
-// protected Object getSelectedElement()
-// {
-// return currElement;
-// }
-
- protected XSDSchema getXSDSchema()
- {
- return xsdSchema;
- }
-
- protected XMLModel getXMLModel()
- {
- if (currElement != null)
- {
- Object obj = currElement.getOwnerDocument();
- if (obj instanceof DocumentImpl)
- {
- DocumentImpl xmlDoc = (DocumentImpl) currElement.getOwnerDocument();
- return xmlDoc.getModel();
- }
- }
- return null;
- }
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDModelAdapterContentProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDModelAdapterContentProvider.java
deleted file mode 100644
index 5e330b5..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDModelAdapterContentProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDContentProvider;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-
-public class XSDModelAdapterContentProvider extends XSDContentProvider
-{
- public XSDModelAdapterContentProvider(XSDModelAdapterFactoryImpl xsdModelAdapterFactory)
- {
- super(xsdModelAdapterFactory);
- }
-
- public Object[] getChildren(Object parentObject)
- {
- List list = null;
-
- XSDConcreteComponent xsdComp = null;
- if (parentObject instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement xsdSchemaExtensibilityElement = (XSDSchemaExtensibilityElement)parentObject;
- list = new ArrayList();
- xsdComp = xsdSchemaExtensibilityElement.getSchema();
- return super.getChildren(xsdComp);
- }
- return super.getChildren(parentObject);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDModelQueryContributor.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDModelQueryContributor.java
deleted file mode 100644
index c993a26..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDModelQueryContributor.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditor;
-import org.eclipse.wst.wsdl.ui.internal.extension.IModelQueryContributor;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.xsd.ui.internal.AbstractXSDDataTypeValueExtension;
-import org.eclipse.wst.xsd.ui.internal.AbstractXSDModelQueryContributor;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-
-public class XSDModelQueryContributor extends AbstractXSDModelQueryContributor implements IModelQueryContributor
-{
- protected WSDLEditor wsdlEditor;
-
- public XSDModelQueryContributor(WSDLEditor wsdlEditor)
- {
- this.wsdlEditor = wsdlEditor;
- }
-
- public AbstractXSDDataTypeValueExtension createXSDDataTypeValueExtension(ModelQuery modelQuery)
- {
- return new XSDDataTypeValueExtension(modelQuery);
- }
-
- class XSDDataTypeValueExtension extends AbstractXSDDataTypeValueExtension
- {
- public XSDDataTypeValueExtension(ModelQuery modelQuery)
- {
- super(modelQuery);
- }
-
- public String getId()
- {
- return "WSDL-XSDDataTypeValueExtension";
- }
-
- protected XSDSchema getEnclosingXSDSchema(Element element)
- {
- XSDSchema result = null;
- Object o = WSDLEditorUtil.getInstance().findModelObjectForElement(wsdlEditor.getDefinition(), element);
- if (o instanceof XSDConcreteComponent)
- {
- result = ((XSDConcreteComponent)o).getSchema();
- }
- return result;
- }
-
- protected TypesHelper createTypesHelper(XSDSchema schema)
- {
- return new TypesHelper(schema)
- {
- protected List getPrefixesForNamespace(String namespace)
- {
- List list = super.getPrefixesForNamespace(namespace);
- Map map = wsdlEditor.getDefinition().getNamespaces();
- for (Iterator i = map.keySet().iterator(); i.hasNext();)
- {
- String prefix = (String)i.next();
- String ns = (String)map.get(prefix);
- if (ns != null && ns.equals(namespace))
- {
- if (!list.contains(prefix))
- {
- list.add(prefix);
- }
- }
- }
- return list;
- }
- };
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDNodeAssociationProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDNodeAssociationProvider.java
deleted file mode 100644
index 5ede964..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDNodeAssociationProvider.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.extension.INodeAssociationProvider;
-import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
-import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
-
-class XSDNodeAssociationProvider implements INodeAssociationProvider
-{
- public Object getModelObject(Object parentModelObject, Element[] elementChain, int start, int[] end)
- {
- Object result = null;
- if (parentModelObject instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement extensibilityElement = (XSDSchemaExtensibilityElement)parentModelObject;
- XSDSchema schema = extensibilityElement.getSchema();
- if (schema != null)
- {
- Element targetElement = elementChain[elementChain.length - 1];
- result = schema.getCorrespondingComponent(targetElement);
- }
- }
- else if (parentModelObject instanceof CategoryAdapter)
- {
- result = ((CategoryAdapter)parentModelObject).getXSDSchema();
- }
- else if (parentModelObject instanceof Category)
- {
- result = ((Category)parentModelObject).getXSDSchema();
- }
-
- return result;
- }
-
- public Node getNode(Object modelObject)
- {
- Node node = null;
- if (modelObject instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement extensibilityElement = (XSDSchemaExtensibilityElement)modelObject;
- XSDSchema schema = extensibilityElement.getSchema();
- if (schema != null)
- {
- node = schema.getElement();
- }
- }
- else if (modelObject instanceof XSDConcreteComponent)
- {
- node = ((XSDConcreteComponent)modelObject).getElement();
- }
- else if (modelObject instanceof CategoryAdapter)
- {
- node = ((CategoryAdapter)modelObject).getXSDSchema().getElement();
- }
- else if (modelObject instanceof Category)
- {
- node = ((Category)modelObject).getXSDSchema().getElement();
- }
-
- return node;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDNodeReconciler.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDNodeReconciler.java
deleted file mode 100644
index cf3a5e8..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDNodeReconciler.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.extension.INodeReconciler;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-
-public class XSDNodeReconciler implements INodeReconciler
-{
- public void notifyChanged(Object modelObject, Element element, int eventType, Object feature, Object oldValue, Object newValue, int index)
- {
- XSDConcreteComponent component = null;
- if (modelObject instanceof XSDConcreteComponent)
- {
- component = (XSDConcreteComponent)modelObject;
- }
- else if (modelObject instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchemaExtensibilityElement extensibilityElement = (XSDSchemaExtensibilityElement)modelObject;
- component = extensibilityElement.getSchema();
- }
-
- if (component != null)
- {
- switch (eventType)
- {
- case INodeNotifier.CHANGE:
- {
- component.elementAttributesChanged(element);
- break;
- }
- case INodeNotifier.STRUCTURE_CHANGED:
- {
- component.elementContentsChanged(element);
- break;
- }
- case INodeNotifier.CONTENT_CHANGED:
- {
- component.elementChanged(element);
- break;
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDPropertySourceProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDPropertySourceProvider.java
deleted file mode 100644
index 95ff36e..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDPropertySourceProvider.java
+++ /dev/null
@@ -1,336 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.ui.provider.PropertySource;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.xsd.ui.internal.properties.AnyAttributePropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.AnyElementPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.AppInfoPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.AttributeGroupRefPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.AttributePropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.BasePropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.ComplexTypePropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.DocumentationPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.ElementPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.EnumerationPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.GroupRefPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.ImportPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.IncludePropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.KeyrefPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.ModelGroupPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.NamePropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.NotationPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.PatternPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.SchemaPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.SimpleContentPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.SimpleRestrictPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.SimpleTypeListPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.SimpleTypePropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.SimpleTypeUnionPropertySource;
-import org.eclipse.wst.xsd.ui.internal.properties.XPathPropertySource;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XSDPropertySourceProvider implements IPropertySourceProvider
-{
- /* (non-Javadoc)
- * @see org.eclipse.ui.views.properties.IPropertySourceProvider#getPropertySource(java.lang.Object)
- */
- public IPropertySource getPropertySource(Object object)
- {
-// Using XSD's item providers
-// XSDItemProviderAdapterFactory adapterFactory = XSDExtensionPlugin.getXSDItemProviderAdapterFactory();
-//
-// IItemPropertySource itemPropertySource =
-// (IItemPropertySource)
-// (object instanceof EObject && ((EObject)object).eClass() == null ?
-// null :
-// adapterFactory.adapt(object, IItemPropertySource.class));
-// return
-// itemPropertySource != null ? createPropertySource(object, itemPropertySource) : null;
-
- if (object == null) return null;
-
- if (object instanceof XSDSchemaExtensibilityElement)
- {
- object = ((XSDSchemaExtensibilityElement)object).getSchema();
- }
- if (object instanceof XSDConcreteComponent)
- {
- BasePropertySource bps = (BasePropertySource)getXSDPropertySource(object);
- Element input = ((XSDConcreteComponent)object).getElement();
- bps.setInput(input);
- return bps;
- }
- return null;
- }
-
- protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource)
- {
- return new PropertySource(object, itemPropertySource);
- }
-
- protected boolean inputEquals(Object input, String tagname, boolean isRef)
- {
- return XSDDOMHelper.inputEquals(input, tagname, isRef);
- }
-
- boolean showParent = false;
-
- // TODO: We should use adapters to do this. Do as we complete 'model'-based port
- public IPropertySource getXSDPropertySource(Object object)
- {
- XSDSchema xsdSchema = ((XSDConcreteComponent)object).getSchema();
- Element input = ((XSDConcreteComponent)object).getElement();
-
- if (inputEquals(input, XSDConstants.ELEMENT_ELEMENT_TAG, false))
- {
- return new ElementPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.ELEMENT_ELEMENT_TAG, true))
- {
- return new GroupRefPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
- inputEquals(input, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
- inputEquals(input, XSDConstants.ALL_ELEMENT_TAG, false))
- {
- return new ModelGroupPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
- {
- return new AttributePropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
- {
- return new AttributeGroupRefPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
- {
- return new NamePropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true))
- {
- return new AttributeGroupRefPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.NOTATION_ELEMENT_TAG, false))
- {
- return new NotationPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
- {
- return new SimpleTypePropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.GROUP_ELEMENT_TAG, false))
- {
- return new NamePropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.GROUP_ELEMENT_TAG, true))
- {
- return new GroupRefPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.SCHEMA_ELEMENT_TAG, false))
- {
- return new SchemaPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
- {
- return new ComplexTypePropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.DOCUMENTATION_ELEMENT_TAG, false))
- {
- return new DocumentationPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.APPINFO_ELEMENT_TAG, false))
- {
- return new AppInfoPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
- {
- if (input != null && input instanceof Element)
- {
- Element parent = (Element)input;
- XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
- Element derivedByNode = xsdDOMHelper.getDerivedByElement(parent);
- if (derivedByNode != null)
- {
- if (inputEquals(derivedByNode, XSDConstants.RESTRICTION_ELEMENT_TAG, false) ||
- inputEquals(derivedByNode, XSDConstants.EXTENSION_ELEMENT_TAG, false))
- {
- return new SimpleContentPropertySource(xsdSchema);
- }
- }
- else
- {
- return null;
- }
- }
- }
- else if (inputEquals(input, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
- {
- if (input != null && input instanceof Element)
- {
- Element parent = (Element)input;
- XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
- Element derivedByNode = xsdDOMHelper.getDerivedByElement(parent);
- if (derivedByNode != null)
- {
- return new SimpleContentPropertySource(xsdSchema);
- }
- else
- {
- return null;
- }
- }
- }
- else if (inputEquals(input, XSDConstants.INCLUDE_ELEMENT_TAG, false))
- {
-// if (editor instanceof XSDEditor)
-// {
-// IFile inputFile = ((IFileEditorInput)editor.getEditorInput()).getFile();
- IFile inputFile = null;
- return new IncludePropertySource(xsdSchema, inputFile);
-// }
-// return null;
- }
- else if (inputEquals(input, XSDConstants.IMPORT_ELEMENT_TAG, false))
- {
-// if (editor instanceof XSDEditor)
-// {
-// IFile inputFile = ((IFileEditorInput)editor.getEditorInput()).getFile();
- IFile inputFile = null;
- return new ImportPropertySource(xsdSchema, inputFile);
-// }
-// return null;
- }
- else if (inputEquals(input, XSDConstants.REDEFINE_ELEMENT_TAG, false))
- {
-// if (editor instanceof XSDEditor)
-// {
-// IFile inputFile = ((IFileEditorInput)editor.getEditorInput()).getFile();
- IFile inputFile = null;
- return new IncludePropertySource(xsdSchema, inputFile);
-// }
-// return null;
- }
- else if (inputEquals(input, XSDConstants.LIST_ELEMENT_TAG, false))
- {
- return new SimpleTypeListPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.UNION_ELEMENT_TAG, false))
- {
- return new SimpleTypeUnionPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
- {
- return createRestrictWindow(input, xsdSchema);
- }
- else if (XSDDOMHelper.isFacet(input))
- {
- if (input != null && input instanceof Element)
- {
- Node parent = ((Element)input).getParentNode();
- if (inputEquals(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
- {
- return createRestrictWindow(input, xsdSchema);
- }
- }
- }
- else if (inputEquals(input, XSDConstants.EXTENSION_ELEMENT_TAG, false))
- {
- if (input != null && input instanceof Element)
- {
- Node parent = ((Element)input).getParentNode();
- if (inputEquals(parent, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false)
- || inputEquals(parent, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
- {
- showParent = true;
- return new SimpleContentPropertySource(xsdSchema);
- }
- }
- }
- else if (inputEquals(input, XSDConstants.PATTERN_ELEMENT_TAG, false))
- {
- return new PatternPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.ENUMERATION_ELEMENT_TAG, false))
- {
- return new EnumerationPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.ANY_ELEMENT_TAG, false))
- {
- return new AnyElementPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false))
- {
- return new AnyAttributePropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.UNIQUE_ELEMENT_TAG, false))
- {
- return new NamePropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.KEYREF_ELEMENT_TAG, false))
- {
- return new KeyrefPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.SELECTOR_ELEMENT_TAG, false))
- {
- return new XPathPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.FIELD_ELEMENT_TAG, false))
- {
- return new XPathPropertySource(xsdSchema);
- }
- else if (inputEquals(input, XSDConstants.KEY_ELEMENT_TAG, false))
- {
- return new NamePropertySource(xsdSchema);
- }
- else
- {
- return null;
- }
- return null;
- }
-
- protected IPropertySource createRestrictWindow(Object input, XSDSchema xsdSchema)
- {
- // special case where SimpleType restriction is different than SimpleContent restriction
-
- if (input != null && input instanceof Element)
- {
- Node parent = ((Element)input).getParentNode();
- if (inputEquals(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
- {
- return new SimpleRestrictPropertySource(xsdSchema);
- }
- else if (inputEquals(parent, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
- {
- return new SimpleRestrictPropertySource(xsdSchema);
- }
- else if (inputEquals(parent, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
- {
- showParent = true;
- return new SimpleContentPropertySource(xsdSchema);
- }
- }
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDSectionDescriptorProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDSectionDescriptorProvider.java
deleted file mode 100644
index 9684b0c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDSectionDescriptorProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-import org.eclipse.wst.common.ui.properties.ISectionDescriptor;
-import org.eclipse.wst.common.ui.properties.ISectionDescriptorProvider;
-
-public class XSDSectionDescriptorProvider implements ISectionDescriptorProvider
-{
- org.eclipse.wst.xsd.ui.internal.properties.section.XSDSectionDescriptorProvider descriptor;
- /**
- *
- */
- public XSDSectionDescriptorProvider()
- {
- super();
- descriptor = new org.eclipse.wst.xsd.ui.internal.properties.section.XSDSectionDescriptorProvider();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.ISectionDescriptorProvider#getSectionDescriptors()
- */
- public ISectionDescriptor[] getSectionDescriptors()
- {
- return descriptor.getSectionDescriptors();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDTempDetailsViewer.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDTempDetailsViewer.java
deleted file mode 100644
index 1b01ef6..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDTempDetailsViewer.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.wst.wsdl.ui.internal.viewers.BaseViewer;
-
-
-public class XSDTempDetailsViewer extends BaseViewer
-{
- protected Composite control;
-
- public XSDTempDetailsViewer(Composite parent)
- {
- super(null);
- createControl(parent);
- }
-
- public void doSetInput(Object input)
- {
- }
-
- public void createControl(Composite parent)
- {
- control = flatViewUtility.createComposite(parent, 1, true);
-
- flatViewUtility.createFlatPageHeader(control, "XSDViewer");
- }
-
- protected void update()
- {
- }
-
- public Control getControl()
- {
- return control;
- }
-
- public void doHandleEvent(Event event)
- {
-
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDTypeSystemProvider.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDTypeSystemProvider.java
deleted file mode 100644
index 388c481..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/XSDTypeSystemProvider.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.Import;
-import org.eclipse.wst.wsdl.Types;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-import org.eclipse.wst.wsdl.ui.internal.extension.ITypeSystemProvider;
-import org.eclipse.wst.wsdl.internal.util.WSDLConstants;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.impl.XSDImportImpl;
-
-//
-//
-public class XSDTypeSystemProvider implements ITypeSystemProvider
-{
- public List getPrefixes(Definition definition, String namespace)
- {
- List list = new ArrayList();
- Map map = definition.getNamespaces();
- for (Iterator i = map.keySet().iterator(); i.hasNext();)
- {
- String prefix = (String) i.next();
- String theNamespace = (String) map.get(prefix);
- if (theNamespace != null && theNamespace.equals(namespace))
- {
- list.add(prefix);
- }
- }
- return list;
- }
-
- public List getPrefixedNames(Definition definition, String namespace, String localName)
- {
- List list = new ArrayList();
- for (Iterator i = getPrefixes(definition, namespace).iterator(); i.hasNext();)
- {
- String prefix = (String) i.next();
- String name = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName;
- list.add(name);
- }
- return list;
- }
-
- protected void addNamedComponents(Definition definition, List list, List namedComponents)
- {
- for (Iterator i = namedComponents.iterator(); i.hasNext();)
- {
- XSDNamedComponent component = (XSDNamedComponent) i.next();
- list.addAll(getPrefixedNames(definition, component.getTargetNamespace(), component.getName()));
- }
- }
-
- public void initWSIStyleImports(XSDSchema xsdSchema)
- {
- if (xsdSchema.getTargetNamespace() == null)
- {
- for (Iterator i = xsdSchema.getContents().iterator(); i.hasNext();)
- {
- XSDSchemaContent content = (XSDSchemaContent) i.next();
- if (content instanceof XSDImportImpl)
- {
- XSDImportImpl xsdImport = (XSDImportImpl) content;
- XSDSchema schema = (XSDSchema)xsdImport.getResolvedSchema();
- if (schema == null)
- {
- schema = xsdImport.importSchema();
- }
- }
- }
- }
- }
-
- public List getAvailableTypeNames(Definition definition, int typeNameCategory)
- {
- List list = new ArrayList();
-
- if (typeNameCategory == ITypeSystemProvider.BUILT_IN_TYPE) {
- list = getBuiltInTypeNamesList(definition);
- }
- else {
- Types types = definition.getETypes();
- if (types != null)
- {
- for (Iterator i = types.getEExtensibilityElements().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchema schema = ((XSDSchemaExtensibilityElement) o).getSchema();
- if (schema != null)
- {
- initWSIStyleImports(schema);
- addNamedComponents(definition, list, schema.getTypeDefinitions());
- }
- }
- }
- }
-
- for (Iterator i = definition.getEImports().iterator(); i.hasNext();)
- {
- Import theImport = (Import) i.next();
- XSDSchema schema = theImport.getESchema();
- if (schema != null)
- {
- addNamedComponents(definition, list, schema.getTypeDefinitions());
- }
- }
- list.addAll(getBuiltInTypeNamesList(definition));
- }
-
- return list;
- }
-
- public List getAvailableTypes(Definition definition, XSDSchema schema, int typeNameCategory)
- {
- List list = new ArrayList();
- List keepTypes = new ArrayList();
- Iterator typeIterator = schema.getTypeDefinitions().iterator();
- // Filter out unwanted Types
- if (typeNameCategory == ITypeSystemProvider.USER_DEFINED_COMPLEX_TYPE) {
- while (typeIterator.hasNext()) {
- Object type = typeIterator.next();
- if (type instanceof XSDComplexTypeDefinition) {
- keepTypes.add(type);
- }
- }
- }
- else if (typeNameCategory == ITypeSystemProvider.USER_DEFINED_SIMPLE_TYPE) {
- while (typeIterator.hasNext()) {
- Object type = typeIterator.next();
- if (type instanceof XSDSimpleTypeDefinition) {
- keepTypes.add(type);
- }
- }
- }
-
- //addNamedComponents(definition, list, keepTypes);
- //return list;
- return keepTypes;
- }
-
- public java.util.List getBuiltInTypeNamesList(Definition definition)
- {
- List items = new ArrayList();
- if (definition != null)
- {
- List prefixes = getPrefixes(definition, WSDLConstants.XSD_NAMESPACE_URI);
- for (Iterator i = prefixes.iterator(); i.hasNext();)
- {
- String prefix = (String) i.next();
- for (int j = 0; j < XSDDOMHelper.dataType.length; j++)
- {
- String localName = XSDDOMHelper.dataType[j][0];
- String name = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName;
- items.add(name);
- }
- }
- }
- return items;
- }
- public List getAvailableElementNames(Definition definition)
- {
- List list = new ArrayList();
- Types types = definition.getETypes();
- if (types != null)
- {
- for (Iterator i = types.getEExtensibilityElements().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaExtensibilityElement)
- {
- XSDSchema schema = ((XSDSchemaExtensibilityElement) o).getSchema();
- if (schema != null)
- {
- initWSIStyleImports(schema);
- addNamedComponents(definition, list, schema.getElementDeclarations());
- }
- }
- }
- }
-
- for (Iterator i = definition.getEImports().iterator(); i.hasNext();)
- {
- Import theImport = (Import) i.next();
- XSDSchema schema = theImport.getESchema();
- if (schema != null)
- {
- addNamedComponents(definition, list, schema.getElementDeclarations());
- }
- }
- return list;
- }
- public int getCategoryForTypeName(Definition definition, String typeName)
- {
- return 0;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/actions/AddSchemaAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/actions/AddSchemaAction.java
deleted file mode 100644
index 9037b3c..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/actions/AddSchemaAction.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd.actions;
-
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
-import org.eclipse.wst.wsdl.ui.internal.actions.AddElementAction;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class AddSchemaAction extends AddElementAction
-{
- protected String targetNamespace;
- protected boolean createTypesElement = false;
-
- public AddSchemaAction(Definition definition, Element definitionElement)
- {
- this(definition, definitionElement, false);
- }
-
- public AddSchemaAction(Definition definition, Element definitionElement, boolean createTypesElement)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_SCHEMA"), "icons/xsd_obj.gif", definitionElement, "xsd:schema");
- this.createTypesElement = createTypesElement;
- targetNamespace = definition.getTargetNamespace();
- }
-
- public AddSchemaAction(Definition definition, Element definitionElement, Element typesElement)
- {
- super(WSDLEditorPlugin.getWSDLString("_UI_ACTION_ADD_SCHEMA"), "icons/xsd_obj.gif", definitionElement, "xsd:schema");
- if (typesElement != null)
- {
- parentNode = typesElement;
- this.createTypesElement = false;
- }
- else
- {
- this.createTypesElement = true;
- }
- targetNamespace = definition.getTargetNamespace();
- }
-
- public AddSchemaAction(Definition definition, Element definitionElement, Element typesElement, Document document)
- {
- this(definition, definitionElement, typesElement);
- this.definition = definition;
- this.document = document;
- }
-
- protected boolean showDialog()
- {
- return true;
- }
-
- protected void addAttributes(Element newElement)
- {
- newElement.setAttribute("xmlns:xsd", XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- newElement.setAttribute("elementFormDefault", "qualified");
- newElement.setAttribute("targetNamespace", targetNamespace);
- }
-
- public void run()
- {
- beginRecording();
- if (parentNode == null || (document != null && document.getChildNodes().getLength() == 0)) {
- createDefinitionStub();
- prefix = null;
- targetNamespace = definition.getTargetNamespace();
- }
-
- if (createTypesElement)
- {
- AddElementAction addTypesAction = new AddElementAction("", "icons/xsd_obj.gif", parentNode, parentNode.getPrefix(), "types");
- addTypesAction.setComputeTopLevelRefChild(true);
- addTypesAction.run();
- parentNode = addTypesAction.getNewElement();
- }
- super.run();
- endRecording();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/actions/BackAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/actions/BackAction.java
deleted file mode 100644
index 892f471..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/actions/BackAction.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.graph.WSDLGraphViewer;
-import org.eclipse.xsd.XSDSchema;
-
-import org.eclipse.wst.xsd.ui.internal.gef.util.editparts.AbstractComponentViewerRootEditPart;
-
-public class BackAction extends Action
-{
- ISelectionProvider selectionProvider;
- XSDSchema xsdSchema;
- Definition definition;
- WSDLGraphViewer graphViewer;
-
- /**
- *
- */
- public BackAction()
- {
- super();
- }
-
- /**
- * @param text
- */
- public BackAction(String text)
- {
- super(text);
- }
-
- /**
- * @param text
- * @param image
- */
- public BackAction(String text, ImageDescriptor image)
- {
- super(text, image);
- }
-
- /**
- * @param text
- * @param style
- */
- public BackAction(String text, int style)
- {
- super(text, style);
- }
-
- public void setSelectionProvider(ISelectionProvider selectionProvider)
- {
- this.selectionProvider = selectionProvider;
- }
-
- AbstractComponentViewerRootEditPart editPart;
- public void setRootEditPart(AbstractComponentViewerRootEditPart editPart)
- {
- this.editPart = editPart;
- }
-
- public void setDefinition(Definition definition)
- {
- this.definition = definition;
- }
-
- public void setXSDSchema(XSDSchema xsdSchema)
- {
- this.xsdSchema = xsdSchema;
- }
-
- public void setGraphViewer(WSDLGraphViewer graphViewer)
- {
- this.graphViewer = graphViewer;
- }
-
- /*
- * @see IAction#run()
- */
- public void run()
- {
- if (xsdSchema != null)
- {
- StructuredSelection selection = new StructuredSelection(xsdSchema);
- selectionProvider.setSelection(selection);
- // editPart.setInput(xsdSchema);
- graphViewer.setInput(xsdSchema);
- }
- else if (definition != null)
- {
- StructuredSelection selection = new StructuredSelection(definition);
- selectionProvider.setSelection(selection);
- // editPart.setInput(definition);
- graphViewer.setInput(definition);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/actions/DeleteAction.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/actions/DeleteAction.java
deleted file mode 100644
index 5b4e480..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/actions/DeleteAction.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd.actions;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.wsdl.Definition;
-import org.eclipse.wst.wsdl.ui.internal.actions.DeleteInterfaceAction;
-import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.BaseGlobalCleanup;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-// Should try to use xsdeditor's delete action....
-
-public class DeleteAction extends Action implements DeleteInterfaceAction
-{
- XSDSchema xsdSchema;
- Definition definition;
- List deleteList;
-
- /**
- * Constructor for DeleteAction.
- * @param text
- */
- public DeleteAction(String text)
- {
- super(XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE"));
- }
-
- public XSDSchema getSchema()
- {
- return xsdSchema;
- }
-
- public void setSchema(XSDSchema xsdSchema)
- {
- this.xsdSchema = xsdSchema;
- }
-
- public void setDeleteList(List list) {
- deleteList = list;
- }
-
- public List getDeleteList() {
- return deleteList;
- }
-
- /*
- * @see IAction#run()
- */
- public void run()
- {
- List selections = getDeleteList();
-
- if (selections.isEmpty())
- {
- return;
- }
-
- Iterator iter = selections.iterator();
- DocumentImpl doc = null;
- while (iter.hasNext())
- {
- Object obj = iter.next();
- Element node;
- if (obj instanceof Element)
- {
- node = (Element)obj;
- Object elem = WSDLEditorUtil.getInstance().findModelObjectForElement(definition, node);
- if (elem instanceof XSDComponent)
- {
- xsdSchema = ((XSDComponent)elem).getSchema();
- }
- }
- else if (obj instanceof XSDComponent)
- {
- node = ((XSDComponent)obj).getElement();
- xsdSchema = ((XSDComponent)obj).getSchema();
- }
- else if (obj instanceof XSDConcreteComponent) {
- node = ((XSDConcreteComponent)obj).getElement();
- xsdSchema = ((XSDConcreteComponent)obj).getSchema();
- }
- else
- {
- return;
- }
-
- if (!XSDDOMHelper.inputEquals(node, XSDConstants.SCHEMA_ELEMENT_TAG, false))
- {
-
- if (doc == null)
- {
- doc = (DocumentImpl) node.getOwnerDocument();
- doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_NODES"));
- }
-
- boolean refresh = cleanupReferences(node);
- XSDDOMHelper.removeNodeAndWhitespace(node);
-
- // Workaround to reset included elements in XSD model
- if (refresh)
- {
-// TODO
-// getEditor().reparseSchema();
-// getEditor().getGraphViewer().setSchema(getEditor().getXSDSchema());
- }
- }
- }
- if (doc != null)
- {
- doc.getModel().endRecording(this);
- }
- }
-
- protected boolean cleanupReferences(Node deletedNode)
- {
- boolean refresh = false;
- XSDConcreteComponent comp = getSchema().getCorrespondingComponent(deletedNode);
-
- if (comp instanceof XSDInclude ||
- comp instanceof XSDImport ||
- comp instanceof XSDRedefine)
- {
- XSDSchema resolvedSchema = ((XSDSchemaDirective)comp).getResolvedSchema();
- XSDSchema referencedSchema = null;
- if (comp instanceof XSDInclude)
- {
- referencedSchema = ((XSDInclude)comp).getIncorporatedSchema();
- refresh = true;
- }
- else if (comp instanceof XSDRedefine)
- {
- referencedSchema = ((XSDRedefine)comp).getIncorporatedSchema();
- refresh = true;
- }
- else if (comp instanceof XSDImport)
- {
- referencedSchema = ((XSDImport)comp).getResolvedSchema();
- }
-
- if (referencedSchema != null)
- {
-// XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
-// cleanHelper.visitSchema(getSchema());
-// // populate messages
-//// TODO
-//// getEditor().createTasksInTaskList(cleanHelper.getMessages());
- }
- if (comp instanceof XSDImport)
- {
- TypesHelper typesHelper = new TypesHelper(getSchema());
- typesHelper.updateMapAfterDelete((XSDImport)comp);
- }
- }
- else if (getSchema().equals(comp.getContainer()))
- {
- BaseGlobalCleanup cleanHelper = null;
- // Only need to clean up references if the component being deleted is global scoped
-// if (comp instanceof XSDElementDeclaration)
-// {
-// cleanHelper = new GlobalElementCleanup(comp);
-// }
-// else if (comp instanceof XSDModelGroupDefinition)
-// {
-// cleanHelper = new GlobalGroupCleanup(comp);
-// }
-// else if (comp instanceof XSDTypeDefinition)
-// {
-// cleanHelper = new GlobalSimpleOrComplexTypeCleanup(comp);
-// }
-// else if (comp instanceof XSDAttributeDeclaration)
-// {
-// cleanHelper = new GlobalAttributeCleanup(comp);
-// }
-// else if (comp instanceof XSDAttributeGroupDefinition)
-// {
-// cleanHelper = new GlobalAttributeGroupCleanup(comp);
-// }
-//
-//
-// if (cleanHelper != null)
-// {
-// cleanHelper.visitSchema(getSchema());
-// // populate messages
-//// TODO
-//// getEditor().createTasksInTaskList(cleanHelper.getMessages());
-// }
- }
- return refresh;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/graph/editparts/XSDSchemaDrillDownEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/graph/editparts/XSDSchemaDrillDownEditPart.java
deleted file mode 100644
index 9bcb1a3..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/graph/editparts/XSDSchemaDrillDownEditPart.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd.graph.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.xsd.XSDSchema;
-
-import org.eclipse.wst.wsdl.ui.internal.graph.editparts.DrillDownEditPart;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-
-
-public class XSDSchemaDrillDownEditPart extends DrillDownEditPart
-{
- protected IFigure createFigure()
- {
- IFigure figure = super.createFigure();
- label.setIcon(XSDEditorPlugin.getXSDImage("icons/XSDFile.gif"));
- return figure;
- }
-
- protected void refreshVisuals()
- {
- XSDSchema schema = (XSDSchema)getModel();
- String ns = schema.getTargetNamespace() != null ? schema.getTargetNamespace() : "";
- label.setText(ns);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/graph/editparts/XSDSchemaExtensibilityElementEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/graph/editparts/XSDSchemaExtensibilityElementEditPart.java
deleted file mode 100644
index 6709309..0000000
--- a/bundles/org.eclipse.wst.wsdl.ui/src/org/eclipse/wst/wsdl/ui/internal/xsd/graph/editparts/XSDSchemaExtensibilityElementEditPart.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsdl.ui.internal.xsd.graph.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
-
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerFigure;
-
-
-public class XSDSchemaExtensibilityElementEditPart extends AbstractGraphicalEditPart
-{
- protected EditPartFactory factory;
-
- public XSDSchemaExtensibilityElementEditPart(EditPartFactory factory)
- {
- this.factory = factory;
- }
-
- protected IFigure createFigure()
- {
- ContainerFigure figure = new ContainerFigure();
- return figure;
- }
-
- protected EditPart createChild(Object model)
- {
- return factory.createEditPart(this, model);
- }
-
- protected List getModelChildren()
- {
- XSDSchemaExtensibilityElement e = (XSDSchemaExtensibilityElement)getModel();
- List result = new ArrayList();
- result.add(e.getSchema());
- return result;
- }
-
- protected void createEditPolicies()
- {
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl/xsd/http.xsd b/bundles/org.eclipse.wst.wsdl/xsd/http.xsd
deleted file mode 100644
index 1cb756e..0000000
--- a/bundles/org.eclipse.wst.wsdl/xsd/http.xsd
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-
-Copyright 2001-2002 International Business Machines Corporation, Microsoft Corporation. All rights reserved.
-
-The presentation, distribution or other dissemination of the
-information contained herein by Microsoft is not a license,
-either expressly or impliedly, to any intellectual property owned or
-controlled by Microsoft.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and to the maximum extent permitted by applicable law,
-Microsoft provides the document AS IS AND WITH ALL FAULTS, and hereby
-disclaims all other warranties and conditions, either express, implied
-or statutory, including, but not limited to, any (if any) implied
-warranties, duties or conditions of merchantability, of fitness for a
-particular purpose, of accuracy or completeness of responses, of
-results, of workmanlike effort, of lack of viruses, and of lack of
-negligence, all with regard to the document. ALSO, THERE IS NO
-WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION,
-CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THE
-DOCUMENT.
-
-IN NO EVENT WILL MICROSOFT BE LIABLE TO ANY OTHER PARTY FOR THE COST
-OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE,
-LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR
-SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE,
-ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS
-DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-
- -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- targetNamespace="http://schemas.xmlsoap.org/wsdl/http/">
-
- <import namespace = "http://schemas.xmlsoap.org/wsdl/" schemaLocation = "wsdl.xsd"/>
-
- <element name="address" type="http:addressType"/>
-
- <complexType name="addressType">
- <complexContent>
- <extension base="wsdl:tExtensibilityElement">
- <sequence/>
- <attribute name="location" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="binding" type="http:bindingType"/>
- <complexType name="bindingType">
- <complexContent>
- <extension base="wsdl:tExtensibilityElement">
- <sequence/>
- <attribute name="verb" type="NMTOKEN" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="operation" type="http:operationType"/>
- <complexType name="operationType">
- <complexContent>
- <extension base="wsdl:tExtensibilityElement">
- <sequence/>
- <attribute name="location" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="urlEncoded">
- <complexType/>
- </element>
- <element name="urlReplacement">
- <complexType/>
- </element>
-</schema>
diff --git a/bundles/org.eclipse.wst.wsdl/xsd/soap.xsd b/bundles/org.eclipse.wst.wsdl/xsd/soap.xsd
deleted file mode 100644
index ce51f4d..0000000
--- a/bundles/org.eclipse.wst.wsdl/xsd/soap.xsd
+++ /dev/null
@@ -1,150 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-
-Copyright 2001-2003 International Business Machines Corporation, Microsoft Corporation. All rights reserved.
-
-The presentation, distribution or other dissemination of the
-information contained herein by Microsoft is not a license,
-either expressly or impliedly, to any intellectual property owned or
-controlled by Microsoft.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and to the maximum extent permitted by applicable law,
-Microsoft provides the document AS IS AND WITH ALL FAULTS, and hereby
-disclaims all other warranties and conditions, either express, implied
-or statutory, including, but not limited to, any (if any) implied
-warranties, duties or conditions of merchantability, of fitness for a
-particular purpose, of accuracy or completeness of responses, of
-results, of workmanlike effort, of lack of viruses, and of lack of
-negligence, all with regard to the document. ALSO, THERE IS NO
-WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION,
-CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THE
-DOCUMENT.
-
-IN NO EVENT WILL MICROSOFT BE LIABLE TO ANY OTHER PARTY FOR THE COST
-OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE,
-LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR
-SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE,
-ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS
-DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- targetNamespace="http://schemas.xmlsoap.org/wsdl/soap/" >
-
- <xs:import namespace = "http://schemas.xmlsoap.org/wsdl/" schemaLocation = "wsdl.xsd"/>
-
- <xs:simpleType name="encodingStyle" >
- <xs:annotation>
- <xs:documentation>
- "encodingStyle" indicates any canonicalization conventions followed in the contents of the containing element. For example, the value "http://schemas.xmlsoap.org/soap/encoding/" indicates the pattern described in SOAP specification
- </xs:documentation>
- </xs:annotation>
- <xs:list itemType="xs:anyURI" />
- </xs:simpleType>
-
- <xs:element name="binding" type="soap:tBinding" />
- <xs:complexType name="tBinding" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibilityElement" >
- <xs:attribute name="transport" type="xs:anyURI" use="required" />
- <xs:attribute name="style" type="soap:tStyleChoice" use="optional" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:simpleType name="tStyleChoice" >
- <xs:restriction base="xs:string" >
- <xs:enumeration value="rpc" />
- <xs:enumeration value="document" />
- </xs:restriction>
- </xs:simpleType>
-
- <xs:element name="operation" type="soap:tOperation" />
- <xs:complexType name="tOperation" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibilityElement" >
- <xs:attribute name="soapAction" type="xs:anyURI" use="optional" />
- <xs:attribute name="style" type="soap:tStyleChoice" use="optional" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="body" type="soap:tBody" />
- <xs:attributeGroup name="tBodyAttributes" >
- <xs:attribute name="encodingStyle" type="soap:encodingStyle" use="optional" />
- <xs:attribute name="use" type="soap:useChoice" use="optional" />
- <xs:attribute name="namespace" type="xs:anyURI" use="optional" />
- </xs:attributeGroup>
- <xs:complexType name="tBody" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibilityElement" >
- <xs:attribute name="parts" type="xs:NMTOKENS" use="optional" />
- <xs:attributeGroup ref = "soap:tBodyAttributes" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:simpleType name="useChoice" >
- <xs:restriction base="xs:string" >
- <xs:enumeration value="literal" />
- <xs:enumeration value="encoded" />
- </xs:restriction>
- </xs:simpleType>
-
- <xs:element name="fault" type="soap:tFault" />
- <xs:complexType name="tFaultRes" abstract="true" >
- <xs:complexContent>
- <xs:restriction base="soap:tBody" >
- <xs:attribute ref="wsdl:required" use="optional" />
- <xs:attribute name="parts" type="xs:NMTOKENS" use="prohibited" />
- <xs:attributeGroup ref="soap:tBodyAttributes" />
- </xs:restriction>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="tFault" >
- <xs:complexContent>
- <xs:extension base="soap:tFaultRes">
- <xs:attribute name="name" type="xs:NCName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
-
- <xs:element name="header" type="soap:tHeader" />
- <xs:attributeGroup name="tHeaderAttributes" >
- <xs:attribute name="message" type="xs:QName" use="required" />
- <xs:attribute name="part" type="xs:NMTOKEN" use="required" />
- <xs:attribute name="use" type="soap:useChoice" use="required" />
- <xs:attribute name="encodingStyle" type="soap:encodingStyle" use="optional" />
- <xs:attribute name="namespace" type="xs:anyURI" use="optional" />
- </xs:attributeGroup>
- <xs:complexType name="tHeader" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibilityElement" >
- <xs:sequence>
- <xs:element ref="soap:headerfault" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attributeGroup ref="soap:tHeaderAttributes" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="headerfault" type="soap:tHeaderFault" />
- <xs:complexType name="tHeaderFault" >
- <xs:attributeGroup ref="soap:tHeaderAttributes" />
- </xs:complexType>
-
- <xs:element name="address" type="soap:tAddress" />
- <xs:complexType name="tAddress" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibilityElement" >
- <xs:attribute name="location" type="xs:anyURI" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
-</xs:schema>
diff --git a/bundles/org.eclipse.wst.wsdl/xsd/soapenc.xsd b/bundles/org.eclipse.wst.wsdl/xsd/soapenc.xsd
deleted file mode 100644
index 87ea888..0000000
--- a/bundles/org.eclipse.wst.wsdl/xsd/soapenc.xsd
+++ /dev/null
@@ -1,536 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-
-<!-- Schema for the SOAP/1.1 encoding
-
- This schema has been produced using W3C's SOAP Version 1.2 schema
- found at:
-
- http://www.w3.org/2001/06/soap-encoding
-
- Copyright 2001 Martin Gudgin, Developmentor.
- http://www.develop.co.uk
-
- Changes made are the following:
- - reverted namespace to http://schemas.xmlsoap.org/soap/encoding/
- - reverted root to only allow 0 and 1 as lexical values
-
- Further changes:
-
- - removed default value from root attribute declaration - 20030314
-
- Original copyright:
-
- Copyright 2001 W3C (Massachusetts Institute of Technology,
- Institut National de Recherche en Informatique et en Automatique,
- Keio University). All Rights Reserved.
- http://www.w3.org/Consortium/Legal/
-
- This document is governed by the W3C Software License [1] as
- described in the FAQ [2].
-
- [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
- [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
- targetNamespace="http://schemas.xmlsoap.org/soap/encoding/" >
-
- <xs:attribute name="root" >
- <xs:annotation>
- <xs:documentation>
- 'root' can be used to distinguish serialization roots from other
- elements that are present in a serialization but are not roots of
- a serialized value graph
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base='xs:boolean'>
- <xs:pattern value='0|1' />
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
-
- <xs:attributeGroup name="commonAttributes" >
- <xs:annotation>
- <xs:documentation>
- Attributes common to all elements that function as accessors or
- represent independent (multi-ref) values. The href attribute is
- intended to be used in a manner like CONREF. That is, the element
- content should be empty iff the href attribute appears
- </xs:documentation>
- </xs:annotation>
- <xs:attribute name="id" type="xs:ID" />
- <xs:attribute name="href" type="xs:anyURI" />
- <xs:anyAttribute namespace="##other" processContents="lax" />
- </xs:attributeGroup>
-
- <!-- Global Attributes. The following attributes are intended to be usable via qualified attribute names on any complex type referencing them. -->
-
- <!-- Array attributes. Needed to give the type and dimensions of an array's contents, and the offset for partially-transmitted arrays. -->
-
- <xs:simpleType name="arrayCoordinate" >
- <xs:restriction base="xs:string" />
- </xs:simpleType>
-
- <xs:attribute name="arrayType" type="xs:string" />
- <xs:attribute name="offset" type="tns:arrayCoordinate" />
-
- <xs:attributeGroup name="arrayAttributes" >
- <xs:attribute ref="tns:arrayType" />
- <xs:attribute ref="tns:offset" />
- </xs:attributeGroup>
-
- <xs:attribute name="position" type="tns:arrayCoordinate" />
-
- <xs:attributeGroup name="arrayMemberAttributes" >
- <xs:attribute ref="tns:position" />
- </xs:attributeGroup>
-
- <xs:group name="Array" >
- <xs:sequence>
- <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
- </xs:sequence>
- </xs:group>
-
- <xs:element name="Array" type="tns:Array" />
- <xs:complexType name="Array" >
- <xs:annotation>
- <xs:documentation>
- 'Array' is a complex type for accessors identified by position
- </xs:documentation>
- </xs:annotation>
- <xs:group ref="tns:Array" minOccurs="0" />
- <xs:attributeGroup ref="tns:arrayAttributes" />
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:complexType>
-
- <!-- 'Struct' is a complex type for accessors identified by name.
- Constraint: No element may be have the same name as any other,
- nor may any element have a maxOccurs > 1. -->
-
- <xs:element name="Struct" type="tns:Struct" />
-
- <xs:group name="Struct" >
- <xs:sequence>
- <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
- </xs:sequence>
- </xs:group>
-
- <xs:complexType name="Struct" >
- <xs:group ref="tns:Struct" minOccurs="0" />
- <xs:attributeGroup ref="tns:commonAttributes"/>
- </xs:complexType>
-
- <!-- 'Base64' can be used to serialize binary data using base64 encoding
- as defined in RFC2045 but without the MIME line length limitation. -->
-
- <xs:simpleType name="base64" >
- <xs:restriction base="xs:base64Binary" />
- </xs:simpleType>
-
- <!-- Element declarations corresponding to each of the simple types in the
- XML Schemas Specification. -->
-
- <xs:element name="duration" type="tns:duration" />
- <xs:complexType name="duration" >
- <xs:simpleContent>
- <xs:extension base="xs:duration" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="dateTime" type="tns:dateTime" />
- <xs:complexType name="dateTime" >
- <xs:simpleContent>
- <xs:extension base="xs:dateTime" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
-
-
- <xs:element name="NOTATION" type="tns:NOTATION" />
- <xs:complexType name="NOTATION" >
- <xs:simpleContent>
- <xs:extension base="xs:QName" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
-
- <xs:element name="time" type="tns:time" />
- <xs:complexType name="time" >
- <xs:simpleContent>
- <xs:extension base="xs:time" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="date" type="tns:date" />
- <xs:complexType name="date" >
- <xs:simpleContent>
- <xs:extension base="xs:date" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="gYearMonth" type="tns:gYearMonth" />
- <xs:complexType name="gYearMonth" >
- <xs:simpleContent>
- <xs:extension base="xs:gYearMonth" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="gYear" type="tns:gYear" />
- <xs:complexType name="gYear" >
- <xs:simpleContent>
- <xs:extension base="xs:gYear" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="gMonthDay" type="tns:gMonthDay" />
- <xs:complexType name="gMonthDay" >
- <xs:simpleContent>
- <xs:extension base="xs:gMonthDay" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="gDay" type="tns:gDay" />
- <xs:complexType name="gDay" >
- <xs:simpleContent>
- <xs:extension base="xs:gDay" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="gMonth" type="tns:gMonth" />
- <xs:complexType name="gMonth" >
- <xs:simpleContent>
- <xs:extension base="xs:gMonth" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="boolean" type="tns:boolean" />
- <xs:complexType name="boolean" >
- <xs:simpleContent>
- <xs:extension base="xs:boolean" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="base64Binary" type="tns:base64Binary" />
- <xs:complexType name="base64Binary" >
- <xs:simpleContent>
- <xs:extension base="xs:base64Binary" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="hexBinary" type="tns:hexBinary" />
- <xs:complexType name="hexBinary" >
- <xs:simpleContent>
- <xs:extension base="xs:hexBinary" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="float" type="tns:float" />
- <xs:complexType name="float" >
- <xs:simpleContent>
- <xs:extension base="xs:float" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="double" type="tns:double" />
- <xs:complexType name="double" >
- <xs:simpleContent>
- <xs:extension base="xs:double" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="anyURI" type="tns:anyURI" />
- <xs:complexType name="anyURI" >
- <xs:simpleContent>
- <xs:extension base="xs:anyURI" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="QName" type="tns:QName" />
- <xs:complexType name="QName" >
- <xs:simpleContent>
- <xs:extension base="xs:QName" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
-
- <xs:element name="string" type="tns:string" />
- <xs:complexType name="string" >
- <xs:simpleContent>
- <xs:extension base="xs:string" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="normalizedString" type="tns:normalizedString" />
- <xs:complexType name="normalizedString" >
- <xs:simpleContent>
- <xs:extension base="xs:normalizedString" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="token" type="tns:token" />
- <xs:complexType name="token" >
- <xs:simpleContent>
- <xs:extension base="xs:token" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="language" type="tns:language" />
- <xs:complexType name="language" >
- <xs:simpleContent>
- <xs:extension base="xs:language" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="Name" type="tns:Name" />
- <xs:complexType name="Name" >
- <xs:simpleContent>
- <xs:extension base="xs:Name" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="NMTOKEN" type="tns:NMTOKEN" />
- <xs:complexType name="NMTOKEN" >
- <xs:simpleContent>
- <xs:extension base="xs:NMTOKEN" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="NCName" type="tns:NCName" />
- <xs:complexType name="NCName" >
- <xs:simpleContent>
- <xs:extension base="xs:NCName" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="NMTOKENS" type="tns:NMTOKENS" />
- <xs:complexType name="NMTOKENS" >
- <xs:simpleContent>
- <xs:extension base="xs:NMTOKENS" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="ID" type="tns:ID" />
- <xs:complexType name="ID" >
- <xs:simpleContent>
- <xs:extension base="xs:ID" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="IDREF" type="tns:IDREF" />
- <xs:complexType name="IDREF" >
- <xs:simpleContent>
- <xs:extension base="xs:IDREF" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="ENTITY" type="tns:ENTITY" />
- <xs:complexType name="ENTITY" >
- <xs:simpleContent>
- <xs:extension base="xs:ENTITY" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="IDREFS" type="tns:IDREFS" />
- <xs:complexType name="IDREFS" >
- <xs:simpleContent>
- <xs:extension base="xs:IDREFS" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="ENTITIES" type="tns:ENTITIES" />
- <xs:complexType name="ENTITIES" >
- <xs:simpleContent>
- <xs:extension base="xs:ENTITIES" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="decimal" type="tns:decimal" />
- <xs:complexType name="decimal" >
- <xs:simpleContent>
- <xs:extension base="xs:decimal" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="integer" type="tns:integer" />
- <xs:complexType name="integer" >
- <xs:simpleContent>
- <xs:extension base="xs:integer" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="nonPositiveInteger" type="tns:nonPositiveInteger" />
- <xs:complexType name="nonPositiveInteger" >
- <xs:simpleContent>
- <xs:extension base="xs:nonPositiveInteger" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="negativeInteger" type="tns:negativeInteger" />
- <xs:complexType name="negativeInteger" >
- <xs:simpleContent>
- <xs:extension base="xs:negativeInteger" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="long" type="tns:long" />
- <xs:complexType name="long" >
- <xs:simpleContent>
- <xs:extension base="xs:long" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="int" type="tns:int" />
- <xs:complexType name="int" >
- <xs:simpleContent>
- <xs:extension base="xs:int" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="short" type="tns:short" />
- <xs:complexType name="short" >
- <xs:simpleContent>
- <xs:extension base="xs:short" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="byte" type="tns:byte" />
- <xs:complexType name="byte" >
- <xs:simpleContent>
- <xs:extension base="xs:byte" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="nonNegativeInteger" type="tns:nonNegativeInteger" />
- <xs:complexType name="nonNegativeInteger" >
- <xs:simpleContent>
- <xs:extension base="xs:nonNegativeInteger" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="unsignedLong" type="tns:unsignedLong" />
- <xs:complexType name="unsignedLong" >
- <xs:simpleContent>
- <xs:extension base="xs:unsignedLong" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="unsignedInt" type="tns:unsignedInt" />
- <xs:complexType name="unsignedInt" >
- <xs:simpleContent>
- <xs:extension base="xs:unsignedInt" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="unsignedShort" type="tns:unsignedShort" />
- <xs:complexType name="unsignedShort" >
- <xs:simpleContent>
- <xs:extension base="xs:unsignedShort" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="unsignedByte" type="tns:unsignedByte" />
- <xs:complexType name="unsignedByte" >
- <xs:simpleContent>
- <xs:extension base="xs:unsignedByte" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="positiveInteger" type="tns:positiveInteger" />
- <xs:complexType name="positiveInteger" >
- <xs:simpleContent>
- <xs:extension base="xs:positiveInteger" >
- <xs:attributeGroup ref="tns:commonAttributes" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="anyType" />
-</xs:schema>
-
diff --git a/bundles/org.eclipse.wst.wsdl/xsd/wsdl-mime.xsd b/bundles/org.eclipse.wst.wsdl/xsd/wsdl-mime.xsd
deleted file mode 100644
index d7a868e..0000000
--- a/bundles/org.eclipse.wst.wsdl/xsd/wsdl-mime.xsd
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-Copyright 2001-2002 International Business Machines Corporation, Microsoft Corporation. All rights reserved.
-
-The presentation, distribution or other dissemination of the
-information contained herein by Microsoft is not a license,
-either expressly or impliedly, to any intellectual property owned or
-controlled by Microsoft.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and to the maximum extent permitted by applicable law,
-Microsoft provides the document AS IS AND WITH ALL FAULTS, and hereby
-disclaims all other warranties and conditions, either express, implied
-or statutory, including, but not limited to, any (if any) implied
-warranties, duties or conditions of merchantability, of fitness for a
-particular purpose, of accuracy or completeness of responses, of
-results, of workmanlike effort, of lack of viruses, and of lack of
-negligence, all with regard to the document. ALSO, THERE IS NO
-WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION,
-CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THE
-DOCUMENT.
-
-IN NO EVENT WILL MICROSOFT BE LIABLE TO ANY OTHER PARTY FOR THE COST
-OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE,
-LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR
-SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE,
-ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS
-DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-
- -->
-<schema targetNamespace="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
- <import namespace="http://schemas.xmlsoap.org/wsdl/" schemaLocation="wsdl.xsd"/>
- <element name="content" type="mime:contentType"/>
- <complexType name="contentType">
- <complexContent>
- <extension base="wsdl:tExtensibilityElement">
- <sequence/>
- <attribute name="type" type="string" use="optional"/>
- <attribute name="part" type="NMTOKEN" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
- <element name="multipartRelated" type="mime:multipartRelatedType"/>
- <complexType name="multipartRelatedType">
- <complexContent>
- <extension base="wsdl:tExtensibilityElement">
- <sequence>
- <element ref="mime:part" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- <element name="part" type="mime:tPart"/>
- <complexType name="tPart">
- <sequence>
- <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NMTOKEN" use="optional"/>
- </complexType>
- <element name="mimeXml" type="mime:tMimeXml"/>
- <complexType name="tMimeXml">
- <complexContent>
- <extension base="wsdl:tExtensibilityElement">
- <sequence/>
- <attribute name="part" type="NMTOKEN" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/bundles/org.eclipse.wst.wsdl/xsd/wsdl.xsd b/bundles/org.eclipse.wst.wsdl/xsd/wsdl.xsd
deleted file mode 100644
index c1b17a0..0000000
--- a/bundles/org.eclipse.wst.wsdl/xsd/wsdl.xsd
+++ /dev/null
@@ -1,312 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-
-Copyright 2001-2003 International Business Machines Corporation, Microsoft Corporation. All rights reserved.
-
-The presentation, distribution or other dissemination of the
-information contained herein by Microsoft is not a license,
-either expressly or impliedly, to any intellectual property owned or
-controlled by Microsoft.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and to the maximum extent permitted by applicable law,
-Microsoft provides the document AS IS AND WITH ALL FAULTS, and hereby
-disclaims all other warranties and conditions, either express, implied
-or statutory, including, but not limited to, any (if any) implied
-warranties, duties or conditions of merchantability, of fitness for a
-particular purpose, of accuracy or completeness of responses, of
-results, of workmanlike effort, of lack of viruses, and of lack of
-negligence, all with regard to the document. ALSO, THERE IS NO
-WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION,
-CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THE
-DOCUMENT.
-
-IN NO EVENT WILL MICROSOFT BE LIABLE TO ANY OTHER PARTY FOR THE COST
-OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE,
-LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR
-SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE,
-ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS
-DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- targetNamespace="http://schemas.xmlsoap.org/wsdl/"
- elementFormDefault="qualified" >
-
- <xs:complexType mixed="true" name="tDocumentation" >
- <xs:sequence>
- <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="tDocumented" >
- <xs:annotation>
- <xs:documentation>
- This type is extended by component types to allow them to be documented
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="documentation" type="wsdl:tDocumentation" minOccurs="0" />
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="tExtensibleAttributesDocumented" abstract="true" >
- <xs:complexContent>
- <xs:extension base="wsdl:tDocumented" >
- <xs:annotation>
- <xs:documentation>
- This type is extended by component types to allow attributes from other namespaces to be added.
- </xs:documentation>
- </xs:annotation>
- <xs:anyAttribute namespace="##other" processContents="lax" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tExtensibleDocumented" abstract="true" >
- <xs:complexContent>
- <xs:extension base="wsdl:tDocumented" >
- <xs:annotation>
- <xs:documentation>
- This type is extended by component types to allow attributes from other namespaces to be added.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
- </xs:sequence>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="definitions" type="wsdl:tDefinitions" >
- <xs:key name="message" >
- <xs:selector xpath="wsdl:message" />
- <xs:field xpath="@name" />
- </xs:key>
- <xs:key name="portType" >
- <xs:selector xpath="wsdl:portType" />
- <xs:field xpath="@name" />
- </xs:key>
- <xs:key name="binding" >
- <xs:selector xpath="wsdl:binding" />
- <xs:field xpath="@name" />
- </xs:key>
- <xs:key name="service" >
- <xs:selector xpath="wsdl:service" />
- <xs:field xpath="@name" />
- </xs:key>
- <xs:key name="import" >
- <xs:selector xpath="wsdl:import" />
- <xs:field xpath="@namespace" />
- </xs:key>
- </xs:element>
-
- <xs:group name="anyTopLevelOptionalElement" >
- <xs:annotation>
- <xs:documentation>
- Any top level optional element allowed to appear more then once - any child of definitions element except wsdl:types. Any extensibility element is allowed in any place.
- </xs:documentation>
- </xs:annotation>
- <xs:choice>
- <xs:element name="import" type="wsdl:tImport" />
- <xs:element name="types" type="wsdl:tTypes" />
- <xs:element name="message" type="wsdl:tMessage" >
- <xs:unique name="part" >
- <xs:selector xpath="wsdl:part" />
- <xs:field xpath="@name" />
- </xs:unique>
- </xs:element>
- <xs:element name="portType" type="wsdl:tPortType" />
- <xs:element name="binding" type="wsdl:tBinding" />
- <xs:element name="service" type="wsdl:tService" >
- <xs:unique name="port" >
- <xs:selector xpath="wsdl:port" />
- <xs:field xpath="@name" />
- </xs:unique>
- </xs:element>
- <xs:any namespace="##other" processContents="lax" />
- </xs:choice>
- </xs:group>
-
- <xs:complexType name="tDefinitions" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:sequence>
- <xs:group ref="wsdl:anyTopLevelOptionalElement" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="targetNamespace" type="xs:anyURI" use="optional" />
- <xs:attribute name="name" type="xs:NCName" use="optional" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tImport" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
- <xs:attribute name="namespace" type="xs:anyURI" use="required" />
- <xs:attribute name="location" type="xs:anyURI" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tTypes" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" />
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tMessage" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:sequence>
- <xs:element name="part" type="wsdl:tPart" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tPart" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="required" />
- <xs:attribute name="element" type="xs:QName" use="optional" />
- <xs:attribute name="type" type="xs:QName" use="optional" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tPortType" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
- <xs:sequence>
- <xs:element name="operation" type="wsdl:tOperation" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tOperation" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:sequence>
- <xs:choice>
- <xs:group ref="wsdl:request-response-or-one-way-operation" />
- <xs:group ref="wsdl:solicit-response-or-notification-operation" />
- </xs:choice>
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- <xs:attribute name="parameterOrder" type="xs:NMTOKENS" use="optional" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:group name="request-response-or-one-way-operation" >
- <xs:sequence>
- <xs:element name="input" type="wsdl:tParam" />
- <xs:sequence minOccurs='0' >
- <xs:element name="output" type="wsdl:tParam" />
- <xs:element name="fault" type="wsdl:tFault" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:sequence>
- </xs:group>
-
- <xs:group name="solicit-response-or-notification-operation" >
- <xs:sequence>
- <xs:element name="output" type="wsdl:tParam" />
- <xs:sequence minOccurs='0' >
- <xs:element name="input" type="wsdl:tParam" />
- <xs:element name="fault" type="wsdl:tFault" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:sequence>
- </xs:group>
-
- <xs:complexType name="tParam" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="optional" />
- <xs:attribute name="message" type="xs:QName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tFault" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleAttributesDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="required" />
- <xs:attribute name="message" type="xs:QName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tBinding" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:sequence>
- <xs:element name="operation" type="wsdl:tBindingOperation" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- <xs:attribute name="type" type="xs:QName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tBindingOperationMessage" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="optional" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tBindingOperationFault" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tBindingOperation" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:sequence>
- <xs:element name="input" type="wsdl:tBindingOperationMessage" minOccurs="0" />
- <xs:element name="output" type="wsdl:tBindingOperationMessage" minOccurs="0" />
- <xs:element name="fault" type="wsdl:tBindingOperationFault" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tService" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:sequence>
- <xs:element name="port" type="wsdl:tPort" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="name" type="xs:NCName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="tPort" >
- <xs:complexContent>
- <xs:extension base="wsdl:tExtensibleDocumented" >
- <xs:attribute name="name" type="xs:NCName" use="required" />
- <xs:attribute name="binding" type="xs:QName" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:attribute name="arrayType" type="xs:string" />
- <xs:attribute name="required" type="xs:boolean" />
- <xs:complexType name="tExtensibilityElement" abstract="true" >
- <xs:attribute ref="wsdl:required" use="optional" />
- </xs:complexType>
-
-</xs:schema>
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/.project b/tests/org.eclipse.wst.wsdl.tests.performance/.project
deleted file mode 100644
index 6c6e861..0000000
--- a/tests/org.eclipse.wst.wsdl.tests.performance/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.wsdl.tests.performance</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/build.properties b/tests/org.eclipse.wst.wsdl.tests.performance/build.properties
deleted file mode 100644
index 7f4b0f7..0000000
--- a/tests/org.eclipse.wst.wsdl.tests.performance/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.performance.jar = performance/
-output.performance.jar = bin/
-bin.includes = plugin.xml,\
- performance.jar,\
- test.xml,\
- data/
-src.includes = data/,\
- build.properties
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/data/StockQuote/StockQuote.wsdl b/tests/org.eclipse.wst.wsdl.tests.performance/data/StockQuote/StockQuote.wsdl
deleted file mode 100644
index 80bf965..0000000
--- a/tests/org.eclipse.wst.wsdl.tests.performance/data/StockQuote/StockQuote.wsdl
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/StockQuote/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StockQuote" targetNamespace="http://tempuri.org/StockQuote/">
- <wsdl:types>
- <xsd:schema targetNamespace="http://tempuri.org/StockQuote/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="getQuoteResponse">
- <xsd:complexType>
- <xsd:all>
- <xsd:element name="tickerSymbol" type="xsd:string"/>
- </xsd:all>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getQuoteRequest">
- <xsd:complexType>
- <xsd:all>
- <xsd:element name="price" type="xsd:float"/>
- </xsd:all>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="Headers">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="header" minOccurs="0" maxOccurs="unbounded">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string"/>
- <xsd:element name="value" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name="getQuoteResponse">
- <wsdl:part element="tns:getQuoteResponse" name="getQuoteResponse"/>
- <wsdl:part element="tns:Headers" name="headers"/>
- </wsdl:message>
- <wsdl:message name="getQuoteRequest">
- <wsdl:part element="tns:getQuoteRequest" name="getQuoteRequest"/>
- <wsdl:part element="tns:Headers" name="headers"/>
- </wsdl:message>
- <wsdl:portType name="StockQuote">
- <wsdl:operation name="getQuote">
- <wsdl:input message="tns:getQuoteRequest"/>
- <wsdl:output message="tns:getQuoteResponse"/>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="StockQuoteSOAP" type="tns:StockQuote">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="getQuote">
- <soap:operation soapAction="http://tempuri.org/StockQuote/getQuote"/>
- <wsdl:input>
- <soap:body parts="getQuoteRequest" use="literal"/>
- <soap:header message="tns:getQuoteRequest" part="headers" use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body parts="getQuoteResponse" use="literal"/>
- <soap:header message="tns:getQuoteResponse" part="headers" use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="StockQuote">
- <wsdl:port binding="tns:StockQuoteSOAP" name="StockQuoteSOAP">
- <soap:address location="http://tempuri.org"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/AllTests.java b/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/AllTests.java
deleted file mode 100644
index 0e42e53..0000000
--- a/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/AllTests.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.wst.wsdl.tests.performance;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests
-{
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Test for org.eclipse.wst.wsdl.tests.performance");
- //$JUnit-BEGIN$
- suite.addTestSuite(ReadStockQuoteWSDLTestCase.class);
- suite.addTestSuite(OpenStockQuoteWSDLSetup.class);
- suite.addTestSuite(OpenStockQuoteWSDLTestCase.class);
- //$JUnit-END$
- return suite;
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/OpenStockQuoteWSDLSetup.java b/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/OpenStockQuoteWSDLSetup.java
deleted file mode 100644
index 5d5c4ce..0000000
--- a/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/OpenStockQuoteWSDLSetup.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.wst.wsdl.tests.performance;
-
-import java.io.IOException;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.intro.IIntroManager;
-import org.eclipse.ui.intro.IIntroPart;
-
-public class OpenStockQuoteWSDLSetup extends TestCase
-{
- public static String PROJECT_NAME = "Project";
-
- public static Test suite()
- {
- return new TestSuite(OpenStockQuoteWSDLSetup.class, "OpenStockQuoteWSDLSetup");
- }
-
- protected void closeIntro()
- {
- IIntroManager introManager = PlatformUI.getWorkbench().getIntroManager();
- IIntroPart introPart = introManager.getIntro();
- if (introPart != null)
- introManager.closeIntro(introPart);
- }
-
- protected IProject createSimpleProject(String name) throws CoreException
- {
- IProject simpleProject = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- simpleProject.create(null);
- simpleProject.open(null);
- return simpleProject;
- }
-
- protected void copyFile(IProject project, String source, String dest) throws IOException, CoreException
- {
- IFile file = project.getFile(dest);
- file.create(PerformancePlugin.getDefault().getBundle().getEntry(source).openStream(), true, null);
- }
-
- protected void joinAutoBuild() throws CoreException
- {
- boolean interrupted = true;
- while (interrupted)
- {
- try
- {
- Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
- interrupted = false;
- }
- catch (InterruptedException e)
- {
- interrupted = true;
- }
- }
- }
-
- public void testSetup() throws Exception
- {
- closeIntro();
- IProject project = createSimpleProject(PROJECT_NAME);
- copyFile(project, "data/StockQuote/StockQuote.wsdl", "StockQuote.wsdl");
- joinAutoBuild();
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/OpenStockQuoteWSDLTestCase.java b/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/OpenStockQuoteWSDLTestCase.java
deleted file mode 100644
index 471912f..0000000
--- a/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/OpenStockQuoteWSDLTestCase.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.wst.wsdl.tests.performance;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.test.performance.PerformanceTestCase;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-
-public class OpenStockQuoteWSDLTestCase extends PerformanceTestCase
-{
- private final String EDITOR_ID = "org.eclipse.wst.wsdl.editor.internal.WSDLEditor";
-
- public static Test suite()
- {
- return new TestSuite(OpenStockQuoteWSDLTestCase.class, "OpenStockQuoteWSDLTestCase");
- }
-
- protected IProject getProject(String projectName) throws CoreException
- {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- assertTrue(project.exists());
- project.open(null);
- project.refreshLocal(IProject.DEPTH_INFINITE, null);
- joinAutoBuild();
- return project;
- }
-
- protected void joinAutoBuild() throws CoreException
- {
- boolean interrupted = true;
- while (interrupted)
- {
- try
- {
- Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
- interrupted = false;
- }
- catch (InterruptedException e)
- {
- interrupted = true;
- }
- }
- }
-
- protected IEditorPart openEditor(IEditorInput editorInput, String editorid) throws PartInitException
- {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- return workbenchWindow.getActivePage().openEditor(editorInput, editorid, true);
- }
-
- protected boolean closeEditor(IEditorPart editor)
- {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- return workbenchWindow.getActivePage().closeEditor(editor, false);
- }
-
- public void testOpenStockQuoteWSDL() throws Exception
- {
- IProject project = getProject(OpenStockQuoteWSDLSetup.PROJECT_NAME);
- IEditorInput editorInput = new FileEditorInput((IFile)project.findMember("StockQuote.wsdl"));
- startMeasuring();
- IEditorPart editorPart = openEditor(editorInput, EDITOR_ID);
- stopMeasuring();
- commitMeasurements();
- assertPerformance();
- closeEditor(editorPart);
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/PerformancePlugin.java b/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/PerformancePlugin.java
deleted file mode 100644
index 478f4ab..0000000
--- a/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/PerformancePlugin.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.wst.wsdl.tests.performance;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-import java.util.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class PerformancePlugin extends Plugin {
- //The shared instance.
- private static PerformancePlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public PerformancePlugin() {
- super();
- plugin = this;
- }
-
- /**
- * 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);
- plugin = null;
- resourceBundle = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static PerformancePlugin 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 = PerformancePlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.wsdl.tests.performance.PerformancePluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/ReadStockQuoteWSDLTestCase.java b/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/ReadStockQuoteWSDLTestCase.java
deleted file mode 100644
index a78fc6b..0000000
--- a/tests/org.eclipse.wst.wsdl.tests.performance/performance/org/eclipse/wst/wsdl/tests/performance/ReadStockQuoteWSDLTestCase.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.wst.wsdl.tests.performance;
-
-import java.net.URL;
-import javax.wsdl.Definition;
-import javax.wsdl.xml.WSDLReader;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.test.performance.PerformanceTestCase;
-import org.eclipse.wst.wsdl.internal.impl.wsdl4j.WSDLFactoryImpl;
-import org.xml.sax.InputSource;
-
-public class ReadStockQuoteWSDLTestCase extends PerformanceTestCase
-{
- public static Test suite()
- {
- return new TestSuite(ReadStockQuoteWSDLTestCase.class, "ReadStockQuoteWSDLTestCase");
- }
-
- public void testReadStockQuoteWSDL() throws Exception
- {
- startMeasuring();
- URL wsdl = PerformancePlugin.getDefault().getBundle().getEntry("data/StockQuote/StockQuote.wsdl");
- WSDLFactoryImpl factory = new WSDLFactoryImpl();
- WSDLReader reader = factory.newWSDLReader();
- Definition definition = reader.readWSDL(wsdl.toString(), new InputSource(wsdl.openStream()));
- stopMeasuring();
- commitMeasurements();
- assertPerformance();
- }
-}
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/plugin.xml b/tests/org.eclipse.wst.wsdl.tests.performance/plugin.xml
deleted file mode 100644
index ec3dd74..0000000
--- a/tests/org.eclipse.wst.wsdl.tests.performance/plugin.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.wsdl.tests.performance"
- name="WSDL Performance Plug-in"
- version="1.0.0"
- provider-name=""
- class="org.eclipse.wst.wsdl.tests.performance.PerformancePlugin">
-
- <runtime>
- <library name="performance.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.junit"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.test.performance"/>
- <import plugin="org.eclipse.wst.wsdl"/>
- </requires>
-
-</plugin>
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/test.xml b/tests/org.eclipse.wst.wsdl.tests.performance/test.xml
deleted file mode 100644
index ea03944..0000000
--- a/tests/org.eclipse.wst.wsdl.tests.performance/test.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="performance" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <property name="eclipse-home" value="${basedir}\..\.."/>
-
- <!-- sets the properties eclipse-home, and library-file -->
- <property name="plugin-name" value="org.eclipse.wst.wsdl.tests.performance"/>
- <property name="library-file"
- value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
-
- <property name="workspace" value="${eclipse-home}/workspace_wsdl_performance"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org.eclipse.wst.wsdl.tests.performance*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the performance tests that need to be run. -->
- <target name="performance_suite">
-
- <delete dir="${workspace}" quiet="true"/>
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${workspace}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.wst.wsdl.tests.performance.ReadStockQuoteWSDLTestCase"/>
- </ant>
-
- <delete dir="${workspace}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${workspace}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.wst.wsdl.tests.performance.OpenStockQuoteWSDLSetup"/>
- </ant>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${workspace}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.wst.wsdl.tests.performance.OpenStockQuoteWSDLTestCase"/>
- </ant>
-
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- <delete dir="${workspace}" quiet="true"/>
- </target>
-
- <!-- This target runs the performance test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="performance" depends="init,performance_suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org.eclipse.wst.wsdl.tests.performance*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-
-</project>