Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Source Page
EMF Source Page [message #902949] Tue, 21 August 2012 07:34 Go to next message
Simon Barnett is currently offline Simon Barnett
Messages: 28
Registered: July 2012
Junior Member
Does anyone know how to create a Source page for a multi-page Eclipse editor (based on EMF) which the user can use to edit the XML of the model directly?

I've got the contents of the XML displayed in an editor page using a TextEditor but it isn't bound to the model so when the user edits it, it doesn't set the file to be dirty and cannot be saved.

Any ideas?
Re: EMF Source Page [message #902951 is a reply to message #902949] Tue, 21 August 2012 07:46 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25907
Registered: July 2009
Senior Member
Simon,

I don't recall anyone has done that. I could imagine doing this at a
course grained level. I.e., a command stack listener could update the
textual view each time a command is executed. The generated editor
already has such a listener to update the properties view. A listener on
the text view could unload the resource and reload it from the textual
source; this is trickier because you'd not want to do that on each
keystroke...


On 21/08/2012 1:34 PM, Simon Barnett wrote:
> Does anyone know how to create a Source page for a multi-page Eclipse
> editor (based on EMF) which the user can use to edit the XML of the
> model directly?
>
> I've got the contents of the XML displayed in an editor page using a
> TextEditor but it isn't bound to the model so when the user edits it,
> it doesn't set the file to be dirty and cannot be saved.
>
> Any ideas?
Re: EMF Source Page [message #902955 is a reply to message #902951] Tue, 21 August 2012 07:55 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5210
Registered: July 2009
Senior Member
Sure someone has done it ;-) Look at the e4xmi-Editor it shows a form
based UI and one that is based on the XML-Editor sample one can create
using the PDE-Wizard.

Tom

Am 21.08.12 13:46, schrieb Ed Merks:
> Simon,
>
> I don't recall anyone has done that. I could imagine doing this at a
> course grained level. I.e., a command stack listener could update the
> textual view each time a command is executed. The generated editor
> already has such a listener to update the properties view. A listener on
> the text view could unload the resource and reload it from the textual
> source; this is trickier because you'd not want to do that on each
> keystroke...
>
>
> On 21/08/2012 1:34 PM, Simon Barnett wrote:
>> Does anyone know how to create a Source page for a multi-page Eclipse
>> editor (based on EMF) which the user can use to edit the XML of the
>> model directly?
>>
>> I've got the contents of the XML displayed in an editor page using a
>> TextEditor but it isn't bound to the model so when the user edits it,
>> it doesn't set the file to be dirty and cannot be saved.
>>
>> Any ideas?
>
Previous Topic:Problem in the installed CDO Source
Next Topic:Xcore for Indigo
Goto Forum:
  


Current Time: Tue Jul 22 11:37:32 EDT 2014

Powered by FUDForum. Page generated in 0.01615 seconds