1 import "Simantics/Model"
\r
2 include "Simantics/Entity" hiding (nameOf)
\r
3 import "http://www.simantics.org/Layer0-1.1" as L0
\r
5 type Library = Resource
\r
7 importJava "org.simantics.modeling.ui.SCLLibrary" where
\r
8 @JavaName createLibrary
\r
10 Creates a new Library under the given Library parameter. Returns the created Library.
\r
12 createLibrary :: Library -> <Proc> Library
\r
14 @Javaname createLibraryInModel
\r
16 Creates a new Library under the given Model parameter. Returns the created Library.
\r
18 createLibraryInModel :: Model -> <Proc> Library
\r
20 @JavaName getLibrary
\r
21 getLibrary :: Model -> String -> <ReadGraph> Library
\r
23 librariesOf :: Model -> <ReadGraph> [Library]
\r
24 librariesOf model = recurse L0.Library (toResource model)
\r
27 cs = resourceChildrenOf r
\r
28 libraries = map fromResource $ filter isLibrary cs
\r
29 libraryGrp = filter (not . isLibrary) cs
\r
30 libraries + concatMap (recurse t) libraryGrp
\r
31 isLibrary r = isInstanceOf r L0.Library