Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » create custom folder structure
create custom folder structure [message #1740245] Wed, 10 August 2016 16:51 Go to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
Hi,

Anyone please tell me how to create a folder structure like Test/src,Test/bin?

I want to create folder structure using File -> New option

Example: File -> New -> Create Library

then an empty folder like
Test
------->src
------->bin

Should be created?
Re: create custom folder structure [message #1740248 is a reply to message #1740245] Wed, 10 August 2016 17:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
in xtext 2.10+ you can add to yoiur workflow

		language = StandardLanguage {
			name = "org.xtext.example.mydsl2.MyDsl"
			fileExtensions = "mydsl2"

			serializer = {
				generateStub = false
			}
			validator = {
				// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
			}
			newProjectWizardForEclipse = {
				generate = true
			}
		}


which creates MyDslNewProjectWizard nd MyDslProjectCreator + registrations in pluginxml

use that (at least as starting point)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: create custom folder structure [message #1740261 is a reply to message #1740248] Thu, 11 August 2016 00:06 Go to previous messageGo to next message
Arya Ramalingam is currently offline Arya RamalingamFriend
Messages: 5
Registered: August 2016
Junior Member
This is a excellent feature. I just tried and it worked for me . However I have a few followup questions.
1) How to add a library/jar to the build path by default using the new ProjectWizardForEclipse. For example . Xtend library
2)Do we have new File wizard , where we can get default contents during file creation based on extension.

It will be of great help, If any one can point me to a reference document which i can refer to for understanding these workflow features
Re: create custom folder structure [message #1740280 is a reply to message #1740248] Thu, 11 August 2016 07:59 Go to previous messageGo to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
Hi Christian,

I am using xtext 2.9.1.
Re: create custom folder structure [message #1740281 is a reply to message #1740280] Thu, 11 August 2016 07:59 Go to previous messageGo to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
No Message Body
Re: create custom folder structure [message #1740283 is a reply to message #1740281] Thu, 11 August 2016 08:04 Go to previous messageGo to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
Hi,

It is working for xtext 2.9 also!!!
Re: create custom folder structure [message #1740301 is a reply to message #1740283] Thu, 11 August 2016 11:05 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
well i was not sure what made it into 2.9 and what not. Smile

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: create custom folder structure [message #1740422 is a reply to message #1740301] Fri, 12 August 2016 16:58 Go to previous messageGo to next message
Arya Ramalingam is currently offline Arya RamalingamFriend
Messages: 5
Registered: August 2016
Junior Member
Can some one please reply to these followup questions . It is related to the same new File Wizard, so i don't want to start a new topic.
1) How to add a library/jar to the build path by default using the new ProjectWizardForEclipse. For example . Xtend library
2)Do we have new File wizard , where we can get default contents during file creation based on extension. I currently use Template Proposals as a alternate to this. However i think having a new file wizard based on the registered extensions in xtext will be a better usability.

Re: create custom folder structure [message #1740426 is a reply to message #1740422] Fri, 12 August 2016 17:56 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hmmm i fear there is no magic button

well new project and new file wizards are a std. eclipse thing and only partially a xtext thing.
so looking on how to create a new file wizard in eclipse will give you an answer for (2)

regarding (1) well you have to digg/customize what xtext creates. the newprojectwizard basically calls a IProjectCreator (MyDslProjectCreator)
which is depending on config a AbstractPluginProjectCreator which allows you to configure with getRequiredBundles a list of plugins added to the manifest
or a AbstractProjectCreator. these use ProjectFactories to create projects.
there is a JavaProjectFactory that allows you to add additional classpath entries

you can fiddle around what the code does and customize it. there is not an option for all 1000 possibilities in the workflow unfortunately.

maybe you can use existing code places in xtext a inspiration source like
org.eclipse.xtext.xtext.ui.wizard.project.XtextProjectCreator


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Update a viewpart when dsl is modified
Next Topic:Extending the grammar language
Goto Forum:
  


Current Time: Thu Apr 18 05:23:11 GMT 2024

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

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

Back to the top