KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 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.debug.ui.AbstractLaunchConfigurationTab;
16 import org.eclipse.swt.SWT;
17 import org.eclipse.swt.layout.GridData;
18 import org.eclipse.swt.widgets.Composite;
19 import org.eclipse.swt.widgets.Label;
20
21 /**
22  * An abstract class subclassed by all PDE tabs.
23  * <p>
24  * This class may be subclassed by clients.
25  * </p>
26  * @since 3.2
27  */

28 public abstract class AbstractLauncherTab extends 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 }
84
Popular Tags