KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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  * Common function for launch configuration tab groups.
20  * Generally, a launch configuration tab group will subclass
21  * this class, and define a method to create and set the tabs
22  * in that group.
23  * <p>
24  * Clients may subclass this class.
25  * </p>
26  * @see ILaunchConfigurationTabGroup
27  * @since 2.0
28  */

29 public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConfigurationTabGroup {
30     
31     /**
32      * The tabs in this tab group, or <code>null</code> if not yet instantiated.
33      */

34     protected ILaunchConfigurationTab[] fTabs = null;
35
36     /**
37      * @see ILaunchConfigurationTabGroup#getTabs()
38      */

39     public ILaunchConfigurationTab[] getTabs() {
40         return fTabs;
41     }
42     
43     /**
44      * Sets the tabs in this group
45      *
46      * @param tabs the tabs in this group
47      */

48     protected void setTabs(ILaunchConfigurationTab[] tabs) {
49         fTabs = tabs;
50     }
51
52     /**
53      * By default, dispose all the tabs in this group.
54      *
55      * @see ILaunchConfigurationTabGroup#dispose()
56      */

57     public void dispose() {
58         ILaunchConfigurationTab[] tabs = getTabs();
59         if (tabs != null) {
60             for (int i = 0; i < tabs.length; i++) {
61                 tabs[i].dispose();
62             }
63         }
64     }
65
66     /**
67      * By default, delegate to all of the tabs in this group.
68      *
69      * @see ILaunchConfigurationTabGroup#setDefaults(ILaunchConfigurationWorkingCopy)
70      */

71     public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
72         ILaunchConfigurationTab[] tabs = getTabs();
73         for (int i = 0; i < tabs.length; i++) {
74             tabs[i].setDefaults(configuration);
75         }
76     }
77
78     /**
79      * By default, delegate to all of the tabs in this group.
80      *
81      * @see ILaunchConfigurationTabGroup#initializeFrom(ILaunchConfiguration)
82      */

83     public void initializeFrom(ILaunchConfiguration configuration) {
84         ILaunchConfigurationTab[] tabs = getTabs();
85         for (int i = 0; i < tabs.length; i++) {
86             tabs[i].initializeFrom(configuration);
87         }
88     }
89
90     /**
91      * By default, delegate to all of the tabs in this group.
92      *
93      * @see ILaunchConfigurationTabGroup#performApply(ILaunchConfigurationWorkingCopy)
94      */

95     public void performApply(ILaunchConfigurationWorkingCopy configuration) {
96         ILaunchConfigurationTab[] tabs = getTabs();
97         for (int i = 0; i < tabs.length; i++) {
98             tabs[i].performApply(configuration);
99         }
100     }
101
102     /**
103      * By default, delegate to all of the tabs in this group.
104      *
105      * @see ILaunchConfigurationTabGroup#launched(ILaunch)
106      * @deprecated
107      */

108     public void launched(ILaunch launch) {
109         ILaunchConfigurationTab[] tabs = getTabs();
110         for (int i = 0; i < tabs.length; i++) {
111             tabs[i].launched(launch);
112         }
113     }
114
115 }
116
Popular Tags