Community
Participate
Working Groups
The JFace Viewer APIs assume that individual Item subclasses can have distinct Foreground, Background, and Font settings. For full parity with the Table, Tree, and Grid APIs, Gallery should also support item-level configuration of these properties.
Fixed on CVS. Note that it' up to the renderer to make use of these properties. The current renderers do not use them ATM. Thanks for reporting this
The new properties do not check arguments or trigger a redraw.
Created attachment 84765 [details] Fix for item-specific rendering properties GalleryItem now triggers a redraw when a rendering property is changed, following the model of TableItem. DefaultGalleryItemRenderer now uses these properties or defaults to the Gallery values if they are null. I also included some fixes for rendering in Gallery itself. A test snippet will be forthcoming in the latest version of the GalleryTreeViewer patch.
I've just noticed that none of the other properties of GalleryItem causes a redraw, as they should. Although the base Item class does not explicitly redraw, TableItem and TreeItem both do. I'm not sure if this fits here or should be another bug. Since this is tied in with the fix for this bug, I'll update my patch here.
Created attachment 84905 [details] Updated rendering patch The GalleryItem text, image, and description setters call redraw(GalleryItem), and the expanded setter calls updateStructuralValues(false) and then a full redraw().
There are some issues with your new background color management : - Redraw problems on mac (Some black lines appear when you scroll the gallery viewer on mac) - The gallery no longer draw the background on mac. Additionally, you let the item renderer fill the background, and this will prevent group renderers to draw a custom background (gradient or image). If TableItem or TreeItem redraw their parent on property change, GalleryItem should do it. But I'd rather redraw only the item and not the full table. Since my subnet is no longer blacklisted by dev.eclipse, I can start working on this too :-)
I agree with all of your comments. Unfortunately, I only tested with Windows XP so far, so platform-specific bugs are likely. I have access to Mac OS X 10.4 and 10.5 and Fedora 7, but not Vista. It will take time for me to try them all, though. In my patch, only setExpanded() will cause a full redraw. I think it is necessary in that case, since the layout needs to be fully recomputed. Other properties call the redraw(GalleryItem) method, which should only affect the one item that has changed. I implemented that method myself, so it is not well tested yet. I see your point about the GalleryItem background color. I suppose that it should only fill the background when a color has been set, and otherwise allow the background to remain unmodified. I was also making an incorrect assumption that the Gallery would be completely filled by GalleryItems, but I see now that there may be gaps between them. You can simply restore the old code that filled the entire background before drawing the items.
Fixed in CVS. Thanks for the patch.
Created attachment 87572 [details] Refresh GalleryItem when setters are called. These changes were included in the last patch, but they got lost in the shuffle. This patch is against the current HEAD 1.10 version of GalleryItem.
Please apply the latest patch before closing this again.
Fixed in CVS
Closing