]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document.server/src/org/simantics/document/server/ConsoleSCLReportingHandler.java
More console printing
[simantics/platform.git] / bundles / org.simantics.document.server / src / org / simantics / document / server / ConsoleSCLReportingHandler.java
diff --git a/bundles/org.simantics.document.server/src/org/simantics/document/server/ConsoleSCLReportingHandler.java b/bundles/org.simantics.document.server/src/org/simantics/document/server/ConsoleSCLReportingHandler.java
new file mode 100644 (file)
index 0000000..e227a89
--- /dev/null
@@ -0,0 +1,34 @@
+package org.simantics.document.server;
+
+import org.simantics.document.server.io.IConsole;
+import org.simantics.scl.runtime.reporting.SCLReportingHandler;
+
+public class ConsoleSCLReportingHandler implements SCLReportingHandler {
+
+       private final IConsole console;
+
+       public ConsoleSCLReportingHandler(IConsole console) {
+               this.console = console;
+       }
+
+       @Override
+       public void print(String text) {
+               console.addMessage(text);
+       }
+
+       @Override
+       public void printError(String error) {
+               console.addMessage(error);
+       }
+
+       @Override
+       public void printCommand(String command) {
+               console.addMessage(command);
+       }
+
+       @Override
+       public void didWork(double amount) {
+               console.addMessage("didWork " + amount);
+       }
+
+}
\ No newline at end of file