Skip to main content



      Home
Home » Modeling » TMF (Xtext) » New file/project wizard name validation
New file/project wizard name validation [message #1797036] Wed, 24 October 2018 06:40 Go to next message
Eclipse UserFriend
Hi,

Im using the 2.14 new file/project creation wizards and there is a validation feature for customizable project templates.

Is there a similar way to validate the project or file name, i.e. show an error message if the user specific naming conventions?

For example you get an error message if you enter the name of an already existing project in the project creation wizard. Id like to add error messages if you use for example a white space or a special character in the project/file name.

Best regards,
Nikita Dümmel
Re: New file/project wizard name validation [message #1797058 is a reply to message #1797036] Wed, 24 October 2018 11:01 Go to previous messageGo to next message
Eclipse UserFriend
You can do the following:
1. Create a new subclass of "org.eclipse.xtext.ui.wizard.template.TemplateNewProjectWizard"
2. Override method "createMainPage" and return your own extension of "WizardNewProjectCreationPage" (you have to create it)
3. Override method "validatePage" as it suits your needs
4. Modify the "plugin.xml" of your UI project. Find the extension of the wizard. Replace the "org.eclipse.xtext.ui.wizard.template.TemplateNewProjectWizard" with the name of your own extension.

[Updated on: Wed, 24 October 2018 11:07] by Moderator

Re: New file/project wizard name validation [message #1797092 is a reply to message #1797058] Thu, 25 October 2018 02:34 Go to previous message
Eclipse UserFriend
Thank you very much!

Best regards,
Nikita Dümmel
Previous Topic:Graphical view of an XText model
Next Topic:How to Customize output directory of code generation
Goto Forum:
  


Current Time: Mon Jun 23 02:14:30 EDT 2025

Powered by FUDForum. Page generated in 0.04651 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top