Multipage editor [message #670012] |
Thu, 12 May 2011 08:21  |
Eclipse User |
|
|
|
I have following sitution.
Multipage editor.
xml file as an input for multipage editor.
First page is Managed form(implements IFormPage), that represent xml file as a table and allow to change some of its part.
Second page is simple text xml editor, that allows to change xml.
I need to synchronize modifications done in text editor and 'gui editor'.
Whenever I change something in text editor, gui editor has to be updated and vice versa.
gui editor - managed form - consist of a few parts, one of which only allow input data modification.
As mentioned This section is table with customized content provider.
My current thoughts of how to organize this:
on MultipageEditor doSave() callback :
- somehow inform gui editor that input has been changed.
- managed form should consequently inform all editable parts that input data has changed.
- each editable part has to update its table viewer , and tableviewer consequently has to call refresh method
- somehow inform xml editor that input has been changed
- editor has to update input data.
I don't like how I see it.There is definetely some flaw in my logic. There has to be another way to organize things.
How exactly should I inform gui form and xml editor?
I would appreciate any tips and advice or links( I might have missed some crucial material that would have helped me out).
|
|
|
Re: Multipage editor [message #670023 is a reply to message #670012] |
Thu, 12 May 2011 08:55  |
Eclipse User |
|
|
|
You need some kind of model, or shared representation, that can notify you of changes. A common implementation I've seen says the XML is the model, and uses org.eclipse.jface.text.source.SourceViewer as the implementation of the XML page. It fires a number of notification events when the source is changed, that would allow you to update your form fields.
Then your form page needs to update the XML source when a field loses focus.
PW
|
|
|
Powered by
FUDForum. Page generated in 0.04236 seconds