|Custom TemplateNewFileWizard [message #1803869]
||Tue, 12 March 2019 17:11
| Marie-Saphira Flug
Registered: January 2019
I am creating a custom TemplateNewFileWizard, so I created a class MyNewFileWizard that extends TemplateNewFileWizard.
I already made a customized TemplateNewProjectWizard the same way. There I created a custom ProjectInformation that implements IExtendedProjectInfo so I could pass all the acquired information (wizard input) to the template creation in MyDSLProjectTemplateProvider.xtend .
In the FileWizard the information about the file to be created is stored in org.eclipse.xtext.ui.wizard.template.TemplateFileInfo. I created my own MyTemplateFileInfo class to store the user input and noticed that setTemplateInfo(TemplateFileInfo info) in org.eclipse.xtext.ui.wizard.template.AbstractFileTemplate is package protected. So I can't set the TemplateInfo, which is usually done in TemplateNewFileWizard.getNextPage(page). Here the method getFileInfo() (returns TemplateFileInfo) is called, instead of my getFileInfo() (returns MyTemplateFileInfo) in the subclass. So the template ends up without info.
The problem is that everything is connected and that I can't use the @FileTemplate annotation with anything other than AbstractFileTemplate. Do I really need to create my own annotation (if yes, how?) to access the user input or is there another way?
I hope I asked my question so you can understand the problem. Thanks a lot in advance.
[Updated on: Thu, 14 March 2019 10:20]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01902 seconds