Package org.eclipse.pde.launching
Class AbstractPDELaunchConfiguration
java.lang.Object
org.eclipse.debug.core.model.LaunchConfigurationDelegate
org.eclipse.pde.launching.AbstractPDELaunchConfiguration
- All Implemented Interfaces:
ILaunchConfigurationDelegate
,ILaunchConfigurationDelegate2
- Direct Known Subclasses:
EclipseApplicationLaunchConfiguration
,EquinoxLaunchConfiguration
An abstract launch delegate for PDE-based launch configurations
Clients may subclass this class.
This class originally existed in 3.2 as
org.eclipse.pde.ui.launcher.AbstractPDELaunchConfiguration
.
- Since:
- 3.6
-
Field Summary
Modifier and TypeFieldDescriptionprotected File
static boolean
Deprecated.This field was wrongly added and is no longer used.Fields inherited from class org.eclipse.debug.core.model.LaunchConfigurationDelegate
complileErrorProjectPromptStatus, complileErrorPromptStatus, promptStatus, saveScopedDirtyEditors, switchToDebugPromptStatus
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
clear
(ILaunchConfiguration configuration, IProgressMonitor monitor) By default, this method does nothing.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 ornull
if unspecified.Returns the fully-qualified name of the class to launch.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.getVMRunner
(ILaunchConfiguration configuration, String mode) Returns the VM runner for the given launch mode to use when launching the given configuration.getVMSpecificAttributesMap
(ILaunchConfiguration configuration) Returns the Map of VM-specific attributes specified by the given launch configuration, ornull
if none.getWorkingDirectory
(ILaunchConfiguration configuration) Returns the working directory path specified by the given launch configuration, ornull
if none.protected boolean
isLaunchProblem
(IMarker problemMarker) void
launch
(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) protected void
manageLaunch
(ILaunch launch) Adds a listener to the launch to be notified at interesting launch lifecycle events such as when the launch terminates.protected 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.showCommandLine
(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) protected void
synchronizeManifests
(ILaunchConfiguration configuration, IProgressMonitor monitor) Checks for old-style plugin.xml files that have become stale since the last launch.static void
updatePDELaunchConfigModuleSystem
(boolean java9) Deprecated.This method was wrongly added and is no longer used.protected void
validatePluginDependencies
(ILaunchConfiguration configuration, IProgressMonitor monitor) Validates inter-bundle dependencies automatically prior to launching if that option is turned on.protected void
validateProjectDependencies
(ILaunchConfiguration configuration, IProgressMonitor monitor) Checks if the Automated Management of Dependencies option is turned on.Methods inherited from class org.eclipse.debug.core.model.LaunchConfigurationDelegate
addReferencedProjects, buildForLaunch, buildProjects, computeBuildOrder, computeReferencedBuildOrder, existsProblems, finalLaunchCheck, getBreakpoints, getLaunch, preLaunchCheck, saveBeforeLaunch
-
Field Details
-
fConfigDir
-
shouldVMAddModuleSystem
Deprecated.This field was wrongly added and is no longer used.This field will control the addition of argument --add-modules=ALL-SYSTEM in the VM arguments during PDE launch. This VM argument is required from Java9 onwards for launching non-modular system- Since:
- 3.8
- Restriction:
- This field is not intended to be referenced by clients.
-
-
Constructor Details
-
AbstractPDELaunchConfiguration
public AbstractPDELaunchConfiguration()
-
-
Method Details
-
isLaunchProblem
- Overrides:
isLaunchProblem
in classLaunchConfigurationDelegate
- Throws:
CoreException
-
showCommandLine
public String showCommandLine(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException - Throws:
CoreException
-
launch
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException - Throws:
CoreException
-
getVMRunner
Returns the VM runner for the given launch mode to use when launching the given configuration.- Parameters:
configuration
- launch configurationmode
- 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
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
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
Returns an array of environment variables to be used when launching the given configuration ornull
if unspecified.- Parameters:
configuration
- launch configuration- Returns:
- the environment variables to be used when launching or
null
- Throws:
CoreException
- if unable to access associated attribute or if unable to resolve a variable in an environment variable's value
-
getWorkingDirectory
Returns the working directory path specified by the given launch configuration, ornull
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<String,Object> getVMSpecificAttributesMap(ILaunchConfiguration configuration) throws CoreException Returns the Map of VM-specific attributes specified by the given launch configuration, ornull
if none.- Parameters:
configuration
- launch configuration- Returns:
- the
Map
of VM-specific attributes - Throws:
CoreException
- if unable to retrieve the attribute
-
getVMArguments
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
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.- Parameters:
configuration
- launch configuration- Returns:
- the program arguments necessary for launching
- Throws:
CoreException
- if unable to retrieve the attribute or create the necessary configuration files
-
preLaunchCheck
protected 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 configurationlaunch
- the launch object to contribute processes and debug targets tomonitor
- a progress monitor- Throws:
CoreException
- exception thrown if launch fails or canceled or if unable to retrieve attributes from the launch configuration
-
getConfigDir
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 - Overrides:
getBuildOrder
in classLaunchConfigurationDelegate
- Throws:
CoreException
-
getProjectsForProblemSearch
protected IProject[] getProjectsForProblemSearch(ILaunchConfiguration configuration, String mode) throws CoreException - Overrides:
getProjectsForProblemSearch
in classLaunchConfigurationDelegate
- Throws:
CoreException
-
getMainClass
Returns the fully-qualified name of the class to launch.- Returns:
- the fully-qualified name of the class to launch. Must not return
null
. - Since:
- 3.3
-
manageLaunch
Adds a listener to the launch to be notified at interesting launch lifecycle events such as when the launch terminates.- Parameters:
launch
- the launch- Since:
- 3.3
-
synchronizeManifests
Checks for old-style plugin.xml files that have become stale since the last launch. For any stale plugin.xml files found, the corresponding MANIFEST.MF is deleted from the runtime configuration area so that it gets regenerated upon startup.- Parameters:
configuration
- the launch configurationmonitor
- a progress monitor- Since:
- 3.3
-
validateProjectDependencies
protected void validateProjectDependencies(ILaunchConfiguration configuration, IProgressMonitor monitor) Checks if the Automated Management of Dependencies option is turned on. If so, it makes sure all manifests are updated with the correct dependencies.- Parameters:
configuration
- the launch configurationmonitor
- a progress monitor- Since:
- 3.3
-
clear
protected void clear(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException By default, this method does nothing. Clients should override, if appropriate.- Parameters:
configuration
- the launch configurationmonitor
- the progress monitor- Throws:
CoreException
- if unable to retrieve launch attribute values or the clear operation was cancelled- Since:
- 3.3
-
validatePluginDependencies
protected void validatePluginDependencies(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException Validates inter-bundle dependencies automatically prior to launching if that option is turned on.- Parameters:
configuration
- the launch configurationmonitor
- a progress monitor- Throws:
CoreException
- Since:
- 3.3
-
updatePDELaunchConfigModuleSystem
Deprecated.This method was wrongly added and is no longer used. It is a no-op now.Updates the field shouldVMAddModuleSystem.- Since:
- 3.8
- Restriction:
- This method is not intended to be referenced by clients.
-