编程方式更改日食背景颜色 [英] programmatically change the background color in eclipse
问题描述
结果
我有Eclipse插件开发相关的问题。是否有任何手段
由我可以通过编程改变日食背景颜色。
我可以通过调用更改文本前景色
setTextColor(颜色,偏移量,长度,controlRedraw)在ITextViewer
但我没有找到,我可以改变背景的任何功能
文本的颜色。
如果有人已经通过这个好心分享您的想法。
I have a question related to eclipse plugin development. Is there any means
by which I can programmatically change the background color in eclipse.
I am able to change the text foreground color by calling
setTextColor(color, offset, length, controlRedraw) in ITextViewer
but I don't find any function by which I can change the background
color of the text.
If anyone has been through this kindly share your thoughts.
谢谢
ARAV
Thanks arav
推荐答案
我不知道这很容易做到,短期延长自己的文本编辑器的版本,在这里你提供一个配置
类,它inturn接受 presentationReconciler
类,它就像一个规则
类,告诉您是否需要把前景颜色或背景
I am not sure this can be done easily, short of extending your own version of a Text Editor, here you provide a Configuration
Class which inturn accepts a PresentationReconciler
Class which is like a Rule
Class that tells you if you need to put a Foreground or a Background Color
请参阅这个文件
presentationReconciler
-
I presentationDamager
:给出定义的文本改变脏区 -
I presentationRepairer
:重新创建脏区presentation -
DefaultDamagerRepairer
同时做两件事,基于令牌的扫描仪 -
ITokenScanner
:解析文本转换为标记流 -
RuleBasedScanner
使用简单的规则
IPresentationDamager
: define dirty region given a text changeIPresentationRepairer
: recreate presentation for dirty regionDefaultDamagerRepairer
does both, based on a token scannerITokenScanner
: parse text into a token streamRuleBasedScanner
uses simple rules
从presentation提取物
Extract from the presentation
<子>从文本编辑器食谱,季节的食谱为你的文本编辑器结果
汤姆·艾彻后,IBM的Eclipse团队
From Text Editor Recipes, Season’s recipes for your text editor
Tom Eicher, IBM Eclipse Team
下面,空背景色手段,需要该插件的默认系统的背景。 (所以在这里:白色)结果。
但是,你可以指定任何你想要的颜色,基于文档的划分和适用的规则。
Here, the null background color means, takes the default system background for that widget. (so here: white).
But you could specify whatever color you want, based on the partitioning of your document and on the rules that would apply.
这篇关于编程方式更改日食背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!