作为过滤过程的一部分,如何突出显示 TableView 单元格的一部分?
背景故事:我正在对 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来
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 youSince 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