如何将TableView单元格的一部分作为过滤过程的一部分?

时间:2022-03-25 00:45:48

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

背景故事:我正在将一个过滤器应用于TableView。这是一个简单的'找到带有这个字符串的行'过滤器。

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.

到目前为止,我看不到这样做的方法。 ITableColorProvider让我为整个单元格应用颜色,但不是它的一小部分。

Clues most welcome.

最受欢迎的线索。

1 个解决方案

#1


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.

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

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

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

#1


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.

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

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

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