Skip to main content



      Home
Home » Modeling » TMF (Xtext) » create custom folder structure
create custom folder structure [message #1740245] Wed, 10 August 2016 12:51 Go to next message
Eclipse UserFriend
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 13:12 Go to previous messageGo to next message
Eclipse UserFriend
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)
Re: create custom folder structure [message #1740261 is a reply to message #1740248] Wed, 10 August 2016 20:06 Go to previous messageGo to next message
Eclipse UserFriend
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 03:59 Go to previous messageGo to next message
Eclipse UserFriend
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 03:59 Go to previous messageGo to next message
Eclipse UserFriend
No Message Body
Re: create custom folder structure [message #1740283 is a reply to message #1740281] Thu, 11 August 2016 04:04 Go to previous messageGo to next message
Eclipse UserFriend
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 07:05 Go to previous messageGo to next message
Eclipse UserFriend
well i was not sure what made it into 2.9 and what not. Smile
Re: create custom folder structure [message #1740422 is a reply to message #1740301] Fri, 12 August 2016 12:58 Go to previous messageGo to next message
Eclipse UserFriend
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 13:56 Go to previous message
Eclipse UserFriend
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
Previous Topic:Update a viewpart when dsl is modified
Next Topic:Extending the grammar language
Goto Forum:
  


Current Time: Wed Jul 23 12:32:16 EDT 2025

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

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

Back to the top