|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.debug.core.model.LaunchConfigurationDelegate
Default implementation of a launch configuration delegate. Provides convenience methods for computing the build order of projects, building projects, and searching for errors in the workspace. The default pre-launch check prompts the user to launch in debug mode if breakpoints are present in the workspace.
Clients implementing launch configration delegates should subclass this class.
Field Summary | |
protected static IStatus |
complileErrorPromptStatus
Status code for which a prompter is registered to ask the user if the want to continue launch despite existing compile errors |
protected static IStatus |
promptStatus
Status code for which a UI prompter is registered. |
protected static IStatus |
switchToDebugPromptStatus
Status code for which a prompter is registered to ask the user if they want to launch in debug mode when breakpoints are present. |
Constructor Summary | |
LaunchConfigurationDelegate()
|
Method Summary | |
protected void |
addReferencedProjects(IProject project,
Set references)
Adds all projects referenced by project to the given
set. |
boolean |
buildForLaunch(ILaunchConfiguration configuration,
String mode,
IProgressMonitor monitor)
Optionally performs any required building before launching the given configuration in the specified mode, and returns whether the debug platform should perform an incremental workspace build before the launch continues. |
protected void |
buildProjects(IProject[] projects,
IProgressMonitor monitor)
Performs an incremental build on each of the given projects. |
protected IProject[] |
computeBuildOrder(IProject[] projects)
Returns a list of projects in their suggested build order from the given unordered list of projects. |
protected IProject[] |
computeReferencedBuildOrder(IProject[] baseProjects)
Returns an array of projects in their suggested build order containing all of the projects specified by baseProjects
and all of their referenced projects. |
protected boolean |
existsProblems(IProject proj)
Returns whether the given project contains any problem markers of the specified severity. |
boolean |
finalLaunchCheck(ILaunchConfiguration configuration,
String mode,
IProgressMonitor monitor)
Returns whether a launch should proceed. |
protected IProject[] |
getBuildOrder(ILaunchConfiguration configuration,
String mode)
Returns the projects to build before launching the given launch configuration or null if the entire workspace should be built incrementally.
|
ILaunch |
getLaunch(ILaunchConfiguration configuration,
String mode)
Returns a launch object to use when launching the given launch configuration in the given mode, or null if a new default
launch object should be created by the debug platform. |
protected IProject[] |
getProjectsForProblemSearch(ILaunchConfiguration configuration,
String mode)
Returns the set of projects to use when searching for errors or null
if no search is to be done. |
protected boolean |
isLaunchProblem(IMarker problemMarker)
Returns whether the given problem should potentially abort the launch. |
boolean |
preLaunchCheck(ILaunchConfiguration configuration,
String mode,
IProgressMonitor monitor)
Returns whether a launch should proceed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.debug.core.model.ILaunchConfigurationDelegate |
launch |
Field Detail |
protected static final IStatus promptStatus
protected static final IStatus switchToDebugPromptStatus
protected static final IStatus complileErrorPromptStatus
Constructor Detail |
public LaunchConfigurationDelegate()
Method Detail |
public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException
ILaunchConfigurationDelegate2
null
if a new default
launch object should be created by the debug platform. If a launch object
is returned, its launch mode must match that of the mode specified in
this method call.
getLaunch
in interface ILaunchConfigurationDelegate2
configuration
- the configuration being launchedmode
- the mode the configuration is being launched in
null
CoreException
- if unable to launchpublic boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException
ILaunchConfigurationDelegate2
false
is returned the launch will proceed without further
building, and if true
is returned an incremental build will
be performed on the workspace before launching.
This method is only called if the launch is invoked with flag indicating
building should take place before the launch. This is done via the
method
ILaunchConfiguration.launch(String mode, IProgressMonitor monitor, boolean build)
.
buildForLaunch
in interface ILaunchConfigurationDelegate2
configuration
- the configuration being launchedmode
- the mode the configuration is being launched inmonitor
- progress monitor
CoreException
- if an exception occurrs while buildingprotected IProject[] getBuildOrder(ILaunchConfiguration configuration, String mode) throws CoreException
null
if the entire workspace should be built incrementally.
Subclasses should override as required.
configuration
- the configuration being launchedmode
- launch mode
null
CoreException
- if an exception occurrsprotected IProject[] getProjectsForProblemSearch(ILaunchConfiguration configuration, String mode) throws CoreException
null
if no search is to be done.
configuration
- the configuration being launchedmode
- launch mode
null
CoreException
- if an exception occurrspublic boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException
ILaunchConfigurationDelegate2
preLaunchCheck()
and buildForLaunch()
providing
a final chance for this launch delegate to abort a launch if required.
For example, a delegate could cancel a launch if it discovered compilation
errors that would prevent the launch from succeeding.
finalLaunchCheck
in interface ILaunchConfigurationDelegate2
configuration
- the configuration being launchedmode
- launch modemonitor
- progress monitor
CoreException
- if an exception occurs during final checkspublic boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException
ILaunchConfigurationDelegate2
preLaunchCheck
in interface ILaunchConfigurationDelegate2
configuration
- configuration being lanuchedmode
- launch modemonitor
- progress monitor
CoreException
- if an exception occurs while performing pre launch checksprotected IProject[] computeReferencedBuildOrder(IProject[] baseProjects) throws CoreException
baseProjects
and all of their referenced projects.
baseProjects
- a collection of projetcs
baseProjects
CoreException
- if an error occurs while computing referenced
projectsprotected void addReferencedProjects(IProject project, Set references) throws CoreException
project
to the given
set.
project
- projectreferences
- set to which referenced projects are added
CoreException
- if an error occurs while computing referenced
projectsprotected IProject[] computeBuildOrder(IProject[] projects)
projects
- the list of projects to sort into build order
projects
sorted
according to their build order.protected boolean existsProblems(IProject proj) throws CoreException
proj
- the project to search
CoreException
- if an error occurs while searching for
problem markersprotected boolean isLaunchProblem(IMarker problemMarker) throws CoreException
problemMarker
- candidate problem
CoreException
- if any exceptions occurr while accessing marker attributesprotected void buildProjects(IProject[] projects, IProgressMonitor monitor) throws CoreException
projects
- projects to buildmonitor
- progress monitor
CoreException
- if an exception occurrs while building
|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.