Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2006-11-21 19:21:44 +0000
committerDarin Wright2006-11-21 19:21:44 +0000
commit73a02ec48e658184eca1602d6387f6796bef710c (patch)
tree13dc8457e60135f024589788dfc3347d3ea0dbda
parent143362e1b304a6456b1d9bba744e93cc8cd7cc2d (diff)
downloadeclipse.platform.debug-73a02ec48e658184eca1602d6387f6796bef710c.tar.gz
eclipse.platform.debug-73a02ec48e658184eca1602d6387f6796bef710c.tar.xz
eclipse.platform.debug-73a02ec48e658184eca1602d6387f6796bef710c.zip
Bug 153500 Asynchronous model viewer
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java14
1 files changed, 10 insertions, 4 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 b600539ad..34768a925 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
@@ -212,15 +212,20 @@ class TreeModelContentProvider extends ModelContentProvider implements ILazyTree
int childCount = delta.getChildCount();
int modelIndex = delta.getIndex();
TreeViewer treeViewer = getTreeViewer();
+ TreePath elementPath = getViewerTreePath(delta);
if (modelIndex >= 0) {
int viewIndex = modelToViewIndex(getViewerTreePath(delta.getParentDelta()), modelIndex);
if (DEBUG_CONTENT_PROVIDER) {
System.out.println("[expand] replace(" + delta.getParentDelta().getElement() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + delta.getElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
- treeViewer.replace(delta.getParentDelta().getElement(), viewIndex, delta.getElement());
+ TreePath parentPath = elementPath.getParentPath();
+ // TODO: I think that getParentPath() should return empty for a 1 segment path
+ if (parentPath == null) {
+ parentPath = TreePath.EMPTY;
+ }
+ treeViewer.replace(parentPath, viewIndex, delta.getElement());
}
if (childCount > 0) {
- TreePath elementPath = getViewerTreePath(delta);
int viewCount = modelToViewChildCount(elementPath, childCount);
if (DEBUG_CONTENT_PROVIDER) {
System.out.println("[expand] setChildCount(" + delta.getElement() + ", (model) " + childCount + " (view) " + viewCount); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -253,7 +258,8 @@ class TreeModelContentProvider extends ModelContentProvider implements ILazyTree
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#handleReplace(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
*/
protected void handleReplace(IModelDelta delta) {
- getTreeViewer().replace(delta.getParentDelta().getElement(), delta.getIndex(), delta.getElement());
+ TreePath parentPath = getViewerTreePath(delta.getParentDelta());
+ getTreeViewer().replace(parentPath, delta.getIndex(), delta.getElement());
}
/* (non-Javadoc)
@@ -277,7 +283,7 @@ class TreeModelContentProvider extends ModelContentProvider implements ILazyTree
if (DEBUG_CONTENT_PROVIDER) {
System.out.println("[select] replace(" + parentDelta.getElement() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + delta.getElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
- treeViewer.replace(parentDelta.getElement(), viewIndex, delta.getElement());
+ treeViewer.replace(parentPath, viewIndex, delta.getElement());
}
treeViewer.setSelection(new TreeSelection(getViewerTreePath(delta)));
}

Back to the top