|
|
Re: How to work with custom painters in NatTable? [message #1091145 is a reply to message #1085694] |
Wed, 21 August 2013 05:14 |
Ali Malik Messages: 27 Registered: August 2013 |
Junior Member |
|
|
Hi Dirk,
What you are trying to say, I assume, is that I have two columns.
But I have only 1 column, and within that column some cells would be using ComboBox Painter, some would be using TextPainter.
I achieved my goal by using a custom painter. In the paintCell method I used the painters as required. Below is a code snippet:
@Override
public void paintCell(ILayerCell arg0, GC arg1, Rectangle arg2,
IConfigRegistry arg3) {
if(arg0.getRowIndex() % 2 == 0 ) {
textPainter.paintCell(arg0, arg1, arg2, arg3);
} else {
comboPainter.paintCell(arg0, arg1, arg2, arg3);
}
}
Where
comboPainter = new ComboBoxPainter();
textPainter = new TextPainter();
So in this snippet, according to the cell index it either paints it as a TextPainter, or a ComboBoxPainter.
Anyways, thanks for your help, Dirk
Regards,
Ali Ahmad Malik
|
|
|
|
Powered by
FUDForum. Page generated in 0.01518 seconds