|
|
Re: [xtext] How to use the generated ecore file? [message #384658 is a reply to message #384651] |
Fri, 08 August 2008 09:22 |
|
Sven Efftinge wrote:
> If you want to generate Java from the Ecore file you have to add a
> corresponding genmodel file. The generation works as usual.
I did that, but I cannot add the genmodel in the src-gen otherwise it
will be erased when running the workflow.
If I create the genmodel on another directory (under src) then the
..ecore file will be copied also in that directory and then I'll have to
take care of copying it again each time I run the workflow and the
generated .ecore is re-generated... am I missing something?
> Note that at runtime (in editor and in standalone mode) the
> EPackage.Registry has to be filled before the parser looks up the meta
> model the first time. If it's not in the registry the parser will load
> the ecore file and use it dynamically.
mh... I don't understand this part sorry...
>
> If you just use Xtend and Xpand to access the meta model you don't need
> to generate any java classes since under the hood those languages use
> EMF's reflection layer any way.
>
> labels and icons are provided by adding label(MyType) and icon(MyType)
> extension to EditorExtensions.ext (in the editor plugin).
>
> example:
>
> label(State this) :
> name;
>
> icon(State this) :
> "state.gif";
>
> given that there is an image 'state.gif' within the icons/ folder.
concerning this part I managed to customize it :-)
thanks
Lorenzo
>
>
> Lorenzo Bettini schrieb:
>> the ecore file, generated in the src-gen directory; is there a way to
>> use it directly (e.g. to generate the emf model and to use the emf
>> model directly)?
>>
>> I mean, if I want to access the emf model is there a way to do it
>> without generating all the stuff from the ecore file?
>>
>> For instance, I'd like to have all the emf icons (and then change
>> them) so that I can then customize the icons of the elements in the
>> outline view; As for this last thing, could anyone provide an example
>> of customization of label and icon for the outline view?
>>
>> thanks in advance
>> Lorenzo
>>
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
|
Re: [xtext] How to use the generated ecore file? [message #619449 is a reply to message #384651] |
Fri, 08 August 2008 09:22 |
|
Sven Efftinge wrote:
> If you want to generate Java from the Ecore file you have to add a
> corresponding genmodel file. The generation works as usual.
I did that, but I cannot add the genmodel in the src-gen otherwise it
will be erased when running the workflow.
If I create the genmodel on another directory (under src) then the
..ecore file will be copied also in that directory and then I'll have to
take care of copying it again each time I run the workflow and the
generated .ecore is re-generated... am I missing something?
> Note that at runtime (in editor and in standalone mode) the
> EPackage.Registry has to be filled before the parser looks up the meta
> model the first time. If it's not in the registry the parser will load
> the ecore file and use it dynamically.
mh... I don't understand this part sorry...
>
> If you just use Xtend and Xpand to access the meta model you don't need
> to generate any java classes since under the hood those languages use
> EMF's reflection layer any way.
>
> labels and icons are provided by adding label(MyType) and icon(MyType)
> extension to EditorExtensions.ext (in the editor plugin).
>
> example:
>
> label(State this) :
> name;
>
> icon(State this) :
> "state.gif";
>
> given that there is an image 'state.gif' within the icons/ folder.
concerning this part I managed to customize it :-)
thanks
Lorenzo
>
>
> Lorenzo Bettini schrieb:
>> the ecore file, generated in the src-gen directory; is there a way to
>> use it directly (e.g. to generate the emf model and to use the emf
>> model directly)?
>>
>> I mean, if I want to access the emf model is there a way to do it
>> without generating all the stuff from the ecore file?
>>
>> For instance, I'd like to have all the emf icons (and then change
>> them) so that I can then customize the icons of the elements in the
>> outline view; As for this last thing, could anyone provide an example
>> of customization of label and icon for the outline view?
>>
>> thanks in advance
>> Lorenzo
>>
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
Powered by
FUDForum. Page generated in 0.03464 seconds