X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2FGraphExplorerFactory.java;fp=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2FGraphExplorerFactory.java;h=b99962bf00d579c6ceb3cf8e0d4eea39a85abe73;hp=de421565951a2a3b025856676954f469c897e534;hb=e84008c029ef2336cf55ad371256c9a12a889e98;hpb=0f3c8efc2d05f7d76b6fa1c2228c9c6ba224374e diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerFactory.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerFactory.java index de4215659..b99962bf0 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerFactory.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerFactory.java @@ -12,6 +12,7 @@ package org.simantics.browsing.ui.swt; import java.lang.reflect.Method; +import java.util.function.BiFunction; import org.eclipse.core.runtime.Platform; import org.eclipse.swt.SWT; @@ -34,7 +35,6 @@ import org.simantics.db.layer0.SelectionHints; import org.simantics.db.layer0.variable.Variable; import org.simantics.db.layer0.variable.Variables; import org.simantics.simulation.ontology.SimulationResource; -import org.simantics.utils.datastructures.BinaryFunction; import org.simantics.utils.datastructures.hints.IHintContext; import org.simantics.utils.ui.ExceptionUtils; @@ -50,7 +50,7 @@ public class GraphExplorerFactory { private IServiceLocator serviceLocator; - private BinaryFunction selectionTransformation = new BinaryFunction() { + private BiFunction selectionTransformation = new BiFunction() { private Resource getModel(final Object object) { if(object instanceof NodeContext) { @@ -90,9 +90,8 @@ public class GraphExplorerFactory { return null; } - @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); @@ -120,7 +119,7 @@ public class GraphExplorerFactory { return this; } - public GraphExplorerFactory selectionTransformation(BinaryFunction transformation) { + public GraphExplorerFactory selectionTransformation(BiFunction transformation) { this.selectionTransformation = transformation; return this; } @@ -194,7 +193,8 @@ public class GraphExplorerFactory { //GraphExplorerImpl2 explorer = new GraphExplorerImpl2(parent, style); try { Bundle bundle = Platform.getBundle("org.simantics.browsing.ui.nattable"); - Class clazz = (Class)bundle.loadClass("org.simantics.browsing.ui.nattable.NatTableGraphExplorer"); + @SuppressWarnings("unchecked") + Class clazz = (Class)bundle.loadClass("org.simantics.browsing.ui.nattable.NatTableGraphExplorer"); //Class clazz = (Class)bundle.getClass().getClassLoader().loadClass("org.simantics.browsing.ui.nattable.NatTableGraphExplorer"); GraphExplorer explorer = clazz.getConstructor(Composite.class, int.class).newInstance(parent,style); explorer.setSelectionDataResolver(selectionDataResolver);