Eclipse PDE
Release 3.2

org.eclipse.pde.ui.launcher
Class AbstractPDELaunchConfiguration

java.lang.Object
  extended byorg.eclipse.debug.core.model.LaunchConfigurationDelegate
      extended byorg.eclipse.pde.ui.launcher.AbstractPDELaunchConfiguration
All Implemented Interfaces:
ILaunchConfigurationDelegate, ILaunchConfigurationDelegate2
Direct Known Subclasses:
EclipseApplicationLaunchConfiguration, EquinoxLaunchConfiguration

public abstract class AbstractPDELaunchConfiguration
extends LaunchConfigurationDelegate

An abstract launch delegate for PDE-based launch configurations

Clients may subclass this class.

Since:
3.2

Field Summary
protected  File fConfigDir
           
 
Fields inherited from class org.eclipse.debug.core.model.LaunchConfigurationDelegate
complileErrorProjectPromptStatus, complileErrorPromptStatus, promptStatus, saveScopedDirtyEditors, switchToDebugPromptStatus
 
Constructor Summary
AbstractPDELaunchConfiguration()
           
 
Method Summary
protected  IProject[] getBuildOrder(ILaunchConfiguration configuration, String mode)
           
 String[] getClasspath(ILaunchConfiguration configuration)
          Returns the entries that should appear on boot classpath.
protected  File getConfigDir(ILaunchConfiguration configuration)
          Returns the configuration area specified by the given launch configuration.
 String[] getEnvironment(ILaunchConfiguration configuration)
          Returns an array of environment variables to be used when launching the given configuration or null if unspecified.
 String[] getProgramArguments(ILaunchConfiguration configuration)
          Returns the program arguments to launch with.
protected  IProject[] getProjectsForProblemSearch(ILaunchConfiguration configuration, String mode)
           
 String[] getVMArguments(ILaunchConfiguration configuration)
          Returns the VM arguments specified by the given launch configuration, as an array of strings.
 IVMRunner getVMRunner(ILaunchConfiguration configuration, String mode)
          Returns the VM runner for the given launch mode to use when launching the given configuration.
 Map getVMSpecificAttributesMap(ILaunchConfiguration configuration)
          Returns the Map of VM-specific attributes specified by the given launch configuration, or null if none.
 File getWorkingDirectory(ILaunchConfiguration configuration)
          Returns the working directory path specified by the given launch configuration, or null if none.
 void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
           
protected abstract  void preLaunchCheck(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor)
          Does sanity checking before launching.
protected  void setDefaultSourceLocator(ILaunchConfiguration configuration)
          Assigns a default source locator to the given launch if a source locator has not yet been assigned to it, and the associated launch configuration does not specify a source locator.
 
Methods inherited from class org.eclipse.debug.core.model.LaunchConfigurationDelegate
addReferencedProjects, buildForLaunch, buildProjects, computeBuildOrder, computeReferencedBuildOrder, existsProblems, finalLaunchCheck, getBreakpoints, getLaunch, isLaunchProblem, preLaunchCheck, saveBeforeLaunch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fConfigDir

protected File fConfigDir
Constructor Detail

AbstractPDELaunchConfiguration

public AbstractPDELaunchConfiguration()
Method Detail

launch

public void launch(ILaunchConfiguration configuration,
                   String mode,
                   ILaunch launch,
                   IProgressMonitor monitor)
            throws CoreException
Throws:
CoreException

getVMRunner

public IVMRunner getVMRunner(ILaunchConfiguration configuration,
                             String mode)
                      throws CoreException
Returns the VM runner for the given launch mode to use when launching the given configuration.

Parameters:
configuration - launch configuration
mode - launch node
Returns:
VM runner to use when launching the given configuration in the given mode
Throws:
CoreException - if a VM runner cannot be determined

setDefaultSourceLocator

protected void setDefaultSourceLocator(ILaunchConfiguration configuration)
                                throws CoreException
Assigns a default source locator to the given launch if a source locator has not yet been assigned to it, and the associated launch configuration does not specify a source locator.

Parameters:
configuration - configuration being launched
Throws:
CoreException - if unable to set the source locator

getClasspath

public String[] getClasspath(ILaunchConfiguration configuration)
                      throws CoreException
Returns the entries that should appear on boot classpath.

Parameters:
configuration - launch configuration
Returns:
the location of startup.jar and the bootstrap classpath specified by the given launch configuration
Throws:
CoreException - if unable to find startup.jar

getEnvironment

public String[] getEnvironment(ILaunchConfiguration configuration)
                        throws CoreException
Returns an array of environment variables to be used when launching the given configuration or null if unspecified.

Parameters:
configuration - launch configuration
Throws:
CoreException - if unable to access associated attribute or if unable to resolve a variable in an environment variable's value

getWorkingDirectory

public File getWorkingDirectory(ILaunchConfiguration configuration)
                         throws CoreException
Returns the working directory path specified by the given launch configuration, or null if none.

Parameters:
configuration - launch configuration
Returns:
the working directory path specified by the given launch configuration, or null if none
Throws:
CoreException - if unable to retrieve the attribute

getVMSpecificAttributesMap

public Map getVMSpecificAttributesMap(ILaunchConfiguration configuration)
                               throws CoreException
Returns the Map of VM-specific attributes specified by the given launch configuration, or null if none.

Parameters:
configuration - launch configuration
Returns:
the Map of VM-specific attributes
Throws:
CoreException - if unable to retrieve the attribute

getVMArguments

public String[] getVMArguments(ILaunchConfiguration configuration)
                        throws CoreException
Returns the VM arguments specified by the given launch configuration, as an array of strings.

Parameters:
configuration - launch configuration
Returns:
the VM arguments specified by the given launch configuration, possibly an empty array
Throws:
CoreException - if unable to retrieve the attribute

getProgramArguments

public String[] getProgramArguments(ILaunchConfiguration configuration)
                             throws CoreException
Returns the program arguments to launch with. This list is a combination of arguments computed by PDE based on attributes specified in the given launch configuration, followed by the program arguments that the entered directly into the launch configuration. This computation may require user interaction (i.e an answer to a question), etc. If the answer is to not proceed, then this method returns null.

Parameters:
configuration - launch configuration
Returns:
the program arguments necessar for launching or null
Throws:
CoreException - if unable to retrieve the attribute or if self-hosting could not proceed due to a bad setup, missing plug-ins, inability to create the necessary configuration files.

preLaunchCheck

protected abstract void preLaunchCheck(ILaunchConfiguration configuration,
                                       ILaunch launch,
                                       IProgressMonitor monitor)
                                throws CoreException
Does sanity checking before launching. The criteria whether the launch should proceed or not is specific to the launch configuration type.

Parameters:
configuration - launch configuration
launch - the launch object to contribute processes and debug targets to
monitor - a progress monitor
Throws:
CoreException - exception thrown if launch fails or if unable to retrieve attributes from the launch configuration

getConfigDir

protected File getConfigDir(ILaunchConfiguration configuration)
Returns the configuration area specified by the given launch configuration.

Parameters:
configuration - launch configuration
Returns:
the directory path specified by the given launch configuration

getBuildOrder

protected IProject[] getBuildOrder(ILaunchConfiguration configuration,
                                   String mode)
                            throws CoreException
Throws:
CoreException

getProjectsForProblemSearch

protected IProject[] getProjectsForProblemSearch(ILaunchConfiguration configuration,
                                                 String mode)
                                          throws CoreException
Throws:
CoreException

Eclipse PDE
Release 3.2

Copyright (c) IBM Corp. and others 2000, 2006. All Rights Reserved.