Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » XText editor embedded in Properties View
XText editor embedded in Properties View [message #1407415] Tue, 12 August 2014 14:30 Go to next message
Ronan B is currently offline Ronan BFriend
Messages: 254
Registered: July 2009
Senior Member
Hi,
I have got my XText grammer working nicely within a Papyrus editor by following the existing OCL embedded editor code, see http://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/tree/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.constraintwithessentialocl.xtext

Now I want to get my grammer embedded in a properties view. I have created an extension for my langauge using org.eclipse.papyrus.uml.properties.languageEditor but I get stuck when implementing an editor that implements the interface org.eclipse.papyrus.uml.properties.widgets.BodyEditor Is there an example I can follow somewhere? Right now I get an NPE when I try and use the properties view, as expected Smile
Re: XText editor embedded in Properties View [message #1407471 is a reply to message #1407415] Tue, 12 August 2014 17:47 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4406
Registered: July 2009
Senior Member
Hi

Let me know when you have solution; embedding OCL in the UML properties
page has been on my to-do list for a few years.

Regards

Ed Willink


On 12/08/2014 15:30, Ronan B wrote:
> Hi,
> I have got my XText grammer working nicely within a Papyrus editor by
> following the existing OCL embedded editor code, see
> http://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/tree/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.constraintwithessentialocl.xtext
>
> Now I want to get my grammer embedded in a properties view. I have
> created an extension for my langauge using
> org.eclipse.papyrus.uml.properties.languageEditor but I get stuck when
> implementing an editor that implements the interface
> org.eclipse.papyrus.uml.properties.widgets.BodyEditor Is there an
> example I can follow somewhere? Right now I get an NPE when I try and
> use the properties view, as expected :)
Re: XText editor embedded in Properties View [message #1407774 is a reply to message #1407471] Wed, 13 August 2014 12:22 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 254
Registered: July 2009
Senior Member
Papyrus does have the OCL editor embedded into the Properties view for OpaqueExpressions doesn't it? See screenshot. This is the kind of integration i'd like to reproduce for my language.
Re: XText editor embedded in Properties View [message #1407777 is a reply to message #1407774] Wed, 13 August 2014 12:28 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4406
Registered: July 2009
Senior Member
On 13/08/2014 13:22, Ronan B wrote:
> Papyrus does have the OCL editor embedded into the Properties view for OpaqueExpressions doesn't it? See screenshot. This is the kind of integration i'd like to reproduce for my language.
Yes. It's nice, but for the UML Model editor I need support in the old
style Properties View.

Regards

Ed Willink
Re: XText editor embedded in Properties View [message #1409534 is a reply to message #1407777] Mon, 18 August 2014 10:59 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 677
Registered: February 2011
Senior Member
Hi Ronan,

Did you have a look at org.eclipse.papyrus.uml.properties.xtext.XtextLanguageEditor, which is the Body editor registered for OCL expressions? It seems generic enough to handle any XText grammar

Regards,
Camille


Camille Letavernier
Papyrus developer
Re: XText editor embedded in Properties View [message #1409553 is a reply to message #1409534] Mon, 18 August 2014 11:32 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 254
Registered: July 2009
Senior Member
Aha. Ok I just set the org.eclipse.papyrus.uml.properties.languageEditor extension point property to editor="org.eclipse.papyrus.uml.properties.xtext.XtextLanguageEditor" and it works!

<extension
point="org.eclipse.papyrus.uml.properties.languageEditor">
<editor
editor="org.eclipse.papyrus.uml.properties.xtext.XtextLanguageEditor"
language="MyLang">
</editor>
</extension>


Thanks Camille.

Ps There seems to be issues related to priority/default editors, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=441962

[Updated on: Tue, 19 August 2014 09:32]

Report message to a moderator

Previous Topic:Migration from Eclipse Kepler to Luna
Next Topic:Own Diagram Editor based on existing org.eclipse.papyrus.uml.diagram.clazz Editor
Goto Forum:
  


Current Time: Sat Jul 04 17:19:29 GMT 2015

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

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