Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » New file/project wizard name validation
New file/project wizard name validation [message #1797036] Wed, 24 October 2018 10:40 Go to next message
Nikita Dümmel is currently offline Nikita DümmelFriend
Messages: 19
Registered: September 2017
Junior Member
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 15:01 Go to previous messageGo to next message
Arne Deutsch is currently offline Arne DeutschFriend
Messages: 12
Registered: July 2009
Junior Member
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 15:07]

Report message to a moderator

Re: New file/project wizard name validation [message #1797092 is a reply to message #1797058] Thu, 25 October 2018 06:34 Go to previous message
Nikita Dümmel is currently offline Nikita DümmelFriend
Messages: 19
Registered: September 2017
Junior Member
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: Sat Apr 27 01:00:23 GMT 2024

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

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

Back to the top