01: /*******************************************************************************
02: * Copyright (c) 2005, 2006 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.ILaunchConfigurationWorkingCopy;
13: import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
14: import org.eclipse.debug.ui.CommonTab;
15: import org.eclipse.debug.ui.EnvironmentTab;
16: import org.eclipse.debug.ui.ILaunchConfigurationDialog;
17: import org.eclipse.debug.ui.ILaunchConfigurationTab;
18: import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab;
19: import org.eclipse.pde.internal.ui.PDEPlugin;
20: import org.eclipse.pde.internal.ui.launcher.OSGiFrameworkManager;
21:
22: /**
23: * Creates and initializes the tabs on the OSGi Framework launch configuration.
24: * <p>
25: * Clients may subclass this class.
26: * </p>
27: * @since 3.3
28: */
29: public class OSGiLauncherTabGroup extends
30: AbstractLaunchConfigurationTabGroup {
31:
32: /*
33: * (non-Javadoc)
34: * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
35: */
36: public void createTabs(ILaunchConfigurationDialog dialog,
37: String mode) {
38: ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
39: new BundlesTab(), new JavaArgumentsTab(),
40: new OSGiSettingsTab(), new TracingTab(),
41: new EnvironmentTab(), new CommonTab() };
42: setTabs(tabs);
43: }
44:
45: /**
46: * Configures defaults on newly created launch configurations.
47: * This function also passes the launch configuration copy to the default
48: * registered OSGi framework, giving it an opportunity to initialize and override
49: * more defaults on the launch configuration.
50: * Refer to the <code>org.eclipse.pde.core.osgiFrameworks</code> extension point for more details
51: * on OSGi frameworks.
52: *
53: * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
54: */
55: public void setDefaults(
56: ILaunchConfigurationWorkingCopy configuration) {
57: super .setDefaults(configuration);
58: OSGiFrameworkManager manager = PDEPlugin.getDefault()
59: .getOSGiFrameworkManager();
60: manager.getDefaultInitializer().initialize(configuration);
61: }
62:
63: }
|