pm.beginTask(LauncherMessages.getString("javaAppLauncher.progress.build"), 4);
pm.beginTask(LauncherMessages.getString("javaAppLauncher.progress.startVM"), 4);
	private boolean doLaunch(final IJavaProject jproject, final String mode, final IType mainType, ExecutionArguments args, String[] classPath, final ILauncher launcherProxy) {		try {			final IVMRunner runner= getVMRunner(jproject, mode);			if (runner == null) {				return false;			}						String vmArgs= null;			String programArgs= null;			if (args != null) {				vmArgs= args.getVMArguments();				programArgs= args.getProgramArguments();			}			final VMRunnerConfiguration config= new VMRunnerConfiguration(JavaModelUtil.getFullyQualifiedName(mainType), classPath);			config.setVMArguments(JavaLaunchUtils.parseArguments(vmArgs));			config.setProgramArguments(JavaLaunchUtils.parseArguments(programArgs));						final VMRunnerResult[] result= new VMRunnerResult[1];						IRunnableWithProgress r= new IRunnableWithProgress() {				public void run(IProgressMonitor pm) throws InvocationTargetException {					pm.beginTask(LauncherMessages.getString("javaAppLauncher.progress.build"), 4); //$NON-NLS-1$					IProject proj= jproject.getProject();					if (!proj.getWorkspace().isAutoBuilding()) {						try {							proj.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new SubProgressMonitor(pm, 3));						} catch (CoreException e) {							throw new InvocationTargetException(e);						}					}					SubProgressMonitor newMonitor= new SubProgressMonitor(pm, 1);					newMonitor.beginTask(LauncherMessages.getString("javaAppLauncher.progress.startVM"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$					result[0]= runner.run(config);					newMonitor.done();					pm.done();				}			};						try {				new ProgressMonitorDialog(JavaPlugin.getActiveWorkbenchShell()).run(true, false, r);					} catch (InterruptedException e) {				return true;			} catch (InvocationTargetException e) {				JavaPlugin.log(e);				return false;			}			if (result[0] != null) {				ISourceLocator sourceLocator= new ProjectSourceLocator(jproject);				Launch newLaunch= new Launch(launcherProxy, mode, mainType, sourceLocator, result[0].getProcesses(), result[0].getDebugTarget());				registerLaunch(newLaunch);			}			return true;		} catch (CoreException e) {			JavaPlugin.log(e);		}		return false;	}