Xtext Graphical View [message #1036534] |
Mon, 08 April 2013 10:01  |
Eclipse User |
|
|
|
Hi there.
This is my problem: I'm working with xtext and I have to create a GRAPHICAL REPRESENTATION of the projects creating with my own language, I mean, once my dsl is creating I'm able to use it creating a "X" project and the idea is to be able to see the rappresentation of that project.
I've been searching for a good example, and for possible solutions, but is like a dead road. I've seen some posts about EUGENIA, GMF, SPRAY... but in any of those they explain what to do. There is also a video in xtext home page with the generic graphic view example, but once and again there is no the explanation about how to create the conexion beetwen my dsl and the results that I can obtain.
What do you suggest, what can I do, do you know a good example.....
Thanks a lot.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Xtext Graphical View [message #1037315 is a reply to message #1037306] |
Tue, 09 April 2013 08:08   |
Eclipse User |
|
|
|
Hello,
sorry, I probably haven't expressed myself properly.
I was wondering where the file extension for files from which a diagram can be created is specified, "domainmodel" in this specific case.
It is likely an extension added to the context menu, applied to a specific file extension, as the menu entry "Initialize [...] diagram" (see picture) only appears in .domainmodel files. I believe if I can find out where that menu entry is registered I can figure out how to work with different extensions.
Edit:
Nevermind, I found it, it's in the popup menu extension of the diagram. Now to find out _why_ it's specified as *.domainmodel there.
Edit2:
Doesn't matter, just editing the nameFilter to *.dmodel does the trick.
Trivial solutions to annoying problems are nice.
It is, however, a little bit of a nuisance that I have to change this all the time when I generate the diagram code anew.
[Updated on: Tue, 09 April 2013 08:40] by Moderator
|
|
|
|
Re: Xtext Graphical View [message #1037944 is a reply to message #1037930] |
Wed, 10 April 2013 03:51   |
Eclipse User |
|
|
|
Oh dear, I wrote up such a nice post and the forum ate it. Rude.
-
Anyway, I hope you don't mind if I answer to the best of my knowledge.
I'm by no means an expert on either Xtext or GMF-based tools, so take what I say with a grain of salt, but I gathered at least some knowledge during the last weeks.
As you probably know, Xtext relies on the EMF, i.e. creates an Ecore model for every grammar to then work with its nodes.
Eugenia (in this case, but other GMF tools too, as far as I know) also uses that model, but takes it in another direction to create a graphical view for it.
So I think the connection between Xtext and Eugenia is more or less only indirect via the Ecore model.
As for your error, I'll take a guess and say it's caused by an erroneous annotation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|