wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "streamit.frontend.ToJava");
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, StreamItLauncherPlugin.TO_JAVA_CLASS);
	public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {		// need to do something with ILaunch launch (add processes, etc)		if (monitor == null) monitor = new NullProgressMonitor();			try {			// Get information from configuration			String projectName = getJavaProjectName(configuration);			String mainClassName = getMainTypeName(configuration);			String strFileName = mainClassName + '.' + StreamItLauncherPlugin.STR_FILE_EXTENSION;			String javaFileName = mainClassName + '.' + JAVA_FILE_EXTENSION;			String secondaryFileNames = configuration.getAttribute(StreamItLauncherPlugin.ATTR_SECONDARY_CLASSES, "");			// run streamit.frontend.ToJava			ILaunchManager manager = getLaunchManager();			ILaunchConfigurationType type = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);			ILaunchConfigurationWorkingCopy wc = type.newInstance(null, "StrToJavaConfig");			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "streamit.frontend.ToJava");			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,							"--output " + javaFileName + " " + strFileName + " " + secondaryFileNames);			ILaunchConfiguration config = wc.doSave();			ILaunch tempLaunch = config.launch(ILaunchManager.RUN_MODE, monitor);			IProcess[] processes = tempLaunch.getProcesses();			while (!tempLaunch.isTerminated()) {}				// show java file to user 			IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);			project.refreshLocal(IResource.DEPTH_INFINITE, monitor);			// compile java file			project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);			// in debug mode, add debug listener			if (mode.equals(ILaunchManager.DEBUG_MODE)) {				DebugPlugin.getDefault().addDebugEventListener(listener);								// test:  process .java				//prepareFilterDisplay(project.getFile(javaFileName), project.getFile(strFileName));			}						// run java code			wc = type.newInstance(null, StreamItLauncherPlugin.ID_STR_APPLICATION);			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, mainClassName);			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, getProgramArguments(configuration));			config = wc.doSave();			tempLaunch = config.launch(mode, monitor);			setDefaultSourceLocator(tempLaunch, config);		} catch (Exception e) {			System.out.println("StreamIt Launch has failed.");		}		}