Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2008-03-24 14:51:32 +0000
committerDarin Wright2008-03-24 14:51:32 +0000
commit6888aa28f83e6631ab69a311172eefca6991c722 (patch)
tree2ffdac484eee9aabf4ca5c80341f10090ee41f8c
parentd19d118c40c8995be57e09cd706e303efe901d1a (diff)
downloadeclipse.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.java21
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;

Back to the top