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.
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?
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?
>