X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.graph.impl%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fgraph%2Fimpl%2FLazyParametrizedViewpoint.java;h=c5d96a90a81fac91b86f556acc421e61130eb153;hp=91aeb9c5d4539b5e2e4e189fc703b5f2bdd6cb03;hb=0d9b90834ce56b292c00b1a39850ed842c3e4d42;hpb=e5db6157fd8722c946613d4e46d7aaf6bfa92609 diff --git a/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/LazyParametrizedViewpoint.java b/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/LazyParametrizedViewpoint.java index 91aeb9c5d..c5d96a90a 100644 --- a/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/LazyParametrizedViewpoint.java +++ b/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/LazyParametrizedViewpoint.java @@ -11,8 +11,6 @@ *******************************************************************************/ package org.simantics.browsing.ui.graph.impl; -import java.util.function.Consumer; - import org.simantics.browsing.ui.BuiltinKeys; import org.simantics.browsing.ui.DataSource; import org.simantics.browsing.ui.NodeContext; @@ -20,6 +18,7 @@ import org.simantics.browsing.ui.PrimitiveQueryUpdater; import org.simantics.browsing.ui.common.viewpoints.ViewpointStub; import org.simantics.browsing.ui.content.Viewpoint; import org.simantics.browsing.ui.graph.impl.request.ParametrizedResourceQuery; +import org.simantics.db.AsyncReadGraph; import org.simantics.db.ReadGraph; import org.simantics.db.exception.DatabaseException; import org.simantics.db.procedure.Listener; @@ -135,7 +134,7 @@ public abstract class LazyParametrizedViewpoint extends ViewpointStub { @Override public NodeContext[] getChildren() { if (children == Viewpoint.PENDING_CHILDREN) { - DataSource source = updater.getDataSource(ReadGraph.class); + DataSource source = updater.getDataSource(AsyncReadGraph.class); if (source != null) { source.schedule(graph -> graph.asyncRequest(childQuery, childQueryProcedure)); } @@ -147,17 +146,11 @@ public abstract class LazyParametrizedViewpoint extends ViewpointStub { @Override public Boolean getHasChildren() { if (hasChildren == Viewpoint.PENDING_HAS_CHILDREN) { - DataSource source = updater.getDataSource(ReadGraph.class); + DataSource source = updater.getDataSource(AsyncReadGraph.class); if (source != null) { - source.schedule(new Consumer() { - @Override - public void accept(ReadGraph source) { - source.asyncRequest(hasChildQuery, hasChildQueryProcedure); - } - }); + source.schedule(graph -> graph.asyncRequest(hasChildQuery, hasChildQueryProcedure)); } } - return hasChildren; }