/** * {@inheritDoc} * * @see org.eclipse.jdt.launching.JavaLaunchDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, * java.lang.String, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor) */ @Override public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { super.launch(configuration, mode, launch, monitor); }
@Override public String getVMArguments(ILaunchConfiguration configuration) throws CoreException { return super.getVMArguments(configuration); }
/** * Returns the applet's main type name. * * @param configuration the config * @return the main type name * @throws CoreException if a problem occurs */ protected String getAppletMainTypeName(ILaunchConfiguration configuration) throws CoreException { return super.getMainTypeName(configuration); }
monitor.subTask(LaunchingMessages.JavaLocalApplicationLaunchConfigurationDelegate_Verifying_launch_attributes____1); String mainTypeName = verifyMainTypeName(configuration); IVMRunner runner = getVMRunner(configuration, mode); File workingDir = verifyWorkingDirectory(configuration); String workingDirName = null; if (workingDir != null) { String[] envp= getEnvironment(configuration); String pgmArgs = getProgramArguments(configuration); String vmArgs = getVMArguments(configuration); ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs); Map<String, Object> vmAttributesMap = getVMSpecificAttributesMap(configuration); String[] classpath = getClasspath(configuration); runConfig.setBootClassPath(getBootpath(configuration)); prepareStopInMain(configuration); setDefaultSourceLocator(launch, configuration); monitor.worked(1);
String mainTypeName = verifyMainTypeName(configuration); File workingDir = verifyWorkingDirectory(configuration); String workingDirName = null; if (workingDir != null) { String[] envp = getEnvironment(configuration); String pgmArgs = getProgramArguments(configuration); String vmArgs = concat(getVMArguments(configuration), getVMArguments(configuration, mode)); ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs); Map<String, Object> vmAttributesMap = getVMSpecificAttributesMap(configuration); String[][] paths = getClasspathAndModulepath(configuration); VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName, getClasspath(configuration)); runConfig.setProgramArguments(execArgs.getProgramArgumentsArray()); runConfig.setEnvironment(envp); runConfig.setWorkingDirectory(workingDirName); runConfig.setVMSpecificAttributesMap(vmAttributesMap); if (supportsModule()) { runConfig.setBootClassPath(getBootpath(configuration)); } else if (supportsModule()) { runConfig.setOverrideDependencies(configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MODULE_CLI_OPTIONS, "")); //$NON-NLS-1$ } else {
@Override public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { if (monitor == null) { monitor = new NullProgressMonitor(); } try { VMRunnerConfiguration runConfig = getVMRunnerConfiguration(configuration, mode, monitor); if (runConfig == null) { return; } // stop in main prepareStopInMain(configuration); // done the verification phase monitor.worked(1); monitor.subTask(LaunchingMessages.JavaLocalApplicationLaunchConfigurationDelegate_Creating_source_locator____2); // set the default source locator if required setDefaultSourceLocator(launch, configuration); monitor.worked(1); // Launch the configuration - 1 unit of work IVMRunner runner = getVMRunner(configuration, mode); runner.run(runConfig, launch, monitor); // check for cancellation if (monitor.isCanceled()) { return; } } finally { monitor.done(); } }
@Override protected Set<IPackageFragmentRoot> getSourceFolders(ILaunchConfiguration configuration) throws CoreException { JavaLaunchDelegate launchDelegate = new JavaLaunchDelegate(); IJavaProject javaProject = launchDelegate.getJavaProject(configuration); if (javaProject == null) { return ImmutableSet.of(); } String mainTypeName = launchDelegate.getMainTypeName(configuration); if (mainTypeName == null) { return ImmutableSet.of(); } IType mainType = javaProject.findType(mainTypeName); if (mainType == null) { return ImmutableSet.of(); } IJavaElement pkg = mainType.getPackageFragment().getParent(); if (!(pkg instanceof IPackageFragmentRoot)) { return ImmutableSet.of(); } return ImmutableSet.of((IPackageFragmentRoot) pkg); }
@Override public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException { try { return super.getProgramArguments(configuration); } catch (CoreException ce) { // do nothing } return configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, IAntCoreConstants.EMPTY_STRING); } }
@Override public String showCommandLine(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { if (monitor == null) { monitor = new NullProgressMonitor(); } try { VMRunnerConfiguration runConfig = getVMRunnerConfiguration(configuration, mode, monitor); if (runConfig == null) { return ""; //$NON-NLS-1$ } IVMRunner runner = getVMRunner(configuration, mode); String cmdLine = runner.showCommandLine(runConfig, launch, monitor); // check for cancellation if (monitor.isCanceled()) { return ""; //$NON-NLS-1$ } return cmdLine; } finally { monitor.done(); } }
@Override public String[] getClasspath(ILaunchConfiguration configuration) throws CoreException { List<String> extendedClasspath = new ArrayList<String>(); Collections.addAll(extendedClasspath, super.getClasspath(configuration)); IScriptProject scriptProject = AbstractScriptLaunchConfigurationDelegate .getScriptProject(configuration); extendedClasspath.addAll(getClassPath(scriptProject)); String[] result = extendedClasspath.toArray(new String[extendedClasspath.size()]); // ILog log = RutaIdeUIPlugin.getDefault().getLog(); // log.log(new Status(IStatus.INFO, RutaIdeUIPlugin.PLUGIN_ID, "Classpath of "+ // configuration.getName()+": " + StringUtils.join(result, ";"))); return result; }
@Override public synchronized void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { try { fLaunch = launch; super.launch(configuration, mode, launch, monitor); } catch (CoreException e) { cleanup(launch); throw e; } fLaunch = null; }
@Override public String getVMArguments(ILaunchConfiguration configuration) throws CoreException { StringBuffer arguments = new StringBuffer(super.getVMArguments(configuration)); File workingDir = verifyWorkingDirectory(configuration); String javaPolicyFile = getJavaPolicyFile(workingDir); arguments.append(" "); //$NON-NLS-1$ arguments.append(javaPolicyFile); return arguments.toString(); }
/** * Returns the applet's main type name. * * @param configuration the config * @return the main type name * @throws CoreException if a problem occurs */ protected String getAppletMainTypeName(ILaunchConfiguration configuration) throws CoreException { return super.getMainTypeName(configuration); }
@Override public synchronized void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { try { fLaunch = launch; super.launch(configuration, mode, launch, monitor); } catch (CoreException e) { cleanup(launch); throw e; } fLaunch = null; }
@Override public String getVMArguments(ILaunchConfiguration configuration) throws CoreException { StringBuilder arguments = new StringBuilder(super.getVMArguments(configuration)); File workingDir = verifyWorkingDirectory(configuration); String javaPolicyFile = getJavaPolicyFile(workingDir); arguments.append(" "); //$NON-NLS-1$ arguments.append(javaPolicyFile); return arguments.toString(); }
/** * Override super to ensure that the aspectpath is on the runtime classpath * * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, * java.lang.String, org.eclipse.debug.core.ILaunch, * org.eclipse.core.runtime.IProgressMonitor) */ public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { LaunchConfigurationClasspathUtils.addAspectPathAndOutJarToClasspath(configuration); super.launch(configuration, mode, launch, monitor); }
/** * {@inheritDoc} * * @see org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getVMArguments(org.eclipse.debug.core.ILaunchConfiguration) */ @Override public String getVMArguments(ILaunchConfiguration configuration) throws CoreException { JettyLaunchConfigurationAdapter adapter = JettyLaunchConfigurationAdapter.getInstance(configuration); File defaultFile = createJettyConfigurationFile(adapter, false); String vmArguments = super.getVMArguments(configuration); vmArguments += String.format(" -D%s=%s", CONFIGURATION_KEY, getConfigurationParameter(adapter, defaultFile)); //$NON-NLS-1$ if (!adapter.isShowLauncherInfo()) { vmArguments += String.format(" -D%s", HIDE_LAUNCH_INFO_KEY); //$NON-NLS-1$ } if (!adapter.isConsoleEnabled()) { vmArguments += String.format(" -D%s", DISABLE_CONSOLE_KEY); //$NON-NLS-1$ } if (adapter.isJmxSupport()) { vmArguments += " -Dcom.sun.management.jmxremote"; //$NON-NLS-1$ } return vmArguments; }
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { IJavaProject javaProject = getJavaProject(configuration); Project project = Activator.getDefault().getCentral().getModel(javaProject); try { launcher = project.getProjectLauncher(); super.launch(configuration, mode, launch, monitor); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { IJavaProject javaProject = getJavaProject(configuration); Project model = Activator.getDefault().getCentral().getModel(javaProject); try { ProjectLauncher launcher = new ProjectLauncher(model); List<String> vmArguments = new ArrayList<String>(); List<String> programArguments = new ArrayList<String>(); launcher.getArguments(vmArguments, programArguments, false); this.classpath = launcher.getClasspath(); this.vmArguments = Processor.join(vmArguments, " "); this.programArguments = Processor.join(programArguments, " "); super.launch(configuration, mode, launch, monitor); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
super.launch(configuration, mode, launch, monitor);