summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Bull2012-11-14 15:56:21 (EST)
committerIan Bull2012-11-19 14:38:30 (EST)
commitcecf43ce5d7eb99d356a798afdecfee2a3910788 (patch)
treedbc8adc8b5096bac5e8ea1ed6ac3bb69b9e73795
parent61ec4a480063a1d94b6293d45fffed27297220c3 (diff)
downloadrt.equinox.p2-cecf43ce5d7eb99d356a798afdecfee2a3910788.zip
rt.equinox.p2-cecf43ce5d7eb99d356a798afdecfee2a3910788.tar.gz
rt.equinox.p2-cecf43ce5d7eb99d356a798afdecfee2a3910788.tar.bz2
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 abce9dd..26cc677 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 ea3bbc2..2ebc6b5 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