简体   繁体   English

如何在eclipse中更改悬停背景和前景色?

[英]How to change hover background and foreground color in eclipse?

I am building a eclipse plugin with custom editor. 我正在使用自定义编辑器构建一个eclipse插件。 I have implemented text hovering functionality in which user hover on some text then that text will be shown on tooltip like javadocs. 我已经实现了文本悬停功能,用户将鼠标悬停在某些文本上,然后该文本将显示在工具提示中,如javadocs。

How can i change the tooltip background and foreground color programmatically? 如何以编程方式更改工具提示背景和前景色?

If your ITextHover class also implements ITextHoverExtension you can provide the IInformationControlCreator in the getHoverControlCreator() method. 如果您ITextHover类也实现ITextHoverExtension您可以提供IInformationControlCreatorgetHoverControlCreator()方法。

You can use a simple IInformationControlCreator which just returns an instance of DefaultInformationControl as the information control. 您可以使用一个简单的IInformationControlCreatorIInformationControlCreator返回一个DefaultInformationControl实例作为信息控件。 DefaultInformationControl has setForegroundColor and setBackgroundColor methods. DefaultInformationControl具有setForegroundColorsetBackgroundColor方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM