|Two different text editors for single file? [message #778137]
||Wed, 11 January 2012 13:16
| Aivar Annamaa
Registered: July 2009
I want to create a special kind of Java editor.|
It has 2 pages, one of them contains standard Java editor and other contains editor which displays same java program with slightly different syntax, ie. there would be two different views of the same program. The alternative syntax is close enough to Java so that it is possible to translate to and from Java without loss of information.
User should be able to edit program in either of the editors and the text in other editor should be updated accordingly. When user saves the edits, then normal Java code will be written to the file.
As I see it, I should base the UI side of this trick on special implementation of either IEditorInput, IDocumentProvider or IDocument, but I haven't found a good solution.
One easy approach seems to be attaching normal Java editor to Java file via default FileEditorInput, make alternative editor unaware of the file and organize mutual updates manually. But text editor needs a IEditorInput and I haven't found a suitable implementation which doesn't use file but still would provide all necessary helper objects.
Do you know some projects which have attempted something like this?
[Updated on: Wed, 11 January 2012 13:21]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.06719 seconds