X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2FGraphExplorerImpl.java;h=37532c64f45d6c36a8fce06d5d63a4b92ccbd7f2;hb=68ce0966a57f5153b133c6283fdbae10f683b745;hp=62b284858cd9893383719e5ec7b89632437335f9;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerImpl.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerImpl.java index 62b284858..37532c64f 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerImpl.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerImpl.java @@ -31,6 +31,7 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.BiFunction; import java.util.function.Consumer; import org.eclipse.core.runtime.Assert; @@ -161,7 +162,6 @@ import org.simantics.browsing.ui.swt.internal.Threads; import org.simantics.db.layer0.SelectionHints; import org.simantics.utils.ObjectUtils; import org.simantics.utils.datastructures.BijectionMap; -import org.simantics.utils.datastructures.BinaryFunction; import org.simantics.utils.datastructures.disposable.AbstractDisposable; import org.simantics.utils.datastructures.hints.IHintContext; import org.simantics.utils.threads.IThreadWorkQueue; @@ -465,6 +465,11 @@ class GraphExplorerImpl extends GraphExplorerImplBase implements Listener, Graph queryUpdateScheduler.execute(QUERY_UPDATE_SCHEDULER); } } + + @Override + public void execFromQuery(java.lang.Runnable r) { + queryUpdateScheduler.execute(r); + } Runnable QUERY_UPDATE_SCHEDULER = new Runnable() { @Override @@ -544,10 +549,10 @@ class GraphExplorerImpl extends GraphExplorerImplBase implements Listener, Graph protected BasePostSelectionProvider selectionProvider = new BasePostSelectionProvider(); protected SelectionDataResolver selectionDataResolver; protected SelectionFilter selectionFilter; - protected BinaryFunction selectionTransformation = new BinaryFunction() { + protected BiFunction selectionTransformation = new BiFunction() { @Override - public Object[] call(GraphExplorer explorer, Object[] objects) { + public Object[] apply(GraphExplorer explorer, Object[] objects) { Object[] result = new Object[objects.length]; for (int i = 0; i < objects.length; i++) { IHintContext context = new AdaptableHintContext(SelectionHints.KEY_MAIN); @@ -1812,7 +1817,7 @@ class GraphExplorerImpl extends GraphExplorerImplBase implements Listener, Graph } @Override - public void setSelectionTransformation(BinaryFunction f) { + public void setSelectionTransformation(BiFunction f) { this.selectionTransformation = f; } @@ -3168,7 +3173,7 @@ class GraphExplorerImpl extends GraphExplorerImplBase implements Listener, Graph } protected Object[] transformSelection(Object[] objects) { - return selectionTransformation.call(this, objects); + return selectionTransformation.apply(this, objects); } protected static Object[] filter(SelectionFilter filter, NodeContext[] contexts) {