Author: dennyxu
Date: 2008-06-10 06:26:03 -0400 (Tue, 10 Jun 2008)
New Revision: 8672
Removed:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossStatusUtils.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeManager.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSClassPathCommand.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSRuntimeCommand.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/IJBossWSFacetDataModelProperties.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/utils/JbossWSCoreUtils.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/JBossWSCreationCore.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/BindingFilesValidationCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java
Log:
JBIDE-2262: change the way of getting runtime location of Jboss web service runtime
location,
Modified: trunk/ws/plugins/org.jboss.tools.ws.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.core/META-INF/MANIFEST.MF 2008-06-10 10:24:27 UTC
(rev 8671)
+++ trunk/ws/plugins/org.jboss.tools.ws.core/META-INF/MANIFEST.MF 2008-06-10 10:26:03 UTC
(rev 8672)
@@ -19,7 +19,8 @@
org.eclipse.jdt.launching,
org.eclipse.jst.jsf.core,
org.eclipse.jst.jsf.ui,
- org.eclipse.jdt.launching
+ org.eclipse.jdt.launching,
+ org.eclipse.jst.j2ee
Eclipse-LazyStart: true
Bundle-Vendor: %PLUGIN_PROVIDER
Export-Package: org.jboss.tools.ws.core,
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -5,6 +5,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.ClasspathContainerInitializer;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
@@ -67,7 +68,8 @@
public IClasspathEntry[] getClasspathEntries() {
if (entries == null) {
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
- IPath wsPath = JbossWSCoreUtils.getJbossWSRuntimePath(segment);
+ JbossWSRuntime jbws =
JbossWSRuntimeManager.getInstance().findRuntimeByName(segment);
+ IPath wsPath = new Path(jbws.getHomeDir());
if (wsPath != null) {
IPath libPath = wsPath.append(JbossWSCoreMessages.Dir_Lib);
list.addAll(Arrays.asList(getEntries(libPath)));
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeManager.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeManager.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeManager.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -246,9 +246,7 @@
e.printStackTrace();
}
for (IFacetedProject facetedProject : facetedProjects) {
- QualifiedName qRuntimeName = new QualifiedName(
- IJBossWSFacetDataModelProperties.QUALIFIEDNAME_IDENTIFIER_IS_SERVER_SUPPLIED,
- IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_ID);
+ QualifiedName qRuntimeName =
IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME;
String name = null;
try {
name = facetedProject.getProject().getPersistentProperty(qRuntimeName);
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSClassPathCommand.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSClassPathCommand.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSClassPathCommand.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -21,10 +21,14 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IAccessRule;
+import org.eclipse.jdt.core.IClasspathAttribute;
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.classpathdep.ClasspathDependencyUtil;
+import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
@@ -56,27 +60,29 @@
boolean isServerSupplied = model
.getBooleanProperty(IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_IS_SERVER_SUPPLIED);
if (isServerSupplied) {
- QualifiedName serverSupplied_qn = new QualifiedName(
- IJBossWSFacetDataModelProperties.QUALIFIEDNAME_IDENTIFIER_IS_SERVER_SUPPLIED,
- IJBossWSFacetDataModelProperties.PERSISTENT_PROPERTY_IS_SERVER_SUPPLIED_RUNTIME);
- project.setPersistentProperty(serverSupplied_qn, "1");
+ project
+ .setPersistentProperty(
+ IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_SERVER_SUPPLIED_RUNTIME,
+ IJBossWSFacetDataModelProperties.DEFAULT_VALUE_IS_SERVER_SUPPLIED);
} else {
// store runtime name and runtime location to the project
- QualifiedName qRuntimeName = new QualifiedName(
- IJBossWSFacetDataModelProperties.QUALIFIEDNAME_IDENTIFIER_IS_SERVER_SUPPLIED,
- IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_ID);
- QualifiedName qRuntimeLocation = new QualifiedName(
- IJBossWSFacetDataModelProperties.QUALIFIEDNAME_IDENTIFIER_IS_SERVER_SUPPLIED,
- IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_ID);
+
String runtimeName = model
.getStringProperty(IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_ID);
String runtimeLocation = model
.getStringProperty(IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_HOME);
- project.setPersistentProperty(qRuntimeName, runtimeName);
project
- .setPersistentProperty(qRuntimeLocation,
+ .setPersistentProperty(
+ IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME,
+ runtimeName);
+ project
+ .setPersistentProperty(
+ IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_RNTIME_LOCATION,
runtimeLocation);
- status = addClassPath(project, runtimeName);
+ boolean isDeployed = model
+ .getBooleanProperty(IJBossWSFacetDataModelProperties.JBOSS_WS_DEPLOY);
+
+ status = addClassPath(project, runtimeName, isDeployed);
}
} catch (CoreException e) {
@@ -86,14 +92,29 @@
return status;
}
- public IStatus addClassPath(IProject project, String segment) {
+ public IStatus addClassPath(IProject project, String segment,
+ boolean isDeployed) {
IStatus status = Status.OK_STATUS;
try {
+ IClasspathEntry newClasspath;
IJavaProject javaProject = JavaCore.create(project);
- IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path(
- JbossWSCoreMessages.JBossWS_Runtime_Lib).append(segment));
+ if (isDeployed) {
+ IClasspathAttribute depAttrib = JavaCore
+ .newClasspathAttribute(
+ IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
+ ClasspathDependencyUtil.getDefaultRuntimePath(
+ true).toString());
+ newClasspath = JavaCore.newContainerEntry(new Path(
+ JbossWSCoreMessages.JBossWS_Runtime_Lib)
+ .append(segment), null,
+ new IClasspathAttribute[] { depAttrib }, true);
+ } else {
+ newClasspath = JavaCore.newContainerEntry(new Path(
+ JbossWSCoreMessages.JBossWS_Runtime_Lib)
+ .append(segment));
+ }
IClasspathEntry[] oldClasspathEntries = javaProject
.readRawClasspath();
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSRuntimeCommand.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSRuntimeCommand.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSRuntimeCommand.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
@@ -45,7 +46,7 @@
IStatus status = Status.OK_STATUS;
// copy lib jars to project's folder
- IPath wsPath = JbossWSCoreUtils.getJbossWSRuntimePath(null);
+ IPath wsPath = new Path("");
IPath libPath = null;
try {
libPath = wsPath.append(JbossWSCoreMessages.Dir_Lib);
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/IJBossWSFacetDataModelProperties.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/IJBossWSFacetDataModelProperties.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/IJBossWSFacetDataModelProperties.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -11,38 +11,31 @@
package org.jboss.tools.ws.core.facet.delegate;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
-/**
- * Seam facet properties collected in Seam Web Project Wizard.
- * Only properties listed below are saved in Seam WebProject Preferences:
- * ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER,
- * ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME,
- * ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER,
- * ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME,
- * ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE,
- * ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
- * ISeamFacetDataModelProperties.SEAM_TEST_PROJECT,
- * ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
- * ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION,
- * ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER,
- * ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME,
- * ISeamFacetDataModelProperties.TEST_CREATING,
- * ISeamFacetDataModelProperties.SEAM_EJB_PROJECT,
- * ISeamFacetDataModelProperties.SEAM_EAR_PROJECT
- * @author eskimo
- */
+
public interface IJBossWSFacetDataModelProperties extends IActionConfigFactory {
// Seam Preferences names constants
String JBOSS_WS_FACET_ID = "jbossws.core";
+ String JBOSS_WS_DEPLOY = "jboss.ws.deploy";
+ String QUALIFIEDNAME_IDENTIFIER = "jboss.tools.jbossws";
String JBOSS_WS_RUNTIME_IS_SERVER_SUPPLIED = "jboss.ws.is.server.supplied";
String JBOSS_WS_RUNTIME_ID = "jboss.ws.runtime_id";
- String JBOSS_WS_DEPLOY = "jboss.ws.deploy";
- String JBOSS_WS_RUNTIME_HOME = "jboss.ws.runtime.home";
- String QUALIFIEDNAME_IDENTIFIER_IS_SERVER_SUPPLIED = "jboss.tools.jbossws";
+
String PERSISTENT_PROPERTY_IS_SERVER_SUPPLIED_RUNTIME =
"is.server.supplied.runtime";
+ String JBOSS_WS_RUNTIME_HOME = "jboss.ws.runtime.home";
+ String DEFAULT_VALUE_IS_SERVER_SUPPLIED = "1";
+
+ QualifiedName PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME = new
QualifiedName(QUALIFIEDNAME_IDENTIFIER,
+ JBOSS_WS_RUNTIME_ID);
+ QualifiedName PERSISTENCE_PROPERTY_RNTIME_LOCATION = new
QualifiedName(QUALIFIEDNAME_IDENTIFIER,
+ JBOSS_WS_RUNTIME_HOME);
+ QualifiedName PERSISTENCE_PROPERTY_SERVER_SUPPLIED_RUNTIME = new QualifiedName(
+ QUALIFIEDNAME_IDENTIFIER,
+ PERSISTENT_PROPERTY_IS_SERVER_SUPPLIED_RUNTIME);
}
\ No newline at end of file
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/utils/JbossWSCoreUtils.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/utils/JbossWSCoreUtils.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/utils/JbossWSCoreUtils.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -220,27 +220,7 @@
}
}
- public static IPath getJbossWSRuntimePath(String runtimeName) {
- JbossWSRuntime[] runtimes = JbossWSRuntimeManager.getInstance().getRuntimes();
- if(runtimes == null || runtimes.length == 0){
- return null;
- }
- if (runtimeName == null || runtimeName.equals("")) {
- for (JbossWSRuntime rt : runtimes) {
- if (rt.isDefault()) {
- return new Path(rt.getHomeDir());
- }
- }
- return null;
- } else {
- for (JbossWSRuntime rt : runtimes) {
- if(rt.getName().equals(runtimeName)){
- return new Path(rt.getHomeDir());
- }
- }
- }
- return null;
- }
+
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF 2008-06-10
10:24:27 UTC (rev 8671)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF 2008-06-10
10:26:03 UTC (rev 8672)
@@ -26,7 +26,10 @@
org.eclipse.jdt.core,
org.eclipse.jface.text,
org.eclipse.core.filebuffers,
- org.eclipse.jdt.ui
+ org.eclipse.jdt.ui,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.wst.server.core,
+ org.jboss.tools.common
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.ws.creation.core,
org.jboss.tools.ws.creation.core.commands,
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/JBossWSCreationCore.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/JBossWSCreationCore.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/JBossWSCreationCore.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -1,12 +1,12 @@
package org.jboss.tools.ws.creation.core;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.common.log.BaseUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
-public class JBossWSCreationCore extends AbstractUIPlugin {
+public class JBossWSCreationCore extends BaseUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.tools.ws.creation.core";
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/BindingFilesValidationCommand.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/BindingFilesValidationCommand.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/BindingFilesValidationCommand.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -12,9 +12,9 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.jboss.tools.ws.core.utils.StatusUtils;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
-import org.jboss.tools.ws.creation.core.utils.JBossStatusUtils;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
@@ -64,13 +64,13 @@
reader.parse(is);
} catch (SAXException e) {
- return JBossStatusUtils
+ return StatusUtils
.errorStatus(
NLS.bind(JBossWSCreationCoreMessages.Error_Message_Invalid_Binding_File,
new String[] {filename, e.getLocalizedMessage() }), e);
} catch (IOException e) {
- return JBossStatusUtils
+ return StatusUtils
.errorStatus(
NLS.bind(JBossWSCreationCoreMessages.Error_Message_Invalid_Binding_File,
new String[] {filename, e.getLocalizedMessage() }), e);
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -30,16 +30,10 @@
import org.eclipse.jdt.core.dom.Block;
import org.eclipse.jdt.core.dom.BooleanLiteral;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ExpressionStatement;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
import org.eclipse.jdt.core.dom.ImportDeclaration;
-import org.eclipse.jdt.core.dom.InfixExpression;
-import org.eclipse.jdt.core.dom.Initializer;
import org.eclipse.jdt.core.dom.MemberValuePair;
import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.MethodInvocation;
import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jdt.core.dom.Name;
import org.eclipse.jdt.core.dom.NormalAnnotation;
import org.eclipse.jdt.core.dom.NumberLiteral;
import org.eclipse.jdt.core.dom.PackageDeclaration;
@@ -52,16 +46,15 @@
import org.eclipse.jdt.core.dom.StringLiteral;
import org.eclipse.jdt.core.dom.Type;
import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
import org.eclipse.jdt.core.dom.WildcardType;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Document;
-import org.eclipse.text.edits.MalformedTreeException;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.jboss.tools.ws.core.utils.StatusUtils;
+import org.jboss.tools.ws.creation.core.JBossWSCreationCore;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
-import org.jboss.tools.ws.creation.core.utils.JBossStatusUtils;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
public class ImplementationClassCreationCommand extends
@@ -70,7 +63,6 @@
private static final String RESOURCE_FOLDER = "src";
private static final String PREFIX_JAXWS_ANNOTATION_CLASS = "javax.jws";
- private static final String SUFFIX_PACKAGENAME_IMPL = "impl";
private static final String DEFAULT_CU_SUFFIX = ".java";
private static final String ANNOTATION_WEB_SERVICE_FULLNAME =
"javax.jws.WebService";
@@ -79,11 +71,6 @@
private static final String ANNOTATION_PROPERTY_SERVICE_NAME = "serviceName";
private static final String ANNOTATION_PROPERTY_ENDPOINT_INTERFACE =
"endpointInterface";
- private static final String LOGGER_FIELD_NAME = "log";
- private static final String LOGGER_CLASS_FULLNAME =
"org.jboss.logging.Logger";
- private static final String LOGGER_CLASS_NAME = "Logger";
- private static final String LOGGER_METHOD_NAME_GETLOGGER = "getLogger";
- private static final String LOGGER_METHOD_NAME_INFO = "info";
private ServiceModel model;
private IWorkspaceRoot fWorkspaceRoot;
@@ -108,35 +95,31 @@
}
} catch (CoreException e) {
- status = JBossStatusUtils
+ status = StatusUtils
.errorStatus(
- JBossWSCreationCoreMessages.Error_Message_Invalid_Binding_File,
+ JBossWSCreationCoreMessages.Error_Message_Failed_to_Generate_Implementation,
e);
- } catch (MalformedTreeException e) {
- status = JBossStatusUtils
- .errorStatus(
- JBossWSCreationCoreMessages.Error_Message_Invalid_Binding_File,
- e);
+ JBossWSCreationCore.getDefault().logError(e);
} catch (BadLocationException e) {
- status = JBossStatusUtils
+ status = StatusUtils
.errorStatus(
- JBossWSCreationCoreMessages.Error_Message_Invalid_Binding_File,
+ JBossWSCreationCoreMessages.Error_Message_Failed_to_Generate_Implementation,
e);
+ JBossWSCreationCore.getDefault().logError(e);
}
return status;
}
protected void generateImplClass(String portTypeName/* , IFile implJavaFile */)
- throws CoreException, MalformedTreeException, BadLocationException {
+ throws CoreException, BadLocationException {
CompilationUnit portTypeCU = getCompilationUnitForInterface(portTypeName);
- Object obj = portTypeCU.imports();
List<ImportDeclaration> imports = getImportsWithoutJaxwsAnnotation(portTypeCU);
IPackageFragment pack = getImplPakcage();
- String cuName = getJavaFileName(portTypeName);
- ICompilationUnit icu = pack.createCompilationUnit(cuName,
+ String implFileName = getJavaFileName(portTypeName);
+ ICompilationUnit icu = pack.createCompilationUnit(implFileName,
"", true, null); //$NON-NLS-1$
// create a working copy with a new owner
@@ -270,7 +253,7 @@
implCU.imports().add(newId);
}
- // import port type interface and jboss Logger
+ // import port type interface
ImportDeclaration importDec = implAST.newImportDeclaration();
QualifiedName portTypeImport = implAST.newQualifiedName(implAST
.newName(portTypeCU.getPackage().getName()
@@ -278,8 +261,8 @@
.newSimpleName(portTypeName));
importDec.setName(portTypeImport);
implCU.imports().add(importDec);
- importDec = implAST.newImportDeclaration();
- importDec.setName(implAST.newName(LOGGER_CLASS_FULLNAME));
+ //importDec = implAST.newImportDeclaration();
+ //importDec.setName(implAST.newName(LOGGER_CLASS_FULLNAME));
implCU.imports().add(importDec);
// import jaxws WebService
@@ -391,40 +374,6 @@
return md;
}
-/* protected FieldDeclaration createLoggerField(AST ast, TypeDeclaration type, String
portTypeName) {
- VariableDeclarationFragment vdf = ast.newVariableDeclarationFragment();
- vdf.setName(ast.newSimpleName(LOGGER_FIELD_NAME));
- Initializer clsAccesss = ast.newInitializer();
- FieldDeclaration fd = ast.newFieldDeclaration(vdf);
- fd.modifiers().add(ast.newModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD));
- fd.modifiers().add(ast.newModifier(Modifier.ModifierKeyword.STATIC_KEYWORD));
- fd.setType(ast.newSimpleType(ast.newSimpleName(LOGGER_CLASS_NAME)));
- MethodInvocation mi = ast.newMethodInvocation();
- mi.setExpression(ast.newSimpleName(LOGGER_CLASS_NAME));
- mi.setName(ast.newSimpleName(LOGGER_METHOD_NAME_GETLOGGER));
- String implClsName = getImplPackageName() + "." +
getImplClassName(portTypeName);
- StringLiteral sl = ast.newStringLiteral();
- sl.setLiteralValue(implClsName);
- mi.arguments().add(sl);
- vdf.setInitializer(mi);
- type.bodyDeclarations().add(fd);
-
- return fd;
- }
-
- protected ExpressionStatement createLoggerInvokeStatement(AST ast, String methodName){
- MethodInvocation methodInvocation = ast.newMethodInvocation();
- Name fieldName = ast.newSimpleName(LOGGER_FIELD_NAME);
- methodInvocation.setExpression(fieldName);
- methodInvocation.setName(ast.newSimpleName(LOGGER_METHOD_NAME_INFO));
- StringLiteral param = ast.newStringLiteral();
- param.setLiteralValue("The method: " + methodName + "() is
invoked.");
- methodInvocation.arguments().add(param);
- ExpressionStatement infoStatement = ast.newExpressionStatement(methodInvocation);
-
- return infoStatement;
-
- }*/
private Type copyTypeFromOtherASTNode(AST ast, Type type) {
if (type instanceof PrimitiveType) {
@@ -468,8 +417,11 @@
return importList;
}
- private CompilationUnit getCompilationUnitForInterface(String portTypeName) {
+ private CompilationUnit getCompilationUnitForInterface(String portTypeName) throws
CoreException {
IFile inFile = getServiceInterfaceFile(portTypeName);
+ if(!inFile.exists()){
+ throw new
CoreException(StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_Message_Failed_To_Generate_Code));
+ }
ICompilationUnit icu = JBossWSCreationUtils.getJavaUnitFromFile(inFile);
ASTParser astp = ASTParser.newParser(AST.JLS3);
astp.setSource(icu);
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -12,6 +12,7 @@
import org.eclipse.wst.ws.internal.wsrt.IWebService;
import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
import org.jboss.tools.ws.core.JbossWSCorePlugin;
+import org.jboss.tools.ws.creation.core.JBossWSCreationCore;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
@@ -48,6 +49,7 @@
model.setPortTypeList(reader.getPortTypeList());
} catch (WSDLException e) {
+ JBossWSCreationCore.getDefault().logError(e);
return StatusUtils.errorStatus(e.getLocalizedMessage(), e);
}
} else {
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -2,30 +2,35 @@
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import java.util.List;
-import javax.xml.parsers.SAXParserFactory;
-
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.jboss.tools.ws.core.JbossWSCorePlugin;
+import org.jboss.tools.ws.core.utils.StatusUtils;
+import org.jboss.tools.ws.creation.core.JBossWSCreationCore;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
-import org.jboss.tools.ws.creation.core.utils.JBossStatusUtils;
+import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
public class WSDL2JavaCommand extends AbstractDataModelOperation{
private ServiceModel model;
+ private static String WSCONSUEM_FILE_NAME_LINUX = "wsconsume.sh";
+ private static String WSCONSUEM_FILE_NAME_WIN = "wsconsume.bat";
-
public WSDL2JavaCommand(ServiceModel model){
this.model = model;
}
@@ -33,17 +38,31 @@
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
-
- String runtimeLocation =
JbossWSCorePlugin.getDefault().getPreferenceStore().getString("jbosswsruntimelocation");
- String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
- String command = "sh wsconsume.sh ";
- if(System.getProperty("os.name").toLowerCase().indexOf("win") >=
0){
- command = "cmd.exe /c wsconsume.bat ";
- }
- String args = getCommandlineArgs();
- command += " -k " + args + " " + model.getWsdlURI();
+ IStatus status = Status.OK_STATUS;
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(model
+ .getWebProjectName());
+
try {
+ String runtimeLocation = JBossWSCreationUtils.getJbossWSRuntimeLocation(project);
+ String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
+ IPath path = new Path(commandLocation);
+ String command = "sh " + WSCONSUEM_FILE_NAME_LINUX;
+ if(System.getProperty("os.name").toLowerCase().indexOf("win")
>= 0){
+ command = "cmd.exe /c " + WSCONSUEM_FILE_NAME_WIN;
+ path.append(WSCONSUEM_FILE_NAME_WIN);
+ }else{
+ path.append(WSCONSUEM_FILE_NAME_LINUX);
+ }
+
+ if(!path.toFile().exists()){
+ return StatusUtils.errorStatus(
+ NLS.bind(JBossWSCreationCoreMessages.Error_Message_Command_File_Not_Found,
+ new String[] {path.toOSString()}));
+ }
+
+ String args = getCommandlineArgs();
+ command += " -k " + args + " " + model.getWsdlURI();
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(command, null, new File(commandLocation));
InputStreamReader ir = new InputStreamReader(proc.getErrorStream());
@@ -57,29 +76,46 @@
}
int exitValue = proc.waitFor();
if(exitValue != 0){
- return JBossStatusUtils.errorStatus(result.toString());
+ return StatusUtils.errorStatus(result.toString());
}
+
+ // log the result of the command execution
+
JBossWSCreationCore.getDefault().logInfo(convertInputStreamToString(proc.getInputStream()));
+ } catch (IOException e) {
+ JBossWSCreationCore.getDefault().logError(e);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
} catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ // ignore
+ } catch (CoreException e) {
+ JBossWSCreationCore.getDefault().logError(e);
+ //unable to get runtime location
+ return e.getStatus();
}
refreshProject(model.getWebProjectName(), monitor);
- return Status.OK_STATUS;
+ return status;
}
+ private String convertInputStreamToString(InputStream input) throws IOException{
+ InputStreamReader ir = new InputStreamReader(input);
+ LineNumberReader reader = new LineNumberReader(ir);
+ String str = reader.readLine();
+ StringBuffer result = new StringBuffer();
+ while(str != null){
+ result.append(str).append("\t\r");
+ str = reader.readLine();
+
+ }
+ return result.toString();
+ }
private void refreshProject(String project, IProgressMonitor monitor){
try {
JBossWSCreationUtils.getProjectByName(project).refreshLocal(2, monitor);
} catch (CoreException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
+ JBossWSCreationCore.getDefault().logError(e);
}
}
@@ -117,28 +153,4 @@
}
-/* private List<String> getEnv(){
- List<String> env = new ArrayList<String>();
-
- String project = model.getWebProjectName();
- String projectRoot = JBossWSCreationUtils.getProjectRoot(project).toOSString();
- env.add("o=" + projectRoot + Path.SEPARATOR + "src");
-
- String customePkg = model.getPackageText();
- if(customePkg != null && !"".equals(customePkg)){
- env.add(" p=" + customePkg);
- }
-
- String bindingFileLocation = model.getBindingFileLocation();
- if(bindingFileLocation != null && !"".equals(bindingFileLocation)){
- File bindingFile = new File(bindingFileLocation);
- if(bindingFile.exists()){
- env.add("b=" + bindingFileLocation);
- }
- }
-
- return env;
-
- }
-*/
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -25,8 +25,8 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.jboss.tools.ws.core.JbossWSCorePlugin;
+import org.jboss.tools.ws.core.utils.StatusUtils;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
-import org.jboss.tools.ws.creation.core.utils.JBossStatusUtils;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
/**
@@ -68,7 +68,7 @@
}
int exitValue = proc.waitFor();
if (exitValue != 0) {
- return JBossStatusUtils.errorStatus(result.toString());
+ return StatusUtils.errorStatus(result.toString());
}
} catch (IOException e) {
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2008-06-10
10:26:03 UTC (rev 8672)
@@ -9,6 +9,10 @@
Error_Message_Invalid_Binding_File={0} is not a valid JAX-WS or JAXB binding file
Error_Read_Binding_File=Exception occurred while reading binding file
+Error_Message_Failed_To_Generate_Code=Failed to Generate code, please read the log for
more details
+Error_Message_Failed_to_Generate_Implementation=Failed to generate implementation class
+Error_Message_Command_File_Not_Found=The command file:{0} does not exist, please check
the JBoss Web Service runtime setting to make sure the location of JBoss Web Service
runtime is valid.
+Error_Message_Execute_Command=Exception occurred while execute JBossWS tool command
Separator_Java=/
Error_Implemetation_Code_Generation=Exception occurred while generating implementation
class
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -27,8 +27,14 @@
public static String Error_Message_Invalid_Binding_File;
public static String Error_Read_Binding_File;
public static String Separator_Java;
+ public static String Error_Message_Failed_To_Generate_Code;
+ public static String Error_Message_Failed_to_Generate_Implementation;
+ public static String Error_Message_Command_File_Not_Found;
+ public static String Error_Message_Execute_Command;
+
+
public static String Error_Implemetation_Code_Generation;
public static String Error_No_Annotation;
public static String WebserviceClient_Annotation;
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossStatusUtils.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossStatusUtils.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossStatusUtils.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -1,24 +0,0 @@
-package org.jboss.tools.ws.creation.core.utils;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-
-public class JBossStatusUtils {
-
- public static IStatus errorStatus(String message, Throwable exc) {
- return new Status(IStatus.ERROR, "id", 0, message, exc);
- }
-
- public static IStatus errorStatus(String message) {
- return new Status(IStatus.ERROR, "id", message);
- }
-
- public static MultiStatus errorMultiStatus(String message, IStatus[] status) {
- return new MultiStatus("id", 0, status, message, null);
- }
-
- public static MultiStatus errorMultiStatus(String message) {
- return new MultiStatus("id", 0, message, null);
- }
-}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -29,6 +29,7 @@
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.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
@@ -39,8 +40,18 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jst.ws.internal.common.J2EEUtils;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.internal.FacetedProject;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
+import org.eclipse.wst.server.core.ServerCore;
import org.jboss.tools.ws.core.JbossWSCorePlugin;
+import org.jboss.tools.ws.core.classpath.JbossWSRuntime;
+import org.jboss.tools.ws.core.classpath.JbossWSRuntimeManager;
+import org.jboss.tools.ws.core.facet.delegate.IJBossWSFacetDataModelProperties;
import org.jboss.tools.ws.core.messages.JbossWSCoreMessages;
+import org.jboss.tools.ws.core.utils.StatusUtils;
public class JBossWSCreationUtils {
@@ -271,4 +282,39 @@
return true;
}
+ public static String getJbossWSRuntimeLocation(IProject project) throws CoreException{
+
+
+ //if users select server as its jbossws runtime, then get runtime location from project
target runtime
+ String isServerSupplied =
project.getPersistentProperty(IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_SERVER_SUPPLIED_RUNTIME);
+ if(IJBossWSFacetDataModelProperties.DEFAULT_VALUE_IS_SERVER_SUPPLIED.equals(isServerSupplied)){
+ IFacetedProject facetedPrj = ProjectFacetsManager.create( project );
+ IRuntime prjRuntime = facetedPrj.getPrimaryRuntime();
+ // TODO get runtime location from specified project target runtime
+ prjRuntime.getRuntimeComponents().get(0).getProperties();
+
+ //if no target runtime specified, get runtime location from default jbossws runtime
from jbossws preference
+ if(prjRuntime == null){
+ JbossWSRuntime jbws = JbossWSRuntimeManager.getInstance().getDefaultRuntime();
+ if(jbws != null){
+ return jbws.getHomeDir();
+ }else{
+ throw new CoreException(StatusUtils.errorStatus("No JBoss Web Service runtime
specified."));
+ }
+
+ }
+ }else{
+ String jbwsRuntimeName =
project.getPersistentProperty(IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME);
+ JbossWSRuntime jbws =
JbossWSRuntimeManager.getInstance().findRuntimeByName(jbwsRuntimeName);
+ if(jbws != null){
+ return jbws.getHomeDir();
+ }else{
+ String jbwsHomeDir =
project.getPersistentProperty(IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_RNTIME_LOCATION);
+ return jbwsHomeDir;
+ }
+ }
+ return "";
+
+ }
+
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java 2008-06-10
10:24:27 UTC (rev 8671)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java 2008-06-10
10:26:03 UTC (rev 8672)
@@ -14,7 +14,6 @@
import java.util.Arrays;
import java.util.EventObject;
import java.util.List;
-import java.util.Map;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
@@ -37,8 +36,6 @@
import org.jboss.tools.ws.core.classpath.JbossWSRuntime;
import org.jboss.tools.ws.core.classpath.JbossWSRuntimeManager;
import org.jboss.tools.ws.core.facet.delegate.IJBossWSFacetDataModelProperties;
-import org.jboss.tools.ws.core.messages.JbossWSCoreMessages;
-import org.jboss.tools.ws.core.utils.JbossWSCoreUtils;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.ui.preferences.JbossRuntimeListFieldEditor;
@@ -138,6 +135,7 @@
btnNew.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
newJBossWSRuntime();
+ changePageStatus();
}
});
@@ -189,7 +187,7 @@
for (int i = 0; i < runtimes.length; i++) {
JbossWSRuntime jr = runtimes[i];
cmRuntime.add(jr.getName());
- cmRuntime.setData(jr.getName(), jr.getHomeDir());
+ cmRuntime.setData(jr.getName(), jr);
// get default jbossws runtime
if (jr.isDefault()) {
@@ -209,6 +207,7 @@
exists, added) {
public boolean performFinish() {
JbossWSRuntime rt = getRuntime();
+ rt.setDefault(true);
JbossWSRuntimeManager.getInstance().addRuntime(rt);
JbossWSRuntimeManager.getInstance().save();
@@ -217,9 +216,9 @@
};
WizardDialog dialog = new WizardDialog(Display.getCurrent()
.getActiveShell(), newRtwizard);
- if (dialog.open() == dialog.OK) {
+ if (dialog.open() == WizardDialog.OK) {
initializeRuntimesCombo(cmbRuntimes);
- cmbRuntimes.select(cmbRuntimes.getItemCount() - 1);
+ //cmbRuntimes.select(0);
}
}