如何更改jface表的背景选择颜色 [英] How do I change the background selection color for a jface table
本文介绍了如何更改jface表的背景选择颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在elipse-rcp应用程序中,我在jface表中为行设置背景颜色,但我不希望选择更改此颜色。我希望能够为所选行指定颜色更改。
In a elipse-rcp application I am setting the background color for a row in a jface table but I don't want the selection to change this color. I want to be able to specify the color change for a selected row.
推荐答案
根据此主题, JFace Viewers
( ListViewer
,表
,树
)通过使用 EraseItem
和 MeasureItem
事件
According to this thread, for JFace Viewers
(ListViewer
, Table
, Tree
) by means of using EraseItem
and MeasureItem
events
详细的一般原则文章自定义绘图表和树项目
SWT.EraseItem
:允许客户自定义绘制单元格的背景和/或选择,并影响是否应该绘制单元格的前景
SWT.EraseItem
: allows a client to custom draw a cell's background and/or selection, and to influence whether the cell's foreground should be drawn
这篇关于如何更改jface表的背景选择颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文