Author: scabanovich
Date: 2010-10-27 11:08:32 -0400 (Wed, 27 Oct 2010)
New Revision: 26091
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
Log:
JBIDE-7319
https://jira.jboss.org/browse/JBIDE-7319
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2010-10-27
14:28:07 UTC (rev 26090)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2010-10-27
15:08:32 UTC (rev 26091)
@@ -138,17 +138,40 @@
runCheckerOnLoad();
}
}
- WorkspaceJob checkerOnLoad = new WorkspaceJob("Checking on load...") {
//$NON-NLS-1$
+
+ static class CheckerJob extends WorkspaceJob {
+ List<AbstractExtendedXMLFileImpl> files = new
ArrayList<AbstractExtendedXMLFileImpl>();
- @Override
+ public CheckerJob() {
+ super("Checking constraints on load..."); //$NON-NLS-1$
+ }
+
+ public void add(AbstractExtendedXMLFileImpl file) {
+ synchronized (files) {
+ files.add(file);
+ }
+ schedule();
+ }
+
+ @Override
public IStatus runInWorkspace(IProgressMonitor monitor)
throws CoreException {
- getResourceMarkers().clear();
- constraintChecker.check();
+ while(true) {
+ AbstractExtendedXMLFileImpl file = null;
+ synchronized (files) {
+ if(files.isEmpty()) break;
+ file = files.remove(0);
+ }
+ file.getResourceMarkers().clear();
+ file.constraintChecker.check();
+ }
+
return Status.OK_STATUS;
}
- };
+ }
+ static CheckerJob checkerOnLoad = new CheckerJob();
+
void runCheckerOnLoad() {
if(!isActive()) return;
XModelObject s = getParent();
@@ -163,7 +186,7 @@
}
};
Display.getDefault().asyncExec(r);*/
- checkerOnLoad.schedule();
+ checkerOnLoad.add(this);
}
public void set(String name, String value) {