]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/scl/Simantics/Diagram.scl
Added Simantics/Diagram#diagramsUnder to complement diagramsOf
[simantics/platform.git] / bundles / org.simantics.modeling / scl / Simantics / Diagram.scl
index bf5c589e85f8f2a248d55a71c5244bc1332b2fae..575563bd2d706e0d66919a199101b82e5d8b2929 100644 (file)
@@ -149,9 +149,15 @@ hasRandomIdentifier entity = runProc (claimRelatedValue_ entity L0.identifier GU
 
 """Returns all diagrams of the given model."""
 diagramsOf :: Model -> <ReadGraph> [Diagram]
-diagramsOf model = recurse
-                   DIA.Diagram 
-                   (configurationOf model)
+diagramsOf model = diagramsUnder $ configurationOf model
+
+"""
+Returns all diagrams under the specified diagram folder.
+The parameter can also be the configuration root `configurationOf`
+in which case this function returns the same as `diagramsOf model`.
+"""
+diagramsUnder :: DiagramFolder -> <ReadGraph> [Resource]
+diagramsUnder folder = recurse DIA.Diagram folder 
   where
     recurse t r = do
         cs = children r