You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SWT's support for showing arbitrary content in table cells is anemic. One might think that drawing arbitrary stuff on image and then returning it in LabelProvider.getImage() would work, but it doesn't, because SWT tries to make images in different column of the same size, i.e. whenever there're multiple images in a table (which is always the case in PP), it will scale everything down to 16x16.
Then owner-draw support is rather low-level. Whenever you register a paint listener, it gets called for each column in a table. We of course would like to wrap it a familiar interface, where there's e.g. OwnerDrawLabelProvider.paint() which gets called just for our column.
I first implemented that as a kind of mixin - interface with hidden inner class to track state. But I initially implemented it using PP's Column class, which of course doesn't work, TableColumn is what should be tracked. But TableColumn is not known at the time label provider is specified (normally Column subclass constructor), it gets assigned later.
In #4224 I describe ColumnWithOptionLabelProvider, which is already set up to capture TableColumn associated with a label provider. And it seems, it's also just what we need to support owner draw either! Then I'm going to drop that dichotomy of ColumnWithOptionLabelProvider vs OwnerDraw interface, and just merge everything into one class. Which then should be named different than ColumnWithOptionLabelProvider.
Don't have a sticky name just yet, but ParameterizableColumnLabelProvider might work.
The text was updated successfully, but these errors were encountered:
Yeah, it's much clearer and concise this way. ParameterizableColumnLabelProvider be it. Updated #4225 with it (new name; functionality of course to be added step by step).
SWT's support for showing arbitrary content in table cells is anemic. One might think that drawing arbitrary stuff on image and then returning it in LabelProvider.getImage() would work, but it doesn't, because SWT tries to make images in different column of the same size, i.e. whenever there're multiple images in a table (which is always the case in PP), it will scale everything down to 16x16.
Then owner-draw support is rather low-level. Whenever you register a paint listener, it gets called for each column in a table. We of course would like to wrap it a familiar interface, where there's e.g. OwnerDrawLabelProvider.paint() which gets called just for our column.
I first implemented that as a kind of mixin - interface with hidden inner class to track state. But I initially implemented it using PP's Column class, which of course doesn't work, TableColumn is what should be tracked. But TableColumn is not known at the time label provider is specified (normally Column subclass constructor), it gets assigned later.
In #4224 I describe ColumnWithOptionLabelProvider, which is already set up to capture TableColumn associated with a label provider. And it seems, it's also just what we need to support owner draw either! Then I'm going to drop that dichotomy of ColumnWithOptionLabelProvider vs OwnerDraw interface, and just merge everything into one class. Which then should be named different than ColumnWithOptionLabelProvider.
Don't have a sticky name just yet, but ParameterizableColumnLabelProvider might work.
The text was updated successfully, but these errors were encountered: