]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
refs #5206
authorjsimomaa <jsimomaa@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 22 Aug 2014 08:07:49 +0000 (08:07 +0000)
committerjsimomaa <jsimomaa@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 22 Aug 2014 08:07:49 +0000 (08:07 +0000)
Adding more UndoPoints to AssignIC class

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30116 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/AssignIC.java

index a84ec5507e5612c0ec7087c10db3bc906308f66e..16bb242b5e5ec5815a55cc52f691a7198ba8a34f 100644 (file)
@@ -34,6 +34,7 @@ import org.simantics.db.common.request.WriteRequest;
 import org.simantics.db.common.utils.NameUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.request.PossibleModel;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.modeling.ui.Activator;\r
 import org.simantics.sysdyn.SysdynResource;\r
@@ -99,22 +100,17 @@ public class AssignIC extends AbstractHandler {
 \r
                        @Override\r
                        public void perform(WriteGraph graph) throws DatabaseException {\r
-\r
+                           graph.markUndoPoint();\r
                                SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
 \r
                                graph.deny(experiment, SYSDYN.Experiment_ic);\r
                                graph.claim(experiment, SYSDYN.Experiment_ic, ic);\r
-\r
+                               Layer0Utils.addCommentMetadata(graph, "Assigned new IC " + NameUtils.getSafeName(graph, ic) + " to experiment " + NameUtils.getSafeLabel(graph, experiment));\r
                        }\r
-\r
                });\r
-\r
         } catch (DatabaseException e) {\r
-\r
+            e.printStackTrace();\r
         }\r
-\r
         return null;\r
-        \r
     }\r
-\r
 }\r