From 159f9e3b618521c76a9dc6c8ffd94a7a3c35b82a Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Sat, 5 Aug 2017 00:31:43 +0300 Subject: [PATCH] Added Simantics/Diagram#diagramsUnder to complement diagramsOf refs #7410 Change-Id: Iab18ab1bf44e96decbc14de2a5289b51feca387f --- .../org.simantics.modeling/scl/Simantics/Diagram.scl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl b/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl index bf5c589e8..575563bd2 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl @@ -149,9 +149,15 @@ hasRandomIdentifier entity = runProc (claimRelatedValue_ entity L0.identifier GU """Returns all diagrams of the given model.""" diagramsOf :: Model -> [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 -> [Resource] +diagramsUnder folder = recurse DIA.Diagram folder where recurse t r = do cs = children r -- 2.47.1