Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 39463 - [JFace] Truncated strings are displayed in the SWT Combo
Summary: [JFace] Truncated strings are displayed in the SWT Combo
Status: CLOSED DUPLICATE of bug 89378
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-30 01:52 EDT by Yoshio Horiuchi CLA
Modified: 2006-11-23 23:27 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yoshio Horiuchi CLA 2003-06-30 01:52:57 EDT
When creating a SWT Combo and setting item list by setItems(), the Combo should
have suitable width to show all the items.
But in my following testcase, the created combo has a bit smaller width than 
expected.

    Combo combo = new Combo(root, SWT.READ_ONLY);
    String[] items = {
	"item 1",
	"item 2",
	"very long item"
    };
    combo.setItems(items);

If I select 3rd item ("very long item"), the last character "m" is shown 
partially.

It causes a usability problem, especially in Double-byte (ex. Taiwan) locale. 
The half of the double-byte character is not shown.

This problem is common in the Workbench.  
For example, in the JAVA Compiler preference in the 2.1.1 latest build (eclipse-
SDK-RC2-win32.zip), there are Combos which have items, "Error", "Warning" 
and "Ignore", and the "Warning"s are truncated.
Comment 1 Steve Northover CLA 2003-07-08 10:30:22 EDT
The SWT part seems to be working.  Here is a snippet.  Can you run this and 
confirm it fails on your machine?  In the mean time, I'm going to move this PR 
to JFace.  Thanks.

Here is the code that WORKSFORME.

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;

public class PR_39463 {

public static void main (String [] args) {
	Display display = new Display ();
	Shell shell = new Shell (display);
	Combo combo = new Combo(shell, SWT.READ_ONLY);
	    String[] items = {
		"item 1",
		"item 2",
		"very long item"
	    };
    combo.setItems(items);
    combo.pack ();
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
}
Comment 2 Yoshio Horiuchi CLA 2003-07-08 22:35:09 EDT
Steve, it doesn't seem that your sample works well.
I got the 2.1.1 latest build (eclipse-SDK-2.1.1-win32.zip) and tested your
sample with it... I still find a truncated string when the 3rd item is selected.
Comment 3 Nick Edgar CLA 2003-07-11 16:40:46 EDT
Back to SWT...
Comment 4 Steve Northover CLA 2003-07-18 18:55:08 EDT
Not sure what to do.  I will get FH to try this on Taiwan Windows.  FH?
Comment 5 Felipe Heidrich CLA 2003-07-21 11:54:47 EDT
Works fine for me on (English) Windows XP. Eclipse 3.0 M2.
Yoshio, does it only fails on double-byte platform ? 
Comment 6 Yoshio Horiuchi CLA 2003-07-21 21:13:55 EDT
Felipe, the problem occurs in both Single-byte and Double-byte locale.
The version of eclipse is 2.1.1.
Comment 7 Felipe Heidrich CLA 2003-07-22 10:29:41 EDT
Could you verify if the problem happens in HEAD stream, Eclipse 3.0 M2 for 
example ?
Comment 8 Yoshio Horiuchi CLA 2003-07-23 08:45:41 EDT
The problem still occurs in the latest Stable Build (eclipse-SDK-3.0M2-
win32.zip).
Comment 9 Terri Lafoon CLA 2003-09-03 18:15:32 EDT
We have also hit this testing our HATS plugin on WSSD V5.1: 

The jface wizard truncates based on screen size, also takes
the space consumed by the windows task bar into account.
The wizard should not truncate the content just because it wont
fit on the screen without scrolling off.

Any update?
Comment 10 Terri Lafoon CLA 2003-10-28 18:46:51 EST
Any new inforamtion of this problem?   We are currently using WSSD V5.1 (with 
Eclipse 2.1.1) and need to understand if there is a fixpack level that we might 
be able to reference.. 
Comment 11 Felipe Heidrich CLA 2003-10-29 10:52:22 EST
Which version of Windows are you running ?
I can't reproduce the problem with the Combo widget. Regarding to your 
comments about jface wizard I can't help cause I really don't know JFace.


Comment 12 Felipe Heidrich CLA 2005-06-14 12:39:31 EDT

*** This bug has been marked as a duplicate of 89378 ***
Comment 13 Yoshio Horiuchi CLA 2006-11-23 23:27:59 EST
Verified: Eclipse SDK 3.2.1 M20060921-0945