]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/scl/Simantics/Rename.scl
Merge branch 'feature/funcwrite'
[simantics/platform.git] / bundles / org.simantics.modeling / scl / Simantics / Rename.scl
index a7d2a3c192fa44ad954b36fdbed51885b9573723..cb048e037ff672cb87841f22bd53adab9316866f 100644 (file)
@@ -1,61 +1,61 @@
-import "Simantics/Entity" hiding (findFreshName)\r
-\r
-importJava "org.simantics.modeling.Rename" where\r
-    @JavaName renameNode\r
-    """\r
-        renameNode resource newName\r
-        \r
-    Renames the given `resource` with the given `newName` and returns\r
-    `string`\r
-    \r
-    Example:\r
-    \r
-        > renameNode resource "NewName"\r
-        "Succesfully renamed oldName to NewName"\r
-        \r
-    or error if failed\r
-    """\r
-    renameNode :: Resource -> String -> <WriteGraph> String\r
-\r
-"""\r
-    renameMBNode entity newName\r
-    \r
-Renames the given `entity` with the given `newName` and returns\r
-`string`\r
-\r
-Example:\r
-\r
-    > renameMBNode entity "NewName"\r
-    "Succesfully renamed oldName to NewName"\r
-    \r
-or error if failed\r
-"""\r
-renameMBNode :: Resource -> String -> <WriteGraph> String\r
-renameMBNode entity newname = do\r
-    renameNode (toResource entity) newname\r
-\r
-importJava "org.simantics.db.common.utils.NameUtils" where\r
-    @JavaName findFreshName\r
-    """\r
-        findFreshName name container\r
-        \r
-    Finds fresh and unused name with proposition `name` under the given `container`\r
-    and returns the freshName\r
-    \r
-    Example:\r
-    \r
-        freshName = findFreshName "Model" currentProject ()\r
-    """\r
-    findFreshName :: String -> Resource -> <ReadGraph> String\r
-    \r
-    @JavaName getSafeName\r
-    """\r
-        getSafeName resource\r
-        \r
-    Gets safe name for the given `resource` and returns the name\r
-    \r
-    Example:\r
-    \r
-        name = getSafeName (toResource model)\r
-    """\r
+import "Simantics/Entity" hiding (findFreshName)
+
+importJava "org.simantics.modeling.Rename" where
+    @JavaName renameNode
+    """
+        renameNode resource newName
+        
+    Renames the given `resource` with the given `newName` and returns
+    `string`
+    
+    Example:
+    
+        > renameNode resource "NewName"
+        "Succesfully renamed oldName to NewName"
+        
+    or error if failed
+    """
+    renameNode :: Resource -> String -> <WriteGraph> String
+
+"""
+    renameMBNode entity newName
+    
+Renames the given `entity` with the given `newName` and returns
+`string`
+
+Example:
+
+    > renameMBNode entity "NewName"
+    "Succesfully renamed oldName to NewName"
+    
+or error if failed
+"""
+@deprecated "This function is equivalent to renameNode."
+renameMBNode :: Resource -> String -> <WriteGraph> String
+renameMBNode entity newname = renameNode entity newname
+
+importJava "org.simantics.db.common.utils.NameUtils" where
+    @JavaName findFreshName
+    """
+        findFreshName name container
+        
+    Finds fresh and unused name with proposition `name` under the given `container`
+    and returns the freshName
+    
+    Example:
+    
+        freshName = findFreshName "Model" currentProject ()
+    """
+    findFreshName :: String -> Resource -> <ReadGraph> String
+    
+    @JavaName getSafeName
+    """
+        getSafeName resource
+        
+    Gets safe name for the given `resource` and returns the name
+    
+    Example:
+    
+        name = getSafeName (toResource model)
+    """
     getSafeName :: Resource -> <ReadGraph> String
\ No newline at end of file