Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-04-03 04:33:51 +0000
committerPawel Piech2012-04-03 04:33:51 +0000
commitf8cca8b65e2ac9a309a01bd318b7b6b50f621055 (patch)
tree9ebcd3a143599cff71070f9169b3bd44d599de1a
parent8c623b599674739320f23be6df89e6ac86f8abe9 (diff)
downloadeclipse.platform.debug-f8cca8b65e2ac9a309a01bd318b7b6b50f621055.tar.gz
eclipse.platform.debug-f8cca8b65e2ac9a309a01bd318b7b6b50f621055.tar.xz
eclipse.platform.debug-f8cca8b65e2ac9a309a01bd318b7b6b50f621055.zip
Bug 375887 - [debug context] IDebugContextService.removeDebugContextProvider()
should trigger an active context notification in view
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
index 819aa4db2..f8e68f14b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
@@ -85,7 +85,11 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
active = activePage.getActivePart();
}
if (fProviders.size() == 1 && (part == null || part.equals(active))) {
- notify(provider);
+ notify(provider);
+ } else {
+ ISelection activeContext = provider.getActiveContext();
+ activeContext = activeContext != null ? activeContext : StructuredSelection.EMPTY;
+ notify(new DebugContextEvent(provider, activeContext, DebugContextEvent.ACTIVATED));
}
provider.addDebugContextListener(this);
}
@@ -100,13 +104,17 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
}
fProvidersByPartId.remove(id);
fProviders.remove(index);
+ IDebugContextProvider activeProvider = getActiveProvider();
if (index == 0) {
- IDebugContextProvider activeProvider = getActiveProvider();
- if (activeProvider != null) {
- notify(activeProvider);
- } else {
- notify(new DebugContextEvent(provider, new StructuredSelection(), DebugContextEvent.ACTIVATED));
- }
+ if (activeProvider != null) {
+ notify(activeProvider);
+ } else {
+ notify(new DebugContextEvent(provider, StructuredSelection.EMPTY, DebugContextEvent.ACTIVATED));
+ }
+ } else {
+ ISelection activeContext = provider.getActiveContext();
+ activeContext = activeContext != null ? activeContext : StructuredSelection.EMPTY;
+ notify(new DebugContextEvent(provider, activeContext, DebugContextEvent.ACTIVATED));
}
}
provider.removeDebugContextListener(this);

Back to the top