Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2008-04-22 15:57:08 -0400
committerDarin Wright2008-04-22 15:57:08 -0400
commita453b5852fc29cae7423130617c8c801fe4d405c (patch)
tree11c97901112df53e5ca34848a82484de4f43d5de
parent15e5a34a16b297fc23a4a987d21d41c625f66447 (diff)
downloadeclipse.platform.debug-a453b5852fc29cae7423130617c8c801fe4d405c.tar.gz
eclipse.platform.debug-a453b5852fc29cae7423130617c8c801fe4d405c.tar.xz
eclipse.platform.debug-a453b5852fc29cae7423130617c8c801fe4d405c.zip
Bug 228267 - Inspect popup dialog disposes presentation context from variables view
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java14
3 files changed, 29 insertions, 5 deletions
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 fca304e53..e8e781de7 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
@@ -86,4 +86,13 @@ public interface IPresentationContext {
*/
public void dispose();
+ /**
+ * Returns all keys of properties currently set in this context,
+ * possibly an empty collection
+ *
+ * @return keys of all current properties
+ * @since 3.4
+ */
+ public String[] getProperties();
+
}
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 3e5c190fd..22c752441 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
@@ -14,6 +14,7 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.Set;
import java.util.Map.Entry;
import org.eclipse.core.runtime.ListenerList;
@@ -228,6 +229,16 @@ public class PresentationContext implements IPresentationContext {
}
return a.equals(b);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext#getProperties()
+ */
+ public String[] getProperties() {
+ synchronized (fProperties) {
+ Set keys = fProperties.keySet();
+ return (String[]) keys.toArray(new String[keys.size()]);
+ }
+ }
}
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 467b6d3a7..edde1e0ad 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
@@ -100,11 +100,15 @@ public class InspectPopupDialog extends DebugPopup {
fSashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
VariablesView view = getViewToEmulate();
- IPresentationContext context;
- if (view == null) {
- context = new PresentationContext(IDebugUIConstants.ID_VARIABLE_VIEW);
- } else {
- context = ((TreeModelViewer)view.getViewer()).getPresentationContext();
+ IPresentationContext context = 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));
+ }
}
fViewer = new TreeModelViewer(fSashForm, SWT.NO_TRIM | SWT.MULTI | SWT.VIRTUAL, context);
fViewer.setAutoExpandLevel(1);

Back to the top