]> gerrit.simantics Code Review - simantics/platform.git/blob
fec8d600a421e0bf3c247b78924ad56579d51805
[simantics/platform.git] /
1 package org.simantics.document.server;
2
3 import org.simantics.document.server.io.IConsole;
4 import org.simantics.scl.runtime.reporting.SCLReportingHandler;
5
6 public class ConsoleSCLReportingHandler implements SCLReportingHandler {
7
8         private static final boolean PRINT_TO_IDE = false;
9         
10         private final IConsole console;
11
12         public ConsoleSCLReportingHandler(IConsole console) {
13                 this.console = console;
14         }
15
16         @Override
17         public void print(String text) {
18                 if(PRINT_TO_IDE) System.err.println("simupedia console print: " + text);
19                 console.addMessage(text);
20         }
21
22         @Override
23         public void printError(String error) {
24                 if(PRINT_TO_IDE) System.err.println("simupedia console print error: " + error);
25                 console.addMessage(error);
26         }
27
28         @Override
29         public void printCommand(String command) {
30                 if(PRINT_TO_IDE) System.err.println("simupedia console print command: " + command);
31                 console.addMessage(command);
32         }
33
34         @Override
35         public void didWork(double amount) {
36                 console.addMessage("didWork " + amount);
37         }
38
39 }