Custom Language New Project Wizard

What is the right way to create the settings dialogs for a custom language's new project wizard?  For instance, out of the box it does not prompt for SDK.

5 comments
Comment actions Permalink

In case you're still wondering how to do it, you have to create your own ModuleType and override modifyProjectTypeStep like this:

 
@Nullable
@Override
public ModuleWizardStep modifyProjectTypeStep(@NotNull SettingsStep settingsStep, @NotNull final ModuleBuilder moduleBuilder) {
    return ProjectWizardStepFactory.getInstance().createJavaSettingsStep(settingsStep, moduleBuilder, new Condition<SdkTypeId>() {
        @Override
        public boolean
value(SdkTypeId sdkType) {
            return moduleBuilder.isSuitableSdkType(sdkType);
        }
    });
}


You can also customize the last step (where you configure the project's name and location) by overriding modifySettingsStep, and you can add your own steps in createWizardSteps.

0
Comment actions Permalink

So `createWizardSteps` seems to work really well, except there's always an extra Project Settings step at the end.  Is there any way to have the Project Settings step come first?

0
Comment actions Permalink

Thanks Yann, unfortunately, I don't see any mention of how to move the last step which takes the project/module name and path.  Ideally, I'd like that step to come first so I can use its information in the following steps.

0
Comment actions Permalink

Hi Cary,

I had the same problem, but I looked at the source code and it seems that the last step is mandatory, and cannot be moved before other steps.

See here: https://github.com/JetBrains/intellij-community/blob/master/java/idea-ui/src/com/intellij/ide/projectWizard/NewProjectWizard.java#L55

mySequence.addCommonFinishingStep(new ProjectSettingsStep(myWizardContext), null);


I would also like to set up the path first, so that I can use it in following steps. People from Jetbrains, any idea how this would be possible, or if some modification to the API would be possible?

Thanks.

0

Please sign in to leave a comment.