I am developing an application using JFace on Eclipse 3.6 and I would like to have actual widgets - mostly checkboxes and buttons - in a TableViewer. Everything I have found seems to suggest that this is not possible at the moment.
My current workaround involves having a MouseListener for the wrapped Table control, where the mouseDown event coordinates are translated to cells using the getCell() method and acted upon. I then use the content provider to supply images and formatted text that somewhat approach the look of the respective widgets.
The problem is that the result is not native-looking at all. There are some workarounds involving taking screenshots of the actual native widgets, but this has a few problems:
- It's a hack
- The captured widgets ocassionally become visible, creating a flickering artifact on the screen
- It requires image handling tricks to make the captured image blend with the table colours
- It does not scale well when e.g. buttons with different contents are required
Is there a way to embed widgets in TableViewer cells without using such cumbersome methods? The underlying SWT Table can certainly do that, but the TableViewer interface does not seem to support this...