Override GMF source code to change diagram <-> text parsing [message #841407] |
Wed, 11 April 2012 04:59  |
Eclipse User |
|
|
|
Hi,
i am searching for a solution to change the way my diagramm is saved in the file. I want to make this possible in the GMF with Xtext environment.
For that i downloaded the complete GMF project code and searched inside that. I am not able to find a parser interface inside the whole source code which could be the right one to do the "parse diagram to text file" thing.
Also i could not find a real documentation for the project to get started changing something there.
Maybe you could tell me a interface name which i have to overwrite. Or you could point me to a documentation (getting started) which i am not able to find.
Thanks in advance!
|
|
|
|
Re: Override GMF source code to change diagram <-> text parsing [message #842393 is a reply to message #841665] |
Thu, 12 April 2012 04:55  |
Eclipse User |
|
|
|
Hi Guillaume,
first of all thanks for your quick reply!
The "combine Xtext and GMF" link helped me a bit, but i still got a question.
In the article is a part with the following text:
Quote:In an Xtext editor, changes in the text are transfered to the underlying XtextResource (src) by a call to the method XtextResource.update(int, int, String) (src), which will trigger a partial parsing of the dirty text region and a replacement of the corresponding subtree in the AST model (semantic model).
So is it possible to change the way of parsing by overwriting some functions? I checked the API and found the following interface:
http://download.eclipse.org/modeling/tmf/xtext/javadoc/2.0.0/org/eclipse/xtext/resource/XtextResource.html
My first idea is to overwrite the doLoad(java.io.InputStream inputStream, java.util.Map<?,?> options), doSave(java.io.OutputStream outputStream, java.util.Map<?,?> options) and the update(int, int, String) function. Am i right, that these functions are doing the parser things if one resource (text or graphic) is changed?
Is my first idea the right one? Or is there another way to solve this?
Best Regards,
Heinz
[Updated on: Thu, 12 April 2012 05:35] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.26859 seconds