diff options
author | Pawel Piech | 2010-12-02 18:34:44 +0000 |
---|---|---|
committer | Pawel Piech | 2010-12-02 18:34:44 +0000 |
commit | 7549c7a81d6e70118ec63598ad218c08dfefac08 (patch) | |
tree | 9bde9d1fb0c6c72f1af2a1f695fa4a1ddc3abdcf /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java | |
parent | af9751e6232940dc5de1046294a166b4a77a2cd9 (diff) | |
download | eclipse.platform.debug-7549c7a81d6e70118ec63598ad218c08dfefac08.tar.gz eclipse.platform.debug-7549c7a81d6e70118ec63598ad218c08dfefac08.tar.xz eclipse.platform.debug-7549c7a81d6e70118ec63598ad218c08dfefac08.zip |
Bug 327263 - Allow multiple debug views and multiple debug context providers
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java index a6d135739..3ce617599 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -74,7 +74,7 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega */ public IStatus runInUIThread(IProgressMonitor monitor) { if (fAction != null) { - IAdaptable context = DebugUITools.getDebugContext(); + IAdaptable context = getDebugContext(); if (context != null) { IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context); @@ -229,7 +229,7 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega // get selection from memory view IMemoryBlock memoryBlock = getCurrentMemoryBlock(); - Object context = DebugUITools.getDebugContext(); + Object context = getDebugContext(); IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context); if (retrieval != null) { allMemoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(retrieval); @@ -299,7 +299,7 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega } private void switchToNext() { - IAdaptable context = DebugUITools.getDebugContext(); + IAdaptable context = getDebugContext(); if (context instanceof IDebugElement) { IDebugElement debugContext = (IDebugElement)context; IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(debugContext); @@ -407,4 +407,11 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega return label; } + private IAdaptable getDebugContext() { + if (fView != null) { + return DebugUITools.getPartDebugContext(fView.getSite()); + } else { + return DebugUITools.getDebugContext(); + } + } } |