]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Document viewer displays the document of active document editor. (refs #3511)
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 18 Jun 2012 12:26:14 +0000 (12:26 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 18 Jun 2012 12:26:14 +0000 (12:26 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25200 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/plugin.xml
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynEditorNamingService.java

index 8638585b2c44e81aabeb7877e42580ea6cc05dfd..910c8d86209e7de5e9265449eb8fa89a24598933 100644 (file)
                         property="org.simantics.sysdyn.ui.nodeClass">\r
                   </test>\r
                   <test\r
-                        args="org.simantics.document.workbench.browser_old.DocumentationFolder"\r
+                        args="org.simantics.document.workbench.browser_old.DocumentationNode"\r
                         property="org.simantics.sysdyn.ui.nodeClass">\r
                   </test>\r
                </or>\r
                         args="org.simantics.sysdyn.ui.browser.nodes.FunctionLibraryNode"\r
                         property="org.simantics.sysdyn.ui.nodeClass">\r
                   </test>\r
+                  <test\r
+                        args="org.simantics.document.workbench.browser_old.DocumentationNode"\r
+                        property="org.simantics.sysdyn.ui.nodeClass">\r
+                  </test>\r
                </or>\r
             </with>\r
          </activeWhen>\r
index f47c890cb3bdc339577f0edc705f127e9739fbc6..eba820ac43e1e890e1d9ade8195fa07a7e18f931 100644 (file)
@@ -22,6 +22,7 @@ import org.simantics.layer0.Layer0;
 import org.simantics.modeling.ModelingResources;\r
 import org.simantics.modeling.ui.features.EditorNamingService2;\r
 import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.ui.workbench.IResourceEditorInput2;\r
 \r
 /**\r
@@ -57,11 +58,13 @@ public class SysdynEditorNamingService extends EditorNamingService2 {
                                }\r
                        } else {\r
                                ModelingResources mr = ModelingResources.getInstance(g);\r
-                               Resource conf = g.getPossibleObject(input.getResource(), mr.DiagramToComposite);\r
-                               if(conf != null) {\r
-                                       Resource module = g.getPossibleObject(conf, Layer0.getInstance(g).PartOf);\r
-                                       if(module != null) \r
-                                               return NameUtils.getSafeName(g, module);\r
+                               SysdynResource sr = SysdynResource.getInstance(g);\r
+                               Resource composite = g.getPossibleObject(input.getResource(), mr.DiagramToComposite);\r
+                               if(composite != null) {\r
+                                       if(g.isInstanceOf(composite, sr.Configuration))\r
+                                               composite = g.getPossibleObject(composite, Layer0.getInstance(g).PartOf);\r
+                                       if(composite != null) \r
+                                               return NameUtils.getSafeName(g, composite);\r
                                }\r
                        }\r
                }\r