01: package org.eclipse.pde.internal.junit.launcher;
02:
03: /*
04: * (c) Copyright IBM Corp. 2000, 2001.
05: * All Rights Reserved.
06: */
07:
08: import org.eclipse.core.boot.BootLoader;
09: import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
10: import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
11: import org.eclipse.debug.ui.CommonTab;
12: import org.eclipse.debug.ui.IDebugUIConstants;
13: import org.eclipse.debug.ui.ILaunchConfigurationDialog;
14: import org.eclipse.debug.ui.ILaunchConfigurationTab;
15: import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab;
16: import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
17: import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
18:
19: public class JUnitPdeTabGroup extends
20: AbstractLaunchConfigurationTabGroup {
21: /**
22: * @see ILaunchConfigurationTabGroup#createTabs(ILaunchConfigurationDialog, String)
23: */
24: public void createTabs(ILaunchConfigurationDialog dialog,
25: String mode) {
26: ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
27: new JUnitPdeMainTab(), new JavaArgumentsTab(),
28: new JavaJRETab(), new CommonTab() };
29: setTabs(tabs);
30: }
31:
32: /**
33: * @see ILaunchConfigurationTabGroup#setDefaults(ILaunchConfigurationWorkingCopy)
34: */
35: public void setDefaults(ILaunchConfigurationWorkingCopy config) {
36: super .setDefaults(config);
37: config.setAttribute(
38: IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE,
39: IDebugUIConstants.PERSPECTIVE_NONE);
40: config
41: .setAttribute(
42: IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
43: getDefaultProgramArguments());
44: }
45:
46: static String getDefaultProgramArguments() {
47: String os = BootLoader.getOS();
48: String ws = BootLoader.getWS();
49: String arch = BootLoader.getOSArch();
50: return "-os " + os + " -ws " + ws + " -arch " + arch;
51: }
52: }
|