]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerImpl2.java
Merge "Better emptying of trash bin"
[simantics/platform.git] / bundles / org.simantics.browsing.ui.swt / src / org / simantics / browsing / ui / swt / GraphExplorerImpl2.java
index 79bd35b872b2991a05537aedede0b62aa50a6561..af0fa25a355019468aecd5a89f6a6f950e69833e 100644 (file)
@@ -30,6 +30,7 @@ import java.util.concurrent.Semaphore;
 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;
@@ -122,6 +123,7 @@ import org.simantics.browsing.ui.PrimitiveQueryUpdater;
 import org.simantics.browsing.ui.SelectionDataResolver;
 import org.simantics.browsing.ui.SelectionFilter;
 import org.simantics.browsing.ui.StatePersistor;
+import org.simantics.browsing.ui.common.AdaptableHintContext;
 import org.simantics.browsing.ui.common.ColumnKeys;
 import org.simantics.browsing.ui.common.ErrorLogger;
 import org.simantics.browsing.ui.common.NodeContextBuilder;
@@ -164,7 +166,6 @@ import org.simantics.browsing.ui.swt.internal.Threads;
 import org.simantics.db.layer0.SelectionHints;
 import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.datastructures.BijectionMap;
-import org.simantics.utils.datastructures.BinaryFunction;
 import org.simantics.utils.datastructures.MapList;
 import org.simantics.utils.datastructures.disposable.AbstractDisposable;
 import org.simantics.utils.datastructures.hints.IHintContext;
@@ -251,10 +252,10 @@ public class GraphExplorerImpl2 extends GraphExplorerImplBase implements GraphEx
     private boolean expand;
     private boolean verticalBarVisible = false;
     
-    private BinaryFunction<Object[], GraphExplorer, Object[]>  selectionTransformation = new BinaryFunction<Object[], GraphExplorer, Object[]>() {
+    private BiFunction<GraphExplorer, Object[], Object[]> selectionTransformation = new BiFunction<GraphExplorer, Object[], Object[]>() {
 
         @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);
@@ -885,7 +886,7 @@ public class GraphExplorerImpl2 extends GraphExplorerImplBase implements GraphEx
     }
     
     protected Object[] transformSelection(Object[] objects) {
-        return selectionTransformation.call(this, objects);
+        return selectionTransformation.apply(this, objects);
     }
     
     protected static Object[] filter(SelectionFilter filter, NodeContext[] contexts) {
@@ -898,7 +899,7 @@ public class GraphExplorerImpl2 extends GraphExplorerImplBase implements GraphEx
 
        @Override
        public void setSelectionTransformation(
-                       BinaryFunction<Object[], GraphExplorer, Object[]> f) {
+                       BiFunction<GraphExplorer, Object[], Object[]> f) {
                this.selectionTransformation = f;
        }