aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Rolka2013-11-04 09:38:31 (EST)
committerGerrit Code Review @ Eclipse.org2013-11-05 15:41:12 (EST)
commite30547c5ce98d545fcad862de824c841d13817c3 (patch)
tree1fe0abbf97e71c1544853a7dec0daa2fa20754bd
parent530d1b774a78f20c04b84036a5ac3d37b5855e3f (diff)
downloadeclipse.platform.ui-e30547c5ce98d545fcad862de824c841d13817c3.zip
eclipse.platform.ui-e30547c5ce98d545fcad862de824c841d13817c3.tar.gz
eclipse.platform.ui-e30547c5ce98d545fcad862de824c841d13817c3.tar.bz2
Bug 419710 - [Wizards] new search wizard does not seem to searchrefs/changes/27/18027/2
submenus Change-Id: I8ba2e0e9783c53aba18b096c09b2d947be666359 Signed-off-by: Daniel Rolka <daniel.rolka@pl.ibm.com>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java
index 7f9b33e..f530520 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java
@@ -12,6 +12,7 @@ package org.eclipse.ui.internal.dialogs;
import java.util.ArrayList;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.ui.dialogs.PatternFilter;
/**
@@ -66,10 +67,21 @@ public class WizardPatternFilter extends PatternFilter {
@Override
public Object[] filter(Viewer viewer, Object parent, Object[] elements) {
ArrayList<Object> result = new ArrayList<Object>();
+ ViewerFilter viewerFilter = new ViewerFilter() {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ return WizardPatternFilter.this.select(viewer, parentElement, element)
+ || hasChildren(element);
+ }
+ private boolean hasChildren(Object element) {
+ return element instanceof WorkbenchWizardElement
+ && ((WorkbenchWizardElement) element).getCollectionElement().size() > 0;
+ }
+ };
for (Object elem : super.filter(viewer, parent, elements)) {
if (elem instanceof WizardCollectionElement) {
- Object wizardCollection = WizardCollectionElement.filter(viewer, this,
+ Object wizardCollection = WizardCollectionElement.filter(viewer, viewerFilter,
(WizardCollectionElement) elem);
if (wizardCollection != null) {
result.add(wizardCollection);