Providing a project wizard
It is nice to provide the clients of your DSL a
project wizard that creates an Eclipse project, sets its source folders, for example, src
and src-gen
and adds the needed dependencies.
Xtext can generate such a project wizard for you, in the .ui
project, if you enable this fragment in the MWE2 file in the StandardLanguage
section:
newProjectWizardForEclipse = {
generate = true
}
After running the MWE2 workflow, you must merge manually the plugin.xml
and the plugin.xml_gen
.
The generated project wizard will be available in the Eclipse New Project dialog, in the Xtext category.
The above MWE2 fragment will generate the classes for the wizard in the src-gen
folder of the .ui
project. Moreover, in the src
folder, it will generate a stub class, in this example it is SmallJavaNewProjectWizardInitialContents
, which you can use to generate some initial contents in the project created by the wizard. In our case, we will generate a simple SmallJava class.
The generated wizard...