import "Simantics/Model" include "Simantics/Entity" hiding (nameOf) import "http://www.simantics.org/Layer0-1.1" as L0 type Library = Resource importJava "org.simantics.modeling.ui.SCLLibrary" where @JavaName createLibrary """ Creates a new Library under the given Library parameter. Returns the created Library. """ createLibrary :: Library -> Library @Javaname createLibraryInModel """ Creates a new Library under the given Model parameter. Returns the created Library. """ createLibraryInModel :: Model -> Library @JavaName getLibrary getLibrary :: Model -> String -> Library librariesOf :: Model -> [Library] librariesOf model = recurse L0.Library (toResource model) where recurse t r = do cs = resourceChildrenOf r libraries = map fromResource $ filter isLibrary cs libraryGrp = filter (not . isLibrary) cs libraries + concatMap (recurse t) libraryGrp isLibrary r = isInstanceOf r L0.Library