]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/UnlockAction.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / actions / UnlockAction.java
index 0bd071e5ee443fd9b3f925b7cb4b55a9ab9dff21..3a9f611e9cf5e256962fcb77b540acc25823d077 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 UnlockAction 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.deny(resource, STR.ComponentType_Locked);\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 UnlockAction 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.deny(resource, STR.ComponentType_Locked);
+                        }
+                    });
+                } catch (DatabaseException e) {
+                    Logger.defaultLogError(e);
+                }
+            }
+        };
+    }
+
+}