JFace 树中选定的文本颜色

发布于 2024-11-26 15:37:05 字数 190 浏览 0 评论 0原文

我正在准备 Eclipse 编辑器,其中一个选项卡是一棵包含一些值的树。我使用颜色和字体样式为用户提供更多信息。例如,当用户输入的值超出范围时,字体颜色为红色,或者当值非默认时,字体为粗体样式。

但是用户必须将选择移动到另一个单元格才能查看颜色/样式是否已更改。 是否可以更改 JFace 树中所选单元格的颜色/样式?

I'm preparing Eclipse editor where one of the tabs is a tree with some values. I'm using colors and font style to give more information for the user. E.g. when the user puts a value which is out of range then the font color is red, or when a value is non-default then the font has a bold style.

But the user has to move the selection to another cell to see if the color/style has changed or not. Is it possible to change the color/style of the selected cell in the JFace tree?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

影子的影子 2024-12-03 15:37:05

有几种方法可以做到这一点。最明显的两个是:

  • 添加您自己的自定义标签提供商。示例 此处
  • 添加标签装饰器。 这里是一篇较旧的有些过时的文章。

无法通过主题更改颜色。

There are several ways to do this. The two most obvious are:

  • Add your own custom label provider. Example here.
  • Add a label decorator. Here is a older somewhat dated article.

It is not possible to change the colors via theming.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文