Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » switchable OutputConfiguration(is it possible to use two IOutputConfiguration instances?)
switchable OutputConfiguration [message #857067] Thu, 26 April 2012 08:08 Go to next message
Michal S is currently offline Michal SFriend
Messages: 74
Registered: July 2011
Member
Hello,

I would like to do following:
- generate class infrastructure (and regenerate it every time I change anything in my model)
- generate implementation classes for infrastructure (They should be generated only once and never more touched by generator... They would basically inherit abstract classes and user could override necessary methods there.)
I know, that I can set both behaviours using IOutputConfiguration. The question is, if and how is possible to generate some files using one configuration and other files using another configuration.
Lets assume I use generator described here: http://www.eclipse.org/Xtext/documentation/2_1_0/040-first-code-generator.php

Thank you & Best regards,
Michal
Re: switchable OutputConfiguration [message #857085 is a reply to message #857067] Thu, 26 April 2012 08:23 Go to previous messageGo to next message
Holger Schill is currently offline Holger SchillFriend
Messages: 75
Registered: July 2009
Member
Hi Michal,

please have a look at
org.eclipse.xtext.generator.OutputConfigurationProvider. It would be
your job to bind a subTyp of this class and define more
OutputConfigurations. After that you could take the
org.eclipse.xtext.generator.IFileSystemAccess.generateFile(String,
String, CharSequence) to point out what outputconfiguration should be used.

Cheers,
Holger

--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: switchable OutputConfiguration [message #857114 is a reply to message #857085] Thu, 26 April 2012 08:56 Go to previous messageGo to next message
Michal S is currently offline Michal SFriend
Messages: 74
Registered: July 2011
Member
Thank you Holger, this will work...
Regards,
Michal
Re: switchable OutputConfiguration [message #859141 is a reply to message #857114] Fri, 27 April 2012 13:34 Go to previous messageGo to next message
Andreas Diestelmann is currently offline Andreas DiestelmannFriend
Messages: 3
Registered: April 2012
Junior Member
Could you give me an example?

What does "bind" mean?

[Updated on: Fri, 27 April 2012 13:35]

Report message to a moderator

Re: switchable OutputConfiguration [message #859149 is a reply to message #857085] Fri, 27 April 2012 13:36 Go to previous messageGo to next message
Andreas Diestelmann is currently offline Andreas DiestelmannFriend
Messages: 3
Registered: April 2012
Junior Member
How to "bind" this subType?
Re: switchable OutputConfiguration [message #859177 is a reply to message #859149] Fri, 27 April 2012 13:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi read the documentation on dependent injection with Google guice
should point you to you Runtime and UIModule where you can add such
bindings


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: switchable OutputConfiguration [message #859208 is a reply to message #859177] Fri, 27 April 2012 14:10 Go to previous messageGo to next message
Andreas Diestelmann is currently offline Andreas DiestelmannFriend
Messages: 3
Registered: April 2012
Junior Member
Thx for your answer.

Where is the subType to inject in?
Re: switchable OutputConfiguration [message #859224 is a reply to message #859208] Fri, 27 April 2012 14:19 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi i so Not understand your question. You want to change the
implementation of something thus you have to add/override a binding.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:F1 Help for Xtext based editor.
Next Topic:What is wrong in my grammar?
Goto Forum:
  


Current Time: Fri Apr 19 05:52:04 GMT 2024

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

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

Back to the top