aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWojciech Sudol2014-02-24 11:15:31 (EST)
committerGerrit Code Review @ Eclipse.org2014-02-24 11:51:51 (EST)
commit914515721924eb99fc6e2194d9e1701442a8da24 (patch)
treebdd4d62741d1b2483c89eaa5d69d31aac1532963
parenta6aa7e0b19a5f402abc23c6b8b8420935164416e (diff)
downloadeclipse.platform.ui-914515721924eb99fc6e2194d9e1701442a8da24.zip
eclipse.platform.ui-914515721924eb99fc6e2194d9e1701442a8da24.tar.gz
eclipse.platform.ui-914515721924eb99fc6e2194d9e1701442a8da24.tar.bz2
Bug 426363 - [ActivityMgmt] Example project wizards are not filteredrefs/changes/49/22449/2
based on Activities Change-Id: I4dc3b1f921e448fb8645d75758cd01286c5ee4cf Signed-off-by: Wojciech Sudol <wojciech.sudol@pl.ibm.com>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java12
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardActivityFilter.java10
2 files changed, 19 insertions, 3 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java
index d3c029c..4b477e3 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.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
@@ -30,6 +30,7 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.IWizardContainer2;
import org.eclipse.swt.SWT;
@@ -50,6 +51,7 @@ import org.eclipse.ui.IWorkbenchWizard;
import org.eclipse.ui.activities.WorkbenchActivityHelper;
import org.eclipse.ui.dialogs.FilteredTree;
import org.eclipse.ui.internal.WorkbenchMessages;
+import org.eclipse.ui.internal.registry.WizardsRegistryReader;
import org.eclipse.ui.model.AdaptableList;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.wizards.IWizardCategory;
@@ -132,6 +134,14 @@ class NewWizardNewPage implements ISelectionChangedListener {
} else {
needShowAll = !allActivityEnabled(wizardCategories);
}
+
+ IWizard wizard = mainPage.getWizard();
+ if (wizard instanceof NewWizard) {
+ if (WizardsRegistryReader.FULL_EXAMPLES_WIZARD_CATEGORY.equals(((NewWizard) wizard)
+ .getCategoryId())) {
+ filter.setFilterPrimaryWizards(true);
+ }
+ }
}
/**
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardActivityFilter.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardActivityFilter.java
index c32ce3d..fcd2777 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardActivityFilter.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardActivityFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2013 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -23,11 +23,17 @@ import org.eclipse.ui.model.AdaptableList;
* @since 3.0
*/
public class WizardActivityFilter extends ViewerFilter {
+ private boolean filterPrimaryWizards = false;
+
+ public void setFilterPrimaryWizards(boolean filter) {
+ filterPrimaryWizards = filter;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (parentElement.getClass().equals(AdaptableList.class)) {
+ if (parentElement.getClass().equals(AdaptableList.class) && !filterPrimaryWizards) {
return true; //top-level ("primary") wizards should always be returned
}