Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2011-12-19 03:27:25 -0500
committerUwe Stieber2011-12-19 03:27:25 -0500
commit29244aee2d04df11b2443133c2fee9e7fd626c06 (patch)
treec7ba3a897746bb22ca1b65da1f6f43f5644d6379 /target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views
parentcc126044badbd90db794df30d11267e52ee2513c (diff)
downloadorg.eclipse.tcf-29244aee2d04df11b2443133c2fee9e7fd626c06.tar.gz
org.eclipse.tcf-29244aee2d04df11b2443133c2fee9e7fd626c06.tar.xz
org.eclipse.tcf-29244aee2d04df11b2443133c2fee9e7fd626c06.zip
Target Explorer: Rework services extension point and fix some issue with the communication monitor handling
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/monitor/console/Factory.java7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/monitor/events/EventListener.java19
2 files changed, 17 insertions, 9 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/monitor/console/Factory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/monitor/console/Factory.java
index ce74e91ac..7b180571f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/monitor/console/Factory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/monitor/console/Factory.java
@@ -42,7 +42,7 @@ public class Factory {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
// Add the console to the manager if not yet done
if (!isConsoleAlreadyAdded(console)) manager.addConsoles(new IConsole[] {console});
- // Show the console view with the TCF communication monitor console
+ // Show the console view with the monitor console
manager.showConsoleView(console);
}
@@ -88,6 +88,11 @@ public class Factory {
CONSOLES.put(peer, console);
}
+ // Add the console to the manager if not yet done
+ if (console != null && !isConsoleAlreadyAdded(console)) {
+ ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {console});
+ }
+
return console;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/monitor/events/EventListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/monitor/events/EventListener.java
index e483c7a68..f6ec17cb3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/monitor/events/EventListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/monitor/events/EventListener.java
@@ -11,6 +11,7 @@ package org.eclipse.tcf.te.tcf.ui.views.monitor.events;
import java.util.EventObject;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.te.tcf.log.core.events.MonitorEvent;
import org.eclipse.tcf.te.tcf.ui.views.monitor.console.Console;
@@ -40,17 +41,19 @@ public class EventListener extends AbstractEventListener {
case CLOSE:
// Channel close messages are logged only if there is an error
if (message != null && message.text != null && !message.text.contains("(error=null)")) { //$NON-NLS-1$
- Console console = Factory.showConsole((IPeer)monitorEvent.getSource(), true);
- if (console != null) {
- // Message type 'R' is an unknown type and will lead to print the
- // message text using the error color.
- console.appendMessage('R', message.text);
- }
+ // Get the console
+ Console console = Factory.getConsole((IPeer)monitorEvent.getSource(), true);
+ Assert.isNotNull(console);
+ // Message type 'R' is an unknown type and will lead to print the
+ // message text using the error color.
+ console.appendMessage('R', message.text);
}
break;
case ACTIVITY:
- Console console = Factory.showConsole((IPeer)monitorEvent.getSource(), true);
- if (console != null && message != null) {
+ if (message != null) {
+ // Get the console
+ Console console = Factory.getConsole((IPeer)monitorEvent.getSource(), true);
+ Assert.isNotNull(console);
console.appendMessage(message.type, message.text);
}
break;

Back to the top