KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > ui > ILaunchConfigurationTabGroup


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.ui;
12
13
14 import org.eclipse.debug.core.ILaunch;
15 import org.eclipse.debug.core.ILaunchConfiguration;
16 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
17  
18 /**
19  * A launch configuration tab group is used to edit/view attributes
20  * of a specific type of launch configuration. Launch
21  * configurations are presented in a dialog, with a tab folder.
22  * Each tab manipulates one or more attributes of a launch
23  * configuration. The tab group controls which tabs are
24  * displayed for a specific type of launch configuration,
25  * and provides a mechanism for overriding configuration
26  * initialization performed by tabs.
27  * <p>
28  * A tab group has the following lifecycle methods:
29  * <ul>
30  * <li><code>createTabs(ILaunchConfigurationDialog, String)</code> -
31  * this is the first method called on a tab group after it is instantiated.</li>
32  * <li><code>initializeFrom(ILaunchConfiguration)</code> - called when a
33  * launch configuration is selected to be displayed.</li>
34  * <li><code>performApply(ILaunchConfigurationWorkingCopy)</code> - called when
35  * a tab group's values are to be written to a launch configuration.</li>
36  * <li><code>dispose()</code> - the last method called on a tab group, when it is
37  * to perform any required cleanup. Note that a tab can be disposed before its control
38  * has been created.</li>
39  * </ul>
40  * The method <code>setDefaults(ILaunchConfigurationWorkingCopy)</code>
41  * can be called before a tab's controls are created.
42  * </p>
43  * <p>
44  * The launch tab framework was originally designed to handle inter tab
45  * communication by applying attributes from the active tab to a launch configuration
46  * being edited, when a tab is exited, and by initializing a tab when activated.
47  * In 3.0, the addition of the methods <code>activated</code> and <code>deactivated</code>
48  * allow tabs to determine the appropriate course of action. The default implementation
49  * in <code>AbstractLaunchConfigurationTab</code> is to call the old methods
50  * (<code>initializeFrom</code> and <code>performApply</code>). Tabs should override
51  * the new methods as required.
52  * </p>
53  * <p>
54  * A launch configuration group extension is defined in <code>plugin.xml</code>.
55  * Following is an example definition of a launch configuration
56  * group extension.
57  * <pre>
58  * &lt;extension point="org.eclipse.debug.ui.launchConfigurationTabGroups"&gt;
59  * &lt;launchConfigurationTabGroup
60  * id="com.example.ExampleTabGroup"
61  * type="com.example.ExampleLaunchConfigurationTypeIdentifier"
62  * class="com.example.ExampleLaunchConfigurationTabGroupClass"&gt;
63  * &lt;/launchConfigurationTabGroup&gt;
64  * &lt;/extension&gt;
65  * </pre>
66  * The attributes are specified as follows:
67  * <ul>
68  * <li><code>id</code> specifies a unique identifier for this launch configuration
69  * tab group.</li>
70  * <li><code>type</code> specifies launch configuration type that this tab
71  * group is applicable to (corresponds to the id of a launch configuration type
72  * extension).</li>
73  * <li><code>class</code> specifies a fully qualified name of a Java class
74  * that implements <code>ILaunchConfigurationTabGroup</code>.</li>
75  * </ul>
76  * </p>
77  * <p>
78  * This interface is intended to be implemented by clients.
79  * </p>
80  * @see org.eclipse.debug.core.ILaunchConfigurationType
81  * @see org.eclipse.debug.core.ILaunchConfiguration
82  * @see org.eclipse.debug.ui.ILaunchConfigurationTab
83  * @since 2.0
84  */

85 public interface ILaunchConfigurationTabGroup {
86
87     /**
88      * Creates the tabs contained in this tab group for the specified
89      * launch mode. The tabs control's are not created. This is the
90      * fist method called in the lifecycle of a tab group.
91      *
92      * @param dialog the launch configuration dialog this tab group
93      * is contained in
94      * @param mode the mode the launch configuration dialog was
95      * opened in
96      */

97     public void createTabs(ILaunchConfigurationDialog dialog, String JavaDoc mode);
98     
99     /**
100      * Returns the tabs contained in this tab group.
101      *
102      * @return the tabs contained in this tab group
103      */

104     public ILaunchConfigurationTab[] getTabs();
105
106     /**
107      * Notifies this launch configuration tab group that it has
108      * been disposed, and disposes this group's tabs. Marks the end
109      * of this tab group's lifecycle, allowing this tab group to
110      * perform any cleanup required.
111      */

112     public void dispose();
113             
114     /**
115      * Initializes the given launch configuration with
116      * default values for this tab group. This method
117      * is called when a new launch configuration is created
118      * such that the configuration can be initialized with
119      * meaningful values. This method may be called before
120      * tab controls are created.
121      *
122      * @param configuration launch configuration
123      */

124     public void setDefaults(ILaunchConfigurationWorkingCopy configuration);
125     
126     /**
127      * Initializes this group's tab controls with values from the given
128      * launch configuration. This method is called when
129      * a configuration is selected to view or edit.
130      *
131      * @param configuration launch configuration
132      */

133     public void initializeFrom(ILaunchConfiguration configuration);
134         
135     /**
136      * Copies values from this group's tabs into the given
137      * launch configuration.
138      *
139      * @param configuration launch configuration
140      */

141     public void performApply(ILaunchConfigurationWorkingCopy configuration);
142     
143     /**
144      * Notifies this tab that a configuration has been
145      * launched, resulting in the given launch. This method can be
146      * called when a tab's control does not exist, to support single-click
147      * launching.
148      *
149      * @param launch the result of launching the current
150      * launch configuration
151      * @deprecated As of R3.0, this method is no longer called by the launch
152      * framework. Since tabs do not exist when launching is performed elsewhere
153      * than the launch dialog, this method cannot be relied upon for launching
154      * functionality.
155      */

156     public void launched(ILaunch launch);
157 }
158
159
Popular Tags