Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324056 - focusLost of Text object does not work properly
Summary: focusLost of Text object does not work properly
Status: CLOSED DUPLICATE of bug 318830
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-31 02:52 EDT by Thilo Brandt CLA
Modified: 2010-09-01 14:22 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thilo Brandt CLA 2010-08-31 02:52:50 EDT
Build Identifier: 20100617-1415

The following coding works fine on Windows and Linux, but causes Problem with Mac OS X 10.6 with Cocoa 64-bit libraries:  

final Text number = new Text(phoneGroup, SWT.BORDER);
number.setText("+49 1234 567890");

number.addFocusListener(new FocusAdapter() {
		public void focusGained(org.eclipse.swt.events.FocusEvent e) {
			number.selectAll();
		}

		public void focusLost(org.eclipse.swt.events.FocusEvent e) {
			// check the number input
			if (number.getText().trim().length() == 0){
				return;
			}
			Formatter f = Formatter.getInstance();
                        number.setText(f.format(number.getText()));
              }
});

On Mac OS X the call number.setText(...) within the focusLost Method has no effect on the rendering of the Text object.


Reproducible: Always

Steps to Reproduce:
1. Execute the coding above on Mac OS X 10.6 with cocoa 64-bit SWT 3.6 libraries
2.
3.
Comment 1 Scott Kovatch CLA 2010-09-01 14:22:12 EDT
This is bug 318830.

*** This bug has been marked as a duplicate of bug 318830 ***