org.eclipse.cdt.launch
Class AbstractCLaunchDelegate

java.lang.Object
  extended by org.eclipse.debug.core.model.LaunchConfigurationDelegate
      extended by org.eclipse.cdt.launch.AbstractCLaunchDelegate
All Implemented Interfaces:
org.eclipse.debug.core.model.ILaunchConfigurationDelegate, org.eclipse.debug.core.model.ILaunchConfigurationDelegate2
Direct Known Subclasses:
CoreFileLaunchDelegate, LocalAttachLaunchDelegate, LocalCDILaunchDelegate, LocalRunLaunchDelegate

public abstract class AbstractCLaunchDelegate
extends org.eclipse.debug.core.model.LaunchConfigurationDelegate


Constructor Summary
AbstractCLaunchDelegate()
           
 
Method Summary
 boolean buildForLaunch(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode, org.eclipse.core.runtime.IProgressMonitor monitor)
          Builds the current project and all of it's prerequisite projects if necessary.
 boolean finalLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode, org.eclipse.core.runtime.IProgressMonitor monitor)
          Searches for compile errors in the current project and any of its prerequisite projects.
static org.eclipse.cdt.core.model.ICProject getCProject(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
 java.lang.String getProgramArguments(org.eclipse.debug.core.ILaunchConfiguration config)
          Returns the program arguments as a String.
 java.lang.String[] getProgramArgumentsArray(org.eclipse.debug.core.ILaunchConfiguration config)
          Returns the program arguments as an array of individual arguments.
static java.lang.String getProgramName(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
static org.eclipse.core.runtime.IPath getProgramPath(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
static java.lang.String getProjectName(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
 java.io.File getWorkingDir(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Deprecated. Should use getWorkingDirectory()
 java.io.File getWorkingDirectory(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns the working directory specified by the given launch configuration, or null if none.
abstract  void launch(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode, org.eclipse.debug.core.ILaunch launch, org.eclipse.core.runtime.IProgressMonitor monitor)
           
 boolean preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode, org.eclipse.core.runtime.IProgressMonitor monitor)
           
 java.io.File verifyWorkingDirectory(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Verifies the working directory specified by the given launch configuration exists, and returns the working directory, or null if none is specified.
 
Methods inherited from class org.eclipse.debug.core.model.LaunchConfigurationDelegate
getLaunch
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCLaunchDelegate

public AbstractCLaunchDelegate()
Method Detail

launch

public abstract void launch(org.eclipse.debug.core.ILaunchConfiguration configuration,
                            java.lang.String mode,
                            org.eclipse.debug.core.ILaunch launch,
                            org.eclipse.core.runtime.IProgressMonitor monitor)
                     throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getWorkingDir

public java.io.File getWorkingDir(org.eclipse.debug.core.ILaunchConfiguration configuration)
                           throws org.eclipse.core.runtime.CoreException
Deprecated. Should use getWorkingDirectory()

Returns the working directory specified by the given launch configuration, or null if none.

Parameters:
configuration - launch configuration
Returns:
the working directory specified by the given launch configuration, or null if none
Throws:
org.eclipse.core.runtime.CoreException - if unable to retrieve the attribute

getWorkingDirectory

public java.io.File getWorkingDirectory(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                 throws org.eclipse.core.runtime.CoreException
Returns the working directory specified by the given launch configuration, or null if none.

Parameters:
configuration - launch configuration
Returns:
the working directory specified by the given launch configuration, or null if none
Throws:
org.eclipse.core.runtime.CoreException - if unable to retrieve the attribute

getCProject

public static org.eclipse.cdt.core.model.ICProject getCProject(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                                        throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getProjectName

public static java.lang.String getProjectName(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                       throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getProgramName

public static java.lang.String getProgramName(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                       throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getProgramPath

public static org.eclipse.core.runtime.IPath getProgramPath(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                                     throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getProgramArguments

public java.lang.String getProgramArguments(org.eclipse.debug.core.ILaunchConfiguration config)
                                     throws org.eclipse.core.runtime.CoreException
Returns the program arguments as a String.

Returns:
the program arguments as a String
Throws:
org.eclipse.core.runtime.CoreException

getProgramArgumentsArray

public java.lang.String[] getProgramArgumentsArray(org.eclipse.debug.core.ILaunchConfiguration config)
                                            throws org.eclipse.core.runtime.CoreException
Returns the program arguments as an array of individual arguments.

Returns:
the program arguments as an array of individual arguments
Throws:
org.eclipse.core.runtime.CoreException

verifyWorkingDirectory

public java.io.File verifyWorkingDirectory(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                    throws org.eclipse.core.runtime.CoreException
Verifies the working directory specified by the given launch configuration exists, and returns the working directory, or null if none is specified.

Parameters:
configuration - launch configuration
Returns:
the working directory specified by the given launch configuration, or null if none
Throws:
org.eclipse.core.runtime.CoreException - if unable to retrieve the attribute

buildForLaunch

public boolean buildForLaunch(org.eclipse.debug.core.ILaunchConfiguration configuration,
                              java.lang.String mode,
                              org.eclipse.core.runtime.IProgressMonitor monitor)
                       throws org.eclipse.core.runtime.CoreException
Builds the current project and all of it's prerequisite projects if necessary. Respects specified build order if any exists.

Specified by:
buildForLaunch in interface org.eclipse.debug.core.model.ILaunchConfigurationDelegate2
Overrides:
buildForLaunch in class org.eclipse.debug.core.model.LaunchConfigurationDelegate
Parameters:
configuration - the configuration being launched
mode - the mode the configuration is being launched in
monitor - progress monitor
Returns:
whether the debug platform should perform an incremental workspace build before the launch
Throws:
org.eclipse.core.runtime.CoreException - if an exception occurrs while building

finalLaunchCheck

public boolean finalLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                java.lang.String mode,
                                org.eclipse.core.runtime.IProgressMonitor monitor)
                         throws org.eclipse.core.runtime.CoreException
Searches for compile errors in the current project and any of its prerequisite projects. If any compile errors, give the user a chance to abort the launch and correct the errors.

Specified by:
finalLaunchCheck in interface org.eclipse.debug.core.model.ILaunchConfigurationDelegate2
Overrides:
finalLaunchCheck in class org.eclipse.debug.core.model.LaunchConfigurationDelegate
Parameters:
configuration -
mode -
monitor -
Returns:
whether the launch should proceed
Throws:
org.eclipse.core.runtime.CoreException - if an exception occurs while checking for compile errors.

preLaunchCheck

public boolean preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration configuration,
                              java.lang.String mode,
                              org.eclipse.core.runtime.IProgressMonitor monitor)
                       throws org.eclipse.core.runtime.CoreException
Specified by:
preLaunchCheck in interface org.eclipse.debug.core.model.ILaunchConfigurationDelegate2
Overrides:
preLaunchCheck in class org.eclipse.debug.core.model.LaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException