Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2009-05-12 14:50:42 -0400
committerDarin Wright2009-05-12 14:50:42 -0400
commitb5b2da9df8d633bf49b3817b034f2eab60b338f1 (patch)
tree3ae70394b63f55a4f768c594f30ba8a9caccba40
parent0611ea546517dd5a081c3bceb8b1b8cec5b24074 (diff)
downloadeclipse.platform.debug-b5b2da9df8d633bf49b3817b034f2eab60b338f1.tar.gz
eclipse.platform.debug-b5b2da9df8d633bf49b3817b034f2eab60b338f1.tar.xz
eclipse.platform.debug-b5b2da9df8d633bf49b3817b034f2eab60b338f1.zip
Bug 275700 - Internal errors when expanding thread groups.
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java4
2 files changed, 11 insertions, 6 deletions
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 282701ab6..0c550e8ba 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
@@ -87,22 +87,27 @@ public class TreeModelContentProvider extends ModelContentProvider implements IT
int count = parentDelta.getChildCount();
if (count > 0) {
setModelChildCount(parentPath, count);
- int viewCount = modelToViewChildCount(parentPath, count);
- int modelIndex = count - 1;
- int viewIndex = viewCount - 1;
+ int modelIndex = count - 1;
+ if (delta.getIndex() != -1) {
+ // assume addition at end, unless index specified by delta
+ modelIndex = delta.getIndex();
+ }
if (shouldFilter(parentPath, element)) {
addFilteredIndex(parentPath, modelIndex, element);
if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("[filtered] handleAdd(" + delta.getElement() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ System.out.println("[filtered] handleAdd(" + delta.getElement() + ") > modelIndex: " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$
}
+ // it was filtered so the child count does not change
} else {
if (isFiltered(parentPath, modelIndex)) {
clearFilteredChild(parentPath, modelIndex);
}
+ int viewCount = modelToViewChildCount(parentPath, count);
if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
System.out.println("handleAdd(" + delta.getElement() + ") viewIndex: " + viewCount + " modelIndex: " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
getViewer().setChildCount(parentPath, viewCount);
+ int viewIndex = modelToViewIndex(parentPath, modelIndex);
getViewer().replace(parentPath, viewIndex, element);
TreePath childPath = parentPath.createChildPath(element);
updateHasChildren(childPath);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java
index 952360bd0..7ca9f481f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation 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
@@ -201,7 +201,7 @@ public class ThreadEventHandler extends DebugEventHandler {
private void fireDeltaAndClearTopFrame(IThread thread, int flags) {
ModelDelta delta = buildRootDelta();
ModelDelta node = addPathToThread(delta, thread);
- node.addNode(thread, flags);
+ node.addNode(thread, indexOf(thread), flags);
synchronized (this) {
fLastTopFrame.remove(thread);
}

Back to the top