]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.tests/src/org/simantics/modeling/tests/commands/ModificationEvents.java
Added missing org.simantics.modeling.tests plug-ins.
[simantics/platform.git] / bundles / org.simantics.modeling.tests / src / org / simantics / modeling / tests / commands / ModificationEvents.java
diff --git a/bundles/org.simantics.modeling.tests/src/org/simantics/modeling/tests/commands/ModificationEvents.java b/bundles/org.simantics.modeling.tests/src/org/simantics/modeling/tests/commands/ModificationEvents.java
new file mode 100644 (file)
index 0000000..7494523
--- /dev/null
@@ -0,0 +1,34 @@
+package org.simantics.modeling.tests.commands;
+
+import org.simantics.databoard.Bindings;
+import org.simantics.db.DevelopmentKeys;
+import org.simantics.db.testing.common.CommandSequenceEnvironment;
+import org.simantics.db.testing.common.WriteCommand;
+import org.simantics.utils.Development;
+
+public class ModificationEvents extends WriteCommand<CommandSequenceEnvironment> {
+
+       transient private boolean enable;
+       
+       public ModificationEvents(boolean enable) {
+               this.enable = enable;
+       }
+       
+       @Override
+       public void run(CommandSequenceEnvironment environment) throws Exception {
+
+               if(enable) {
+                       Development.setProperty(DevelopmentKeys.WRITEGRAPH_DEBUG, true, Bindings.BOOLEAN);
+                       Development.setProperty(DevelopmentKeys.WRITEGRAPH_DEBUG_NAMES, true, Bindings.BOOLEAN);
+                       Development.setProperty(DevelopmentKeys.PRINT, false, Bindings.BOOLEAN);
+                       Development.setProperty(DevelopmentKeys.LOGGER_ECHO, false, Bindings.BOOLEAN);
+               } else {
+                       Development.setProperty(DevelopmentKeys.WRITEGRAPH_DEBUG, false, Bindings.BOOLEAN);
+                       Development.setProperty(DevelopmentKeys.WRITEGRAPH_DEBUG_NAMES, false, Bindings.BOOLEAN);
+                       Development.setProperty(DevelopmentKeys.PRINT, true, Bindings.BOOLEAN);
+                       Development.setProperty(DevelopmentKeys.LOGGER_ECHO, true, Bindings.BOOLEAN);
+               }
+               
+       }
+
+}
\ No newline at end of file