开发者

how to change TableViewer headers's background in RCP App

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜