Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Two different text editors for single file?
Two different text editors for single file? [message #778137] Wed, 11 January 2012 13:16
Aivar Annamaa is currently offline Aivar AnnamaaFriend
Messages: 33
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

Previous Topic:Team menu cluttered
Next Topic:[Common Navigator][DnD] Non-deterministic drag behavior
Goto Forum:

Current Time: Thu Jun 21 03:12:59 GMT 2018

Powered by FUDForum. Page generated in 0.01753 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top