Skip to content

Commit 620482d

Browse files
committed
Apply activity filter for primary wizards to be shown in the New Wizard
dialog. See #2809
1 parent 328646d commit 620482d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/wizards/AbstractWizardRegistry.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
*******************************************************************************/
1414
package org.eclipse.ui.internal.wizards;
1515

16+
import java.util.HashSet;
17+
import java.util.Set;
18+
import org.eclipse.ui.activities.WorkbenchActivityHelper;
1619
import org.eclipse.ui.internal.dialogs.WizardCollectionElement;
1720
import org.eclipse.ui.internal.dialogs.WorkbenchWizardElement;
1821
import org.eclipse.ui.wizards.IWizardCategory;
@@ -32,6 +35,7 @@ public abstract class AbstractWizardRegistry implements IWizardRegistry {
3235

3336
private WizardCollectionElement wizardElements;
3437

38+
private static Set<WorkbenchWizardElement> filteredWizards = new HashSet<>();
3539
/**
3640
* Create a new instance of this class.
3741
*/
@@ -69,7 +73,15 @@ public IWizardDescriptor findWizard(String id) {
6973
@Override
7074
public IWizardDescriptor[] getPrimaryWizards() {
7175
initialize();
72-
return primaryWizards;
76+
77+
// Filter the wizards that are disabled by activity support. Issue 2809
78+
filteredWizards.clear();
79+
for (WorkbenchWizardElement wizardElement : primaryWizards) {
80+
if (!WorkbenchActivityHelper.filterItem(wizardElement)) {
81+
filteredWizards.add(wizardElement);
82+
}
83+
}
84+
return filteredWizards.toArray(new WorkbenchWizardElement[filteredWizards.size()]);
7385
}
7486

7587
@Override

0 commit comments

Comments
 (0)