Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2004-11-23 19:48:30 +0000
committerDarin Wright2004-11-23 19:48:30 +0000
commitb3e473fec62bee7e137267bf78234859c8b76661 (patch)
tree3165b8922802519df343ffa19c0d7b28280c73e2
parentdd9c25cc51f6b84d534633acde471ae7da965fdb (diff)
downloadeclipse.platform.debug-b3e473fec62bee7e137267bf78234859c8b76661.tar.gz
eclipse.platform.debug-b3e473fec62bee7e137267bf78234859c8b76661.tar.xz
eclipse.platform.debug-b3e473fec62bee7e137267bf78234859c8b76661.zip
Bug 79304 - Incorrect stack frame selected
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/RemoteTreeViewer.java86
1 files changed, 44 insertions, 42 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/RemoteTreeViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/RemoteTreeViewer.java
index 7996c8470..6f4041f3e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/RemoteTreeViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/RemoteTreeViewer.java
@@ -305,56 +305,58 @@ public class RemoteTreeViewer extends TreeViewer {
Widget widget = findItem(parent);
if (widget != null) {
Item[] currentChildren = getChildren(widget);
- if (offset < currentChildren.length) {
- Object[] pruned = new Object[currentChildren.length - offset];
- System.arraycopy(currentChildren, offset, pruned, 0, pruned.length);
- remove(pruned);
+ for (int i = offset; i < currentChildren.length; i++) {
+ disassociate(currentChildren[i]);
+ currentChildren[i].dispose();
}
}
}
-
-
- public synchronized void replace(Object parent, Object[] children, int offset) {
- Widget widget = findItem(parent);
- if (widget == null) {
- add(parent, children);
- return;
- }
- Item[] currentChildren = getChildren(widget);
- if (offset >= currentChildren.length) {
- // append
- add(parent, children);
- } else {
- // replace
- for (int i = 0; i < children.length; i++) {
- Object child = children[i];
- if (offset < currentChildren.length) {
+ public synchronized void replace(final Object parent, final Object[] children, final int offset) {
+ preservingSelection(new Runnable() {
+ public void run() {
+ Widget widget = findItem(parent);
+ if (widget == null) {
+ add(parent, children);
+ return;
+ }
+ Item[] currentChildren = getChildren(widget);
+ int pos = offset;
+ if (pos >= currentChildren.length) {
+ // append
+ add(parent, children);
+ } else {
// replace
- Item item = currentChildren[offset];
- Object data = item.getData();
- if (!child.equals(data)) {
- associate(child, item);
- internalRefresh(item, child, true, true);
- } else {
- internalRefresh(item, child, false, true);
+ for (int i = 0; i < children.length; i++) {
+ Object child = children[i];
+ if (pos < currentChildren.length) {
+ // replace
+ Item item = currentChildren[pos];
+ Object data = item.getData();
+ if (!child.equals(data)) {
+ associate(child, item);
+ internalRefresh(item, child, true, true);
+ } else {
+ internalRefresh(item, child, false, true);
+ }
+ } else {
+ // add
+ int numLeft = children.length - i;
+ if (numLeft > 1) {
+ Object[] others = new Object[numLeft];
+ System.arraycopy(children, i, others, 0, numLeft);
+ add(parent, others);
+ } else {
+ add(parent, child);
+ }
+ return;
+ }
+ pos++;
}
- } else {
- // add
- int numLeft = children.length - i;
- if (numLeft > 1) {
- Object[] others = new Object[numLeft];
- System.arraycopy(children, i, others, 0, numLeft);
- add(parent, others);
- } else {
- add(parent, child);
- }
- return;
}
- offset++;
+ runDeferredUpdates();
}
- }
- runDeferredUpdates();
+ });
}
}

Back to the top