Anyone know of an SWT widget that can be a text editor with support for syntax highlighting? I'm aware of the StyledText widget but I'm hoping that somebody has already written some libraries so one can just specify the keywords that should be highlighted.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Indeed, the general principle of syntax highlighting are using the StyledText Widget.
The JavaSourcecodeViewer is a more advanced example.
The JavaViewer is even more detailed (source code).
回答2:
I'd look into what Eclipse uses in their code editor. Because if any SWT application uses syntax highlighting, its Eclipse.
回答3:
Perhaps what you are looking for is Eclipse Colorer plug-in.
I have no idea though if and how would the colorer be usable as an SWT widget.