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

Last change on this file since 205 was 202, checked in by sherbold, 13 years ago
  • minor refactorings
  • Property svn:mime-type set to text/plain
File size: 1.2 KB
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.listener.ICommandListener;
8import de.ugoe.cs.util.console.listener.IErrorListener;
9import de.ugoe.cs.util.console.listener.IOutputListener;
10import de.ugoe.cs.util.console.listener.ITraceListener;
11
12public class SWTConsole implements IOutputListener, IErrorListener, ITraceListener, ICommandListener {
13
14        Text output;
15       
16        public SWTConsole(Text output) {
17                Console.getInstance().registerOutputListener(this);
18                Console.getInstance().registerErrorListener(this);
19                Console.getInstance().registerTraceListener(this);
20                Console.getInstance().registerCommandListener(this);
21                this.output = output;
22        }
23       
24        @Override
25        public void outputMsg(String newMessage) {
26                output.append(newMessage);
27        }
28
29        @Override
30        public void errorMsg(String errMessage) {
31                output.append(errMessage);
32
33        }
34
35        @Override
36        public void traceMsg(String traceMessage) {
37                output.append(traceMessage);
38        }
39       
40        @Override
41        public void commandNotification(String command) {
42                output.append("> " + command + StringTools.ENDLINE);   
43        }
44}
Note: See TracBrowser for help on using the repository browser.