Community
Participate
Working Groups
The list viewer imposes a requirement that all of the text displayed has to be in one font. I've just been through the process of constructing a Viewer subclass that, as much as possible, behaves just like the list viewer, but displays a list of more complex items. In this case, the items are several text controls so text can be in more than one font. I ended up duplicating a lot of the contents of the ListViewer and even the AbstractListViewer, and I'm still not completely satisfied with my product. On Win32, there's a concept of 'owner draw' that allows an app to get all the structural functionality of a complex control while still owning the painting process. I don't even need that; I just need a ListViewer-y thing that is modelled as a list of Composites into which I create whatever children I care to. Obviously, there is no concept of a label provider here in the 'return a string' sense, but there could still be a separate interface for taking an object from the model and setting up the appropriate current content of the controls within a list item.
As far as I understand, SWT will not implement owner-draw capabilities in the forseeable future. You might want to have a look at KTable (on sourceforge I think) or CompositeTable (check out org.eclipse.jface.examples.databinding from CVS). Note that CompositeTable is not part of JFace.
I understand that a full-blown owner draw architecture would be a massive undertaking. However, I submit that a fairly painless refactoring would allow viewers with a richer control environment. Thanks for the pointer; I have separate needs for a tabular control that isn't handicapped by the SWT table's dependence on the Windows List Control, which isn't really a table.
*** This bug has been marked as a duplicate of bug 188333 ***