*******************************************************************************/
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;
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;
@Override
public NodeContext[] getChildren() {
if (children == Viewpoint.PENDING_CHILDREN) {
- DataSource<ReadGraph> source = updater.getDataSource(ReadGraph.class);
+ DataSource<AsyncReadGraph> source = updater.getDataSource(AsyncReadGraph.class);
if (source != null) {
source.schedule(graph -> graph.asyncRequest(childQuery, childQueryProcedure));
}
@Override
public Boolean getHasChildren() {
if (hasChildren == Viewpoint.PENDING_HAS_CHILDREN) {
- DataSource<ReadGraph> source = updater.getDataSource(ReadGraph.class);
+ DataSource<AsyncReadGraph> source = updater.getDataSource(AsyncReadGraph.class);
if (source != null) {
- source.schedule(new Consumer<ReadGraph>() {
- @Override
- public void accept(ReadGraph source) {
- source.asyncRequest(hasChildQuery, hasChildQueryProcedure);
- }
- });
+ source.schedule(graph -> graph.asyncRequest(hasChildQuery, hasChildQueryProcedure));
}
}
-
return hasChildren;
}