Extending/customizing an X-Text generated editor [message #701484] |
Mon, 25 July 2011 03:13  |
Eclipse User |
|
|
|
Hi,
I have generated an X-text editor from my grammar. Now I would like to integrate
additional custom validation and serialization code.
Ideally I would like to have provide two additional buttons in the editor:
*Validate* and *Export*. There I would like to hook-in and use my custom code.
So far I have only found the means to replace the standard serialization mechanism
by injecting a custom resource instance.
Can comedy please point out how I could customize the generated editor to my needs?
Many thanks in advance,
Olga
|
|
|
Re: Extending/customizing an X-Text generated editor [message #702199 is a reply to message #701484] |
Tue, 26 July 2011 00:47  |
Eclipse User |
|
|
|
Not sure why you would want to trigger serialization and validation explicitly via menu entries. Ideally, you'd always want to know whether your model is valid or not, without any special action. For example, when you make a mistake in your Java code Eclipse will alert you to the problem with an error marker right away. To me, it seems the best approach would be to customize the EValidator for your language, to get instant feedback on validation problems. There is an auto-generated <YourLanguage>JavaValidator that you can customize.
For serialization (i.e., writing your language code to an external format, if I understand your scenario correctly), I'd suggest to look at the IXtextBuilderParticipant to get instant serialization of your models (see http://www.eclipse.org/forums/index.php/mv/msg/224285/702182/#msg_702182).
|
|
|
Powered by
FUDForum. Page generated in 0.27943 seconds