Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2002-11-05 21:46:05 +0000
committerDarin Wright2002-11-05 21:46:05 +0000
commite55458866f495e41e2e5e9aeb913d30368ef1c45 (patch)
treefd3df9badae778f7abb83477e0429bf8a8735470 /org.eclipse.ui.externaltools/Program Tools Support
parent58362093138953ad489f6d1cab1b9e7917715236 (diff)
downloadeclipse.platform.debug-e55458866f495e41e2e5e9aeb913d30368ef1c45.tar.gz
eclipse.platform.debug-e55458866f495e41e2e5e9aeb913d30368ef1c45.tar.xz
eclipse.platform.debug-e55458866f495e41e2e5e9aeb913d30368ef1c45.zip
bug 25746
Diffstat (limited to 'org.eclipse.ui.externaltools/Program Tools Support')
-rw-r--r--org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java58
1 files changed, 4 insertions, 54 deletions
diff --git a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java
index 86081988b..e92f8bec2 100644
--- a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java
+++ b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java
@@ -10,20 +10,16 @@ Contributors:
**********************************************************************/
import java.io.File;
-import java.io.IOException;
import org.eclipse.core.resources.IResource;
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.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
import org.eclipse.ui.externaltools.launchConfigurations.ExternalToolsUtil;
-import org.eclipse.ui.externaltools.model.IExternalToolConstants;
import org.eclipse.ui.externaltools.variable.ExpandVariableContext;
/**
@@ -102,57 +98,11 @@ public class ProgramLaunchDelegate implements ILaunchConfigurationDelegate {
return;
}
- Process p = exec(cmdLine, workingDir);
- DebugPlugin.newProcess(launch, p, location.toOSString());
+ Process p = DebugPlugin.exec(cmdLine, workingDir);
+ if (p != null) {
+ DebugPlugin.newProcess(launch, p, location.toOSString());
+ }
}
- /**
- * Performs a runtime exec on the given command line in the context
- * of the specified working directory, and returns
- * the resulting process. If the current runtime does not support the
- * specification of a working directory, the status handler for error code
- * <code>ERR_WORKING_DIRECTORY_NOT_SUPPORTED</code> is queried to see if the
- * exec should be re-executed without specifying a working directory.
- *
- * @param cmdLine the command line
- * @param workingDirectory the working directory, or <code>null</code>
- * @return the resulting process or <code>null</code> if the exec is
- * cancelled
- * @see Runtime
- *
- * TODO: this should be pushed down to debug core
- */
- protected Process exec(String[] cmdLine, File workingDirectory) throws CoreException {
- Process p= null;
- try {
-
- if (workingDirectory == null) {
- p= Runtime.getRuntime().exec(cmdLine, null);
- } else {
- p= Runtime.getRuntime().exec(cmdLine, null, workingDirectory);
- }
- } catch (IOException e) {
- if (p != null) {
- p.destroy();
- }
- Status status = new Status(IStatus.ERROR, IExternalToolConstants.PLUGIN_ID, 0, "Exception occurred launching process.", e);
- throw new CoreException(status);
- } catch (NoSuchMethodError e) {
- //attempting launches on 1.2.* - no ability to set working directory
- exec(cmdLine, null);
-
-// IStatus status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), IJavaLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_NOT_SUPPORTED, LaunchingMessages.getString("AbstractVMRunner.Eclipse_runtime_does_not_support_working_directory_2"), e); //$NON-NLS-1$
-// IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status);
-//
-// if (handler != null) {
-// Object result = handler.handleStatus(status, this);
-// if (result instanceof Boolean && ((Boolean)result).booleanValue()) {
-// p= exec(cmdLine, null);
-// }
-// }
- }
- return p;
- }
-
}

Back to the top