From 9203dcfbb2b41bd6ad5df35e8d72f22cd2e37e88 Mon Sep 17 00:00:00 2001 From: jkauttio Date: Thu, 31 Mar 2016 12:28:18 +0000 Subject: [PATCH] Use standard Java interfaces instead of custom Simantics interfaces as explained in #6397 fixes #6400 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@32627 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/ui/editor/OpenDiagramFromComponentAdapter.java | 6 +++--- .../participant/CreateVariablesShortcutParticipant.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromComponentAdapter.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromComponentAdapter.java index 5456e92a..c8c7b531 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromComponentAdapter.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/OpenDiagramFromComponentAdapter.java @@ -3,6 +3,7 @@ package org.simantics.sysdyn.ui.editor; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.function.Consumer; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IEditorPart; @@ -29,7 +30,6 @@ import org.simantics.modeling.ui.Activator; import org.simantics.sysdyn.SysdynResource; import org.simantics.ui.utils.ResourceAdaptionUtils; import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter; -import org.simantics.utils.datastructures.Callback; import org.simantics.utils.threads.ThreadUtils; import org.simantics.utils.ui.AdaptionUtils; @@ -134,9 +134,9 @@ public class OpenDiagramFromComponentAdapter extends AbstractResourceEditorAdapt final Collection selectedObjects = findElementObjects(g, module); result.add( - NavigateToTarget.editorActivator(EDITOR_ID, diagram, model, rvi, new Callback() { + NavigateToTarget.editorActivator(EDITOR_ID, diagram, model, rvi, new Consumer() { @Override - public void run(IEditorPart part) { + public void accept(IEditorPart part) { final ICanvasContext openedCanvas = (ICanvasContext) part.getAdapter(ICanvasContext.class); assert openedCanvas != null; // CanvasContext-wide denial of initial zoom-to-fit on diagram open. diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/CreateVariablesShortcutParticipant.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/CreateVariablesShortcutParticipant.java index 4e2c6c87..0fc30199 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/CreateVariablesShortcutParticipant.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/CreateVariablesShortcutParticipant.java @@ -14,6 +14,7 @@ package org.simantics.sysdyn.ui.editor.participant; import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; import java.util.Set; +import java.util.function.Consumer; import org.simantics.db.Resource; import org.simantics.db.common.request.Queries; @@ -55,7 +56,6 @@ import org.simantics.sysdyn.ui.elements.StockFactory; import org.simantics.sysdyn.ui.elements.SysdynElementHints; import org.simantics.sysdyn.ui.elements.ValveFactory; import org.simantics.ui.SimanticsUI; -import org.simantics.utils.datastructures.Callback; import org.simantics.utils.ui.ExceptionUtils; public class CreateVariablesShortcutParticipant extends AbstractDiagramParticipant { @@ -261,9 +261,9 @@ public class CreateVariablesShortcutParticipant extends AbstractDiagramParticipa private void createVariableOnDiagram(IDiagram d) { - DiagramUtils.mutateDiagram(d, new Callback() { + DiagramUtils.mutateDiagram(d, new Consumer() { @Override - public void run(DiagramMutator m) { + public void accept(DiagramMutator m) { Resource r; try { -- 2.47.1