Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313703 - Eclipse UI forms cuts off certain Section text under Red Hat Linux Enterprise 5.3
Summary: Eclipse UI forms cuts off certain Section text under Red Hat Linux Enterprise...
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2010-05-20 07:39 EDT by Ken CLA
Modified: 2018-04-13 16:39 EDT (History)
9 users (show)

See Also:


Attachments
Plugin.xml overview page in Eclipse with 'g' cut off in Testing (62.94 KB, image/png)
2010-05-20 07:43 EDT, Ken CLA
no flags Details
Plugin.xml runtime page in Eclipse with "later)" cut off in Package Visibility section (52.41 KB, image/png)
2010-05-20 07:44 EDT, Ken CLA
no flags Details
Patch to allocate extra space to the label (840 bytes, patch)
2010-06-01 17:33 EDT, Chris Goldthorpe CLA
no flags Details | Diff
Screenshot of bug in code which does not use UI forms. (153.65 KB, image/png)
2010-06-01 17:55 EDT, Chris Goldthorpe CLA
no flags Details
similar issue on RHEL 5.5 and SWT 3.7.1 GA (37.47 KB, image/png)
2011-10-10 22:50 EDT, Meng Xin Zhu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ken CLA 2010-05-20 07:39:07 EDT
Build Identifier: 20100218-1601

Using the Eclipse UI forms section, certain text will get cut off. For example, "Abc Test" just shows "Abc" and "Abc Variables" just shows "Abc". The "Abc" text is irrelevant. You can create your own form to test or use the org.eclipse.ui.forms.examples. I changed "Header Features" text in NewStylePage.java.

After more investigating, I found similar issues with Eclipse IDE itself. In the plugin.xml editor Overview tab Testing says "Testin". The Runtime tab also seems to have cut off section text.

I've testing my code on Ubuntu, Windows, and Mac without problems. I'm also seeing other odd behavior with Eclipse UI forms on Red Hat, but I'll leave that for other bug posts. 

Reproducible: Always

Steps to Reproduce:
1. Create Eclipse UI FormPage with a Section
2. Set Section text to "Abc Test"

Test is cut off when you run.
Comment 1 Ken CLA 2010-05-20 07:43:49 EDT
Created attachment 169316 [details]
Plugin.xml overview page in Eclipse with 'g' cut off in Testing
Comment 2 Ken CLA 2010-05-20 07:44:51 EDT
Created attachment 169317 [details]
Plugin.xml runtime page in Eclipse with "later)" cut off in Package Visibility section
Comment 3 Ken CLA 2010-05-20 08:32:56 EDT
I've just confirmed this is also an issue with 3.6, I20100513-1500.
Comment 4 Chris Goldthorpe CLA 2010-05-20 16:29:51 EDT
Did you see this problem in Eclipse 3.5 also? I will see if I can find a machine running red hat to test on, I have not see the problem on Ubuntu or Windows.
Comment 5 Ken CLA 2010-05-20 16:31:26 EDT
Yes, 3.5 and 3.6. Let me know if you need any other info. Thanks.
Comment 6 Chris Goldthorpe CLA 2010-05-20 16:48:51 EDT
This problem looks very similar to Bug 277268 which was fixed in Eclipse 3.5, I'm not sure why the problem you described is still happening even after that bug was fixed.
Comment 7 Ken CLA 2010-05-20 16:57:05 EDT
I also just test Eclipse 3.4.2 and it has the same problem as well.
Comment 8 Chris Goldthorpe CLA 2010-05-21 15:10:40 EDT
Copying Bogdan Gheorghe who has an RHEL 5 system.
Comment 9 Ken CLA 2010-05-21 15:57:12 EDT
Bug 277268 reference seemed to imply opening and closing the section would fix the text, but it does not for me. 

Also, if you change the word "Test" to "Aaaaa" it works fine. Seems like certain words cause the problem - Test and variables is what I've found. Very strange.
Comment 10 Chris Goldthorpe CLA 2010-05-21 17:28:01 EDT
The similarity with Bug 277268 is I think adding to the confusion, my guess is that this is a different bug but with the same symptom of not calculating the size correctly. I'm working on getting this tested on RHEL 5, until I can reproduce the problem I can't do too much.
Comment 11 Bogdan Gheorghe CLA 2010-05-21 17:29:55 EDT
I can see this on my RHEL5 with the I20100520-1744 build (and I confirmed that it was in a 3.5.2 build as well). Also Ubuntu 10.04 does not have this problem so it is likely a GTK-version problem (RHEL5 uses GTK 2.10, Ubuntu 10.04 uses GTK 2.18).
Comment 12 Ken CLA 2010-05-21 17:45:55 EDT
Ubuntu 9.1 works as well. Does that use GTK 2.18?
Comment 13 Chris Goldthorpe CLA 2010-05-24 20:00:49 EDT
I was able to reproduce the problem on a virtual machine running RHEL5 but I don't yet know why it would be happening
Comment 14 Chris Goldthorpe CLA 2010-06-01 13:57:51 EDT
Here is a snippet that will reproduce the problem, I used this in a project created with the plug-in with a view template. It seems that the width calculation is off by one.

public void createPartControl(Composite parent) {
		Composite inner = new Composite(parent, SWT.NULL);
		FormToolkit toolkit = new FormToolkit(parent.getDisplay());

		inner.setLayout(new GridLayout(1, false));
		Section section = toolkit.createSection(inner,
				ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE
						| ExpandableComposite.EXPANDED);
		Composite client = toolkit.createComposite(section);
		section.setClient(client);
		section.setText("Feature");
		
}
Comment 15 Chris Goldthorpe CLA 2010-06-01 17:33:52 EDT
Created attachment 170712 [details]
Patch to allocate extra space to the label

This is a patch which makes the problem go away by allocating 1 extra unit of width for the Label. I don't feel that I have got to the root of the problem yet but if anyone needs a workaround this patch should be safe.
Comment 16 Chris Goldthorpe CLA 2010-06-01 17:53:46 EDT
Reassigning to SWT

Here is a small snippet that reproduces the problem in a plug-in with a view. Note that I have only seen the failure on RHEL5, and the default font does not cause the problem to occur. 

	public void createPartControl(Composite parent) {
		Composite inner = new Composite(parent, SWT.NULL);
		inner.setLayout(new GridLayout(1, false));
		Label lab = new Label(inner, SWT.WRAP);
		lab.setText("Feature");
		lab.setFont(JFaceResources.getHeaderFont());
	}
Comment 17 Chris Goldthorpe CLA 2010-06-01 17:55:23 EDT
Created attachment 170714 [details]
Screenshot of bug in code which does not use UI forms.
Comment 18 Chris Goldthorpe CLA 2010-07-15 18:36:56 EDT
Can someone from SWT take a look at this bug - it seems that SWT.Label is where the problem originates.
Comment 19 Bogdan Gheorghe CLA 2010-08-24 17:48:38 EDT
I took a look at this today and it is definitely a bug in the Pango that comes with GTK 2.10. It got fixed in GTK 2.12 (and onwards). 

The bug shows up whenever you are using a label with a bold font that has the SWT.WRAP style bit set. I want to take a quick look at 3.4.2 as Ken mentioned he was seeing the problem there as well...
Comment 20 Meng Xin Zhu CLA 2011-10-10 22:50:10 EDT
Created attachment 204916 [details]
similar issue on RHEL 5.5 and SWT 3.7.1 GA

I used PDE Picasso to help investigate this issue. It looks like everything of Java Label instance works well. Both text value and width looks fine. The Label is created by FormToolkit with WRAP style, and uses normal font. However only part of string is shown by GTK.
Comment 21 Eric Williams CLA 2018-04-13 16:39:23 EDT
Old versions of GTK2 and SWT. Label has had many fixes for wrapping in the last years. Please file a new bug against 4.8 if the issue re-occurs.