use of com.android.tools.idea.npw.module.ModuleDescriptionProvider in project android by JetBrains.
the class AndroidNewModuleAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
Project project = e.getProject();
if (project != null) {
// TODO: before submitting this code, change this to only use the new wizard
if (Boolean.getBoolean("use.npw.modelwizard") && (e.getModifiers() & InputEvent.SHIFT_MASK) == 0) {
ArrayList<ModuleGalleryEntry> moduleDescriptions = new ArrayList<>();
for (ModuleDescriptionProvider provider : ModuleDescriptionProvider.EP_NAME.getExtensions()) {
moduleDescriptions.addAll(provider.getDescriptions());
}
ChooseModuleTypeStep chooseModuleTypeStep = new ChooseModuleTypeStep(new NewModuleModel(project), moduleDescriptions);
ModelWizard wizard = new ModelWizard.Builder().addStep(chooseModuleTypeStep).build();
new StudioWizardDialogBuilder(wizard, message("android.wizard.module.new.module.title")).build().show();
} else {
NewModuleWizardDynamic dialog = new NewModuleWizardDynamic(project, null);
dialog.init();
dialog.show();
}
}
}
Aggregations