Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Extending/customizing an X-Text generated editor
Extending/customizing an X-Text generated editor [message #701484] Mon, 25 July 2011 07:13 Go to next message
Olga  is currently offline Olga Friend
Messages: 1
Registered: July 2011
Junior Member
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 04:47 Go to previous message
Mirko Raner is currently offline Mirko RanerFriend
Messages: 98
Registered: July 2009
Location: New York City, NY
Member
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).
Previous Topic:JvmIdentifiableElement in XBase
Next Topic:ValidatorTester - Test all Checks
Goto Forum:
  


Current Time: Sun Sep 20 08:00:50 GMT 2020

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

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

Back to the top