13
13
*******************************************************************************/
14
14
package org .eclipse .ui .internal .dialogs ;
15
15
16
+ import java .util .Collection ;
17
+ import java .util .HashSet ;
18
+ import java .util .List ;
16
19
import java .util .StringTokenizer ;
17
20
import org .eclipse .jface .viewers .IStructuredSelection ;
18
21
import org .eclipse .jface .wizard .IWizard ;
19
22
import org .eclipse .jface .wizard .Wizard ;
20
23
import org .eclipse .ui .IWorkbench ;
24
+ import org .eclipse .ui .activities .WorkbenchActivityHelper ;
21
25
import org .eclipse .ui .internal .IWorkbenchGraphicConstants ;
22
26
import org .eclipse .ui .internal .WorkbenchImages ;
23
27
import org .eclipse .ui .internal .WorkbenchMessages ;
33
37
public class NewWizard extends Wizard {
34
38
private static final String CATEGORY_SEPARATOR = "/" ; //$NON-NLS-1$
35
39
36
- private String categoryId = null ;
40
+ private String categoryId ;
37
41
38
42
private NewWizardSelectionPage mainPage ;
39
43
40
- private boolean projectsOnly = false ;
44
+ private boolean projectsOnly ;
41
45
42
46
private IStructuredSelection selection ;
43
47
@@ -51,6 +55,10 @@ public void addPages() {
51
55
IWizardCategory root = WorkbenchPlugin .getDefault ().getNewWizardRegistry ().getRootCategory ();
52
56
IWizardDescriptor [] primary = WorkbenchPlugin .getDefault ().getNewWizardRegistry ().getPrimaryWizards ();
53
57
58
+ // Filter the wizards that are disabled by activity support. Issue 2809
59
+ Collection <IWizardDescriptor > filteredWizards = WorkbenchActivityHelper .filterCollection (List .of (primary ),
60
+ new HashSet <>());
61
+
54
62
if (categoryId != null ) {
55
63
IWizardCategory categories = root ;
56
64
StringTokenizer familyTokenizer = new StringTokenizer (categoryId , CATEGORY_SEPARATOR );
@@ -65,7 +73,8 @@ public void addPages() {
65
73
}
66
74
}
67
75
68
- mainPage = new NewWizardSelectionPage (workbench , selection , root , primary , projectsOnly );
76
+ mainPage = new NewWizardSelectionPage (workbench , selection , root ,
77
+ filteredWizards .toArray (IWizardDescriptor []::new ), projectsOnly );
69
78
addPage (mainPage );
70
79
}
71
80
0 commit comments