01: /*******************************************************************************
02: * Copyright (c) 2005, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.ui.launcher;
11:
12: import org.eclipse.debug.core.ILaunchConfiguration;
13: import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
14: import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
15: import org.eclipse.swt.SWT;
16: import org.eclipse.swt.layout.GridData;
17: import org.eclipse.swt.widgets.Composite;
18: import org.eclipse.swt.widgets.Label;
19:
20: /**
21: * An abstract class subclassed by all PDE tabs.
22: * <p>
23: * This class may be subclassed by clients.
24: * </p>
25: * @since 3.2
26: */
27: public abstract class AbstractLauncherTab extends
28: AbstractLaunchConfigurationTab {
29:
30: /**
31: * Creates an empty label and hence a space in the tab
32: *
33: * @param parent the parent of the label
34: * @param span the span of the label
35: * @deprecated
36: */
37: protected void createStartingSpace(Composite parent, int span) {
38: Label label = new Label(parent, SWT.NULL);
39: GridData data = new GridData();
40: data.horizontalSpan = span;
41: label.setLayoutData(data);
42: }
43:
44: /**
45: *
46: *
47: * @return <code>true</code> if the tab is valid, <code>false</code> otherwise
48: *
49: * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
50: */
51: public boolean isValid(ILaunchConfiguration config) {
52: return getErrorMessage() == null;
53: }
54:
55: /* (non-Javadoc)
56: * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
57: */
58: public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
59: }
60:
61: /* (non-Javadoc)
62: * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
63: */
64: public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
65: }
66:
67: /**
68: * Validates the page and updates the buttons and message of the launch configuration dialog.
69: *
70: * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
71: */
72: public void updateLaunchConfigurationDialog() {
73: validateTab();
74: super .updateLaunchConfigurationDialog();
75: }
76:
77: /**
78: * Validates the data entered on the tab.
79: *
80: */
81: public abstract void validateTab();
82:
83: }
|