Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2006-10-12 18:45:19 +0000
committerDarin Wright2006-10-12 18:45:19 +0000
commitaa1793aa588d2aa2e3d6d2ae2a4688bbeb2b639d (patch)
tree87136019a05292df13f7d6be8039d15df9215793
parentd415365d072606d6577583e840c81dfdd7c6a94b (diff)
downloadeclipse.platform.debug-aa1793aa588d2aa2e3d6d2ae2a4688bbeb2b639d.tar.gz
eclipse.platform.debug-aa1793aa588d2aa2e3d6d2ae2a4688bbeb2b639d.tar.xz
eclipse.platform.debug-aa1793aa588d2aa2e3d6d2ae2a4688bbeb2b639d.zip
don't remove filters when re-mapping to same element
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java2
2 files changed, 28 insertions, 4 deletions
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 2b1f9b1a1..b2ee18dc8 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
@@ -129,6 +129,11 @@ public class InternalTreeModelViewer extends TreeViewer {
private boolean fInserting = false;
/**
+ * Whether to notify the content provider of an un-map operation
+ */
+ private boolean fNotifyUnmap = true;
+
+ /**
* Persist column sizes when they change.
*
* @since 3.2
@@ -340,13 +345,32 @@ public class InternalTreeModelViewer extends TreeViewer {
}
protected void unmapElement(Object element, Widget widget) {
- IContentProvider provider = getContentProvider();
- if (provider instanceof ModelContentProvider) {
- ((ModelContentProvider) provider).unmapPath((TreePath) widget.getData(TREE_PATH_KEY));
+ if (fNotifyUnmap) {
+ IContentProvider provider = getContentProvider();
+ if (provider instanceof ModelContentProvider) {
+ ((ModelContentProvider) provider).unmapPath((TreePath) widget.getData(TREE_PATH_KEY));
+ }
}
super.unmapElement(element, widget);
}
+ protected void associate(Object element, Item item) {
+ // see AbstractTreeViewer.associate(...)
+ Object data = item.getData();
+ if (data != null && data != element && equals(data, element)) {
+ // elements are equal but not identical
+ // -> being removed from map, but should not change filters
+ try {
+ fNotifyUnmap = false;
+ super.associate(element, item);
+ } finally {
+ fNotifyUnmap = true;
+ }
+ } else {
+ super.associate(element, item);
+ }
+ }
+
/* (non-Javadoc)
*
* We need tree paths when disposed/unmapped in any order so cache the tree path.
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 b8181dd3b..b7200ada8 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
@@ -76,7 +76,7 @@ class TreeModelContentProvider extends ModelContentProvider implements ILazyTree
* @see org.eclipse.jface.viewers.ILazyTreeContentProvider#updateChildCount(java.lang.Object, int)
*/
public synchronized void updateChildCount(Object element, int currentChildCount) {
- //System.out.println("updateChildCount(" + element + ")");
+ //System.out.println("updateChildCount(" + element + ", " + currentChildCount + ")");
TreePath[] treePaths = getTreePaths(element);
for (int i = 0; i < treePaths.length; i++) {
// re-filter children when asked to update the child count for an element (i.e.

Back to the top