/** * Configures defaults on newly created launch configurations. * This function also passes the launch configuration copy to the default * registered OSGi framework, giving it an opportunity to initialize and override * more defaults on the launch configuration. * Refer to the <code>org.eclipse.pde.core.osgiFrameworks</code> extension point for more details * on OSGi frameworks. * * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { super.setDefaults(configuration); OSGiFrameworkManager manager = PDELaunchingPlugin.getDefault().getOSGiFrameworkManager(); manager.getDefaultInitializer().initialize(configuration); }
/** * Delegates to all tabs to set defaults. * It then sets program and VM arguments based on values on the * <b>Plug-in Development > Target Platform > Launching Arguments</b> preference page. * * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { super.setDefaults(configuration); if (TargetPlatformHelper.usesNewApplicationModel()) configuration.setAttribute(IPDEConstants.LAUNCHER_PDE_VERSION, "3.3"); //$NON-NLS-1$ else if (TargetPlatformHelper.getTargetVersion() >= 3.2) configuration.setAttribute(IPDEConstants.LAUNCHER_PDE_VERSION, "3.2a"); //$NON-NLS-1$ configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER, PDESourcePathProvider.ID); // Set Program/VM arguments with preference values String programArgs = LaunchArgumentsHelper.getInitialProgramArguments().trim(); if (programArgs.length() > 0) configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArgs); String vmArgs = LaunchArgumentsHelper.getInitialVMArguments().trim(); if (vmArgs.length() > 0) configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs); configuration.setAttribute(IPDEConstants.APPEND_ARGS_EXPLICITLY, true); }
@Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { // set default name for script IResource resource = DebugUITools.getSelectedResource(); if (resource != null && resource instanceof IFile) { IFile file = (IFile) resource; if (AntUtil.isKnownAntFile(file)) { String projectName = file.getProject().getName(); StringBuffer buffer = new StringBuffer(projectName); buffer.append(' '); buffer.append(file.getName()); String name = buffer.toString().trim(); name = DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(name); configuration.rename(name); // set the project name so that the correct default VM install can be determined configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName); configuration.setAttribute(IExternalToolConstants.ATTR_LOCATION, VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", file.getFullPath().toString())); //$NON-NLS-1$ } } configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, "org.eclipse.ant.ui.AntClasspathProvider"); //$NON-NLS-1$ super.setDefaults(configuration); } }