I finally figured out how to achieve coloring without using Reconcilers. I found that first I needed a way to get a reference to my SourceViewer object, as I am extending TextEditor. I also found that I could implement the TextListener interface and add my own listener to the SourceViewer object. However, you need to be careful, since calling the getSourceViewer () method can lead to null if not called in the appropriate place. I originally overwrote the init (...) function in my editor class and called the getSourceViewer () call, but it still led to null. After doing a bit of research, I found that I could correctly get a reference to the SourceViewer object by overriding the createPartControl method. First I call super.createPartControl (...) and then I call getSourceViewer (). After I got this link, I used it with my listener class, which I created, and was able to paint myself using the setTextColor method, which has a SourceViewer object. Hope this helps others in the same situation.
source share