KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > core > model > ILaunchConfigurationDelegate2


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.core.model;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IProgressMonitor;
15 import org.eclipse.debug.core.ILaunch;
16 import org.eclipse.debug.core.ILaunchConfiguration;
17
18 /**
19  * Optional enhancements to the launch configuration delegate interface.
20  * Allows launch delegates to abort a launch, build relevant projects in
21  * the workspace before a launch, and create the launch object to be used
22  * in a launch.
23  * <p>
24  * Clients implementing <code>ILaunchConfigurationDelegate</code> may also
25  * implement this interface.
26  * </p>
27  * @since 3.0
28  */

29 public interface ILaunchConfigurationDelegate2 extends ILaunchConfigurationDelegate {
30     
31     /**
32      * Returns a launch object to use when launching the given launch
33      * configuration in the given mode, or <code>null</code> if a new default
34      * launch object should be created by the debug platform. If a launch object
35      * is returned, its launch mode must match that of the mode specified in
36      * this method call.
37      *
38      * @param configuration the configuration being launched
39      * @param mode the mode the configuration is being launched in
40      * @return a launch object or <code>null</code>
41      * @throws CoreException if unable to launch
42      */

43     public ILaunch getLaunch(ILaunchConfiguration configuration, String JavaDoc mode) throws CoreException;
44     
45     /**
46      * Optionally performs any required building before launching the given
47      * configuration in the specified mode, and returns whether the debug platform
48      * should perform an incremental workspace build before the launch continues.
49      * If <code>false</code> is returned the launch will proceed without further
50      * building, and if <code>true</code> is returned an incremental build will
51      * be performed on the workspace before launching.
52      * <p>
53      * This method is only called if the launch is invoked with flag indicating
54      * building should take place before the launch. This is done via the
55      * method
56      * <code>ILaunchConfiguration.launch(String mode, IProgressMonitor monitor, boolean build)</code>.
57      * </p>
58      * @param configuration the configuration being launched
59      * @param mode the mode the configuration is being launched in
60      * @param monitor progress monitor
61      * @return whether the debug platform should perform an incremental workspace
62      * build before the launch
63      * @throws CoreException if an exception occurs while building
64      */

65     public boolean buildForLaunch(ILaunchConfiguration configuration, String JavaDoc mode, IProgressMonitor monitor) throws CoreException;
66     
67     /**
68      * Returns whether a launch should proceed. This method is called after
69      * <code>preLaunchCheck()</code> and <code>buildForLaunch()</code> providing
70      * a final chance for this launch delegate to abort a launch if required.
71      * For example, a delegate could cancel a launch if it discovered compilation
72      * errors that would prevent the launch from succeeding.
73      *
74      * @param configuration the configuration being launched
75      * @param mode launch mode
76      * @param monitor progress monitor
77      * @return whether the launch should proceed
78      * @throws CoreException if an exception occurs during final checks
79      */

80     public boolean finalLaunchCheck(ILaunchConfiguration configuration, String JavaDoc mode, IProgressMonitor monitor) throws CoreException;
81     
82     /**
83      * Returns whether a launch should proceed. This method is called first
84      * in the launch sequence providing an opportunity for this launch delegate
85      * to abort the launch.
86      *
87      * @param configuration configuration being launched
88      * @param mode launch mode
89      * @param monitor progress monitor
90      * @return whether the launch should proceed
91      * @throws CoreException if an exception occurs while performing pre-launch checks
92      */

93     public boolean preLaunchCheck(ILaunchConfiguration configuration, String JavaDoc mode, IProgressMonitor monitor) throws CoreException;
94 }
95
Popular Tags