misc changes
[phpeclipse.git] / net.sourceforge.phpeclipse.launching / src / net / sourceforge / phpdt / internal / launching / PHPLaunchConfigurationDelegate.java
1 package net.sourceforge.phpdt.internal.launching;
2
3 import org.eclipse.core.resources.IFile;
4 import org.eclipse.core.resources.IProject;
5 import org.eclipse.core.runtime.CoreException;
6 import org.eclipse.core.runtime.IProgressMonitor;
7 import org.eclipse.core.runtime.IStatus;
8 import org.eclipse.core.runtime.Status;
9 import org.eclipse.debug.core.ILaunch;
10 import org.eclipse.debug.core.ILaunchConfiguration;
11 import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
12
13
14 public class PHPLaunchConfigurationDelegate implements ILaunchConfigurationDelegate {
15         protected static final InterpreterRunner interpreterRunner = new InterpreterRunner();
16 //      protected static final DebuggerRunner debuggerRunner = new DebuggerRunner();
17
18         public PHPLaunchConfigurationDelegate() {
19                 super();
20         }
21
22         /**
23          * @see ILaunchConfigurationDelegate#launch(ILaunchConfiguration, String, ILaunch, IProgressMonitor)
24          */
25         public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
26                 if (PHPRuntime.getDefault().getSelectedInterpreter() == null)
27                         throw new CoreException(new Status(IStatus.ERROR, PHPLaunchingPlugin.PLUGIN_ID, IStatus.OK, "You must define an interpreter before running PHP.", null));
28 //              if (mode.equals("debug")) {
29 //                      debuggerRunner.run(new InterpreterRunnerConfiguration(configuration), launch);
30 //              } else {
31                         interpreterRunner.run(new InterpreterRunnerConfiguration(configuration), launch);
32 //              }               
33         }
34 }