Search in sources :

Example 1 with ChooseModuleTypeStep

use of com.android.tools.idea.npw.module.ChooseModuleTypeStep 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();
        }
    }
}
Also used : Project(com.intellij.openapi.project.Project) ChooseModuleTypeStep(com.android.tools.idea.npw.module.ChooseModuleTypeStep) ModuleDescriptionProvider(com.android.tools.idea.npw.module.ModuleDescriptionProvider) NewModuleModel(com.android.tools.idea.npw.module.NewModuleModel) ModuleGalleryEntry(com.android.tools.idea.npw.module.ModuleGalleryEntry) StudioWizardDialogBuilder(com.android.tools.idea.ui.wizard.StudioWizardDialogBuilder) ArrayList(java.util.ArrayList) StudioWizardDialogBuilder(com.android.tools.idea.ui.wizard.StudioWizardDialogBuilder) ModelWizard(com.android.tools.idea.wizard.model.ModelWizard)

Aggregations

ChooseModuleTypeStep (com.android.tools.idea.npw.module.ChooseModuleTypeStep)1 ModuleDescriptionProvider (com.android.tools.idea.npw.module.ModuleDescriptionProvider)1 ModuleGalleryEntry (com.android.tools.idea.npw.module.ModuleGalleryEntry)1 NewModuleModel (com.android.tools.idea.npw.module.NewModuleModel)1 StudioWizardDialogBuilder (com.android.tools.idea.ui.wizard.StudioWizardDialogBuilder)1 ModelWizard (com.android.tools.idea.wizard.model.ModelWizard)1 Project (com.intellij.openapi.project.Project)1 ArrayList (java.util.ArrayList)1