|Re: Entry & Validation of Text in a GMF Runtime [message #1125332 is a reply to message #1117898]
||Fri, 04 October 2013 11:58
| Louis Rose
Registered: July 2009
Location: York, United Kingdom
Are you perhaps using Kepler (Eclipse 4.3)? If so, I think that you'll need to use a slightly newer version of the example, which I've just committed to our SVN repository . If you're using Eclipse Juno (4.2), the version you already have should work. If not, you could try regenerating the GMF code for the precise version of GMF that you have installed, by selecting the esm.emf file, right-clicking and then selecting Eugenia > Generate GMF editor.
Also, for this example to work, do be sure that you edit the transition's text by double-clicking on the labels in the canvas, rather than via the property sheet view. This example only binds the Xtext parser to the label editor used on the GMF editor's canvas. The property sheet view is contributed by a plug-in which is generated by EMF rather than Eugenia, so we don't currently have a good way to repeatedly edit the behaviour of the property sheet view.
I've attached a video showing how the example works. First, I change the label on the transition and we see that this change is reflected by the addition of a "Dec" element in the model. This "Dec" object is an instance of a class from the metamodel generated from the Xtext grammar. Then, I show that the label editor won't allow invalid statements such as "foo" to be set as transition labels. Finally, I show that the property sheet editor doesn't perform validation and will allow "foo" to be set as a transition label.
Hope this helps!
[Updated on: Fri, 04 October 2013 12:02]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.05211 seconds