KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > ui > launcher > TracingTab


1 /*******************************************************************************
2  * Copyright (c) 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.pde.ui.launcher;
12
13 import org.eclipse.debug.core.ILaunchConfiguration;
14 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
15 import org.eclipse.jface.dialogs.Dialog;
16 import org.eclipse.pde.internal.ui.IHelpContextIds;
17 import org.eclipse.pde.internal.ui.PDEPlugin;
18 import org.eclipse.pde.internal.ui.PDEPluginImages;
19 import org.eclipse.pde.internal.ui.PDEUIMessages;
20 import org.eclipse.pde.internal.ui.launcher.TracingBlock;
21 import org.eclipse.swt.SWT;
22 import org.eclipse.swt.graphics.Image;
23 import org.eclipse.swt.layout.GridLayout;
24 import org.eclipse.swt.widgets.Composite;
25 import org.eclipse.ui.PlatformUI;
26
27 /**
28  * A launch configuration tab that enables tracing and displays all plug-ins that support
29  * tracing.
30  * <p>
31  * This class may be instantiated. This class is not intended to be subclassed by clients.
32  * </p>
33  * @since 3.2
34  */

35 public class TracingTab extends AbstractLauncherTab {
36     
37     private Image fImage;
38     private TracingBlock fTracingBlock;
39     
40     /**
41      * Constructor
42      *
43      */

44     public TracingTab() {
45         fTracingBlock = new TracingBlock(this);
46         PDEPlugin.getDefault().getLabelProvider().connect(this);
47         fImage = PDEPluginImages.DESC_DOC_SECTION_OBJ.createImage();
48     }
49     
50     /*
51      * (non-Javadoc)
52      * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
53      */

54     public void createControl(Composite parent) {
55         Composite container = new Composite(parent, SWT.NULL);
56         container.setLayout(new GridLayout());
57         fTracingBlock.createControl(container);
58         setControl(container);
59         Dialog.applyDialogFont(container);
60         PlatformUI.getWorkbench().getHelpSystem().setHelp(container, IHelpContextIds.LAUNCHER_TRACING);
61     }
62
63     /*
64      * (non-Javadoc)
65      * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
66      */

67     public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
68         fTracingBlock.activated(workingCopy);
69     }
70     
71     /*
72      * (non-Javadoc)
73      * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
74      */

75     public void dispose() {
76         fTracingBlock.dispose();
77         if (fImage != null)
78             fImage.dispose();
79         PDEPlugin.getDefault().getLabelProvider().disconnect(this);
80         super.dispose();
81     }
82     
83     /*
84      * (non-Javadoc)
85      * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
86      */

87     public void initializeFrom(ILaunchConfiguration config) {
88         fTracingBlock.initializeFrom(config);
89     }
90     
91     /*
92      * (non-Javadoc)
93      * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
94      */

95     public void performApply(ILaunchConfigurationWorkingCopy config) {
96         fTracingBlock.performApply(config);
97     }
98     
99     /*
100      * (non-Javadoc)
101      * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
102      */

103     public void setDefaults(ILaunchConfigurationWorkingCopy config) {
104         fTracingBlock.setDefaults(config);
105     }
106     
107     /*
108      * (non-Javadoc)
109      * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
110      */

111     public String JavaDoc getName() {
112         return PDEUIMessages.TracingLauncherTab_name;
113     }
114     
115     /*
116      * (non-Javadoc)
117      * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
118      */

119     public Image getImage() {
120         return fImage;
121     }
122     
123     /*
124      * (non-Javadoc)
125      * @see org.eclipse.pde.ui.launcher.AbstractLauncherTab#validateTab()
126      */

127     public void validateTab() {
128     }
129 }
130
Popular Tags