]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/NewUserIssue.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.issues.ui / src / org / simantics / issues / ui / handler / NewUserIssue.java
index 8eb30cc24ee84112cfe55d82bb3cc6fd8a06229d..633c8d96dd46b7136634c773146d5a37906da396 100644 (file)
@@ -1,53 +1,53 @@
-/*******************************************************************************\r
- * Copyright (c) 2007, 2011 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.issues.ui.handler;\r
-\r
-import org.eclipse.core.commands.AbstractHandler;\r
-import org.eclipse.core.commands.ExecutionEvent;\r
-import org.eclipse.core.commands.ExecutionException;\r
-import org.simantics.Simantics;\r
-import org.simantics.browsing.ui.common.ErrorLogger;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.Session;\r
-import org.simantics.db.VirtualGraph;\r
-import org.simantics.db.WriteGraph;\r
-import org.simantics.db.common.request.WriteRequest;\r
-import org.simantics.db.common.utils.NameUtils;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.util.Layer0Utils;\r
-import org.simantics.issues.common.IssueUtils;\r
-\r
-/**\r
- * @author Tuukka Lehtonen\r
- */\r
-public class NewUserIssue extends AbstractHandler {\r
-\r
-    @Override\r
-    public Object execute(ExecutionEvent event) throws ExecutionException {\r
-        try {\r
-            Session session = Simantics.getSession();\r
-            VirtualGraph vg = null;\r
-            session.syncRequest(new WriteRequest(vg) {\r
-                @Override\r
-                public void perform(WriteGraph graph) throws DatabaseException {\r
-                    graph.markUndoPoint();\r
-                    Resource issue = IssueUtils.newUserIssueForModel(graph);\r
-                    Layer0Utils.addCommentMetadata(graph, "Created new User Issue " + NameUtils.getSafeLabel(graph, issue) + " " + issue.toString());\r
-                }\r
-            });\r
-        } catch (DatabaseException e) {\r
-            ErrorLogger.defaultLogError(e);\r
-        }\r
-        return null;\r
-    }\r
-\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.issues.ui.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.simantics.Simantics;
+import org.simantics.browsing.ui.common.ErrorLogger;
+import org.simantics.db.Resource;
+import org.simantics.db.Session;
+import org.simantics.db.VirtualGraph;
+import org.simantics.db.WriteGraph;
+import org.simantics.db.common.request.WriteRequest;
+import org.simantics.db.common.utils.NameUtils;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.util.Layer0Utils;
+import org.simantics.issues.common.IssueUtils;
+
+/**
+ * @author Tuukka Lehtonen
+ */
+public class NewUserIssue extends AbstractHandler {
+
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        try {
+            Session session = Simantics.getSession();
+            VirtualGraph vg = null;
+            session.syncRequest(new WriteRequest(vg) {
+                @Override
+                public void perform(WriteGraph graph) throws DatabaseException {
+                    graph.markUndoPoint();
+                    Resource issue = IssueUtils.newUserIssueForModel(graph);
+                    Layer0Utils.addCommentMetadata(graph, "Created new User Issue " + NameUtils.getSafeLabel(graph, issue) + " " + issue.toString());
+                }
+            });
+        } catch (DatabaseException e) {
+            ErrorLogger.defaultLogError(e);
+        }
+        return null;
+    }
+
 }
\ No newline at end of file