diff options
author | Darin Wright | 2008-03-24 14:51:32 +0000 |
---|---|---|
committer | Darin Wright | 2008-03-24 14:51:32 +0000 |
commit | 6888aa28f83e6631ab69a311172eefca6991c722 (patch) | |
tree | 2ffdac484eee9aabf4ca5c80341f10090ee41f8c | |
parent | d19d118c40c8995be57e09cd706e303efe901d1a (diff) | |
download | eclipse.platform.debug-6888aa28f83e6631ab69a311172eefca6991c722.tar.gz eclipse.platform.debug-6888aa28f83e6631ab69a311172eefca6991c722.tar.xz eclipse.platform.debug-6888aa28f83e6631ab69a311172eefca6991c722.zip |
Bug 208040 - Inspect and other popups should automatically select first item
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java | 21 |
1 files changed, 21 insertions, 0 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 c32a42b7d..467b6d3a7 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.IChildrenUpdate; 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,6 +31,8 @@ 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.TreeSelection; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; @@ -132,6 +136,23 @@ public class InspectPopupDialog extends DebugPopup { } TreeRoot treeRoot = new TreeRoot(); + // add update listener to auto-select and display details of root expression + fViewer.addViewerUpdateListener(new IViewerUpdateListener() { + public void viewerUpdatesComplete() { + } + public void viewerUpdatesBegin() { + } + public void updateStarted(IViewerUpdate update) { + } + public void updateComplete(IViewerUpdate update) { + if (update instanceof IChildrenUpdate) { + TreeSelection selection = new TreeSelection(new TreePath(new Object[]{fExpression})); + fViewer.setSelection(selection); + fDetailPane.display(selection); + fViewer.removeViewerUpdateListener(this); + } + } + }); fViewer.setInput(treeRoot); return fTree; |