I have a TableViewer and like to have a graphics on one column. How can I do this?
What is NOT working is:
I tried the TableEditor with a Canvas, snippet:
MyCanvas canvas = new MyCanvas (tableViewer.getTable(), SWT.NONE, (MyClass)item.getData());
with MyCanvas having a PaintListener doing the drawing job.
It worked drawing on the table cell, but when the tableViewer was filtered, the graphics column - and only this - stayed unfiltered: Lets say the table had 100 lines and the filter matched 80 lines, the result was 80 lines with data but 100 lines with the Canvas, so also 20 lines where nothing else but the Canvas was shown.
I suppose the problem comes from having the TableEditor on the table rather than on the TableViewer. I found out that there is TableViewer.setCellEditors() but I cannot figure out how I could use it to write to a cell´s (column) canvas.
Maybe there is even another possibility using no editors to get the canvas of a (filtered!) table cell. Many thanks for any solution hint.
OwnerDrawLabelProvideras the column label provider. This lets you draw the column yourself directly. - greg-449