Hosting text editors in views - is it possible
As some of you might have noticed from past postings, I normally prefer to use only views in RCP application and no editors at all...
One of my new customers already have a text editor (based on TextEditor) as an Eclipse IDE extension they want to bring over to a new RCP application. One of the questions, we now have to assert is whether to use editors in the RCP application in question or try to redo the editor as a view.
But, before we start on this work, I just wanted to hear if anybody out these has tried to do this before and have a qualified meaning about the issues involved. Is it at all possible? Or is it just a lot of work?
We understand that the real work is in how to use SourceViewer and friends, and that seems to be doable in a view, but...
If it turns out to be very difficult to implement editors in view, we might just dedicate a speciel perspective for this, but the best solution probably would be to use views only.

3 comments:
Tonny,
I did this over a year ago and it was not too hard (but I did have the ability to modify the code of the editor...)
Vineet
@Vineet, I do expect to modify the code quite a bit... But I want to tap into the big infra structure of SourceViewer and friends to get something that looks as much like the "real" thing as possible.
How did you handle the DocumentProvider API?
I did this about 2 months ago on the 3.3.2 release of eclipse. The major pain points are replicating usage of extensions generally associated with TextEditors. There is really no reason that those extensions cannot also be associated with a SourceViewer, but the TextEditor gives it to you for free.
I was mainly trying this out as a way to annotate and decorate text I was generating for user output rather than providing editing facilities, so my use case might be a bit simplified.
Ultimately, I was unable to use the SourceViewer because native line wrapping doesn't work with it right now. Below is a link to the bug requesting line wrapping in TextViewers.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=35779
Post a Comment