background image not showing in column header [message #1817615] |
Tue, 26 November 2019 11:20  |
Eclipse User |
|
|
|
In Sample original _4222_CellPainterExample.java , used background image and TextPainter like below:
private void registerColumnHeaderStyle(IConfigRegistry configRegistry) {
Image bgImage = GUIHelper.getImageByURL("columnHeaderBg",
getClass().getResource("/org/eclipse/nebula/widgets/nattable/examples/resources/column_header_bg.png"));
Image selectedBgImage = GUIHelper.getImageByURL("selectedColumnHeaderBg",
getClass().getResource("/org/eclipse/nebula/widgets/nattable/examples/resources/selected_column_header_bg.png"));
TextPainter txtPainter = new TextPainter(false, false);
ICellPainter bgImagePainter =
new BackgroundImagePainter(txtPainter, bgImage, GUIHelper.getColor(192, 192, 192));
The column headers are not displayed completely (see the figure orig.png).
So to add space if we change TextPainter txtPainter = new TextPainter(false, false); to
TextPainter txtPainter = new TextPainter(false, true, 1, true);
The background image is not showing in column header. please see custom.png.
can you please suggest how to use background image in row header and columnheader so that image shows properly in header and and space in columnheader.
Attachment: orig.PNG
(Size: 72.94KB, Downloaded 109 times)
Attachment: custom.PNG
(Size: 92.21KB, Downloaded 118 times)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03330 seconds