I am doing some skin work about RCP App. How can I ch开发者_Python百科ange a table header's color?
SWT Table is actually table GDI control of running OS. So you can't modify it's originalities. The Philosophy of SWT consider native experience very important, So we can't change original experience which is provided by OS.
If you want to customize table, You have to use Custom Widget which is not rendered by os, rendered by java itself. (subclasses of Canvas)
I think Grid widget which belongs to Nebula is best choice. It also support JFace layer. (likes TreeViewer, TableViewer) And it also support SWT.VIRTUAL. Nebula grid gives you option: Native Column Header | Custom Column Header Renderer
http://www.eclipse.org/nebula/widgets/grid/grid.php
This is now possible with Eclipse Oxygen (4.7)
final Color foreGround = new Color(Display.getDefault(), 0, 0, 0);
final Color backGround = new Color(Display.getDefault(), 0, 255, 255);
table.setHeaderBackground(backGround);
table.setHeaderForeground(foreGround);
精彩评论