]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Added Simantics/Diagram#diagramsUnder to complement diagramsOf 09/809/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 4 Aug 2017 21:31:43 +0000 (00:31 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 4 Aug 2017 22:03:02 +0000 (01:03 +0300)
refs #7410

Change-Id: Iab18ab1bf44e96decbc14de2a5289b51feca387f
(cherry picked from commit 159f9e3b618521c76a9dc6c8ffd94a7a3c35b82a)

bundles/org.simantics.modeling/scl/Simantics/Diagram.scl

index 554a25edad081a50f4388688d19820b359440942..0ee3e9d28ec03afeec9aff59d69097643472df72 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]
 
 """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 
   where
     recurse t r = do
         cs = children r