Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to trigger the serializer on existing EMF model?
How to trigger the serializer on existing EMF model? [message #1001938] Thu, 17 January 2013 15:31 Go to next message
Marco Naddeo is currently offline Marco NaddeoFriend
Messages: 62
Registered: November 2012
Member
Hi Smile

I want to trigger the serializer from a context menu in my language editor on the existing EMF model, i.e. without re-parsing the source code... how can I obtain the Resource (and then the AST) starting from my command handler which extends AbstractHandler?


Thanks in advance. Smile

Marco
Re: How to trigger the serializer on existing EMF model? [message #1001971 is a reply to message #1001938] Thu, 17 January 2013 16:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

am not quite sure what your problem is?
you may have a look at http://christiandietrich.wordpress.com/2011/10/15/xtext-calling-the-generator-from-a-context-menu/

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to trigger the serializer on existing EMF model? [message #1002249 is a reply to message #1001971] Fri, 18 January 2013 08:47 Go to previous messageGo to next message
Marco Naddeo is currently offline Marco NaddeoFriend
Messages: 62
Registered: November 2012
Member
Ok if I want my context menu to be a menuContribution with locationURI "popup:org.eclipse.jdt.ui.PackageExplorer", but what about if I want it to have instead locationURI="popup:#TextEditorContext?after=additions"?

In this case, how can I get the Resource in my handler to trigger the serializer on the EMF model? Is it possible to get it from that context? Confused


Marco
Re: How to trigger the serializer on existing EMF model? [message #1002257 is a reply to message #1002249] Fri, 18 January 2013 08:58 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
The blog has an example for right click in the editor too

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Access model from the editor
Next Topic: JvmTypesBuilder generate final parameters
Goto Forum:
  


Current Time: Fri Apr 26 06:52:06 GMT 2024

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

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

Back to the top