Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Bull2012-11-14 20:56:21 +0000
committerIan Bull2012-11-19 19:38:30 +0000
commitcecf43ce5d7eb99d356a798afdecfee2a3910788 (patch)
treedbc8adc8b5096bac5e8ea1ed6ac3bb69b9e73795
parent61ec4a480063a1d94b6293d45fffed27297220c3 (diff)
downloadrt.equinox.p2-cecf43ce5d7eb99d356a798afdecfee2a3910788.tar.gz
rt.equinox.p2-cecf43ce5d7eb99d356a798afdecfee2a3910788.tar.xz
rt.equinox.p2-cecf43ce5d7eb99d356a798afdecfee2a3910788.zip
Bug 235654: Use all the selected elements, not just the visible ones
This changeset modifies the Install New Software dialog to use all the selected items, not just the visible ones when installing software. This means that if the text filter is hiding elements that were already selected, they will still be installed.
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUGroup.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java11
2 files changed, 10 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUGroup.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUGroup.java
index abce9ddbd..26cc67738 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUGroup.java
@@ -300,7 +300,7 @@ public class AvailableIUGroup extends StructuredIUGroup {
* @return the array of checked IU's
*/
public IInstallableUnit[] getCheckedLeafIUs() {
- Object[] selections = filteredTree.getCheckboxTreeViewer().getCheckedElements();
+ Object[] selections = filteredTree.getCheckedElements(); // Get all the elements that have been selected, not just the visible ones
if (selections.length == 0)
return new IInstallableUnit[0];
ArrayList<IInstallableUnit> leaves = new ArrayList<IInstallableUnit>(selections.length);
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 ea3bbc23b..2ebc6b531 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
@@ -48,7 +48,7 @@ public class DelayedFilterCheckboxTree extends FilteredTree {
WorkbenchJob filterJob;
boolean ignoreFiltering = true;
Object viewerInput;
- ArrayList<Object> checkState = new ArrayList<Object>();
+ HashSet<Object> checkState = new HashSet<Object>();
Set<Object> expanded = new HashSet<Object>();
ContainerCheckedTreeViewer checkboxViewer;
@@ -276,7 +276,7 @@ public class DelayedFilterCheckboxTree extends FilteredTree {
ContainerCheckedTreeViewer v = (ContainerCheckedTreeViewer) getViewer();
Object[] checked = v.getCheckedElements();
if (checkState == null)
- checkState = new ArrayList<Object>(checked.length);
+ checkState = new HashSet<Object>(checked.length);
for (int i = 0; i < checked.length; i++)
if (!v.getGrayed(checked[i]) && contentProvider.getChildren(checked[i]).length == 0)
if (!checkState.contains(checked[i]))
@@ -329,4 +329,11 @@ public class DelayedFilterCheckboxTree extends FilteredTree {
protected long getRefreshJobDelay() {
return FILTER_DELAY;
}
+
+ public Object[] getCheckedElements() {
+ if (this.checkState != null) {
+ return this.checkState.toArray();
+ }
+ return new Object[0];
+ }
} \ No newline at end of file

Back to the top