| Summary: | [Capabilities] cannot filter primary wizards | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Paul E. Keyser <rolarenfan> |
| Component: | UI | Assignee: | Kim Horne <eclipse> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | acabler |
| Version: | 3.2.1 | Keywords: | helpwanted |
| Target Milestone: | 3.4 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Paul E. Keyser
(under more info) I think I wasn't clear enough: the activities work fine *IF* the new-wizard is in a category (that category is disabled); but what if I want (a) to disable wizards one by one rather than by category? or (b) want to place my new-wizards at the top-level (as one might, in an RCP app that had only a few new-wizards) and not in any category? Will investigate for M5 (In reply to comment #2) > Will investigate for M5 > Is this still in the works for 3.3? I can't promise but I am more than willing to entertain a patch if you have one. There are bigger issues we need to address first. I wont have time to look into this for 3.3. Sorry. Proposal for solving this Bug Replace the class WizardActivityFilter with this code (Changes are annotated): /******************************************************************************* * Copyright (c) 2004, 2006 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 * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.ui.internal.dialogs; import org.eclipse.jface.viewers.AbstractTreeViewer; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.ui.activities.WorkbenchActivityHelper; import org.eclipse.ui.model.AdaptableList; /** * Viewer filter designed to work with the new wizard page (and its input/content provider). * This will filter all non-primary wizards that are not enabled by activity. * * @since 3.0 */ public class WizardActivityFilter extends ViewerFilter { /* (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) { Object[] children = ((ITreeContentProvider) ((AbstractTreeViewer) viewer) .getContentProvider()).getChildren(element); if (children.length > 0) { return filter(viewer, element, children).length > 0; } if (parentElement.getClass().equals(AdaptableList.class)) { //SSoft if (WorkbenchActivityHelper.filterItem(element)) { return false; } //Original //return true; //top-level ("primary") wizards should always be returned } if (WorkbenchActivityHelper.filterItem(element)) { return false; } return true; } } Sorry for taking so long to look at this. The problem with the patch is that it specifically works around "primary wizards." Primary Wizards, by design, are intended to bypass activities entirely. Specifying a wizard as primary is the only way to have a wizard show up at the top level and in this case having them always appear is consistent with our intentions. I'm inclined to close this as WONTFIX but would entertain a fix that satisfied our "never filter" usage of primary wizards. We have many downstream products that rely on this behaviour and we cannot change it. |