Synchronizing editor tabs


I have tabbed editor for GUI editing xml file. My xml file have own model from plugin library which I will use for GUI. I want the file to be also editable by default TextEditor tab, which have own model for editing file. I dont know how to properly synchronize this two models, so when the user changes model in TextEditor, changes are propagated to my GUI model and vice versa.

For synchronizing changes from TextEditor I found just document events, which tells me that the text has been changed in specified char position and what is the change. I would like to listen to events which know that it is xml file, that is edited, and can tell me for instance that the change occurs in this tag. Are there such events fired somewhere? I am a bit confused, that my XML file is by default opened in Intellij with TextEditor and I can listen only to above described events. Or I am probably missing something...

For the other way I would like changing TextEditor xml file also in some not so low level way, but for instance inserting tag values, when my GUI xml model changes.

Can you please point me to classes which can allow me this functionality? Or some similar implementation? Thanks.

1 comment
Comment actions Permalink

Please see There's various levels to intercept changes, depending on the data you need in the change events.


Please sign in to leave a comment.