Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilos Kleint2011-04-27 08:49:11 -0400
committerMilos Kleint2011-04-27 08:49:11 -0400
commit8e1002a4f9cbc2884053a8b9ac6ecdf48acea158 (patch)
treee027b5c84753f9b0c91d2cf9e05eaa7eb9c354d0
parente5bf339a54aac2642f9153f339486bc75508175d (diff)
downloadm2e-core-8e1002a4f9cbc2884053a8b9ac6ecdf48acea158.tar.gz
m2e-core-8e1002a4f9cbc2884053a8b9ac6ecdf48acea158.tar.xz
m2e-core-8e1002a4f9cbc2884053a8b9ac6ecdf48acea158.zip
have a single workspace proposal work for all configuration update marker occurences
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java26
1 files changed, 20 insertions, 6 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java
index 9521b892..d22bf72f 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java
@@ -24,6 +24,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolutionGenerator;
@@ -37,17 +38,30 @@ import org.eclipse.m2e.core.ui.internal.UpdateConfigurationJob;
public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IMarkerResolutionGenerator2 {
private static final Logger LOG = LoggerFactory.getLogger(MarkerResolutionGenerator.class);
+
+ static QualifiedName QUALIFIED = new QualifiedName("org.eclipse.m2e.core.ui", "refreshResolution"); //$NON-NLS-1$ //$NON-NLS-2$
public boolean hasResolutions(IMarker marker) {
- // TODO is the resolution for all configuration markers??
+ // TODO is the resolution for all lifecycle markers??
return true;
}
public IMarkerResolution[] getResolutions(IMarker marker) {
- // TODO is the resolution for all configuration markers??
- return new IMarkerResolution[] { new RefreshResolution() };
+ // TODO is the resolution for all lifecycle markers??
+ try {
+ //for each file have just one instance of the discover proposal array.
+ //important for 335299
+ IMarkerResolution[] cached = (IMarkerResolution[]) marker.getResource().getSessionProperty(QUALIFIED);
+ if (cached == null) {
+ cached = new IMarkerResolution[] {new RefreshResolution()};
+ marker.getResource().setSessionProperty(QUALIFIED, cached);
+ }
+ return cached;
+ } catch(CoreException e) {
+ return new IMarkerResolution[] {new RefreshResolution()};
+ }
}
-
+
private class RefreshResolution extends WorkbenchMarkerResolution {
@@ -113,8 +127,8 @@ public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IM
List<IMarker> toRet = new ArrayList<IMarker>();
for (IMarker m : markers) {
try {
- if (IMavenConstants.MARKER_ATTR_CONFIGURATOR_ID.equals(m.getType())) {
- //TODO is this the only condition
+ if (IMavenConstants.MARKER_CONFIGURATION_ID.equals(m.getType())) {
+ //TODO is this the only condition for lifecycle markers
toRet.add(m);
}
} catch(CoreException ex) {

Back to the top