launchArgument.append(parameter); if (spaceBetweenParameterAndArgument) launchArgument.append(" "); launchArgument.append(argument); launchArgument.append(" "); } } String debugGroups = configuration .getAttribute( WOJavaLocalApplicationLaunchConfigurationDelegate.ATTR_WOLIPS_LAUNCH_DEBUG_GROUPS, ""); if (debugGroups != null && debugGroups.length() > 0) { launchArgument.append(" -DNSDebugGroups=\"("); launchArgument.append(debugGroups); launchArgument.append(")\""); }  String pgmArgs = getProgramArguments(configuration) + " " + launchArgument.toString(); String vmArgs = getVMArguments(configuration); StringBuffer vmArgsBuffer = new StringBuffer(vmArgs);
launchArgument.append(StringUtilities.toCommandlineParameterFormat(parameter, argument)); launchArgument.append(" "); } } String debugGroups = configuration.getAttribute(WOJavaLocalApplicationLaunchConfigurationDelegate.ATTR_WOLIPS_LAUNCH_DEBUG_GROUPS, ""); if (debugGroups != null && debugGroups.length() > 0) { launchArgument.append(" -DNSDebugGroups=\"("); launchArgument.append(debugGroups); launchArgument.append(")\""); }  String pgmArgs = getProgramArguments(configuration) + " " + launchArgument.toString(); String vmArgs = getVMArguments(configuration); StringBuffer vmArgsBuffer = new StringBuffer(vmArgs);
	public void launch(ILaunchConfiguration configuration, String mode,			ILaunch launch, IProgressMonitor monitor) throws CoreException {		if (monitor == null) {			monitor = new NullProgressMonitor();		}		monitor				.beginTask(						LaunchingMessages								.getString("WOJavaLocalApplicationLaunchConfigurationDelegate.Launching..._1"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$		// check for cancellation		if (monitor.isCanceled()) {			return;		}		JavaProject javaProject = (JavaProject) (this				.getJavaProject(configuration).getAdapter(JavaProject.class));		String mainTypeName = verifyMainTypeName(configuration);		IVMInstall vm = verifyVMInstall(configuration);		IVMRunner runner = vm.getVMRunner(mode);		if (runner == null) {			if (mode == ILaunchManager.DEBUG_MODE) {				abort(						MessageFormat								.format(										LaunchingMessages												.getString("WOJavaLocalApplicationLaunchConfigurationDelegate.JRE_{0}_does_not_support_debug_mode._1"), new String[] { vm.getName() }), null, IJavaLaunchConfigurationConstants.ERR_VM_RUNNER_DOES_NOT_EXIST); //$NON-NLS-1$			} else {				abort(						MessageFormat								.format(										LaunchingMessages												.getString("WOJavaLocalApplicationLaunchConfigurationDelegate.JRE_{0}_does_not_support_run_mode._2"), new String[] { vm.getName() }), null, IJavaLaunchConfigurationConstants.ERR_VM_RUNNER_DOES_NOT_EXIST); //$NON-NLS-1$			}		}		File workingDir = verifyWorkingDirectory(configuration);		String workingDirName = null;		if (workingDir != null) {			workingDirName = workingDir.getAbsolutePath();		}		String launchArguments = configuration				.getAttribute(						WOJavaLocalApplicationLaunchConfigurationDelegate.ATTR_WOLIPS_LAUNCH_WOARGUMENTS,						Preferences.getPREF_LAUNCH_GLOBAL());		ILaunchInfo[] launchInfo = Preferences				.getLaunchInfoFrom(launchArguments);		StringBuffer launchArgument = new StringBuffer();		String automatic = "Automatic";		for (int i = 0; i < launchInfo.length; i++) {			boolean spaceBetweenParameterAndArgument = true;			if (launchInfo[i].isEnabled()) {				// -WOApplicationClassName				String parameter = launchInfo[i].getParameter();				String argument = launchInfo[i].getArgument();				if (automatic.equals(argument)) {					if ("-WOApplicationClassName".equals(parameter))						argument = mainTypeName;					if ("-DWORoot=".equals(parameter)) {						argument = VariablesPlugin.getDefault().getSystemRoot()								.toOSString();						spaceBetweenParameterAndArgument = false;						if (javaProject.isOnMacOSX()) {							parameter = "";							argument = "";						}					}					if ("-DWORootDirectory=".equals(parameter)) {						argument = VariablesPlugin.getDefault().getSystemRoot()								.toOSString();						spaceBetweenParameterAndArgument = false;						if (javaProject.isOnMacOSX()) {							parameter = "";							argument = "";						}					}					if ("-DWOUserDirectory".equals(parameter)) {						argument = workingDir.getAbsolutePath();						spaceBetweenParameterAndArgument = false;					}					if ("-NSProjectSearchPath".equals(parameter)) {						argument = javaProject.getGeneratedByWOLips(Preferences								.getPREF_NS_PROJECT_SEARCH_PATH());					}				}				launchArgument.append(parameter);				if (spaceBetweenParameterAndArgument)					launchArgument.append(" ");				launchArgument.append(argument);				launchArgument.append(" ");			}		}		String debugGroups = configuration				.getAttribute(						WOJavaLocalApplicationLaunchConfigurationDelegate.ATTR_WOLIPS_LAUNCH_DEBUG_GROUPS,						"");		if (debugGroups != null && debugGroups.length() > 0) {			launchArgument.append(" -DNSDebugGroups=\"(");			launchArgument.append(debugGroups);			launchArgument.append(")\"");		}		// Program & VM args		String pgmArgs = getProgramArguments(configuration) + " "				+ launchArgument.toString();		String vmArgs = getVMArguments(configuration);		StringBuffer vmArgsBuffer = new StringBuffer(vmArgs);		this.addVMArguments(vmArgsBuffer, configuration, launch, mode);		ExecutionArguments execArgs = new ExecutionArguments(vmArgsBuffer				.toString(), pgmArgs);		// VM-specific attributes		Map vmAttributesMap = getVMSpecificAttributesMap(configuration);		// Classpath		String[] classpath = getClasspath(configuration);		// Create VM config		VMRunnerConfiguration runConfig = new VMRunnerConfiguration(				mainTypeName, classpath);		runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());		runConfig.setVMArguments(execArgs.getVMArgumentsArray());		runConfig.setWorkingDirectory(workingDirName);		runConfig.setVMSpecificAttributesMap(vmAttributesMap);		// Bootpath		String[] bootpath = getBootpath(configuration);		runConfig.setBootClassPath(bootpath);		// check for cancellation		if (monitor.isCanceled()) {			return;		}		// stop in main		prepareStopInMain(configuration);		// Launch the configuration		runner.run(runConfig, launch, monitor);		// check for cancellation		if (monitor.isCanceled()) {			return;		}		// set the default source locator if required		setDefaultSourceLocator(launch, configuration);		monitor.done();	}