|
Re: [xtext] How to use the generated ecore file? [message #19603 is a reply to message #19329] |
Fri, 08 August 2008 02:45  |
Eclipse User |
|
|
|
Originally posted by: sven.efftinge.de
If you want to generate Java from the Ecore file you have to add a
corresponding genmodel file. The generation works as usual.
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.
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.
Sven
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.03085 seconds