Author: scabanovich
Date: 2009-11-27 11:21:19 -0500 (Fri, 27 Nov 2009)
New Revision: 18886
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5283
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java 2009-11-27
16:10:53 UTC (rev 18885)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java 2009-11-27
16:21:19 UTC (rev 18886)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.model.markers;
import java.util.*;
+
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
@@ -32,8 +33,8 @@
return instance;
}
- private Set<XModelObject> errorObjects = new HashSet<XModelObject>();
- private Set<XModelObject> warningObjects = new HashSet<XModelObject>();
+ private Map<IProject, Set<XModelObject>> errorObjects = new
HashMap<IProject, Set<XModelObject>>();
+ private Map<IProject, Set<XModelObject>> warningObjects = new
HashMap<IProject, Set<XModelObject>>();
private XMarkerManager() {
reload(null);
@@ -43,6 +44,11 @@
public void resourceChanged(IResourceChangeEvent event) {
IProject project = null;
Object o = event.getSource();
+ if(event.getType() == IResourceChangeEvent.PRE_DELETE && event.getResource()
instanceof IProject) {
+ errorObjects.remove((IProject)event.getResource());
+ warningObjects.remove((IProject)event.getResource());
+ return;
+ }
if(o instanceof IWorkspace) {
IResourceDelta d = event.getDelta();
IResourceDelta[] cs = d.getAffectedChildren();
@@ -74,8 +80,18 @@
} catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
}
- reload(ms, errorObjects, IMarker.SEVERITY_ERROR);
- reload(ms, warningObjects, IMarker.SEVERITY_WARNING);
+ Set<XModelObject> os = errorObjects.get(project);
+ if(os == null) {
+ os = new HashSet<XModelObject>();
+ errorObjects.put(project, os);
+ }
+ reload(ms, os, IMarker.SEVERITY_ERROR);
+ os = warningObjects.get(project);
+ if(os == null) {
+ os = new HashSet<XModelObject>();
+ warningObjects.put(project, os);
+ }
+ reload(ms, os, IMarker.SEVERITY_WARNING);
}
void reload(IMarker[] ms, Set<XModelObject> objects, int severity) {