]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Use standard Java interfaces instead of custom Simantics interfaces as explained...
authorjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 31 Mar 2016 12:28:18 +0000 (12:28 +0000)
committerjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 31 Mar 2016 12:28:18 +0000 (12:28 +0000)
fixes #6400

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@32627 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromComponentAdapter.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/CreateVariablesShortcutParticipant.java

index 5456e92a71d6bde212f5801fd49fc5b2252305bd..c8c7b53196996ca81af703e5030deb1dc1602ca5 100644 (file)
@@ -3,6 +3,7 @@ package org.simantics.sysdyn.ui.editor;
 import java.util.ArrayList;\r
 import java.util.Collection;\r
 import java.util.Collections;\r
+import java.util.function.Consumer;\r
 \r
 import org.eclipse.swt.widgets.Display;\r
 import org.eclipse.ui.IEditorPart;\r
@@ -29,7 +30,6 @@ import org.simantics.modeling.ui.Activator;
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.ui.utils.ResourceAdaptionUtils;\r
 import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;\r
-import org.simantics.utils.datastructures.Callback;\r
 import org.simantics.utils.threads.ThreadUtils;\r
 import org.simantics.utils.ui.AdaptionUtils;\r
 \r
@@ -134,9 +134,9 @@ public class OpenDiagramFromComponentAdapter extends AbstractResourceEditorAdapt
             final Collection<Object> selectedObjects = findElementObjects(g, module);\r
 \r
             result.add(\r
-                    NavigateToTarget.editorActivator(EDITOR_ID, diagram, model, rvi, new Callback<IEditorPart>() {\r
+                    NavigateToTarget.editorActivator(EDITOR_ID, diagram, model, rvi, new Consumer<IEditorPart>() {\r
                         @Override\r
-                        public void run(IEditorPart part) {\r
+                        public void accept(IEditorPart part) {\r
                             final ICanvasContext openedCanvas = (ICanvasContext) part.getAdapter(ICanvasContext.class);\r
                             assert openedCanvas != null;\r
                             // CanvasContext-wide denial of initial zoom-to-fit on diagram open.\r
index 4e2c6c87fb3996627330296ceaf2dc7edf537447..0fc30199e936b19c215aa17f080d4e25be0a2a58 100644 (file)
@@ -14,6 +14,7 @@ package org.simantics.sysdyn.ui.editor.participant;
 import java.awt.geom.AffineTransform;\r
 import java.awt.geom.Point2D;\r
 import java.util.Set;\r
+import java.util.function.Consumer;\r
 \r
 import org.simantics.db.Resource;\r
 import org.simantics.db.common.request.Queries;\r
@@ -55,7 +56,6 @@ import org.simantics.sysdyn.ui.elements.StockFactory;
 import org.simantics.sysdyn.ui.elements.SysdynElementHints;\r
 import org.simantics.sysdyn.ui.elements.ValveFactory;\r
 import org.simantics.ui.SimanticsUI;\r
-import org.simantics.utils.datastructures.Callback;\r
 import org.simantics.utils.ui.ExceptionUtils;\r
 \r
 public class CreateVariablesShortcutParticipant extends AbstractDiagramParticipant {\r
@@ -261,9 +261,9 @@ public class CreateVariablesShortcutParticipant extends AbstractDiagramParticipa
 \r
 \r
        private void createVariableOnDiagram(IDiagram d) {\r
-               DiagramUtils.mutateDiagram(d, new Callback<DiagramMutator>() {\r
+               DiagramUtils.mutateDiagram(d, new Consumer<DiagramMutator>() {\r
                        @Override\r
-                       public void run(DiagramMutator m) {\r
+                       public void accept(DiagramMutator m) {\r
 \r
                                Resource r;\r
                                try {\r