KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > core > ILaunchConfigurationType


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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;
12
13  
14 import java.util.Set JavaDoc;
15
16 import org.eclipse.core.resources.IContainer;
17 import org.eclipse.core.runtime.CoreException;
18 import org.eclipse.core.runtime.IAdaptable;
19 import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
20 import org.eclipse.debug.core.sourcelookup.ISourcePathComputer;
21
22 /**
23  * Describes and creates instances of a specific type of
24  * launch configuration. Launch configuration types are
25  * defined by extensions.
26  * <p>
27  * A launch configuration type extension is defined in <code>plugin.xml</code>.
28  * Following is an example definition of a launch configuration
29  * type extension.
30  * <pre>
31  * &lt;extension point="org.eclipse.debug.core.launchConfigurationTypes"&gt;
32  * &lt;launchConfigurationType
33  * id="com.example.ExampleIdentifier"
34  * delegate="com.example.ExampleLaunchConfigurationDelegate"
35  * modes="run, debug"
36  * name="Example Application"&gt;
37  * sourceLocatorId="com.example.SourceLocator"&gt;
38  * sourcePathComputerId="com.example.SourcePathComputer"&gt;
39  * &lt;/launchConfigurationType&gt;
40  * &lt;/extension&gt;
41  * </pre>
42  * The attributes are specified as follows:
43  * <ul>
44  * <li><code>id</code> specifies a unique identifier for this launch configuration
45  * type.</li>
46  * <li><code>delegate</code> specifies the fully qualified name of the java class
47  * that implements <code>ILaunchConfigurationDelegate</code>. Launch configuration
48  * instances of this type will delegate to instances of this class
49  * to perform launching.</li>
50  * <li><code>modes</code> specifies a comma separated list of the modes this
51  * type of launch configuration supports - <code>"run"</code> and/or <code>"debug"</code>.</li>
52  * <li><code>name</code> specifies a human readable name for this type
53  * of launch configuration.</li>
54  * <li><code>category</code> is an optional attribute that specifies a category
55  * for this launch configuration type. Categories are client defined. This
56  * attribute was added in the 2.1 release.</li>
57  * <li><code>sourceLocatorId</code> an optional unique identifier of a sourceLocator extension that
58  * is used to create the source locator for sessions launched using launch configurations
59  * of this type. This attribute was added in the 3.0 release.</li>
60  * <li><code>sourcePathComputerId</code> an optional unique identifier of a sourcePathComputer extension
61  * that is used to compute a default source lookup path for launch configurations of this type.
62  * This attribute was added in the 3.0 release.</li>
63  * </ul>
64  * </p>
65  * <p>
66  * The <code>category</code> attribute has been added in release 2.1, such that other
67  * tools may re-use the launch configuration framework for purposes other than
68  * the standard running and debugging of programs under development. Such that
69  * clients may access arbitrary attributes specified in launch configuration type
70  * extension definitions, the method <code>getAttribute</code> has also been
71  * added. Launch configurations that are to be recognized as standard run/debug
72  * launch configurations should not specify the <code>category</code> attribute.
73  * </p>
74  * <p>
75  * This interface is not intended to be implemented by clients. Clients
76  * that define a launch configuration delegate extension implement the
77  * <code>ILaunchConfigurationDelegate</code> interface.
78  * </p>
79  * @see ILaunchConfiguration
80  * @since 2.0
81  */

82 public interface ILaunchConfigurationType extends IAdaptable {
83         
84     /**
85      * Returns the attribute with the given name, as specified by this launch
86      * configuration type's extension definition, or <code>null</code> if
87      * unspecified.
88      *
89      * @param attributeName attribute name
90      * @return the specified extension attribute, or <code>null</code>
91      * @since 2.1
92      */

93     public String JavaDoc getAttribute(String JavaDoc attributeName);
94     
95     /**
96      * Returns this launch configuration type's category, or <code>null</code>
97      * if unspecified. This corresponds to the category attribute specified in
98      * the extension definition.
99      *
100      * @return this launch configuration type's category, or <code>null</code>
101      * @since 2.1
102      */

103     public String JavaDoc getCategory();
104     
105     /**
106      * Returns the launch configuration delegate for launch
107      * configurations of this type, for <code>run</code> mode.
108      * The first time this method is called, the delegate is instantiated.
109      *
110      * @return launch configuration delegate
111      * @exception CoreException if unable to instantiate the
112      * delegate
113      * @deprecated use <code>getDelegate(String)</code> to specify mode
114      */

115     public ILaunchConfigurationDelegate getDelegate() throws CoreException;
116     
117     /**
118      * Returns the launch configuration delegate for launch
119      * configurations of this type, for the specified mode. The first time
120      * this method is called for a mode, the delegate is instantiated.
121      * Launch delegates may be contributed to a launch configuration type
122      * via the extension point <code>org.eclipse.debug.core.launchDelegates</code>
123      *
124      * @param mode launch mode
125      * @return launch configuration delegate
126      * @exception CoreException if unable to instantiate the
127      * delegate
128      * @since 3.0
129      * @deprecated since 3.3, the method <code>getDelegates(Set)</code> should be used
130      * instead, as there can be more than one capable delegate per mode or combination
131      * of modes
132      */

133     public ILaunchConfigurationDelegate getDelegate(String JavaDoc mode) throws CoreException;
134     
135     /**
136      * Returns the delegates capable of launching in the specified modes, possibly
137      * an empty set.
138      *
139      * @param modes set of launch modes
140      * @return the <code>ILaunchDelegate</code>s capable of launching
141      * in the specified modes or an empty collection if none
142      * @throws CoreException
143      * @since 3.3
144      */

145     public ILaunchDelegate[] getDelegates(Set JavaDoc modes) throws CoreException;
146     
147     /**
148      * Returns the preferred launch delegate for this type in the specified mode combination
149      * or <code>null</code> if there is no preferred delegate.
150      *
151      * @param modes the set of modes to support
152      * @return the preferred delegate or <code>null</code> if none
153      * @throws CoreException
154      *
155      * @since 3.3
156      */

157     public ILaunchDelegate getPreferredDelegate(Set JavaDoc modes) throws CoreException;
158     
159     /**
160      * Sets the preferred launch delegate for this type in the specified mode combination.
161      * Specify <code>null</code> as a preferred delegate to remove any preferred delegate
162      * setting for this launch configuration type.
163      *
164      * @param modes launch mode combination
165      * @param delegate preferred launch delegate or <code>null</code>
166      * @throws CoreException
167      *
168      * @since 3.3
169      */

170     public void setPreferredDelegate(Set JavaDoc modes, ILaunchDelegate delegate) throws CoreException;
171     
172     /**
173      * Returns whether this launch configuration supports the specified launch
174      * mode combination.
175      *
176      * @param modes launch mode combination
177      * @return whether the launch mode combination is supported
178      * @since 3.3
179      */

180     public boolean supportsModeCombination(Set JavaDoc modes);
181     
182     /**
183      * Returns the unique identifier for this type of launch configuration
184      *
185      * @return the unique identifier for this type of launch configuration
186      */

187     public String JavaDoc getIdentifier();
188     
189     /**
190      * Returns the name of this type of launch configuration.
191      *
192      * @return the name of this type of launch configuration
193      */

194     public String JavaDoc getName();
195     
196     /**
197      * Returns the identifier of the plug-in that contributes this launch configuration type.
198      *
199      * @return the identifier of the plug-in that contributes this launch configuration type
200      * @since 3.0
201      */

202     public String JavaDoc getPluginIdentifier();
203     
204     /**
205      * Returns the identifier of the persistable source locator registered with
206      * this launch configurations type, or <code>null</code> if unspecified.
207      * A source locator can be specified by a launch configuration type or
208      * launch delegate extension's <code>sourceLocatorId</code> attribute.
209      * <p>
210      * Only one source locator should be provided per launch configuration type
211      * and its launch delegates.
212      * </p>
213      * @return the identifier of the persistable source locator registered with
214      * this launch configurations type, or <code>null</code> if unspecified
215      * @since 3.0
216      */

217     public String JavaDoc getSourceLocatorId();
218     
219     /**
220      * Returns the source path computer registered with this launch configuration
221      * type or <code>null</code> if unspecified. A source path computer can be
222      * specified by a launch configuration type or launch delegate extension's
223      * <code>sourcePathComputerId</code> attribute.
224      * <p>
225      * Only one source path computer should be provided per launch configuration type
226      * and its launch delegates.
227      * </p>
228      * @return the source path computer registered with this launch configuration
229      * type or <code>null</code> if unspecified
230      * @since 3.0
231      */

232     public ISourcePathComputer getSourcePathComputer();
233     
234     /**
235      * Returns all of the registered supported modes for this launch configuration type.
236      * This method does not return null.
237      *
238      * <p>
239      * The returned set does not convey any mode combination capability nor does it describe how or what the type can launch, all this method does is return
240      * a set of strings of all the modes in some way associated with this type
241      * </p>
242      *
243      * @return the set of all supported modes
244      * @since 3.2
245      *
246      * @deprecated Since 3.3 all modes are provided as sets and not individual strings. The method <code>getSupportedModeCombinations</code>
247      * should be used instead to retrieve the complete listing of supported modes and their allowable combinations.
248      */

249     public Set JavaDoc getSupportedModes();
250     
251     /**
252      * Returns a <code>java.util.Set</code> of <code>java.util.Set</code>s containing all of the
253      * supported launch mode combinations for this type.
254      *
255      * @return a set of sets of all the supported mode combinations supported by this type
256      *
257      * @since 3.3
258      */

259     public Set JavaDoc getSupportedModeCombinations();
260     
261     /**
262      * Returns whether this launch configuration type is public. Public configuration
263      * types are available for use by the user, for example, the user can create new
264      * configurations based on public types through the UI. Private types are not
265      * accessible in this way, but are still available through the methods on
266      * <code>ILaunchManager</code>.
267      *
268      * @return whether this launch configuration type is public.
269      */

270     public boolean isPublic();
271     
272     /**
273      * Returns a new launch configuration working copy of this type,
274      * that resides in the specified container, with the given name.
275      * When <code>container</code> is </code>null</code>, the configuration
276      * will reside locally in the metadata area.
277      * Note: a launch configuration is not actually created until the working copy is saved.
278      *
279      * @param container the container in which the new configuration will
280      * reside, or <code>null</code> if the configuration should reside
281      * locally with the metadata.
282      * @param name name for the launch configuration
283      * @return a new launch configuration working copy instance of this type
284      * @exception CoreException if an instance of this type
285      * of launch configuration could not be created for any
286      * reason
287      */

288     public ILaunchConfigurationWorkingCopy newInstance(IContainer container, String JavaDoc name) throws CoreException;
289     
290     /**
291      * Returns whether this type of launch configuration supports
292      * the specified mode.
293      *
294      * @param mode a mode in which a configuration can be launched, one of
295      * the mode constants defined by <code>ILaunchManager</code> - <code>RUN_MODE</code> or
296      * <code>DEBUG_MODE</code>.
297      * @return whether this kind of launch configuration supports the
298      * specified mode
299      */

300     public boolean supportsMode(String JavaDoc mode);
301     
302     /**
303      * Returns the name of the plug-in that contributed this launch configuration type.
304      *
305      * @return name of contributing plug-in
306      * @since 3.3
307      */

308     public String JavaDoc getContributorName();
309
310 }
311
Popular Tags