Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2010-04-13 17:22:58 -0400
committerDarin Wright2010-04-13 17:22:58 -0400
commita59f1fa8bc05bfbb2b5ed0c54a1be45a91b59add (patch)
tree51a228bac28d721ec9b76059550ed91a692e8f5f
parentadb0cecc757d87e82c8424d34c7067e513ee4968 (diff)
downloadeclipse.platform.debug-a59f1fa8bc05bfbb2b5ed0c54a1be45a91b59add.tar.gz
eclipse.platform.debug-a59f1fa8bc05bfbb2b5ed0c54a1be45a91b59add.tar.xz
eclipse.platform.debug-a59f1fa8bc05bfbb2b5ed0c54a1be45a91b59add.zip
Bug 304277 - debug view: updating stack frames on suspend can take up to 40s
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ChildrenUpdateTests.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProviderTarget.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java10
6 files changed, 38 insertions, 2 deletions
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ChildrenUpdateTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ChildrenUpdateTests.java
index dfef61a00..4095eeff2 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ChildrenUpdateTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ChildrenUpdateTests.java
@@ -50,6 +50,7 @@ public class ChildrenUpdateTests extends TestCase {
public void addSelectionChangedListener(ISelectionChangedListener listener) {}
public void updateViewer(IModelDelta delta) {}
public void setSelection(ISelection selection, boolean reveal, boolean force) {}
+ public void clearSelectionQuiet() {}
public boolean trySelection(ISelection selection, boolean reveal, boolean force) { return true; }
public void setInput(Object object) {}
public void setAutoExpandLevel(int level) {}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProviderTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProviderTarget.java
index dee5a1ec8..4e651832e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProviderTarget.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProviderTarget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
+ * Copyright (c) 2009, 2010 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - ongoing bug fixes and enhancements
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model;
@@ -248,4 +249,13 @@ public interface ITreeModelContentProviderTarget extends ITreeModelViewer {
* @since 3.6
*/
public boolean getElementChildrenRealized(TreePath parentPath);
+
+ /**
+ * Clears the selection in the viewer, if any, without firing
+ * selection change notification. This is only to be used by
+ * the platform.
+ *
+ * @since 3.6
+ */
+ public void clearSelectionQuiet();
}
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 a66813078..b342febde 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
@@ -2465,4 +2465,11 @@ public class InternalTreeModelViewer extends TreeViewer
((TreeModelContentProvider) contentProvider).cancelRestore(path, IModelDelta.EXPAND);
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget#clearSelectionQuiet()
+ */
+ public void clearSelectionQuiet() {
+ getTree().setSelection(new TreeItem[0]);
+ }
}
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 7d5f06c92..dff4d630c 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
@@ -1469,4 +1469,10 @@ public class InternalVirtualTreeModelViewer extends Viewer
return null;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget#clearSelectionQuiet()
+ */
+ public void clearSelectionQuiet() {
+ getTree().setSelection(EMPTY_ITEMS_ARRAY);
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
index be7d66c53..486d89f64 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
@@ -353,6 +353,10 @@ public class SubTreeModelViewer extends TreeModelViewer {
public void update(Object element) {
SubTreeModelViewer.this.update(element);
}
+
+ public void clearSelectionQuiet() {
+ SubTreeModelViewer.this.clearSelectionQuiet();
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
index b1db68875..fcde05bba 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
@@ -17,6 +17,7 @@ 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.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
@@ -342,6 +343,13 @@ public class TreeModelContentProvider extends ModelContentProvider implements IT
protected void handleSelect(IModelDelta delta) {
int modelIndex = delta.getIndex();
ITreeModelContentProviderTarget treeViewer = getViewer();
+ // check if selection is allowed
+ IStructuredSelection candidate = new TreeSelection(getViewerTreePath(delta));
+ if (!treeViewer.overrideSelection(treeViewer.getSelection(), candidate)) {
+ return;
+ }
+ // empty the selection before replacing elements to avoid materializing elements (@see bug 305739)
+ treeViewer.clearSelectionQuiet();
if (modelIndex >= 0) {
IModelDelta parentDelta = delta.getParentDelta();
TreePath parentPath = getViewerTreePath(parentDelta);
@@ -363,7 +371,7 @@ public class TreeModelContentProvider extends ModelContentProvider implements IT
}
}
TreePath selectionPath = getViewerTreePath(delta);
- if ( treeViewer.trySelection(new TreeSelection(selectionPath), false, (delta.getFlags() & IModelDelta.FORCE) != 0) ) {
+ if (treeViewer.trySelection(new TreeSelection(selectionPath), false, true)) {
cancelRestore(selectionPath, IModelDelta.SELECT);
}
}

Back to the top