Author: Grid.Qian
Date: 2008-06-16 06:41:18 -0400 (Mon, 16 Jun 2008)
New Revision: 8777
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialClientCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
Log:
JBIDE-2047: add uninstall command for jbossws facet
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialClientCommand.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialClientCommand.java 2008-06-16
10:41:03 UTC (rev 8776)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialClientCommand.java 2008-06-16
10:41:18 UTC (rev 8777)
@@ -14,9 +14,11 @@
import javax.wsdl.WSDLException;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
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.jboss.tools.ws.core.utils.StatusUtils;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
@@ -28,6 +30,7 @@
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
import org.jboss.tools.ws.creation.core.utils.WSDLPropertyReader;
+import org.jboss.tools.ws.ui.messages.JbossWSUIMessages;
/**
* @author Grid Qian
@@ -48,9 +51,17 @@
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- if (!JBossWSCreationUtils.validateJBossWSLocation()) {
- return StatusUtils
- .errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
+ try {
+ String location =
JBossWSCreationUtils.getJbossWSRuntimeLocation(JBossWSCreationUtils.getProjectByName(model.getWebProjectName()));
+ if (location.equals("")) {
+ return StatusUtils
+ .errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
+ } else if(!new
Path(location).append(JbossWSUIMessages.Bin).append(JbossWSUIMessages.Command).toFile().exists()){
+ return StatusUtils
+ .errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
+ }
+ } catch (CoreException e1) {
+ return StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
}
model.setTarget(JBossWSCreationCoreMessages.Value_Target_0);
if (scenario == WebServiceScenario.CLIENT) {
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-16
10:41:03 UTC (rev 8776)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java 2008-06-16
10:41:18 UTC (rev 8777)
@@ -1,11 +1,15 @@
package org.jboss.tools.ws.creation.core.commands;
+import java.io.File;
+
import javax.wsdl.WSDLException;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
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.jboss.tools.ws.core.utils.StatusUtils;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
@@ -17,6 +21,7 @@
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
import org.jboss.tools.ws.creation.core.utils.WSDLPropertyReader;
+import org.jboss.tools.ws.ui.messages.JbossWSUIMessages;
public class InitialCommand extends AbstractDataModelOperation {
@@ -34,9 +39,17 @@
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- if (!JBossWSCreationUtils.validateJBossWSLocation()) {
- return StatusUtils
- .errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
+ try {
+ String location =
JBossWSCreationUtils.getJbossWSRuntimeLocation(JBossWSCreationUtils.getProjectByName(model.getWebProjectName()));
+ if (location.equals("")) {
+ return StatusUtils
+ .errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
+ } else if(!new
Path(location).append(JbossWSUIMessages.Bin).append(JbossWSUIMessages.Command).toFile().exists()){
+ return StatusUtils
+ .errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
+ }
+ } catch (CoreException e1) {
+ return StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_WS_Location);
}
model.setTarget(JBossWSCreationCoreMessages.Value_Target_0);
if (scenario == WebServiceScenario.TOPDOWN) {
Show replies by date