|
@@ -23,6 +23,7 @@
|
23
|
23
|
package com.dmdirc.addons.parserdebug;
|
24
|
24
|
|
25
|
25
|
import com.dmdirc.DMDircMBassador;
|
|
26
|
+import com.dmdirc.events.CommandOutputEvent;
|
26
|
27
|
import com.dmdirc.events.ServerDisconnectedEvent;
|
27
|
28
|
import com.dmdirc.interfaces.Connection;
|
28
|
29
|
import com.dmdirc.parser.events.DebugInfoEvent;
|
|
@@ -30,7 +31,6 @@ import com.dmdirc.parser.interfaces.Parser;
|
30
|
31
|
import com.dmdirc.ui.WindowManager;
|
31
|
32
|
import com.dmdirc.ui.messages.BackBufferFactory;
|
32
|
33
|
|
33
|
|
-import java.util.Date;
|
34
|
34
|
import java.util.HashMap;
|
35
|
35
|
import java.util.Map;
|
36
|
36
|
|
|
@@ -96,9 +96,10 @@ public class ParserDebugManager {
|
96
|
96
|
connection, eventBus, backBufferFactory);
|
97
|
97
|
windowManager.addWindow(connection.getWindowModel(), window);
|
98
|
98
|
registeredParsers.put(parser, window);
|
99
|
|
- window.addLine("======================", new Date());
|
100
|
|
- window.addLine("Started Monitoring: " + parser, new Date());
|
101
|
|
- window.addLine("======================", new Date());
|
|
99
|
+ window.getEventBus().publishAsync(new CommandOutputEvent(window,
|
|
100
|
+ "======================\n" +
|
|
101
|
+ "Started Monitoring: " + parser + '\n' +
|
|
102
|
+ "======================"));
|
102
|
103
|
}
|
103
|
104
|
|
104
|
105
|
/**
|
|
@@ -110,9 +111,10 @@ public class ParserDebugManager {
|
110
|
111
|
public void removeParser(final Parser parser, final boolean close) {
|
111
|
112
|
parser.getCallbackManager().unsubscribe(this);
|
112
|
113
|
final DebugWindow window = registeredParsers.get(parser);
|
113
|
|
- window.addLine("======================", new Date());
|
114
|
|
- window.addLine("No Longer Monitoring: " + parser + " (User Requested)", new Date());
|
115
|
|
- window.addLine("======================", new Date());
|
|
114
|
+ window.getEventBus().publishAsync(new CommandOutputEvent(window,
|
|
115
|
+ "======================\n" +
|
|
116
|
+ "No Longer Monitoring: " + parser + " (User Requested)\n" +
|
|
117
|
+ "======================"));
|
116
|
118
|
if (close) {
|
117
|
119
|
window.close();
|
118
|
120
|
}
|
|
@@ -142,7 +144,8 @@ public class ParserDebugManager {
|
142
|
144
|
public void onDebugInfo(final DebugInfoEvent event) {
|
143
|
145
|
final DebugWindow window = registeredParsers.get(event.getParser());
|
144
|
146
|
if (window != null) {
|
145
|
|
- window.addLine(String.format("[%d] %s%n", event.getLevel(), event.getData()), new Date());
|
|
147
|
+ window.getEventBus().publishAsync(new CommandOutputEvent(window,
|
|
148
|
+ String.format("[%d] %s%n", event.getLevel(), event.getData())));
|
146
|
149
|
}
|
147
|
150
|
}
|
148
|
151
|
|