Bug 414292 - [Viewers] StyledCellLabelProvider makes item width too small (1 or 2 pixels)
Summary: [Viewers] StyledCellLabelProvider makes item width too small (1 or 2 pixels)
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted, triaged
Depends on:
Blocks:
 
Reported: 2013-08-02 07:21 EDT by Andrei Diaconu CLA
Modified: 2021-05-27 00:35 EDT (History)
9 users (show)

See Also:


Attachments
Text clipping and graphical glitch snippet (3.35 KB, text/plain)
2018-08-07 16:08 EDT, Matthew Janssen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Diaconu CLA 2013-08-02 07:21:23 EDT
To reproduce, the the JFace tree viewer snippet from http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet002TreeViewer.java and change the label provider to:

new StyledCellLabelProvider() {
	@Override
	public void update(ViewerCell cell) {
		cell.setText(cell.getElement().toString());
	}
}

The item with the longest text will be cut off 1 or 2 pixels. Depending on the last character, even small parts missing are very visible. For example, 'r' looks like 'i'.
Comment 1 Ingo Mohr CLA 2017-07-10 11:03:41 EDT
This bug still exists with Oxygen 4.7.0 as released in June 2017.
Comment 2 Matthew Janssen CLA 2018-08-07 16:08:47 EDT
Created attachment 275307 [details]
Text clipping and graphical glitch snippet

I also am able to reproduce the issue documented using the latest jface release. This additional snippet I have attached further demonstrates the issue and even shows a larger graphical glitch. If you run the snippet and resize the first column (make it smaller and then larger) you will see that the text gets all garbled. Moving the mouse over the row (so it's highlighted) causes the cell to redraw and the graphical oddities are fixed. I have confirmed these issues on Windows 7 and Windows 10.

During my investigations I have reason to believe that this bug was introduced with the patch supplied for this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=291245
Comment 3 Andrey Loskutov CLA 2018-08-07 16:11:47 EDT
Matthew, do you have a patch in mind? https://wiki.eclipse.org/Platform_UI/How_to_Contribute
Comment 4 Matthew Janssen CLA 2018-08-07 16:17:08 EDT
(In reply to Andrey Loskutov from comment #3)
> Matthew, do you have a patch in mind?
> https://wiki.eclipse.org/Platform_UI/How_to_Contribute

At this point in time, I do not. I will need to do a little more investigating to determine the exact cause of the bug and try some workarounds. However, I'm also not exactly sure if I will have some time to do that. Right now we may just downgrade the version of jface we are using as a temporary workaround.
Comment 5 Eclipse Genie CLA 2018-08-20 09:53:09 EDT
New Gerrit change created: https://git.eclipse.org/r/127713
Comment 6 Missing name CLA 2019-06-06 07:21:58 EDT
I am also experiencing this issue when I implemented the StyledCellLabelProvider#update method.  Will this issue be fixed anytime soon?
Comment 7 Dani Megert CLA 2019-06-06 08:20:18 EDT
(In reply to Missing name from comment #6)
> I am also experiencing this issue when I implemented the
> StyledCellLabelProvider#update method.  Will this issue be fixed anytime
> soon?
Only if someone provides a Gerrit change.
Comment 8 Eclipse Genie CLA 2021-05-27 00:35:49 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.