Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Complementing EMF/GMF-based Editor with Xtext
Complementing EMF/GMF-based Editor with Xtext [message #1732335] Mon, 16 May 2016 07:04 Go to next message
Devon Miles is currently offline Devon MilesFriend
Messages: 1
Registered: May 2016
Junior Member
Amongst others there are some ecore modelled elements "Variable" and "Expression". The latter has a String attribute "Term". So in the EMF editor the user just fills in a text for the Expression's Term property. Finally the user exports the model and the Expression's Term text get's validated using a handcoded logic: The Term may contain "Variables" as operands, arithmetic operators and brackets. These constraint info is not expressed in the ecore model at all.

What I'd like to create is a fully-featured XText-Editor which pops up when the user starts editing the Expression's Term property. (Preferrably only)* the Editor shall "know" about the constraints stated above and provide code completion for Variable names, etc

"(Preferrably only)*": I'd prefer to leave the ecore model untouched but to express the constraint info just in the Xtext editors grammar if possible. So the Xtext editors knows only about the part he will be made for.

Thank you for telling me about the route to go especially where to start. If successful I will share the sample code here.

I think first step is to write the grammar for the Expression's Term. That grammar imports (at least) the Variables of the ecore model. Right? How to progress? Thanks!
Re: Complementing EMF/GMF-based Editor with Xtext [message #1732356 is a reply to message #1732335] Mon, 16 May 2016 13:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You should find that Xbase gives you a useable Java-like expression
grammar. (The OCL project pivides an OCL expression geammar if you need
OMG compliance, but you wll find that it is less mature and harder to
integrate than Xbase).

EMF has limited UI extensibility. The EMF Forms project has opened out
extensibility considerably.

The EmbeddedXtextEditor supports re-use of an editor in other
applications. Not sure if there is yet an official version of it or you
have to search around for a clone of a clone of the Eclipse Labs prototype.

Do share your results, but check that it is not already available.

Regards

Ed Willink


On 16/05/2016 14:43, Devon Miles wrote:
> Amongst others there are some ecore modelled elements "Variable" and
> "Expression". The latter has a String attribute "Term". So in the EMF
> editor the user just fills in a text for the Expression's Term
> property. Finally the user exports the model and the Expression's Term
> text get's validated using a handcoded logic: The Term may contain
> "Variables" as operands, arithmetic operators and brackets. These
> constraint info is not expressed in the ecore model at all.
>
> What I'd like to create is a fully-featured XText-Editor which pops up
> when the user starts editing the Expression's Term property.
> (Preferrably only)* the Editor shall "know" about the constraints
> stated above and provide code completion for Variable names, etc
>
> "(Preferrably only)*": I'd prefer to leave the ecore model untouched
> but to express the constraint info just in the Xtext editors grammar
> if possible. So the Xtext editors knows only about the part he will be
> made for.
>
> Thank you for telling me about the route to go especially where to
> start. If successful I will share the sample code here.
>
> I think first step is to write the grammar for the Expression's Term.
> That grammar imports (at least) the Variables of the ecore model.
> Right? How to progress? Thanks!
Re: Complementing EMF/GMF-based Editor with Xtext [message #1737968 is a reply to message #1732335] Thu, 14 July 2016 13:46 Go to previous message
Philipp Heisig is currently offline Philipp HeisigFriend
Messages: 26
Registered: November 2014
Junior Member
I'm struggling with the extactly same issue. Is there by chance a solution or progress on this?

What I've done so far is implementing my Xtext Grammar and created the hook in the EMF editor for providing the xtext editor. For the second one just follow the proposed approach in https://www.eclipse.org/forums/index.php/t/126975/ . As a cell editor is expected, the next step would be to provide a xtext cell editor. Probably the information in http://muelder.blogspot.de/2011/04/xtext-celleditor-integration.html are sufficient, but I'm stucked here at the moment.
Previous Topic:update from 2.1 to 2.6.2 problem
Next Topic:Serialization and concrete syntax validation
Goto Forum:
  


Current Time: Fri Apr 19 00:19:56 GMT 2024

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

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

Back to the top