Last change
on this file since 205 was
202,
checked in by sherbold, 13 years ago
|
|
-
Property svn:mime-type set to
text/plain
|
File size:
1.2 KB
|
Line | |
---|
1 | package de.ugoe.cs.eventbench.swt;
|
---|
2 |
|
---|
3 | import org.eclipse.swt.widgets.Text;
|
---|
4 |
|
---|
5 | import de.ugoe.cs.util.StringTools;
|
---|
6 | import de.ugoe.cs.util.console.Console;
|
---|
7 | import de.ugoe.cs.util.console.listener.ICommandListener;
|
---|
8 | import de.ugoe.cs.util.console.listener.IErrorListener;
|
---|
9 | import de.ugoe.cs.util.console.listener.IOutputListener;
|
---|
10 | import de.ugoe.cs.util.console.listener.ITraceListener;
|
---|
11 |
|
---|
12 | public 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.