source: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/SWTConsole.java @ 195

Last change on this file since 195 was 192, checked in by sherbold, 13 years ago

Work on the SWT GUI prototype. The prototype is still incomplete and should not be used.

  • Property svn:mime-type set to text/plain
File size: 899 bytes
Line 
1package de.ugoe.cs.eventbench.swt;
2
3import org.eclipse.swt.widgets.Text;
4
5import de.ugoe.cs.util.StringTools;
6import de.ugoe.cs.util.console.Console;
7import de.ugoe.cs.util.console.ConsoleObserver;
8
9public class SWTConsole implements ConsoleObserver {
10
11        Text output;
12       
13        public SWTConsole(Text output) {
14                Console.getInstance().registerObserver(this);
15                this.output = output;
16        }
17       
18        @Override
19        public void updateText(String newMessage) {
20                output.append(newMessage);
21        }
22
23        @Override
24        public void errStream(String errMessage) {
25                output.append(errMessage);
26
27        }
28
29        @Override
30        public void trace(String traceMessage) {
31                output.append(traceMessage);
32        }
33
34        @Override
35        public void printStacktrace(Exception e) {
36                // TODO print stacktrace
37        }
38       
39        @Override
40        public void commandNotification(String command) {
41                output.append("> " + command + StringTools.ENDLINE);   
42        }
43}
Note: See TracBrowser for help on using the repository browser.