Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to use an external editor to edit attributes of type EString(instead of using the properties view)
How to use an external editor to edit attributes of type EString [message #698962] Wed, 20 July 2011 14:50 Go to next message
Marc Palyart is currently offline Marc Palyart
Messages: 4
Registered: November 2010
Junior Member
Hi,

At some point in the metamodel that I have defined there's a class which contains an attribute of type EString. This attribute aims to store the body of a C++ method .

Sadly writing C++ code within the standard properties view is not usable in practice.

That's why I would like to add a command in the context menu of the attribute (in the tree view of the EMF Editor ) to open its value within an external text editor, the best would be the CDT editor.

Editor are usually associated with file extension ? So should I create a temporary file for each instances of this attribute and then open-it with the CDT editor ? How to handle the synchronization of the data between the two views ?

I don't really know where to start to done this in a proper way so suggestions are welcome.

Thanks

Marc Palyart
Re: How to use an external editor to edit attributes of type EString [message #698967 is a reply to message #698962] Wed, 20 July 2011 14:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26137
Registered: July 2009
Senior Member
Marc,

Comments below.

On 20/07/2011 7:51 AM, Marc Palyart wrote:
> Hi,
>
> At some point in the metamodel that I have defined there's a class
> which contains an attribute of type EString. This attribute aims to
> store the body of a C++ method .
> Sadly writing C++ code within the standard properties view is not
> usable in practice.
You'd certainly need a multi-line editor; you can configure that in the
GenFeature...
>
> That's why I would like to add a command in the context menu of the
> attribute (in the tree view of the EMF Editor ) to open its value
> within an external text editor, the best would be the CDT editor.
>
> Editor are usually associated with file extension ?
Typically yes.
> So should I create a temporary file for each instances of this
> attribute and then open-it with the CDT editor ?
It's likely that it will only work with contents in a resource...
Typically though it would need to work with a complex context...
> How to handle the synchronization of the data between the two views ?
Good question. I've not solved a problem like this before...
>
> I don't really know where to start to done this in a proper way so
> suggestions are welcome.
You could always just force the user to do cut and paste between some
editor and the multi-line entry field.
>
> Thanks
>
> Marc Palyart
Re: How to use an external editor to edit attributes of type EString [message #698974 is a reply to message #698967] Wed, 20 July 2011 15:17 Go to previous messageGo to next message
Marc Palyart is currently offline Marc Palyart
Messages: 4
Registered: November 2010
Junior Member
Thanks Ed for the answer.

I've already enabled the multi-line feature in the GenModel but writing C++ source code in this view is not really user-friendly.

Regarding the copy/paste approach that's the current way but I was hoping that the integration of external editors for editing part of EMF model was not so complicated.

It would be marvelous to be able in EMF to define easily different viewpoints on the model (this part of the model can be edited with this editor or this one, this other part can be edited with this editor...), maybe it's planned ?

Marc Palyart
Re: How to use an external editor to edit attributes of type EString [message #698988 is a reply to message #698974] Wed, 20 July 2011 15:38 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26137
Registered: July 2009
Senior Member
Marc,

Certainly EMF supports models that cross resource boundaries so one
might imagine if you had a model for C++ you could just refer to
something in a C++ resource. Syncing up the value of an attribute with
the contents of some other resource isn't something we have designs or
plans for...



On 20/07/2011 8:17 AM, Marc Palyart wrote:
> Thanks Ed for the answer.
>
> I've already enabled the multi-line feature in the GenModel but
> writing C++ source code in this view is not really user-friendly.
>
> Regarding the copy/paste approach that's the current way but I was
> hoping that the integration of external editors for editing part of
> EMF model was not so complicated.
>
> It would be marvelous to be able in EMF to define easily different
> viewpoints on the model (this part of the model can be edited with
> this editor or this one, this other part can be edited with this
> editor...), maybe it's planned ?
>
> Marc Palyart
Previous Topic:Using GenModel Redirection Pattern to change a single filename
Next Topic:Setting different default values for Inherited attributes
Goto Forum:
  


Current Time: Thu Oct 23 18:52:02 GMT 2014

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

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