aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Rolka2014-01-09 07:48:38 (EST)
committerGerrit Code Review @ Eclipse.org2014-01-15 09:33:12 (EST)
commitfb703ae64d2be04529fed1eb8875ac2ef68eb932 (patch)
treecf61458022debc407c0fa0c4e0f6cdd674f6f2e3
parent6df0b57ec213ca7f176ee15512904ee5c9fb0dce (diff)
downloadeclipse.platform.ui-fb703ae64d2be04529fed1eb8875ac2ef68eb932.zip
eclipse.platform.ui-fb703ae64d2be04529fed1eb8875ac2ef68eb932.tar.gz
eclipse.platform.ui-fb703ae64d2be04529fed1eb8875ac2ef68eb932.tar.bz2
Bug 423837 - [Wizards] Wizard categories without direct wizard are notrefs/changes/28/20428/2
shown anymore Change-Id: Idbcc41ad33fb47f9db1cb9afbc7ba9755ca976d5 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/WizardCollectionElement.java7
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java16
2 files changed, 7 insertions, 16 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java
index c827ea2..780514e 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -448,7 +448,6 @@ public class WizardCollectionElement extends AdaptableList implements IPluginCon
static WizardCollectionElement filter(Viewer viewer, ViewerFilter viewerFilter,
WizardCollectionElement inputCollection) {
AdaptableList wizards = null;
-
for (Object child : inputCollection.getWizardAdaptableList().getChildren()) {
if (viewerFilter.select(viewer, inputCollection, child)) {
if (wizards == null) {
@@ -459,8 +458,12 @@ public class WizardCollectionElement extends AdaptableList implements IPluginCon
}
if (wizards == null) {
+ if (inputCollection.getChildren().length > 0) {
+ return new WizardCollectionElement(inputCollection, new AdaptableList());
+ }
return null;
}
+
if (inputCollection.getWizardAdaptableList().size() == wizards.size()) {
return inputCollection;
}
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 f530520..da63938 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ 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;
/**
@@ -67,21 +66,10 @@ 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, viewerFilter,
+ Object wizardCollection = WizardCollectionElement.filter(viewer, this,
(WizardCollectionElement) elem);
if (wizardCollection != null) {
result.add(wizardCollection);