1 11 package org.eclipse.pde.internal.ui.launcher; 12 13 import java.util.*; 14 15 import org.eclipse.core.runtime.*; 16 import org.eclipse.debug.core.*; 17 import org.eclipse.pde.internal.ui.*; 18 19 public class JUnitArgumentsTab extends BasicLauncherTab { 20 21 protected String getApplicationAttribute() { 22 return APP_TO_TEST; 23 } 24 25 public void setDefaults(ILaunchConfigurationWorkingCopy config) { 26 config.setAttribute( 27 LOCATION + "0", LauncherUtils.getDefaultPath().append("runtime-test-workspace").toOSString()); config.setAttribute(DOCLEAR, true); 30 config.setAttribute(ASKCLEAR, false); 31 config.setAttribute(PROGARGS, ""); config.setAttribute(VMARGS, ""); config.setAttribute(BOOTSTRAP_ENTRIES, ""); if (!JUnitLaunchConfiguration.requiresUI(config)) 35 config.setAttribute(APPLICATION, JUnitLaunchConfiguration.CORE_APPLICATION); 36 } 37 38 protected String [] getApplicationNames() { 39 TreeSet result = new TreeSet(); 40 result.add(PDEUIMessages.JUnitArgumentsTab_headless); String [] appNames = super.getApplicationNames(); 42 for (int i = 0; i < appNames.length; i++) { 43 result.add(appNames[i]); 44 } 45 return (String [])result.toArray(new String [result.size()]); 46 } 47 48 51 protected void initializeApplicationSection(ILaunchConfiguration config) 52 throws CoreException { 53 String application = config.getAttribute(APPLICATION, (String )null); 54 if (JUnitLaunchConfiguration.CORE_APPLICATION.equals(application)) 55 fApplicationCombo.setText(PDEUIMessages.JUnitArgumentsTab_headless); else 57 super.initializeApplicationSection(config); 58 } 59 60 63 protected void saveApplicationSection(ILaunchConfigurationWorkingCopy config) { 64 if (fApplicationCombo.getText().equals(PDEUIMessages.JUnitArgumentsTab_headless)) { config.setAttribute(APPLICATION, JUnitLaunchConfiguration.CORE_APPLICATION); 66 config.setAttribute(APP_TO_TEST, (String )null); 67 } else { 68 config.setAttribute(APPLICATION, (String )null); 69 super.saveApplicationSection(config); 70 } 71 } 72 73 74 75 } 76 | Popular Tags |