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

Bug 312171

Summary: TVT36:TCT186: TVT_KOR: Truncation on button
Product: [Tools] Target Management Reporter: CDE Administration <cdeadmin>
Component: RSEAssignee: Xuan Chen <xuanchen>
Status: CLOSED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: camle, kitlo, pwebster, susan, xuanchen
Version: 3.2   
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
14.000.280.png
none
186_14.000.280.gif none

Description CDE Administration CLA 2010-05-08 17:46:18 EDT
<response_by> MiJung Cho at 2010.05.07.00.59.51 </response_by>
Description:
NLS Build Label: 20100506-1500
Language: Korean
Must-Fix: Yes

Problem description:
"Deselect all(D)" string on button is truncated.
----------------
Procedure:
In the Remote Systems view, expand the TestConnection node and Right-Click Files
Select New > Filter
Select the Subset by file types radio button
Click Select...
Verify the dialog. The list of file types may differ from what is shown below
Click Cancel

Thanks
MJ

<response_by> rewagner at 2010.05.08.16.22.16 </response_by>
This article was reassigned from Category:''TVT/Testing,Inbox''.

<response_by> rewagner at 2010.05.08.16.22.53 </response_by>
I have been able to reproduce this bug on Win 7, but not Win XP.  It has to do with the font size again I believe.  But the size of the button should be fixed.

Thanks,
Ross
Comment 1 CDE Administration CLA 2010-05-08 17:46:23 EDT
Created attachment 167615 [details]
14.000.280.png
Comment 2 CDE Administration CLA 2010-05-08 17:46:26 EDT
<cde:tctdetail>
Testcase: 14.000.280
Project: WSW36
Component: Xfer - Target Management/RSE
Priority: 2
Subject: TVT_KOR: Truncation on button
Article ID: 186
Originator: mjcho@kr.ibm.com
</cde:tctdetail>
Comment 3 CDE Administration CLA 2010-05-10 04:20:30 EDT
<response_by> Keiko Terada at 2010.05.10.03.08.41 </response_by>
same problem for Japanese
Comment 4 CDE Administration CLA 2010-05-10 04:20:32 EDT
Created attachment 167666 [details]
186_14.000.280.gif
Comment 5 Xuan Chen CLA 2010-05-11 14:03:14 EDT
This is not a TVT problem (no need to change the PII file). We will fix it in service pack of RSE 3.2.
Comment 6 Kit Lo CLA 2010-05-11 15:11:37 EDT
Xuan, do you think this is similar to bug 311940, where the dialog page is calling setButtonLayoutData before it sets up the proper font in the buttons?
Comment 7 Xuan Chen CLA 2010-05-11 15:53:27 EDT
Yeah, it looks like the same problem.  Thanks.
Comment 8 Xuan Chen CLA 2010-05-11 17:19:20 EDT
Actually, I took a look at our code, and it seems we already used the suggestion that Susan made in bug 311940.

This is our code:

Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, 
		                                     SystemResources.RESID_SELECTFILES_DESELECTALL_BUTTON_ROOT_LABEL, false); 

And this is the method createButton in Dialog:

protected Button createButton(Composite parent, int id, String label,
			boolean defaultButton) {
		// increment the number of columns in the button bar
		((GridLayout) parent.getLayout()).numColumns++;
		Button button = new Button(parent, SWT.PUSH);
		button.setText(label);
		button.setFont(JFaceResources.getDialogFont());
		button.setData(new Integer(id));
		button.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent event) {
				buttonPressed(((Integer) event.widget.getData()).intValue());
			}
		});
		if (defaultButton) {
			Shell shell = parent.getShell();
			if (shell != null) {
				shell.setDefaultButton(button);
			}
		}
		buttons.put(new Integer(id), button);
		setButtonLayoutData(button);
		return button;
	}

As you can see, it calls:
button.setFont(JFaceResources.getDialogFont());
first, and then calls:
setButtonLayoutData(button);

But we still have the truncation problem for Korean.

If I change to code to:

Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, 
                "really really really long name", false);

I can see the button re-size properly to display the long English name.
Comment 9 Susan McCourt CLA 2010-05-11 18:16:55 EDT
(In reply to comment #8)
> 
> But we still have the truncation problem for Korean.
> 
> If I change to code to:
> 
> Button deselectButton = createButton(buttonComposite,
> IDialogConstants.DESELECT_ALL_ID, 
>                 "really really really long name", false);
> 
> I can see the button re-size properly to display the long English name.

So you are saying a Korean label is truncated and an English label is not?  Or is the timing of setting the label different?  If it is happening with Korean strings and not English strings, then maybe the font itself has a problem.  You might try changing the dialog font in the Eclipse preferences and see if it seems to be related to a particular font.
Comment 10 Xuan Chen CLA 2010-05-14 10:58:07 EDT
Susan,

I posted some comments regarding to the font of this problem in bug 311940:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=311940#c22

For Korean, I tried several different fonts, and they all have problems.

Right now, the only way I have to workaround this problem is to manually resize the button by adding the following code:

                GridData buttonData = (GridData)deselectButton.getLayoutData();
		buttonData.widthHint = buttonData.widthHint * 130 / 100;

Please comment.  Thanks.
Comment 11 Xuan Chen CLA 2010-05-18 16:28:31 EDT
I will check in the workaround I proposed.  Thanks.
Comment 12 Martin Oberhuber CLA 2010-05-20 00:49:53 EDT
A checkin has been made on Tue 18-May:

[dsdp-tm-cvs-commit] xchenorg.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogsSystemSelectFileTypesDialog.java

Please adjust the bugzilla state if this is considered fixed.
Also, since we are in TM endgame mode, please attach a patch for every change being committed such that your fellow committers can review.
Comment 13 Xuan Chen CLA 2010-05-20 13:58:31 EDT
This problem is fixed.
Comment 14 CDE Administration CLA 2010-05-24 01:20:27 EDT
<response_by> Keiko Terada at 2010.05.24.00.19.40 </response_by>
Verified fix for JA in 20100522-1600, thanks.
Comment 15 CDE Administration CLA 2010-05-27 05:20:55 EDT
<response_by> MiJung Cho at 2010.05.27.04.11.03 </response_by>
Hello,

It is fixed for korean in 20100522 build

Thanks
MJ