From 72709abc6e8ebb68a260d5ccde9d66c78f9c9b7b Mon Sep 17 00:00:00 2001 From: lehtonen Date: Wed, 30 May 2012 08:54:27 +0000 Subject: [PATCH] Added to CopyAdvisor interface the possibility to get a map from source resources to copied resource as output. fixes #3480 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25069 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../ui/editor/participant/SysdynComponentCopyAdvisor.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/SysdynComponentCopyAdvisor.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/SysdynComponentCopyAdvisor.java index 62672a39..94e3a9f0 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/SysdynComponentCopyAdvisor.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/participant/SysdynComponentCopyAdvisor.java @@ -11,6 +11,8 @@ *******************************************************************************/ package org.simantics.sysdyn.ui.editor.participant; +import java.util.Map; + import org.simantics.databoard.Bindings; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; @@ -26,10 +28,10 @@ import org.simantics.modeling.mapping.ComponentCopyAdvisor; import org.simantics.structural.stubs.StructuralResource2; import org.simantics.utils.datastructures.BinaryFunction; -public class SysdynComponentCopyAdvisor extends ComponentCopyAdvisor{ +public class SysdynComponentCopyAdvisor extends ComponentCopyAdvisor { @Override - public Object copy(ISynchronizationContext context, WriteGraph graph, Resource source, Resource sourceContainer, Resource targetContainer) throws DatabaseException { + public Object copy(ISynchronizationContext context, WriteGraph graph, Resource source, Resource sourceContainer, Resource targetContainer, Map map) throws DatabaseException { BinaryFunction tester = new BinaryFunction() { @@ -56,7 +58,7 @@ public class SysdynComponentCopyAdvisor extends ComponentCopyAdvisor{ StructuralResource2 sr2 = StructuralResource2.getInstance(graph); if(graph.isInstanceOf(source, sr2.Connection)) { - copy = CopyAdvisorUtil.copy(graph, source, tester); + copy = CopyAdvisorUtil.copy(graph, source, tester, map); } else { copy = CopyAdvisorUtil.copy4(graph, source); } -- 2.47.1