1 | package de.uka.ipd.sdq.pcmsolver; |
2 | |
3 | import org.eclipse.swt.widgets.Display; |
4 | import org.eclipse.ui.console.IOConsoleOutputStream; |
5 | import org.eclipse.ui.console.IPatternMatchListener; |
6 | import org.eclipse.ui.console.MessageConsole; |
7 | import org.eclipse.ui.console.PatternMatchEvent; |
8 | import org.eclipse.ui.console.TextConsole; |
9 | |
10 | public class PCMSolverPatternMatchListener implements IPatternMatchListener { |
11 | |
12 | MessageConsole myConsole; |
13 | IOConsoleOutputStream stream; |
14 | |
15 | public int getCompilerFlags() { |
16 | // TODO Auto-generated method stub |
17 | return 0; |
18 | } |
19 | |
20 | public String getLineQualifier() { |
21 | // TODO Auto-generated method stub |
22 | return null; |
23 | } |
24 | |
25 | public String getPattern() { |
26 | // TODO Auto-generated method stub |
27 | return "INFO"; |
28 | } |
29 | |
30 | public void connect(TextConsole console) { |
31 | if (console instanceof MessageConsole) { |
32 | myConsole = (MessageConsole)console; |
33 | stream = myConsole.newOutputStream(); |
34 | } |
35 | |
36 | } |
37 | |
38 | public void disconnect() { |
39 | // TODO Auto-generated method stub |
40 | |
41 | } |
42 | |
43 | public void matchFound(PatternMatchEvent event) { |
44 | stream.setColor(new org.eclipse.swt.graphics.Color(Display.getCurrent(), 0, 255, 0)); |
45 | |
46 | } |
47 | |
48 | public IOConsoleOutputStream getStream() { |
49 | return stream; |
50 | } |
51 | |
52 | public void setStream(IOConsoleOutputStream stream) { |
53 | this.stream = stream; |
54 | } |
55 | |
56 | } |