001: /*******************************************************************************
002: * Copyright (c) 2005 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.pde.ui.launcher;
011:
012: import org.eclipse.debug.core.ILaunchConfiguration;
013: import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
014: import org.eclipse.jface.dialogs.Dialog;
015: import org.eclipse.pde.internal.ui.IHelpContextIds;
016: import org.eclipse.pde.internal.ui.PDEPlugin;
017: import org.eclipse.pde.internal.ui.PDEPluginImages;
018: import org.eclipse.pde.internal.ui.PDEUIMessages;
019: import org.eclipse.pde.internal.ui.launcher.TracingBlock;
020: import org.eclipse.swt.SWT;
021: import org.eclipse.swt.graphics.Image;
022: import org.eclipse.swt.layout.GridLayout;
023: import org.eclipse.swt.widgets.Composite;
024: import org.eclipse.ui.PlatformUI;
025:
026: /**
027: * A launch configuration tab that enables tracing and displays all plug-ins that support
028: * tracing.
029: * <p>
030: * This class may be instantiated. This class is not intended to be subclassed by clients.
031: * </p>
032: * @since 3.2
033: */
034: public class TracingTab extends AbstractLauncherTab {
035:
036: private Image fImage;
037: private TracingBlock fTracingBlock;
038:
039: /**
040: * Constructor
041: *
042: */
043: public TracingTab() {
044: fTracingBlock = new TracingBlock(this );
045: PDEPlugin.getDefault().getLabelProvider().connect(this );
046: fImage = PDEPluginImages.DESC_DOC_SECTION_OBJ.createImage();
047: }
048:
049: /*
050: * (non-Javadoc)
051: * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
052: */
053: public void createControl(Composite parent) {
054: Composite container = new Composite(parent, SWT.NULL);
055: container.setLayout(new GridLayout());
056: fTracingBlock.createControl(container);
057: setControl(container);
058: Dialog.applyDialogFont(container);
059: PlatformUI.getWorkbench().getHelpSystem().setHelp(container,
060: IHelpContextIds.LAUNCHER_TRACING);
061: }
062:
063: /*
064: * (non-Javadoc)
065: * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
066: */
067: public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
068: fTracingBlock.activated(workingCopy);
069: }
070:
071: /*
072: * (non-Javadoc)
073: * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
074: */
075: public void dispose() {
076: fTracingBlock.dispose();
077: if (fImage != null)
078: fImage.dispose();
079: PDEPlugin.getDefault().getLabelProvider().disconnect(this );
080: super .dispose();
081: }
082:
083: /*
084: * (non-Javadoc)
085: * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
086: */
087: public void initializeFrom(ILaunchConfiguration config) {
088: fTracingBlock.initializeFrom(config);
089: }
090:
091: /*
092: * (non-Javadoc)
093: * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
094: */
095: public void performApply(ILaunchConfigurationWorkingCopy config) {
096: fTracingBlock.performApply(config);
097: }
098:
099: /*
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 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: }
|