Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312861 - Suse11 and zh locale--Width of MessageDialog always reaches the maximum of screen width
Summary: Suse11 and zh locale--Width of MessageDialog always reaches the maximum of sc...
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact: Bogdan Gheorghe CLA
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2010-05-14 02:07 EDT by yanghang CLA
Modified: 2018-06-15 14:59 EDT (History)
5 users (show)

See Also:


Attachments
locale result to confirm your setting is correct (14.90 KB, image/jpeg)
2010-05-14 02:09 EDT, yanghang CLA
no flags Details
the result when click button (27.42 KB, image/jpeg)
2010-05-14 02:16 EDT, yanghang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description yanghang CLA 2010-05-14 02:07:43 EDT
Build Identifier: 

My sample code is below:
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class MessageDialogTest extends Shell {

	/**
	 * Launch the application
	 * @param args
	 */
	public static void main(String args[]) {
		try {
			Display display = Display.getDefault();
			MessageDialogTest shell = new MessageDialogTest(display,
					SWT.SHELL_TRIM);
			shell.open();
			shell.layout();
			while (!shell.isDisposed()) {
				if (!display.readAndDispatch())
					display.sleep();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the shell
	 * @param display
	 * @param style
	 */
	public MessageDialogTest(Display display, int style) {
		super(display, style);
		createContents();
	}

	/**
	 * Create contents of the window
	 */
	protected void createContents() {
		setText("SWT Application");
		setSize(500, 375);

		final Button button = new Button(this, SWT.NONE);
		button.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent arg0) {
				String[] buttonString = {IDialogConstants.OK_LABEL,IDialogConstants.CANCEL_LABEL};
				
				MessageDialog md = new MessageDialog(MessageDialogTest.this, "remove", null, "message dialog T" +
						"", MessageDialog.QUESTION, buttonString, 1);
				int doSend = md.open();
			}
		});
		button.setText("button");
		button.setBounds(22, 143, 48, 26);
		//
	}

	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}

}



when click the button, will pop up message Dialog, the width reaches the maximum of screen width

Reproducible: Always

Steps to Reproduce:
1. create test.jar with the code
2.in terminal, input cmd below
a:) input 
export LC_ALL=zh_CN 
to setting locale
b:) input 
locale 
to confirm you setting is correct
c:) input 
java -jar test.jar , and click the button
Comment 1 yanghang CLA 2010-05-14 02:09:24 EDT
Created attachment 168504 [details]
locale result to confirm your setting is correct
Comment 2 yanghang CLA 2010-05-14 02:16:22 EDT
Created attachment 168506 [details]
the result when click button
Comment 3 Silenio Quarti CLA 2010-06-10 10:57:14 EDT
Bogdan, please investigate once E4 is out.
Comment 4 Eric Williams CLA 2018-06-15 14:59:52 EDT
Suse11 is no longer a supported platform.