English 中文(简体)
2. 未经陈述的Syntax Coloring Reconciler
原标题:Syntax Coloring without Presentation Reconciler

我愿在Eclipse中不使用列报调节器。 因此,首先,我需要说明如何把案文序言反对与我的编辑或文件联系起来,但我难以确定如何将其联系起来。 通常情况下,知识产权认证接口中的创建前使案文的行文范围广,而Eclipse则知道与这一表述目标有什么关系。 在不使用提交书时,是否有某种方式使用案文序言物体? 如果我能不使用调和器,那么我会这样做。 谢谢。

最佳回答

I finally figured out how to achieve the coloring without the use of Reconcilers. I discovered that first I needed a way to obtain a reference to my SourceViewer object, as I am extending TextEditor. I also discovered that I could implement the TextListener interface and add my own listener to the SourceViewer object. One must be careful, however, as calling the getSourceViewer() method can result in null if not called at the appropriate spot. Originally, I overwrote the init(...) function in my editor class and made the getSourceViewer() call, but it still resulted in null. After doing a bit of research, I discovered that I could properly obtain a reference to the SourceViewer object by overriding the createPartControl method. I first call super.createPartControl(...) and then make a call to getSourceViewer(). After I obtained that reference, I used that with my listener class I created and was able to do the coloring myself with the setTextColor method the SourceViewer object has. Hope this helps others in the same situation.

问题回答

暂无回答




相关问题
Why can t I launch notepad++ from the command line anymore?

I m teaching myself some Django tonight using the local dev package at instantdjango.com I made it through half the tutorial, building a basic map with points on it, then closed out of the console ...

Indentation guide for the eclipse editor

Is there a setting or plugin for eclipse that can show indentation guides in the editor? Something like the Codekana plugin for visual studio (not so fancy is also OK). Important that it works with ...

How can I replace multiple line breaks with a single <BR>?

I am replacing all occurances of with the <BR> tag, but for some reason the text entered has many in a row, so I need to combine them. Basically, if more than 1 occur together, replace ...

Templated HTML Editor

I m looking for a HTML editor that kinda supports templated editing or live snippets or something like that. Background: I m working on a website for a friend. As there are no specifications what the ...

热门标签