### Eclipse Workspace Patch 1.0 #P org.eclipse.pde.core Index: src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java,v retrieving revision 1.54 diff -u -r1.54 BundleErrorReporter.java --- src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 13 Nov 2007 05:12:28 -0000 1.54 +++ src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 16 Nov 2007 21:38:02 -0000 @@ -36,6 +36,7 @@ import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.launching.IVMInstall; import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.launching.environments.IExecutionEnvironment; import org.eclipse.osgi.service.resolver.BundleDescription; @@ -377,8 +378,22 @@ String[] bundleEnvs = desc.getExecutionEnvironments(); if (bundleEnvs == null || bundleEnvs.length == 0) { // No EE specified - report(PDECoreMessages.BundleErrorReporter_noExecutionEnvironmentSet, 1, sev, - PDEMarkerFactory.M_EXECUTION_ENVIRONMENT_NOT_SET, PDEMarkerFactory.CAT_EE); + IExecutionEnvironment[] systemEnvs = JavaRuntime.getExecutionEnvironmentsManager().getExecutionEnvironments(); + IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall(); + + for(int i = 0; i < systemEnvs.length; i++) { + // Get strictly compatible EE for the default VM + if(systemEnvs[i].isStrictlyCompatible(defaultVM)) { + IMarker marker = report(PDECoreMessages.BundleErrorReporter_noExecutionEnvironmentSet, 1, sev, + PDEMarkerFactory.M_EXECUTION_ENVIRONMENT_NOT_SET, PDEMarkerFactory.CAT_EE); + try { + if (marker != null) { + marker.setAttribute("ee_id", systemEnvs[i].getId()); //$NON-NLS-1$ + } + } catch (CoreException e) {} + break; + } + } return; } Index: src/org/eclipse/pde/internal/core/pderesources.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties,v retrieving revision 1.81 diff -u -r1.81 pderesources.properties --- src/org/eclipse/pde/internal/core/pderesources.properties 7 Nov 2007 16:38:42 -0000 1.81 +++ src/org/eclipse/pde/internal/core/pderesources.properties 16 Nov 2007 21:37:57 -0000 @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2006 IBM Corporation and others. +# Copyright (c) 2000, 2007 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -147,7 +147,7 @@ BundleErrorReporter_unresolvedHost=Host bundle ''{0}'' exists but is unresolved BundleErrorReporter_lazyStart_unsupported=The Eclipse-LazyStart header is not supported by pre-3.2 targets BundleErrorReporter_unsatisfiedConstraint=Unsatisfied constraint: ''{0}'' -BundleErrorReporter_noExecutionEnvironmentSet=No Execution Environment has been set +BundleErrorReporter_noExecutionEnvironmentSet=No required execution environment has been set BundleTextChangeListener_editNames_newLine=Add a new line at the end of the file BundleTextChangeListener_editNames_remove=Remove "{0}" header BundleTextChangeListener_editNames_insert=Insert "{0}" header #P org.eclipse.pde.ui Index: src/org/eclipse/pde/internal/ui/correction/AddDefaultExecutionEnvironmentResolution.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddDefaultExecutionEnvironmentResolution.java,v retrieving revision 1.2 diff -u -r1.2 AddDefaultExecutionEnvironmentResolution.java --- src/org/eclipse/pde/internal/ui/correction/AddDefaultExecutionEnvironmentResolution.java 12 Oct 2007 23:00:49 -0000 1.2 +++ src/org/eclipse/pde/internal/ui/correction/AddDefaultExecutionEnvironmentResolution.java 16 Nov 2007 21:38:18 -0000 @@ -11,9 +11,9 @@ *******************************************************************************/ package org.eclipse.pde.internal.ui.correction; -import org.eclipse.jdt.launching.IVMInstall; import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.launching.environments.IExecutionEnvironment; +import org.eclipse.osgi.util.NLS; import org.eclipse.pde.internal.core.ibundle.IManifestHeader; import org.eclipse.pde.internal.core.text.bundle.BundleModel; import org.eclipse.pde.internal.core.text.bundle.RequiredExecutionEnvironmentHeader; @@ -22,8 +22,11 @@ public class AddDefaultExecutionEnvironmentResolution extends AbstractManifestMarkerResolution { - public AddDefaultExecutionEnvironmentResolution(int type) { + private String id; + + public AddDefaultExecutionEnvironmentResolution(int type, String id) { super(type); + this.id = id; } protected void createChange(BundleModel model) { @@ -38,22 +41,12 @@ header = model.getBundle().getManifestHeader(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT); if(header != null && header instanceof RequiredExecutionEnvironmentHeader) { - // TODO consider moving to VMHelper class - // Get available EEs & default install VM - IExecutionEnvironment[] systemEnvs = JavaRuntime.getExecutionEnvironmentsManager().getExecutionEnvironments(); - IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall(); - - for(int i = 0; i < systemEnvs.length; i++) { - // Get strictly compatible EE for the default VM - if(systemEnvs[i].isStrictlyCompatible(defaultVM)) { - ((RequiredExecutionEnvironmentHeader) header).addExecutionEnvironment(systemEnvs[i]); - break; - } - } + IExecutionEnvironment ee = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(id); + ((RequiredExecutionEnvironmentHeader) header).addExecutionEnvironment(ee); } } public String getLabel() { - return PDEUIMessages.AddDefaultExecutionEnvironment_label; + return NLS.bind(PDEUIMessages.AddDefaultExecutionEnvironment_label, id); } } Index: src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java,v retrieving revision 1.31 diff -u -r1.31 ResolutionGenerator.java --- src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java 4 Oct 2007 20:44:24 -0000 1.31 +++ src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java 16 Nov 2007 21:38:18 -0000 @@ -93,9 +93,9 @@ case PDEMarkerFactory.M_DEPRECATED_PROVIDE_PACKAGE: return new IMarkerResolution[] {new RenameProvidePackageResolution(AbstractPDEMarkerResolution.RENAME_TYPE)}; case PDEMarkerFactory.M_EXECUTION_ENVIRONMENT_NOT_SET: - return new IMarkerResolution[] { new AddDefaultExecutionEnvironmentResolution(AbstractPDEMarkerResolution.CREATE_TYPE) }; + return new IMarkerResolution[] { new AddDefaultExecutionEnvironmentResolution(AbstractPDEMarkerResolution.CREATE_TYPE, marker.getAttribute("ee_id", null)) }; //$NON-NLS-1$ case PDEMarkerFactory.M_MISSING_BUNDLE_CLASSPATH_ENTRY: - return new IMarkerResolution[] {new AddBundleClassPathMarkerResolution(AbstractPDEMarkerResolution.CREATE_TYPE, marker.getAttribute("entry", null))}; //$NON-NLS-1$) + return new IMarkerResolution[] {new AddBundleClassPathMarkerResolution(AbstractPDEMarkerResolution.CREATE_TYPE, marker.getAttribute("entry", null))}; //$NON-NLS-1$ } return NO_RESOLUTIONS; } Index: src/org/eclipse/pde/internal/ui/pderesources.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties,v retrieving revision 1.938 diff -u -r1.938 pderesources.properties --- src/org/eclipse/pde/internal/ui/pderesources.properties 12 Nov 2007 13:47:29 -0000 1.938 +++ src/org/eclipse/pde/internal/ui/pderesources.properties 16 Nov 2007 21:38:18 -0000 @@ -2035,7 +2035,7 @@ RemoveRequireBundleResolution_label=Remove bundle ''{0}'' from the list RemoveUnknownExecEnvironments_label=Remove all unknown Execution Environments -AddDefaultExecutionEnvironment_label=Add default Execution Environment +AddDefaultExecutionEnvironment_label=Add ''{0}'' as a required execution environment RegisterCSWizard_registerCheatSheet=Register Cheat Sheet RegisterCSWizardPage_wizardPageDescription=Allow the cheat sheet to be accessed through the Help menu RegisterCSWizardPage_labelInstructionText=Optionally, specify the category and description to use when selecting the cheat sheet from a dialog: