Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis Windatt2007-05-09 15:56:10 +0000
committerCurtis Windatt2007-05-09 15:56:10 +0000
commite9f4b1ed6aebaa0468d6b18f41028d6d51599544 (patch)
tree2f9d77145af7b078c298104205a2d1c6ccd4e849 /org.eclipse.debug.ui
parent9f608bba955d1da25bb6040be7b1442ad1953ed8 (diff)
downloadeclipse.platform.debug-e9f4b1ed6aebaa0468d6b18f41028d6d51599544.tar.gz
eclipse.platform.debug-e9f4b1ed6aebaa0468d6b18f41028d6d51599544.tar.xz
eclipse.platform.debug-e9f4b1ed6aebaa0468d6b18f41028d6d51599544.zip
Bug 178246 - inspect/all instances popup should expand first element
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java47
1 files changed, 45 insertions, 2 deletions
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 f8617c7e5..efbd60c40 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
@@ -18,8 +18,10 @@ import org.eclipse.debug.core.model.IExpression;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
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.PresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
@@ -29,7 +31,6 @@ import org.eclipse.debug.internal.ui.views.variables.details.DetailPaneProxy;
import org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
@@ -134,8 +135,8 @@ public class InspectPopupDialog extends DebugPopup {
}
TreeRoot treeRoot = new TreeRoot();
+ fViewer.addViewerUpdateListener(new ViewerListener(fExpression));
fViewer.setInput(treeRoot);
- fViewer.expandToLevel(new TreePath(new Object[] {fExpression}), 1);
return fTree;
}
@@ -331,5 +332,47 @@ public class InspectPopupDialog extends DebugPopup {
}
}
+
+ private class ViewerListener implements IViewerUpdateListener {
+
+ private Object rootElement;
+
+ ViewerListener(Object root) {
+ rootElement = root;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener#updateComplete(org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
+ */
+ public void updateComplete(IViewerUpdate update) {
+ if (update instanceof IHasChildrenUpdate) {
+ IHasChildrenUpdate hcu = (IHasChildrenUpdate) update;
+ if (hcu.getElement().equals(rootElement)) {
+ fViewer.removeViewerUpdateListener(this);
+ fViewer.expandToLevel(update.getElementPath(), 1);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener#updateStarted(org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
+ */
+ public void updateStarted(IViewerUpdate update) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener#viewerUpdatesBegin()
+ */
+ public void viewerUpdatesBegin() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener#viewerUpdatesComplete()
+ */
+ public void viewerUpdatesComplete() {
+ }
+
+
+ }
}

Back to the top