]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
refs #5314
authorjsimomaa <jsimomaa@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 16 Sep 2014 07:19:07 +0000 (07:19 +0000)
committerjsimomaa <jsimomaa@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 16 Sep 2014 07:19:07 +0000 (07:19 +0000)
Add cache listener to DiagramFinderRequest calls

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30284 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromComponentAdapter.java

index 1ff6f174eb24a5e4a00c95abe59a83ae356bde8f..5456e92a71d6bde212f5801fd49fc5b2252305bd 100644 (file)
@@ -9,6 +9,7 @@ import org.eclipse.ui.IEditorPart;
 import org.simantics.Simantics;\r
 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.common.request.UnaryRead;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.request.PossibleModel;\r
@@ -45,7 +46,7 @@ public class OpenDiagramFromComponentAdapter extends AbstractResourceEditorAdapt
 \r
     @Override\r
     public boolean canHandle(ReadGraph graph, Object input) throws DatabaseException {\r
-        Collection<Runnable> rs = graph.syncRequest(new DiagramFinderRequest(input));\r
+        Collection<Runnable> rs = graph.syncRequest(new DiagramFinderRequest(input), TransientCacheAsyncListener.<Collection<Runnable>>instance());\r
         return !rs.isEmpty();\r
     }\r
 \r
@@ -74,7 +75,7 @@ public class OpenDiagramFromComponentAdapter extends AbstractResourceEditorAdapt
         if (d == null)\r
             return;\r
         \r
-        Collection<Runnable> rs = Simantics.getSession().syncRequest(new DiagramFinderRequest(input));\r
+        Collection<Runnable> rs = Simantics.getSession().syncRequest(new DiagramFinderRequest(input), TransientCacheAsyncListener.<Collection<Runnable>>instance());\r
         for (Runnable runnable : rs) {\r
             runnable.run();\r
         }\r