Search in sources :

Example 1 with NewProjectModel

use of com.android.tools.idea.npw.project.NewProjectModel in project android by JetBrains.

the class AndroidModuleBuilder method createWizardAdaptor.

private void createWizardAdaptor(@NotNull AbstractWizard hostWizard, @NotNull WizardType type) {
    Preconditions.checkState(myWizardAdapter == null, "Attempting to create a Wizard Adaptor when one already exists.");
    ModelWizard.Builder builder = new ModelWizard.Builder();
    if (type == WizardType.PROJECT) {
        NewProjectModel projectModel = new NewProjectModel();
        builder.addStep(new ConfigureAndroidProjectStep(projectModel));
    // TODO: more steps once they are complete.
    } else {
        throw new UnsupportedOperationException();
    // TODO: once new module wizard is complete, register it here.
    // NewModuleModel moduleModel = new NewModuleModel();
    // builder.addStep(new ConfigureAndroidModuleStep(moduleModel));
    }
    myWizardAdapter = new IdeaWizardAdapter(hostWizard, builder.build());
}
Also used : ModuleBuilder(com.intellij.ide.util.projectWizard.ModuleBuilder) ModelWizard(com.android.tools.idea.wizard.model.ModelWizard) NewProjectModel(com.android.tools.idea.npw.project.NewProjectModel) ConfigureAndroidProjectStep(com.android.tools.idea.npw.project.ConfigureAndroidProjectStep)

Example 2 with NewProjectModel

use of com.android.tools.idea.npw.project.NewProjectModel in project android by JetBrains.

the class AndroidNewProjectAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent e) {
    // TODO: Temporary! This will be the main code path after we completely convert over NewProjectWizardDynamic
    if (Boolean.getBoolean("use.npw.modelwizard") && (e.getModifiers() & InputEvent.SHIFT_MASK) == 0) {
        NewProjectModel model = new NewProjectModel();
        ModelWizard wizard = new ModelWizard.Builder().addStep(new ConfigureAndroidProjectStep(model)).build();
        new StudioWizardDialogBuilder(wizard, "Create New Project").build().show();
    } else {
        try {
            NewProjectWizardDynamic dialog = new NewProjectWizardDynamic(null, null);
            dialog.init();
            dialog.show();
        } catch (IllegalStateException error) {
            Logger.getInstance(AndroidNewProjectAction.class).warn("Unable to launch New Project Wizard", error);
        }
    }
}
Also used : NewProjectWizardDynamic(com.android.tools.idea.npw.NewProjectWizardDynamic) StudioWizardDialogBuilder(com.android.tools.idea.ui.wizard.StudioWizardDialogBuilder) StudioWizardDialogBuilder(com.android.tools.idea.ui.wizard.StudioWizardDialogBuilder) NewProjectModel(com.android.tools.idea.npw.project.NewProjectModel) ModelWizard(com.android.tools.idea.wizard.model.ModelWizard) ConfigureAndroidProjectStep(com.android.tools.idea.npw.project.ConfigureAndroidProjectStep)

Aggregations

ConfigureAndroidProjectStep (com.android.tools.idea.npw.project.ConfigureAndroidProjectStep)2 NewProjectModel (com.android.tools.idea.npw.project.NewProjectModel)2 ModelWizard (com.android.tools.idea.wizard.model.ModelWizard)2 NewProjectWizardDynamic (com.android.tools.idea.npw.NewProjectWizardDynamic)1 StudioWizardDialogBuilder (com.android.tools.idea.ui.wizard.StudioWizardDialogBuilder)1 ModuleBuilder (com.intellij.ide.util.projectWizard.ModuleBuilder)1