Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumsxtext Editor in Papyrus
https://www.eclipse.org/forums/index.php/mv/msg/199258/635674/#msg_635674
I wanted to ask to developers of Papyrus about xtext editors used in papyrus. These are three xtext editor plugins used to define grammer etc for properties.
I have seen all of these three plugins but could not find how you are using it when you drag property on a class then click it and get a text area to write. it gives code completion and code highligting. I wanted to know where can I find this implementation? is it implemented in some other plugin? can any one point me to that code? it would help me alot!
Regards
/Jaguar]]>Dani2010-10-27T17:17:09-00:00Re: xtext Editor in Papyrus
https://www.eclipse.org/forums/index.php/mv/msg/199258/635800/#msg_635800
From your eclipse session (provided that Papyrus is installed), you can find documentation on how to embedd an XText editor inside Papyrus in "Help / Help Contents / Papyrus Guide / Developer guide / Papyrus Integration with XText". Any feedback on this tutorial is welcome.
From this location, sources for the textual property editor can be found following this path: Trunk / plugins / uml
Cheers,
Arnaud]]>Arnaud Cuccuru2010-10-28T08:02:05-00:00Re: xtext Editor in Papyrus
https://www.eclipse.org/forums/index.php/mv/msg/199258/636432/#msg_636432
its very good tutorial thank you very much for the help. if need to rate your tutorial its 10/10. thankss
]]>Dani2010-11-01T09:57:23-00:00Re: xtext Editor in Papyrus
https://www.eclipse.org/forums/index.php/mv/msg/199258/652281/#msg_652281
I tried to follow the tutorial but I'm a little stuck now...
First I found that various classes referenced in the "message" example code have been deleted from the SVN (for instance org.eclipse.xtext.gmf.glue/src/org/eclipse/xtext/gmf/glue/ed it/part/IEObjectContextUpdater.java, which is taken from an old revision on the head svn of papyrus)
I can try to launch my editor with a right click on a UML element (Comment in my case) and choosing edit Comment -> using MyComment editor.
However, when doing so, the "public IPopupEditorHelper createPopupEditorHelper(Object editPart)" method is not called and the editor is clearly not the one expected (big windows with only one line and no button). (This a method from my class that extends org.eclipse.xtext.gmf.glue.PopupEditorConfiguration)
I precise that I added the correct extension point with popup editor... but...
It seems that I'm doing something wrong... Have you got any idea ?
By the way, can you tell us what environment (papyrus and xtext revision / version) is expected to use the tutorial ?
thanks in advance,
regards,
julien]]>Julien Deantoni2011-02-03T13:01:35-00:00Re: xtext Editor in Papyrus
https://www.eclipse.org/forums/index.php/mv/msg/199258/652401/#msg_652401
The tutorial has been written on the basis of the following environment: Papyrus 0.7.0 + XText 1.0.1. The interface IEobjectContextUpdater has indeed been removed in more recent versions of Papyrus, and the tutorial would therefore require to be updated.
For the method "createPopupEditorHelper" to be called, you should perform a direct edit on the graphical element (e.g., in your example, once you have selected your comment in the diagram, you can press F2). Also, please note that if you want your own textual editor to be opened by pressing F2, Papyrus must be configured properly:
- Go to Window/Preferences/Papyrus/Embedded Editors from the menu
- In the window "Elements to edit", select "Comment"
- In the window "Associated editor", your editor should appear. Select it and make it your default editor for comments.
=> If you can't see "Comment" or your associated editor, there is probably a problem with the contribution to the extension point.
Could you please tell us if this works for you?
Best regards,
Arnaud]]>Arnaud Cuccuru2011-02-03T18:27:49-00:00Re: xtext Editor in Papyrus
https://www.eclipse.org/forums/index.php/mv/msg/199258/652492/#msg_652492
So, I changed the default editor in the preference and the good code is now called
However, I use Papyrus 0.8.0 and Xtext 1.0.2...
I checked out the old version of .....gmf.glue to be able to "copy" the code from your examples (to figure out what kind of code must be called in the createPopupEditorHelper)... I have problems with the temporary file in the showEditor() method... (cast problem)
I'm now going to try with the last svn version and give you feedback.
thanks for your answer,
julien]]>Julien Deantoni2011-02-04T09:46:04-00:00Re: xtext Editor in Papyrus
https://www.eclipse.org/forums/index.php/mv/msg/199258/652953/#msg_652953
some quick news. I managed having the popup editor and it works well (syntax coloring, completion, etc).... until I close it.
I'm not able to propagate the changes in the model (I edit the body of a comment and just want to set the body with the new edited text)
I think this is a problem with the reconciler but I'm not sure. None of these two methods is called: reconcile(EObject modelObject, EObject xtextObject)
CommandResult doExecuteWithResult(IProgressMonitor arg0, IAdaptable arg1)
Do you have any idea / hint ?
thanks,
regards,
julien]]>Julien Deantoni2011-02-07T18:03:17-00:00Re: xtext Editor in Papyrus
https://www.eclipse.org/forums/index.php/mv/msg/199258/652966/#msg_652966
The method "reconcile" is called by PopupXtextEditorHelper::closeEditor(boolean isReconcile). If you have a look at this method, you will see that there are three normal cases where reconciliation does not happen:
- isReconcile == false => It is the case when you close the editor by pressing Esc, otherwise (ctrl+enter or focusLost) it is true.
- the edited text contains parsing errors (=> isDocumentHasErrors(xtextDocument) == true)
- the edited text contains semantic errors (=> semanticValidator.validate() == false)
I suspect that the problem comes from the semanticValidator, which is not documented in the tutorial. We have introduced it since the method isDocumentHasErrors (which was provided by XText) only considers parsing errors, and not the errors that you may have generated using the validation framework.
If you have not written your own semantic validator (or used the DefaultSemanticValidator which is provided in gmf.glue), you should check the type of the semanticValidator which is called in the method "closeEditor". I hope that this will solve your problem.
Best regards,
Arnaud.]]>Arnaud Cuccuru2011-02-07T19:02:47-00:00Re: xtext Editor in Papyrus
https://www.eclipse.org/forums/index.php/mv/msg/199258/653147/#msg_653147
thank you for your help !
It works fine now
my problem was that the edited text contained parsing errors (=> isDocumentHasErrors(xtextDocument) == true) :-/
Thank you very much !
Best regards,
Julien]]>Julien Deantoni2011-02-08T16:44:08-00:00Re: xtext Editor in Papyrus
https://www.eclipse.org/forums/index.php/mv/msg/199258/1385319/#msg_1385319
Is anyone keen to provide me with updated instructions of how to include a Xtext Editor into Papyrus.
Somehow my editor does not show up under Window/Preferences/Papyrus/Embedded Editors.
Thx & Cheers
Davincho]]>Davincho Huevada2014-06-05T15:12:23-00:00