| Summary: | Mail Template, label "From:" is shown as "Fro" | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Wenbin Liu <liuwenbin168> | ||||||
| Component: | UI | Assignee: | Curtis Windatt <curtis.windatt.public> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | curtis.windatt.public, liuwenbin168 | ||||||
| Version: | 4.2.2 | Keywords: | helpwanted | ||||||
| Target Milestone: | 4.4 M1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Couldn't reproduce in Win7. The template code doesn't set any layout data on the labels and they are set to wrap so there could be some bad behaviour there. Can you try changing some of the code in View.java where the label is created (line 51). Setting a GridData layout data on it might help. If you find a code pattern that fixes it, please post it here. I will test it and incorporate it into the template code. Created attachment 232122 [details]
View.java and From.png
I added some code to View.java, and it seems that the trick is on "SWT.WRAP".
(In reply to comment #2) > Created attachment 232122 [details] > View.java and From.png > > I added some code to View.java, and it seems that the trick is on "SWT.WRAP". Hi Curtis, It works well on my Win7 too. I can only reproduce it on Linux, again mine is CentOS 5.7 32bit, and another issue OS I tested is Redhat 5.7 64 bit. By now, the trick is on "SWT.WRAP". **** Button t = new Button(banner, SWT.NONE); // This shows correctly "From" t.setText("From"); t.setFont(boldFont); t = new Button(banner, SWT.WRAP); // This shows incorrectly "Fro" t.setText("From"); t.setFont(boldFont); **** And I tried: **** Button t = new Button(banner, SWT.WRAP); t.setText("fFrom"); // This shows correctly "fFrom" t.setFont(boldFont); t = new Button(banner, SWT.WRAP); t.setText("frFrom"); // This shows incorrectly "frFro" t.setFont(boldFont); **** But, I still cannot figure out these two issues: 1. Why other labels (such as: "Subject:", "Date") work well? 2. It seems that if the text starts with "fr"(both lower and upper case can introduce this issue), incorrect cases occur. In my attachement "View.java and From.png", you can get the code above (from L63 to L77). If you run it you can get some similar result with the picture I attached. Thanks, Wenbin Fixed in master http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=e8a5e91f3e602ae6fb70436132d6c847b8ddfe16 The template should not use wrap labels without setting the layout data. There is no reason for the to/from/etc labels to be wrapping anyways. This fix corrects the template to only use wrapping labels for the contents and ensures they all have the correct layout data. Wenbin, if you want to test, you can either create a new template project in a build containing this fix, or simply copy the patched changes in View.java. If you are still having issues on Linux, we will need to create a small snippet to reproduce and send this bug to SWT. (In reply to comment #4) > > Wenbin, if you want to test, you can either create a new template project in > a build containing this fix, or simply copy the patched changes in > View.java. If you are still having issues on Linux, we will need to create > a small snippet to reproduce and send this bug to SWT. Hi Curtis, Thanks for the update. I fixed it by removing "SWT.WRAP" from my widget. Thanks, Wenbin |
Created attachment 231969 [details] "Fro" should be "From" Hi, My OS is CentOS 5.7, 32bit. I create a Plugin project with the Mail template. Run it, for the "From:" label, it shows: "Fro". See the attachment. Thanks, Wenbin