]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/CompilePGraphs.java
Progress monitoring to users Pgraph compilation
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / CompilePGraphs.java
index 10e23c65bbd72340277652d8c9618ab4f7032147..7f7171dca54a8b82ece8f27441e7d58c7079eb29 100644 (file)
@@ -16,6 +16,8 @@ import java.util.Map;
 import java.util.Set;
 
 import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.osgi.framework.Bundle;
 import org.simantics.Simantics;
 import org.simantics.databoard.Bindings;
@@ -86,6 +88,10 @@ public class CompilePGraphs {
     }
 
     public static void compilePGraphs(Resource r, UserAgent userAgent) throws IOException, DatabaseException {
+        compilePGraphs(r, userAgent, new NullProgressMonitor());
+    }
+    
+    public static void compilePGraphs(Resource r, UserAgent userAgent, IProgressMonitor monitor) throws IOException, DatabaseException {
         final Collection<ISource> sources = new ArrayList<>();
         Collection<TransferableGraph1> dependencies = new ArrayList<>();
 
@@ -249,6 +255,9 @@ public class CompilePGraphs {
                 }
             });
         }
+        
+        // Delete index to get rid of floating old instances of the same ontology
+//        DatabaseIndexing.deleteAllIndexes();
     }
 
     private static File extractLib(URL libURL, String libName) throws FileNotFoundException, IOException {