Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2010-12-02 18:34:44 +0000
committerPawel Piech2010-12-02 18:34:44 +0000
commit7549c7a81d6e70118ec63598ad218c08dfefac08 (patch)
tree9bde9d1fb0c6c72f1af2a1f695fa4a1ddc3abdcf /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views
parentaf9751e6232940dc5de1046294a166b4a77a2cd9 (diff)
downloadeclipse.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')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java31
12 files changed, 76 insertions, 39 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java
index cbaced58f..207cd4bad 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java
@@ -42,6 +42,7 @@ import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.ui.IWorkbenchPartSite;
/**
* Drop Adapter allowing expressions, variables and text to be dropped in the Expression View.
@@ -54,7 +55,8 @@ import org.eclipse.swt.dnd.TransferData;
*/
public class ExpressionDropAdapter extends ViewerDropAdapter {
- private TransferData fCurrentTransferType = null;
+ private IWorkbenchPartSite fSite;
+ private TransferData fCurrentTransferType = null;
private boolean fInsertBefore;
private int fDropType;
@@ -67,8 +69,9 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
* Constructor takes the viewer this drop adapter applies to.
* @param viewer the viewer to add drop to
*/
- protected ExpressionDropAdapter(TreeModelViewer viewer) {
+ protected ExpressionDropAdapter(IWorkbenchPartSite site, TreeModelViewer viewer) {
super(viewer);
+ fSite = site;
setFeedbackEnabled(true);
setSelectionFeedbackEnabled(false);
setScrollExpandEnabled(false);
@@ -473,7 +476,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
*/
private IExpression createExpression(String exp) {
IWatchExpression expression = DebugPlugin.getDefault().getExpressionManager().newWatchExpression(exp);
- IAdaptable object = DebugUITools.getDebugContext();
+ IAdaptable object = DebugUITools.getPartDebugContext(fSite);
IDebugElement context = null;
if (object instanceof IDebugElement) {
context = (IDebugElement) object;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
index bcf9c86f0..984b37ede 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
@@ -155,7 +155,7 @@ public class ExpressionView extends VariablesView {
*/
protected void initDragAndDrop(TreeModelViewer viewer) {
viewer.addDragSupport(DND.DROP_MOVE, new Transfer[] {LocalSelectionTransfer.getTransfer()}, new SelectionDragAdapter(viewer));
- viewer.addDropSupport(DND.DROP_MOVE|DND.DROP_COPY, new Transfer[] {LocalSelectionTransfer.getTransfer(), TextTransfer.getInstance()}, new ExpressionDropAdapter(viewer));
+ viewer.addDropSupport(DND.DROP_MOVE|DND.DROP_COPY, new Transfer[] {LocalSelectionTransfer.getTransfer(), TextTransfer.getInstance()}, new ExpressionDropAdapter(getSite(), viewer));
}
/* (non-Javadoc)
@@ -226,7 +226,7 @@ public class ExpressionView extends VariablesView {
// TODO: duplicate code from WatchExpressionAction
protected IDebugElement getContext() {
- IAdaptable object = DebugUITools.getDebugContext();
+ IAdaptable object = DebugUITools.getPartDebugContext(getSite());
IDebugElement context = null;
if (object instanceof IDebugElement) {
context = (IDebugElement) object;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
index 6dad2ff78..791dd71ff 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
@@ -115,8 +115,8 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
addListeners();
- Object context = DebugUITools.getDebugContext();
- if (context != null)
+ Object context = DebugUITools.getPartDebugContext(fParent.getSite());
+ if (context != null)
{
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
if (retrieval != null)
@@ -132,7 +132,7 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
{
MemoryViewUtil.getMemoryBlockManager().addListener(this);
fParent.getViewSite().getPage().addSelectionListener(this);
- DebugUITools.getDebugContextManager().getContextService(fParent.getSite().getWorkbenchWindow()).addDebugContextListener(this);
+ DebugUITools.addPartDebugContextListener(fParent.getSite(), this);
DebugPlugin.getDefault().addDebugEventListener(this);
}
@@ -140,8 +140,7 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
{
MemoryViewUtil.getMemoryBlockManager().removeListener(this);
fParent.getViewSite().getPage().removeSelectionListener(this);
- DebugUITools.getDebugContextManager().getContextService(fParent.getSite().getWorkbenchWindow()).removeDebugContextListener(this);
-
+ DebugUITools.removePartDebugContextListener(fParent.getSite(), this);
if (fStackLayout.topControl != null)
{
CTabFolder old = (CTabFolder)fStackLayout.topControl;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java
index c0188450b..0ebcbb4f0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -104,11 +104,11 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_MONITOR_EXPRESSION));
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".addMemoryMonitorAction_context"); //$NON-NLS-1$
- // listen for context changed
- DebugUITools.getDebugContextManager().getContextService(site.getSite().getWorkbenchWindow()).addDebugContextListener(this);
+ // listen for context changed
+ DebugUITools.addPartDebugContextListener(fSite.getSite(), this);
// get current context
- fCurrentContext = DebugUITools.getDebugContext();
+ fCurrentContext = DebugUITools.getPartDebugContext(site.getSite());
// set up enablement based on current selection
updateAction(fCurrentContext);
@@ -127,7 +127,7 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
{
exit = true;
- Object elem = DebugUITools.getDebugContext();
+ Object elem = fCurrentContext;
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(elem);
@@ -347,7 +347,7 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
// remove listeners
DebugPlugin.getDefault().removeDebugEventListener(this);
- DebugUITools.getDebugContextManager().getContextService(fSite.getSite().getWorkbenchWindow()).removeDebugContextListener(this);
+ DebugUITools.removePartDebugContextListener(fSite.getSite(), this);
}
private void addDefaultRenderings(IMemoryBlock memoryBlock)
@@ -422,7 +422,7 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
*/
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
- IAdaptable context = DebugUITools.getDebugContext();
+ IAdaptable context = DebugUITools.getPartDebugContext(fSite.getSite());
updateAction(context);
fCurrentContext = context;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
index 3eef011ab..9e57d147b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -432,7 +432,7 @@ public class AddMemoryRenderingDialog extends SelectionDialog {
if (element == null)
{
- IAdaptable context = DebugUITools.getDebugContext();
+ IAdaptable context = DebugUITools.getPartDebugContext(fSite.getSite());
if (context != null)
{
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
index eeba2d96b..2e4179594 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -296,7 +296,7 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
fPresentationContext = new MemoryViewPresentationContext(site, this, null);
fTreeViewer = new MemoryViewTreeViewer(parent, style, fPresentationContext);
- IAdaptable context = DebugUITools.getDebugContext();
+ IAdaptable context = DebugUITools.getPartDebugContext(fParent.getSite());
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
if (retrieval != null)
fTreeViewer.setInput(retrieval);
@@ -307,7 +307,7 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
fParent.getViewSite().getPage().addSelectionListener(this);
fDebugContextListener = new TreeViewPaneContextListener();
- DebugUITools.getDebugContextManager().getContextService(fParent.getSite().getWorkbenchWindow()).addDebugContextListener(fDebugContextListener);
+ DebugUITools.addPartDebugContextListener(fParent.getSite(), fDebugContextListener);
fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@@ -342,7 +342,7 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
*/
private void updateRetrieval() {
- Object context = DebugUITools.getDebugContext();
+ Object context = DebugUITools.getPartDebugContext(fParent.getSite());
fRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
}
@@ -367,7 +367,7 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
fParent.getViewSite().getSelectionProvider().removeSelectionChangedListener(this);
fParent.getViewSite().getPage().removeSelectionListener(this);
fAddMemoryBlockAction.dispose();
- DebugUITools.getDebugContextManager().getContextService(fParent.getSite().getWorkbenchWindow()).removeDebugContextListener(fDebugContextListener);
+ DebugUITools.removePartDebugContextListener(fParent.getSite(), fDebugContextListener);
fEvtHandler.dispose();
fPresentationContext.dispose();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
index 5e8333be2..bccacccaf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -352,7 +352,7 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite {
fAddHandler = new AbstractHandler() {
public Object execute(ExecutionEvent event) throws ExecutionException {
- IAdaptable context = DebugUITools.getDebugContext();
+ IAdaptable context = DebugUITools.getPartDebugContext(getSite());
if (context != null && MemoryViewUtil.isValidSelection(new StructuredSelection(context)))
{
RetargetAddMemoryBlockAction action = new RetargetAddMemoryBlockAction(MemoryView.this);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
index 137e5b004..d45f55b35 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
@@ -821,7 +821,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
if (memoryBlock == null)
{
// get a memory block from current debug context
- IAdaptable context = DebugUITools.getDebugContext();
+ IAdaptable context = DebugUITools.getPartDebugContext(fParent.getSite());
if (context != null)
{
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java
index dfa60c091..a0667815d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2006 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
@@ -45,7 +45,7 @@ public class RetargetAddMemoryBlockAction extends AddMemoryBlockAction {
public void run() {
// get current selection from Debug View
- Object debugContext = DebugUITools.getDebugContext();
+ Object debugContext = DebugUITools.getPartDebugContext(fSite.getSite());
IAddMemoryBlocksTarget target = getAddMemoryBlocksTarget(debugContext);
if (target != null)
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();
+ }
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java
index c078b7a20..690b788ca 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -28,6 +28,7 @@ import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.memory.AbstractMemoryRendering;
import org.eclipse.debug.ui.memory.IMemoryRendering;
+import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
import org.eclipse.debug.ui.memory.IMemoryRenderingType;
import org.eclipse.debug.ui.memory.IRepositionableMemoryRendering;
import org.eclipse.jface.action.Action;
@@ -43,11 +44,13 @@ import org.eclipse.ui.PlatformUI;
*/
public class GoToAddressAction extends Action
{
+ private IMemoryRenderingContainer fContainer;
private IRepositionableMemoryRendering fRendering;
- public GoToAddressAction(IRepositionableMemoryRendering rendering)
+ public GoToAddressAction(IMemoryRenderingContainer container, IRepositionableMemoryRendering rendering)
{
super(DebugUIMessages.GoToAddressAction_title);
+ fContainer = container;
setToolTipText(DebugUIMessages.GoToAddressAction_title);
fRendering = rendering;
@@ -166,7 +169,7 @@ public class GoToAddressAction extends Action
private void addNewMemoryBlock(String expression, IMemoryBlockRetrievalExtension retrieval)
{
- Object elem = DebugUITools.getDebugContext();
+ Object elem = DebugUITools.getPartDebugContext(fContainer.getMemoryRenderingSite().getSite());
if (!(elem instanceof IDebugElement))
return;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
index 1473e28e2..e8d826dfe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
@@ -14,6 +14,8 @@
* Wind River - Pawel Piech - Fix viewer input race condition (Bug 234908)
* Wind River - Anton Leherbauer - Fix selection provider (Bug 254442)
* Patrick Chuong (Texas Instruments) - Improve usability of the breakpoint view (Bug 238956)
+ * Patrick Chuong (Texas Instruments) and Pawel Piech (Wind River) -
+ * Allow multiple debug views and multiple debug context providers (Bug 327263)
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.variables;
@@ -64,6 +66,7 @@ import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.contexts.DebugContextEvent;
import org.eclipse.debug.ui.contexts.IDebugContextListener;
+import org.eclipse.debug.ui.contexts.IDebugContextService;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -418,7 +421,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
*/
public void dispose() {
- DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).removeDebugContextListener(this);
+ DebugUITools.removePartDebugContextListener(getSite(), this);
getSite().getWorkbenchWindow().removePerspectiveListener(this);
DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
JFaceResources.getFontRegistry().removeListener(this);
@@ -696,17 +699,39 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
});
variablesViewer.addPostSelectionChangedListener(getTreeSelectionChangedListener());
- DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).addDebugContextListener(this);
+ DebugUITools.addPartDebugContextListener(getSite(), this);
+
return variablesViewer;
}
/**
+ * Returns the active debug context for this view based on the view's
+ * site IDs.
+ *
+ * @since 3.7
+ */
+ protected ISelection getDebugContext() {
+ IViewSite site = (IViewSite)getSite();
+ IDebugContextService contextService = DebugUITools.getDebugContextManager().getContextService(site.getWorkbenchWindow());
+ return contextService.getActiveContext(site.getId(), site.getSecondaryId());
+ }
+
+ /**
* Returns the presentation context id for this view.
*
* @return context id
*/
protected String getPresentationContextId() {
return IDebugUIConstants.ID_VARIABLE_VIEW;
+ }
+
+ /**
+ * Returns the presentation context secondary id for this view.
+ *
+ * @return context secondary id.
+ */
+ protected String getPresentationContextSecondaryId() {
+ return ((IViewSite)getSite()).getSecondaryId();
}
/**
@@ -1291,7 +1316,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
*/
protected void becomesVisible() {
super.becomesVisible();
- ISelection selection = DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).getActiveContext();
+ ISelection selection = getDebugContext();
contextActivated(selection);
}

Back to the top