Skip to main content



      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 10:31 Go to next message
Eclipse UserFriend
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 11:22 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: How to trigger the serializer on existing EMF model? [message #1002249 is a reply to message #1001971] Fri, 18 January 2013 03:47 Go to previous messageGo to next message
Eclipse UserFriend
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 03:58 Go to previous message
Eclipse UserFriend
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
Previous Topic:Access model from the editor
Next Topic: JvmTypesBuilder generate final parameters
Goto Forum:
  


Current Time: Thu Jul 10 09:58:03 EDT 2025

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

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

Back to the top