Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [xtext] How to use the generated ecore file?
[xtext] How to use the generated ecore file? [message #19329] Wed, 06 August 2008 11:25 Go to next message
Eclipse UserFriend
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
Re: [xtext] How to use the generated ecore file? [message #19603 is a reply to message #19329] Fri, 08 August 2008 02:45 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:[xText] Error in the generated PartitionScanner
Next Topic:[xText] how to put oaw projects on CVS
Goto Forum:
  


Current Time: Tue May 13 23:12:35 EDT 2025

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

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

Back to the top