Community
Participate
Working Groups
Created attachment 285478 [details] Modified SWT Snippet to reproduce problem Labels for the longest/widest node in an SWT Tree seem to get routinely truncated under certain circumstances, on OSX. See the attached code snippet, which is just a slightly tweaked version of Snippet15 from the SWT code samples on the website. The problem actually reproduces fine with the unmodified snippet, but it's a bit easier to see what's going on with this tweak, which makes the width of the node a crude function of its hierarchical position within the tree. What I think is happening is that when the tree items are expanded/collapsed, the code recomputes the size of the tree but fails to take into account some kind of padding or possibly uses the wrong font metrics. When the tree is rendered, most of it is fine but there is just not *quite* enough space for the widest part of the tree, and is shown truncated (e.g. ABCDE12345 is shown as ABCDE12...). If you expand the tree a little more, then what was previously truncated is now rendered fine, but the new widest node is now truncated. It doesn't seem to happen all the time - plenty of trees in Eclipse render fine, but it's occurring in some code in the plugin I'm maintaining and I have been unable to shed any light on what triggers it and why. I tried implementing the JFaces label provider approach but it made no difference. As it reproduces easily with a simple code snippet, I'm hoping someone can give a fix or a hint as to a workaround!
Created attachment 285479 [details] Screenshot of Collapsed Tree
Created attachment 285480 [details] Screenshot after expand first node
Thanks for the details. This is caused by some change in BigSur, needs more investigation. *** This bug has been marked as a duplicate of bug 568383 ***
(In reply to Lakshmi P Shanmugam from comment #3) > Thanks for the details. This is caused by some change in BigSur, needs more > investigation. Thanks for the prompt response. I'll monitor the original report. If it only affects Big Sur and only child debug sessions then it's very liveable-with. Ahmed