开发者

how to change TableViewer headers's background in RCP App

开发者 https://www.devze.com 2023-03-10 08:34 出处:网络
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

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

精彩评论

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

关注公众号