Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2009-12-01 14:49:25 +0000
committerDarin Wright2009-12-01 14:49:25 +0000
commit5ee31ed55ca0a3720552e04ab1091e460a20507f (patch)
tree1346d569fae7b24219baf0e7feda175fdf42ad7d
parentcb9aca189d297be5daf45960bf9bc29527687b33 (diff)
downloadeclipse.platform.debug-5ee31ed55ca0a3720552e04ab1091e460a20507f.tar.gz
eclipse.platform.debug-5ee31ed55ca0a3720552e04ab1091e460a20507f.tar.xz
eclipse.platform.debug-5ee31ed55ca0a3720552e04ab1091e460a20507f.zip
Bug 295771 - [flex-hierarchy] IPresentationContext should be disposed by its creator.
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/CheckTests.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PerformanceTests.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PresentationContextTests.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/SelectionTests.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/UpdateTests.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerLazyModeTests.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java8
18 files changed, 59 insertions, 27 deletions
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/CheckTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/CheckTests.java
index 1d0816d3e..9c37e6185 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/CheckTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/CheckTests.java
@@ -68,6 +68,7 @@ abstract public class CheckTests extends TestCase {
fViewer.removeLabelUpdateListener(fListener);
fViewer.removeViewerUpdateListener(fListener);
fViewer.removeModelChangedListener(fListener);
+ fViewer.getPresentationContext().dispose();
// Close the shell and exit.
fShell.close();
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java
index b5eb53f1a..339a319f2 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java
@@ -65,6 +65,7 @@ abstract public class ContentTests extends TestCase {
fViewer.removeLabelUpdateListener(fListener);
fViewer.removeViewerUpdateListener(fListener);
fViewer.removeModelChangedListener(fListener);
+ fViewer.getPresentationContext().dispose();
// Close the shell and exit.
fShell.close();
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java
index 5f6886270..887a1ff76 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java
@@ -71,6 +71,7 @@ abstract public class DeltaTests extends TestCase {
fViewer.removeLabelUpdateListener(fListener);
fViewer.removeViewerUpdateListener(fListener);
fViewer.removeModelChangedListener(fListener);
+ fViewer.getPresentationContext().dispose();
// Close the shell and exit.
fShell.close();
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PerformanceTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PerformanceTests.java
index f4c0786c6..9da1d4b34 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PerformanceTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PerformanceTests.java
@@ -66,6 +66,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd
fViewer.removeLabelUpdateListener(fListener);
fViewer.removeViewerUpdateListener(fListener);
fViewer.removeModelChangedListener(fListener);
+ fViewer.getPresentationContext().dispose();
// Close the shell and exit.
fShell.close();
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PresentationContextTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PresentationContextTests.java
index 8e5028935..7e4d2d280 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PresentationContextTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PresentationContextTests.java
@@ -48,6 +48,7 @@ public class PresentationContextTests extends TestCase {
assertEquals("Wrong value restored", new Integer(1), context.getProperty("integer"));
assertEquals("Wrong value restored", new Boolean(true), context.getProperty("boolean"));
assertEquals("Wrong value restored", ResourcesPlugin.getWorkspace().getRoot(), context.getProperty("persistable"));
+ context.dispose();
}
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/SelectionTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/SelectionTests.java
index aa1155466..b6f725b60 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/SelectionTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/SelectionTests.java
@@ -69,6 +69,7 @@ abstract public class SelectionTests extends TestCase {
fViewer.removeLabelUpdateListener(fListener);
fViewer.removeViewerUpdateListener(fListener);
fViewer.removeModelChangedListener(fListener);
+ fViewer.getPresentationContext().dispose();
// Close the shell and exit.
fShell.close();
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java
index d5b8dfadc..8aff79ca5 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java
@@ -71,6 +71,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
fViewer.removeViewerUpdateListener(fListener);
fViewer.removeModelChangedListener(fListener);
fViewer.addStateUpdateListener(fListener);
+ fViewer.getPresentationContext().dispose();
// Close the shell and exit.
fShell.close();
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/UpdateTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/UpdateTests.java
index eff52f495..7b981af18 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/UpdateTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/UpdateTests.java
@@ -66,6 +66,7 @@ abstract public class UpdateTests extends TestCase {
fViewer.removeLabelUpdateListener(fListener);
fViewer.removeViewerUpdateListener(fListener);
fViewer.removeModelChangedListener(fListener);
+ fViewer.getPresentationContext().dispose();
// Close the shell and exit.
fShell.close();
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerLazyModeTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerLazyModeTests.java
index 6afa8f6de..93ec9344e 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerLazyModeTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerLazyModeTests.java
@@ -68,6 +68,7 @@ public class VirtualViewerLazyModeTests extends TestCase {
fViewer.removeLabelUpdateListener(fListener);
fViewer.removeViewerUpdateListener(fListener);
fViewer.removeModelChangedListener(fListener);
+ fViewer.getPresentationContext().dispose();
// Close the shell and exit.
fShell.close();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
index cacf33d08..b37edcaef 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
@@ -1875,6 +1875,10 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fTableViewer.dispose();
}
+ if (fPresentationContext != null) {
+ fPresentationContext.dispose();
+ }
+
if (!fToolTipShell.isDisposed())
{
fToolTipShell.dispose();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
index d25db71ef..670355541 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
@@ -165,16 +165,6 @@ public class InternalTreeModelViewer extends TreeViewer
private boolean fNotifyUnmap = true;
/**
- * Flag indicating whether the viewer is a pop-up viewer. A pop-up viewer
- * is transient and does not automatically expand and select elements up
- * when requested by the model. It also does not dispose the presentation
- * context when its control is disposed.
- *
- * @since 3.5
- */
- private boolean fIsPopup;
-
- /**
* Persist column sizes when they change.
*
* @since 3.2
@@ -1019,8 +1009,9 @@ public class InternalTreeModelViewer extends TreeViewer
setContentProvider(createContentProvider());
setLabelProvider(createLabelProvider());
- fIsPopup = (style & SWT.POP_UP) != 0;
- if (fIsPopup) {
+ // A pop-up viewer is transient and does not automatically expand
+ // and select elements up when requested by the model
+ if ((style & SWT.POP_UP) != 0) {
((ITreeModelContentProvider)getContentProvider()).setModelDeltaMask(
~ITreeModelContentProvider.ALL_MODEL_DELTA_FLAGS & ~ITreeModelContentProvider.CONTROL_MODEL_DELTA_FLAGS);
}
@@ -1138,9 +1129,6 @@ public class InternalTreeModelViewer extends TreeViewer
}
fCellModifier.dispose();
- if (!fIsPopup) {
- fContext.dispose();
- }
super.handleDispose(event);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
index c0c229bed..8dfc928da 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
@@ -951,7 +951,6 @@ public class InternalVirtualTreeModelViewer extends Viewer
if (fColumnPresentation != null) {
fColumnPresentation.dispose();
}
- fContext.dispose();
if (fContentProvider != null) {
fContentProvider.dispose();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java
index 780d18a6e..f8ef91019 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java
@@ -22,13 +22,23 @@ import org.eclipse.jface.util.IPropertyChangeListener;
* @since 3.2
*/
public interface IPresentationContext {
-
+
/**
* Property name used for property change notification when the columns
* in a presentation context change.
*/
public static final String PROPERTY_COLUMNS = "PROPERTY_COLUMNS"; //$NON-NLS-1$
-
+
+ /**
+ * Property indicating whether the presentation context is disposed.
+ * It is set to <code>Boolean.TRUE</code> after the presentation context
+ * is disposed. This property may be <code>null</code>, which indicates
+ * that context is not yet disposed.
+ *
+ * @since 3.6
+ */
+ public static final String PROPERTY_DISPOSED = "PROPERTY_DISPOSED"; //$NON-NLS-1$
+
/**
* Returns identifiers of the visible columns in the order
* labels should be provided, or <code>null</code> if columns
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
index 22c752441..b79b67859 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
@@ -98,8 +98,9 @@ public class PresentationContext implements IPresentationContext {
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext#dispose()
*/
public void dispose() {
+ fProperties.clear();
+ setProperty(PROPERTY_DISPOSED, Boolean.TRUE);
fListeners.clear();
- fProperties.clear();
}
/* (non-Javadoc)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
index 327dfc817..b17575779 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
@@ -63,6 +63,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedList
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisitor;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
@@ -173,6 +174,8 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
*/
private IDebugModelPresentation fPresentation = null;
+ private IPresentationContext fPresentationContext;
+
private EditLaunchConfigurationAction fEditConfigAction = null;
private AddToFavoritesAction fAddToFavoritesAction = null;
private EditSourceLookupPathAction fEditSourceAction = null;
@@ -771,9 +774,10 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
*/
protected Viewer createViewer(Composite parent) {
fPresentation = new DelegatingModelPresentation();
+ fPresentationContext = new DebugModelPresentationContext(IDebugUIConstants.ID_DEBUG_VIEW, fPresentation);
TreeModelViewer viewer = new TreeModelViewer(parent,
SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL,
- new DebugModelPresentationContext(IDebugUIConstants.ID_DEBUG_VIEW, fPresentation));
+ fPresentationContext);
viewer.addSelectionChangedListener(fTreeViewerSelectionChangedListener);
viewer.getControl().addKeyListener(new KeyAdapter() {
@@ -992,6 +996,9 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
viewer.removeSelectionChangedListener(fTreeViewerSelectionChangedListener);
((TreeModelViewer)viewer).removeViewerUpdateListener(this);
}
+ if (fPresentationContext != null) {
+ fPresentationContext.dispose();
+ }
IWorkbenchPage page = getSite().getPage();
page.removePartListener((IPartListener2) this);
IWorkbenchWindow window = getSite().getWorkbenchWindow();
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 4862fdeb2..a54b69229 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
@@ -32,6 +32,7 @@ import org.eclipse.debug.internal.ui.DebugUIMessages;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.internal.ui.memory.provisional.MemoryViewPresentationContext;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.contexts.DebugContextEvent;
@@ -74,6 +75,7 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
public static final String PANE_ID = DebugUIPlugin.getUniqueIdentifier() + ".MemoryView.MemoryBlocksTreeViewPane"; //$NON-NLS-1$
private IViewPart fParent;
+ private IPresentationContext fPresentationContext;
private MemoryViewTreeViewer fTreeViewer;
protected IMemoryBlockRetrieval fRetrieval;
private ViewPaneSelectionProvider fSelectionProvider;
@@ -291,8 +293,8 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
fLabel = label;
IMemoryRenderingSite site = getMemoryRenderingSite();
- MemoryViewPresentationContext presentationContext = new MemoryViewPresentationContext(site, this, null);
- fTreeViewer = new MemoryViewTreeViewer(parent, style, presentationContext);
+ fPresentationContext = new MemoryViewPresentationContext(site, this, null);
+ fTreeViewer = new MemoryViewTreeViewer(parent, style, fPresentationContext);
IAdaptable context = DebugUITools.getDebugContext();
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
@@ -367,6 +369,7 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
fAddMemoryBlockAction.dispose();
DebugUITools.getDebugContextManager().getContextService(fParent.getSite().getWorkbenchWindow()).removeDebugContextListener(fDebugContextListener);
fEvtHandler.dispose();
+ fPresentationContext.dispose();
}
/* (non-Javadoc)
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 8023624a9..7e03edb9f 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
@@ -357,6 +357,11 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
private SelectionProviderWrapper fSelectionProvider;
/**
+ * Presentation context for this view.
+ */
+ private IPresentationContext fPresentationContext;
+
+ /**
* Remove myself as a selection listener
* and preference change listener.
*
@@ -373,6 +378,10 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
viewer.removeModelChangedListener(this);
viewer.removeViewerUpdateListener(this);
}
+ if (fPresentationContext != null) {
+ fPresentationContext.dispose();
+ fPresentationContext = null;
+ }
if (fDetailPane != null) fDetailPane.dispose();
fInputService.dispose();
fSelectionProvider.dispose();
@@ -580,8 +589,8 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
protected TreeModelViewer createTreeViewer(Composite parent) {
int style = getViewerStyle();
- final TreeModelViewer variablesViewer = new TreeModelViewer(parent, style,
- new DebugModelPresentationContext(getPresentationContextId(), fModelPresentation));
+ fPresentationContext = new DebugModelPresentationContext(getPresentationContextId(), fModelPresentation);
+ final TreeModelViewer variablesViewer = new TreeModelViewer(parent, style, fPresentationContext);
variablesViewer.getControl().addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent e) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
index 2144d26a0..3c1eaa5fe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
@@ -64,6 +64,7 @@ public class InspectPopupDialog extends DebugPopup {
private static final int MIN_WIDTH = 300;
private static final int MIN_HEIGHT = 250;
+ private IPresentationContext fContext;
private TreeModelViewer fViewer;
private SashForm fSashForm;
private Composite fDetailPaneComposite;
@@ -100,17 +101,17 @@ public class InspectPopupDialog extends DebugPopup {
fSashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
VariablesView view = getViewToEmulate();
- IPresentationContext context = new PresentationContext(IDebugUIConstants.ID_VARIABLE_VIEW);
+ fContext = new PresentationContext(IDebugUIConstants.ID_VARIABLE_VIEW);
if (view != null) {
// copy over properties
IPresentationContext copy = ((TreeModelViewer)view.getViewer()).getPresentationContext();
String[] properties = copy.getProperties();
for (int i = 0; i < properties.length; i++) {
String key = properties[i];
- context.setProperty(key, copy.getProperty(key));
+ fContext.setProperty(key, copy.getProperty(key));
}
}
- fViewer = new TreeModelViewer(fSashForm, SWT.NO_TRIM | SWT.MULTI | SWT.VIRTUAL, context);
+ fViewer = new TreeModelViewer(fSashForm, SWT.NO_TRIM | SWT.MULTI | SWT.VIRTUAL, fContext);
fViewer.setAutoExpandLevel(1);
fDetailPaneComposite = SWTFactory.createComposite(fSashForm, 1, 1, GridData.FILL_BOTH);
@@ -253,6 +254,7 @@ public class InspectPopupDialog extends DebugPopup {
fExpression.dispose();
}
fDetailPane.dispose();
+ fContext.dispose();
return super.close();
}

Back to the top