public abstract class AbstractJavaLaunchConfigurationDelegate
extends LaunchConfigurationDelegate
Clients implementing Java launch configuration delegates should subclass this class.
| Constructor and Description |
|---|
AbstractJavaLaunchConfigurationDelegate() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
abort(java.lang.String message,
java.lang.Throwable exception,
int code)
Throws a core exception with an error status object built from the given
message, lower level exception, and error code.
|
protected void |
allowAdvancedSourcelookup()
Enabled advanced sourcelookup for this launch delegate.
|
java.lang.String[] |
getBootpath(ILaunchConfiguration configuration)
Returns entries that should appear on the bootstrap portion of the
classpath as specified by the given launch configuration, as an array of
resolved strings.
|
java.lang.String[][] |
getBootpathExt(ILaunchConfiguration configuration)
Returns three sets of entries which represent the boot classpath
specified in the launch configuration, as an array of three arrays of
resolved strings.
|
protected IBreakpoint[] |
getBreakpoints(ILaunchConfiguration configuration) |
protected IProject[] |
getBuildOrder(ILaunchConfiguration configuration,
java.lang.String mode) |
java.lang.String[] |
getClasspath(ILaunchConfiguration configuration)
Deprecated.
use getClasspathAndModulepath
|
java.lang.String[][] |
getClasspathAndModulepath(ILaunchConfiguration config)
Returns the entries that should appear on the user portion of the classpath and modulepath as specified by the given launch configuration, as
an array of resolved strings.
|
protected java.io.File |
getDefaultWorkingDirectory(ILaunchConfiguration configuration)
Returns the default working directory for the given launch configuration,
or
null if none. |
java.lang.String[] |
getEnvironment(ILaunchConfiguration configuration)
Returns an array of environment variables to be used when
launching the given configuration or
null if unspecified. |
java.lang.String[] |
getJavaLibraryPath(ILaunchConfiguration configuration)
Returns an array of paths to be used for the
java.library.path
system property, or null if unspecified. |
IJavaProject |
getJavaProject(ILaunchConfiguration configuration)
Returns the Java project specified by the given launch configuration, or
null if none. |
java.lang.String |
getJavaProjectName(ILaunchConfiguration configuration)
Returns the Java project name specified by the given launch
configuration, or
null if none. |
ILaunch |
getLaunch(ILaunchConfiguration configuration,
java.lang.String mode) |
protected ILaunchManager |
getLaunchManager()
Convenience method to get the launch manager.
|
java.lang.String |
getMainTypeName(ILaunchConfiguration configuration)
Returns the main type name specified by the given launch configuration,
or
null if none. |
java.lang.String |
getModuleCLIOptions(ILaunchConfiguration configuration)
Returns the module-related command line options for the configuration that are needed at runtime as equivalents of those options specified by
IClasspathAttributes of the following names:
IClasspathAttribute#ADD_EXPORTS
IClasspathAttribute#ADD_READS
IClasspathAttribute#LIMIT_MODULES
IClasspathAttribute#PATCH_MODULE
|
java.lang.String |
getProgramArguments(ILaunchConfiguration configuration)
Returns the program arguments specified by the given launch
configuration, as a string.
|
protected IProject[] |
getProjectsForProblemSearch(ILaunchConfiguration configuration,
java.lang.String mode) |
java.lang.String |
getVMArguments(ILaunchConfiguration configuration)
Returns the VM arguments specified by the given launch configuration, as
a string.
|
java.lang.String |
getVMArguments(ILaunchConfiguration configuration,
java.lang.String mode)
Returns the VM arguments specified by the given launch configuration, as a string.
|
java.lang.String |
getVMConnectorId(ILaunchConfiguration configuration)
Returns the VM connector identifier specified by the given launch
configuration, or
null if none. |
IVMInstall |
getVMInstall(ILaunchConfiguration configuration)
Returns the VM install specified by the given launch configuration, or
null if none. |
java.lang.String |
getVMInstallName(ILaunchConfiguration configuration)
Returns the VM install name specified by the given launch configuration,
or
null if none. |
IVMInstallType |
getVMInstallType(ILaunchConfiguration configuration)
Returns the VM install type specified by the given launch configuration,
or
null if none. |
java.lang.String |
getVMInstallTypeId(ILaunchConfiguration configuration)
Returns the VM install type identifier specified by the given launch
configuration, or
null if none. |
IVMRunner |
getVMRunner(ILaunchConfiguration configuration,
java.lang.String mode)
Returns the VM runner for the given launch mode to use when launching the
given configuration.
|
java.util.Map<java.lang.String,java.lang.Object> |
getVMSpecificAttributesMap(ILaunchConfiguration configuration)
Returns the Map of VM-specific attributes specified by the given launch
configuration, or
null if none. |
java.io.File |
getWorkingDirectory(ILaunchConfiguration configuration)
Returns the working directory specified by the given launch
configuration, or
null if none. |
IPath |
getWorkingDirectoryPath(ILaunchConfiguration configuration)
Returns the working directory path specified by the given launch
configuration, or
null if none. |
void |
handleDebugEvents(DebugEvent[] events)
Handles the "stop-in-main" option.
|
boolean |
isAllowTerminate(ILaunchConfiguration configuration)
Returns whether the given launch configuration specifies that termination
is allowed.
|
protected boolean |
isLaunchProblem(IMarker problemMarker) |
boolean |
isStopInMain(ILaunchConfiguration configuration)
Returns whether the given launch configuration specifies that execution
should suspend on entry of the main method.
|
boolean |
preLaunchCheck(ILaunchConfiguration configuration,
java.lang.String mode,
IProgressMonitor monitor) |
protected void |
prepareStopInMain(ILaunchConfiguration configuration)
Determines if the given launch configuration specifies the "stop-in-main"
attribute, and sets up an event listener to handle the option if
required.
|
protected void |
setDefaultSourceLocator(ILaunch launch,
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.
|
protected boolean |
supportsModule()
Supports modular class for launching.
|
protected boolean |
supportsPreviewFeatures(ILaunchConfiguration configuration)
Supports Preview Features for launching.
|
IJavaProject |
verifyJavaProject(ILaunchConfiguration configuration)
Verifies a Java project is specified by the given launch configuration,
and returns the Java project.
|
java.lang.String |
verifyMainTypeName(ILaunchConfiguration configuration)
Verifies a main type name is specified by the given launch configuration,
and returns the main type name.
|
IVMInstall |
verifyVMInstall(ILaunchConfiguration configuration)
Verifies the VM install specified by the given launch configuration
exists and returns the VM install.
|
java.io.File |
verifyWorkingDirectory(ILaunchConfiguration configuration)
Verifies the working directory specified by the given launch
configuration exists, and returns the working directory, or
null if none is specified. |
public AbstractJavaLaunchConfigurationDelegate()
protected ILaunchManager getLaunchManager()
protected void abort(java.lang.String message,
java.lang.Throwable exception,
int code)
throws CoreException
message - the status messageexception - lower level exception associated with the error, or
null if nonecode - error codeCoreException - the "abort" core exceptionpublic IVMInstall getVMInstall(ILaunchConfiguration configuration) throws CoreException
null if none.configuration - launch configurationnull if noneCoreException - if unable to retrieve the attributepublic java.lang.String getVMInstallName(ILaunchConfiguration configuration)
throws CoreException
null if none.configuration - launch configurationnull if noneCoreException - if unable to retrieve the attributepublic IVMInstallType getVMInstallType(ILaunchConfiguration configuration) throws CoreException
null if none.configuration - launch configurationnull if noneCoreException - if unable to retrieve the attributepublic java.lang.String getVMInstallTypeId(ILaunchConfiguration configuration)
throws CoreException
null if none.configuration - launch configurationnull if noneCoreException - if unable to retrieve the attributepublic IVMInstall verifyVMInstall(ILaunchConfiguration configuration) throws CoreException
configuration - launch configurationCoreException - if unable to retrieve the attribute, the attribute is
unspecified, or if the home location is unspecified or
does not existpublic java.lang.String getVMConnectorId(ILaunchConfiguration configuration)
throws CoreException
null if none.configuration - launch configurationnull if noneCoreException - if unable to retrieve the attributepublic java.lang.String[] getBootpath(ILaunchConfiguration configuration)
throws CoreException
null if all
entries are standard (i.e. appear by default), or empty to represent an
empty bootpath.configuration - launch configurationnull represents a default bootpath.CoreException - if unable to retrieve the attributepublic java.lang.String[][] getBootpathExt(ILaunchConfiguration configuration)
throws CoreException
null represents the default
bootclasspath. The third array represents the classpath that should be
appended to the boot classpath.configuration - launch configurationCoreException - if unable to retrieve the attribute@Deprecated
public java.lang.String[] getClasspath(ILaunchConfiguration configuration)
throws CoreException
configuration - launch configurationCoreException - if unable to retrieve the attributepublic java.lang.String[][] getClasspathAndModulepath(ILaunchConfiguration config)
throws CoreException
config - launch configurationCoreException - if unable to retrieve the attributepublic IJavaProject getJavaProject(ILaunchConfiguration configuration)
throws CoreException
null if none.configuration - launch configurationnull if noneCoreException - if unable to retrieve the attributepublic java.lang.String getJavaProjectName(ILaunchConfiguration configuration)
throws CoreException
null if none.configuration - launch configurationnull if noneCoreException - if unable to retrieve the attributepublic java.lang.String getMainTypeName(ILaunchConfiguration configuration)
throws CoreException
null if none.configuration - launch configurationnull if noneCoreException - if unable to retrieve the attributepublic java.lang.String getProgramArguments(ILaunchConfiguration configuration)
throws CoreException
configuration - launch configurationCoreException - if unable to retrieve the attributepublic java.lang.String getVMArguments(ILaunchConfiguration configuration)
throws CoreException
configuration - launch configurationCoreException - if unable to retrieve the attributepublic java.lang.String getVMArguments(ILaunchConfiguration configuration,
java.lang.String mode)
throws CoreException
configuration - launch configurationmode - the mode in which to launch, one of the mode constants defined by ILaunchManager - RUN_MODE or
DEBUG_MODE.CoreException - if unable to retrieve the attributepublic java.util.Map<java.lang.String,java.lang.Object> getVMSpecificAttributesMap(ILaunchConfiguration configuration)
throws CoreException
null if none.configuration - launch configurationMap of VM-specific attributesCoreException - if unable to retrieve the attributepublic java.io.File getWorkingDirectory(ILaunchConfiguration configuration)
throws CoreException
null if none.configuration - launch configurationnull if noneCoreException - if unable to retrieve the attributepublic IPath getWorkingDirectoryPath(ILaunchConfiguration configuration)
throws CoreException
null if none.configuration - launch configurationnull if noneCoreException - if unable to retrieve the attributepublic IJavaProject verifyJavaProject(ILaunchConfiguration configuration)
throws CoreException
configuration - launch configurationCoreException - if unable to retrieve the attribute or the attribute is
unspecifiedpublic java.lang.String verifyMainTypeName(ILaunchConfiguration configuration)
throws CoreException
configuration - launch configurationCoreException - if unable to retrieve the attribute or the attribute is
unspecifiedpublic java.io.File verifyWorkingDirectory(ILaunchConfiguration configuration)
throws CoreException
null if none is specified.configuration - launch configurationnull if noneCoreException - if unable to retrieve the attributepublic boolean isAllowTerminate(ILaunchConfiguration configuration)
throws CoreException
configuration - launch configurationCoreException - if unable to retrieve the attributepublic boolean isStopInMain(ILaunchConfiguration configuration)
throws CoreException
configuration - launch configurationCoreException - if unable to retrieve the attributeprotected void setDefaultSourceLocator(ILaunch launch,
ILaunchConfiguration configuration)
throws CoreException
launch - launch objectconfiguration - configuration being launchedCoreException - if unable to set the source locatorprotected void prepareStopInMain(ILaunchConfiguration configuration)
throws CoreException
configuration - configuration being launchedCoreException - if unable to access the attributepublic void handleDebugEvents(DebugEvent[] events)
events - the debug events.org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(DebugEvent[])protected IProject[] getBuildOrder(ILaunchConfiguration configuration,
java.lang.String mode)
throws CoreException
CoreExceptionprotected IProject[] getProjectsForProblemSearch(ILaunchConfiguration configuration,
java.lang.String mode)
throws CoreException
CoreExceptionprotected boolean isLaunchProblem(IMarker problemMarker)
throws CoreException
CoreExceptionpublic boolean preLaunchCheck(ILaunchConfiguration configuration,
java.lang.String mode,
IProgressMonitor monitor)
throws CoreException
CoreExceptionprotected IBreakpoint[] getBreakpoints(ILaunchConfiguration configuration)
public IVMRunner getVMRunner(ILaunchConfiguration configuration, java.lang.String mode) throws CoreException
configuration - launch configurationmode - launch nodeCoreException - if a VM runner cannot be determinedpublic java.lang.String[] getEnvironment(ILaunchConfiguration configuration)
throws CoreException
null if unspecified.configuration - launch configurationCoreException - if unable to access associated attribute or if
unable to resolve a variable in an environment variable's valuepublic java.lang.String[] getJavaLibraryPath(ILaunchConfiguration configuration)
throws CoreException
java.library.path
system property, or null if unspecified.configuration - the configjava.library.path
system property, or nullCoreException - if unable to determine the attributeprotected java.io.File getDefaultWorkingDirectory(ILaunchConfiguration configuration)
throws CoreException
null if none. Subclasses may override as necessary.configuration - the confignull if noneCoreException - if an exception occurs computing the default working
directorypublic ILaunch getLaunch(ILaunchConfiguration configuration,
java.lang.String mode)
throws CoreException
CoreExceptionprotected final void allowAdvancedSourcelookup()
public java.lang.String getModuleCLIOptions(ILaunchConfiguration configuration)
throws CoreException
IClasspathAttributes of the following names:
IClasspathAttribute#ADD_EXPORTSIClasspathAttribute#ADD_READSIClasspathAttribute#LIMIT_MODULESIClasspathAttribute#PATCH_MODULECoreExceptionprotected boolean supportsModule()
protected boolean supportsPreviewFeatures(ILaunchConfiguration configuration)