First submit for debug plugin
[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.runtime.CoreException;
4 import org.eclipse.core.runtime.IProgressMonitor;
5 import org.eclipse.core.runtime.IStatus;
6 import org.eclipse.core.runtime.Status;
7 import org.eclipse.debug.core.ILaunch;
8 import org.eclipse.debug.core.ILaunchConfiguration;
9 import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
10
11
12 public class PHPLaunchConfigurationDelegate implements ILaunchConfigurationDelegate {
13         protected static final InterpreterRunner interpreterRunner = new InterpreterRunner();
14 //      protected static final DebuggerRunner debuggerRunner = new DebuggerRunner();
15
16         public PHPLaunchConfigurationDelegate() {
17                 super();
18         }
19
20         /**
21          * @see ILaunchConfigurationDelegate#launch(ILaunchConfiguration, String, ILaunch, IProgressMonitor)
22          */
23         public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
24                 if (PHPRuntime.getDefault().getSelectedInterpreter() == null)
25                         throw new CoreException(new Status(IStatus.ERROR, PHPLaunchingPlugin.PLUGIN_ID, IStatus.OK, "You must define an interpreter before running PHP.", null));
26 //              if (mode.equals("debug")) {
27 //                      debuggerRunner.run(new InterpreterRunnerConfiguration(configuration), launch);
28 //              } else {
29                         interpreterRunner.run(new InterpreterRunnerConfiguration(configuration), launch);
30 //              }               
31         }
32 }