Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340268

Summary: [Import/Export] Button label truncation on Import/Export Preferences dialogs
Product: [Eclipse Project] Platform Reporter: Kit Lo <kitlo>
Component: IDEAssignee: Prakash Rangaraj <prakash>
Status: VERIFIED FIXED QA Contact: Prakash Rangaraj <prakash>
Severity: normal    
Priority: P3 CC: daniel_megert, prakash
Version: 3.7   
Target Milestone: 3.7 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 344453, 440093    
Attachments:
Description Flags
Import Preferences
none
Export Preferences
none
Patch v01 none

Description Kit Lo CLA 2011-03-17 00:45:32 EDT
Created attachment 191375 [details]
Import Preferences

Button label truncation on Import/Export Preferences dialogs

If you replace the "Select All" & "Deselect All" button labels with some longer translations, you can see that they are truncated.
Comment 1 Kit Lo CLA 2011-03-17 00:47:01 EDT
Created attachment 191376 [details]
Export Preferences
Comment 2 Prakash Rangaraj CLA 2011-03-23 07:22:32 EDT
In the screenshots the text of all the controls are appended with G[ and ends with ] How did you get to this state?
Comment 3 Kit Lo CLA 2011-03-23 07:42:08 EDT
I generated and used some "pseudo translation language packs". You probably can see the same problem if you replace "Deselect All" with "D e s e l e c t  A l l"
Comment 4 Prakash Rangaraj CLA 2011-03-24 03:18:00 EDT
Created attachment 191808 [details]
Patch v01
Comment 5 Prakash Rangaraj CLA 2011-03-24 03:18:55 EDT
Patch v01 released to HEAD
Comment 6 Dani Megert CLA 2011-03-28 05:00:19 EDT
Prakash, why did you inline the button creation code and leave the createButton(...) unused, given this is internal code?
Comment 7 Prakash Rangaraj CLA 2011-03-28 07:48:17 EDT
(In reply to comment #6)
> Prakash, why did you inline the button creation code and leave the
> createButton(...) unused, given this is internal code?

      Its not exactly inlining the code. The createButton() method first calls the setButtonLayoutData() and  then calls setText(). So the widthHint is not correctly set. The new code will setText() first and then call setButtonLayoutData(). I didn't want to change this logic in createButton() (or remove it), as I was not sure of whether its been used any clients above and its too late in the cycle to break them.
Comment 8 Dani Megert CLA 2011-03-28 07:53:52 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > Prakash, why did you inline the button creation code and leave the
> > createButton(...) unused, given this is internal code?
> 
>       Its not exactly inlining the code.
Yep, I saw that, but it's adding code duplication for which createButton(...) had been added to avoid this.

>I didn't want to change this logic in createButton() 
Is the current behavior of it useful or would they also suffer from the bug? Given it's an internal class a fix in there seems more appropriate.
Comment 9 Prakash Rangaraj CLA 2011-04-26 10:36:54 EDT
Verified in I20110425-1800
Comment 10 Dani Megert CLA 2011-05-02 09:28:39 EDT
My argument is that the current createButton(...) method can't work for anyone. If people worked around that bug by resizing/layouting after calling that method then their code would still work even after fixing the code in said method.

I've created a follow-up bug to clean this up during 3.8 (bug 344453).