]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Sync git svn branch with SVN repository r33359.
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 25 Oct 2016 05:50:09 +0000 (08:50 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 25 Oct 2016 05:50:09 +0000 (08:50 +0300)
refs #6786

bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/Synchronizer.java

index 7412c6ccfc3b0951533e3447fa25e0453f9a8bac..d2738d84444fab9c02739555a676f1bf156d26ee 100644 (file)
@@ -12,6 +12,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;\r
+import org.simantics.db.exception.CancelTransactionException;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.exception.MissingVariableValueException;\r
 import org.simantics.db.layer0.request.ResourceToPossibleVariable;\r
@@ -228,7 +229,7 @@ public class Synchronizer {
         }\r
         \r
         if(changeFlags == null) {\r
-            // Full synchronization, synchronize all childre\r
+            // Full synchronization, synchronize all children\r
             if(children.size() > 0) {\r
                 double proportionOfWorkForChildren = proportionOfWork / children.size();\r
                 for(Variable child : children)\r
@@ -236,6 +237,9 @@ public class Synchronizer {
             }\r
             else {\r
                 didWork(proportionOfWork);\r
+                // Full synchronization is cancelable\r
+                if(monitor != null && monitor.isCanceled())\r
+                    throw new CancelTransactionException();\r
             }\r
         }\r
         else {\r