]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/LockAction.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / actions / LockAction.java
index 9a9728c3bafee8e5efb9ffbc1ca6239b0f8a9f4b..64a777f542fa9736cb4047adf90785139c93dbfd 100644 (file)
@@ -1,41 +1,41 @@
-package org.simantics.modeling.ui.actions;\r
-\r
-import org.simantics.Simantics;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.WriteGraph;\r
-import org.simantics.db.common.request.WriteRequest;\r
-import org.simantics.db.common.utils.Logger;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.adapter.ActionFactory;\r
-import org.simantics.structural.stubs.StructuralResource2;\r
-\r
-public class LockAction implements ActionFactory {\r
-\r
-    @Override\r
-    public Runnable create(Object target) {\r
-\r
-        if (!(target instanceof Resource))\r
-            return null;\r
-\r
-        final Resource resource = (Resource)target;\r
-\r
-        return new Runnable() {\r
-            @Override\r
-            public void run() {\r
-                try {\r
-                    Simantics.getSession().markUndoPoint();\r
-                    Simantics.getSession().syncRequest(new WriteRequest() {\r
-                        @Override\r
-                        public void perform(WriteGraph graph) throws DatabaseException {\r
-                            StructuralResource2 STR = StructuralResource2.getInstance(graph);\r
-                            graph.claim(resource, STR.ComponentType_Locked, resource);\r
-                        }\r
-                    });\r
-                } catch (DatabaseException e) {\r
-                    Logger.defaultLogError(e);\r
-                }\r
-            }\r
-        };\r
-    }\r
-\r
-}\r
+package org.simantics.modeling.ui.actions;
+
+import org.simantics.Simantics;
+import org.simantics.db.Resource;
+import org.simantics.db.WriteGraph;
+import org.simantics.db.common.request.WriteRequest;
+import org.simantics.db.common.utils.Logger;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.adapter.ActionFactory;
+import org.simantics.structural.stubs.StructuralResource2;
+
+public class LockAction implements ActionFactory {
+
+    @Override
+    public Runnable create(Object target) {
+
+        if (!(target instanceof Resource))
+            return null;
+
+        final Resource resource = (Resource)target;
+
+        return new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    Simantics.getSession().markUndoPoint();
+                    Simantics.getSession().syncRequest(new WriteRequest() {
+                        @Override
+                        public void perform(WriteGraph graph) throws DatabaseException {
+                            StructuralResource2 STR = StructuralResource2.getInstance(graph);
+                            graph.claim(resource, STR.ComponentType_Locked, resource);
+                        }
+                    });
+                } catch (DatabaseException e) {
+                    Logger.defaultLogError(e);
+                }
+            }
+        };
+    }
+
+}