]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Separate name caches for each diagram configuration. Previously sysdyn model had...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 22 Nov 2012 08:39:04 +0000 (08:39 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 22 Nov 2012 08:39:04 +0000 (08:39 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26386 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/ShowInstantiatedModuleAction.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynCreationInstruction.java

index 944fdacd130ac6f64b9ba7038c8f9eb3471ea522..4447c94076d3d98268de110d2240b8c544a6cdde 100644 (file)
@@ -29,8 +29,8 @@ import org.simantics.sysdyn.ui.browser.nodes.ModuleNode;
 import org.simantics.sysdyn.ui.editor.SysdynEditorInput;\r
 import org.simantics.ui.DoubleClickEvent;\r
 import org.simantics.ui.IDoubleClickAction;\r
-import org.simantics.ui.utils.AdaptionUtils;\r
 import org.simantics.ui.workbench.ResourceEditorInput2;\r
+import org.simantics.utils.ui.AdaptionUtils;\r
 import org.simantics.utils.ui.ISelectionUtils;\r
 import org.simantics.utils.ui.action.PriorityAction;\r
 import org.simantics.utils.ui.workbench.WorkbenchUtils;\r
@@ -54,14 +54,14 @@ public class ShowInstantiatedModuleAction implements IDoubleClickAction {
         // Open instance for a module instance, if the resource is adaptable to variable\r
         Variable variable = AdaptionUtils.adaptToSingle(e.getResource(), Variable.class);\r
         if(variable != null) {\r
-            String rvi = Variables.getRVI(g, variable);\r
-            if(!rvi.isEmpty())\r
-                rvi = rvi.substring(1);\r
-            Resource model = Variables.getModel(g, variable);\r
-            Resource represents = (Resource)variable.getPropertyValue(g, Variables.REPRESENTS);\r
+            Resource represents = variable.getRepresents(g);\r
             Resource instanceOf = g.getPossibleObject(represents, l0.InstanceOf);\r
             Resource configuration = g.getPossibleObject(instanceOf, sr2.IsDefinedBy);\r
             if(configuration != null) {\r
+                String rvi = Variables.getRVI(g, variable);\r
+                if(!rvi.isEmpty())\r
+                    rvi = rvi.substring(1);\r
+                Resource model = Variables.getModel(g, variable);\r
                 addShowModuleAction(e, getResourceEditorInput(g, model, configuration, rvi));\r
                 return;\r
             }\r
index f465a16ee022729a7662014036a50353c7a3f3c0..3e4a83edf6f9cd7d115a65e72577cd0a87e56352 100644 (file)
@@ -50,7 +50,7 @@ public class SysdynCreationInstruction extends CreationInstruction {
         Layer0X L0X = Layer0X.getInstance(g);\r
         \r
         try {\r
-            String proposition = URIStringUtils.escape(ComponentNamingUtil.findFreshInstanceName(g, project, configurationRoot, configuration, componentType));\r
+            String proposition = URIStringUtils.escape(ComponentNamingUtil.findFreshInstanceName(g, project, configuration, configuration, componentType));\r
             Resource result = GraphUtils.create(g,\r
                     l0.HasName, proposition\r
             );\r