1 11 package org.eclipse.pde.internal.ui.launcher; 12 13 import org.eclipse.core.runtime.Preferences; 14 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; 15 import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; 16 import org.eclipse.debug.ui.CommonTab; 17 import org.eclipse.debug.ui.EnvironmentTab; 18 import org.eclipse.debug.ui.ILaunchConfigurationDialog; 19 import org.eclipse.debug.ui.ILaunchConfigurationTab; 20 import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab; 21 import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; 22 import org.eclipse.pde.internal.core.ICoreConstants; 23 import org.eclipse.pde.internal.core.PDECore; 24 import org.eclipse.pde.ui.launcher.EquinoxPluginsTab; 25 import org.eclipse.pde.ui.launcher.EquinoxSettingsTab; 26 import org.eclipse.pde.ui.launcher.TracingTab; 27 28 public class EquinoxLauncherTabGroup extends AbstractLaunchConfigurationTabGroup { 29 30 public void createTabs(ILaunchConfigurationDialog dialog, String mode) { 31 ILaunchConfigurationTab[] tabs = 32 new ILaunchConfigurationTab[]{ 33 new EquinoxPluginsTab(), 34 new JavaArgumentsTab(), 35 new EquinoxSettingsTab(), 36 new TracingTab(), 37 new EnvironmentTab(), 38 new CommonTab()}; 39 setTabs(tabs); 40 } 41 42 public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { 43 super.setDefaults(configuration); 44 configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "-console"); Preferences preferences = PDECore.getDefault().getPluginPreferences(); 46 String progArgs = preferences.getString(ICoreConstants.PROGRAM_ARGS); 47 if (progArgs.indexOf("-console") == -1) progArgs = "-console " + progArgs; configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, progArgs); String vmArgs = preferences.getString(ICoreConstants.VM_ARGS); 51 if (vmArgs.length() > 0) 52 configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs); 53 } 54 55 } 56 | Popular Tags |