summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Matsuoka2018-06-06 15:39:24 -0400
committerAlexander Kurtakov2018-06-12 07:28:59 -0400
commit43e2105b58b2e2cc002bf979c6ed88e7d8b3b144 (patch)
treeeedcfc719a51635350749b0068f6c64730388ac6
parentb33a385b7ba003651854d5d055d669a2dba4aade (diff)
downloadrt.equinox.p2-43e2105b58b2e2cc002bf979c6ed88e7d8b3b144.zip
rt.equinox.p2-43e2105b58b2e2cc002bf979c6ed88e7d8b3b144.tar.gz
rt.equinox.p2-43e2105b58b2e2cc002bf979c6ed88e7d8b3b144.tar.xz
Bug 533655 - Can't deselect features from top level category which hasI20180613-0440I20180613-0300
subcategories Change-Id: I6214b2518b13c4243c84d61de0a2e4d21b20b5b5 Signed-off-by: Joshua Matsuoka <jmatsuok@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java
index d1527c5..f5238eb 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java
@@ -73,10 +73,10 @@ public class DelayedFilterCheckboxTree extends FilteredTree {
// cache.
if (contentProvider.hasChildren(event.getElement())) {
Set<Object> unchecked = new HashSet<>();
- Object[] children = contentProvider.getChildren(event.getElement());
- for (Object element1 : children) {
- unchecked.add(element1);
- }
+ // See bug 533655, We should uncheck all of the children
+ // of the triggering element, not just the direct descendants.
+ uncheckAllChildren(unchecked, event.getElement());
+
Iterator<Object> iter = checkState.iterator();
while (iter.hasNext()) {
Object current = iter.next();
@@ -103,6 +103,15 @@ public class DelayedFilterCheckboxTree extends FilteredTree {
return checkboxViewer;
}
+ private void uncheckAllChildren(Set<Object> unchecked, Object element) {
+ for (Object child : contentProvider.getChildren(element)) {
+ unchecked.add(child);
+ if (contentProvider.getChildren(child).length > 0) {
+ uncheckAllChildren(unchecked, child);
+ }
+ }
+ }
+
@Override
protected Composite createFilterControls(Composite filterParent) {
super.createFilterControls(filterParent);