Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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