作为过滤过程的一部分,如何突出显示 TableView 单元格的一部分?

发布于 2024-07-12 23:07:18 字数 196 浏览 3 评论 0原文

背景故事:我正在对 TableView 应用过滤器。 这是一个简单的“查找包含此字符串的行”过滤器。

要求:我希望突出显示搜索词出现的实例。

到目前为止,我看不出有什么办法可以做到这一点。 ITableColorProvider 让我可以将颜色应用于整个单元格,但不能应用于其中的一小部分。

非常欢迎提供线索。

The backstory: I am applying a filter to a TableView. It's a simple 'find the rows with this string' filter.

The requirement: I wish to hilight instances of the search term where they occur.

Thus far I can see no means of doing this. ITableColorProvider let's me apply colours to entire cells, but not to a fraction of it.

Clues most welcome.

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

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

发布评论

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

评论(1

岁月无声 2024-07-19 23:07:18

看起来 highlighting 方法适合您,

因为 3.5M4,现有所有者绘制对 JFace TableViewer 和 TreeViewer 的支持已扩展为允许单元格内使用多种字体。 例如,这可用于使用粗体突出显示搜索结果中的匹配文本。

替代文本 http://update .eclipse.org/downloads/drops/S-3.5M4-200812111908/images/multi-font-labels.png

Looks like the highlighting method is for you

Since 3.5M4, the existing owner draw support for JFace TableViewer and TreeViewer has been extended to allow multiple fonts within cells. For example, this can be used to highlight matching text in search results using a bold font.

alt text http://update.eclipse.org/downloads/drops/S-3.5M4-200812111908/images/multi-font-labels.png

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