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

Bug 377019

Summary: Specific file name filter not working on Mac OS X
Product: [Eclipse Project] Platform Reporter: Peter Parapounsky <pjparapo>
Component: SWTAssignee: Lakshmi P Shanmugam <lshanmug>
Status: VERIFIED FIXED QA Contact: Lakshmi P Shanmugam <lshanmug>
Severity: normal    
Priority: P3 CC: pjparapo, Silenio_Quarti
Version: 4.2   
Target Milestone: 4.3 M3   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Peter Parapounsky CLA 2012-04-17 14:49:02 EDT
Build Identifier: 

Setting the file filter to a specific file name in the FileDialog doesn't allow selecting the file. For example, having a file named "test.txt" and setting the filter to "test.txt". On Windows or Linux you can select the file, but on Mac OS X the file dialog doesn't allow you to select it. Example code:

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

public class TestFileDialog {

	public static void main (String [] args) {
		Display display = new Display ();
		Shell shell = new Shell (display);
		shell.open ();
		FileDialog dialog = new FileDialog (shell, SWT.OPEN);
		dialog.setFilterExtensions (new String [] {"test.txt"});
		dialog.open();
		while (!shell.isDisposed ()) {
			if (!display.readAndDispatch ()) display.sleep ();
		}
		display.dispose ();
	}
}


Reproducible: Always
Comment 1 Sebastien Dubois CLA 2012-05-16 12:17:31 EDT
This problem has also been reported by our R4E MAC users.  See bug 364423 for moere information
Comment 2 Lakshmi P Shanmugam CLA 2012-10-11 07:25:26 EDT
Added check to match the filename with the filter.
Fixed in 4.3 master > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=d60ebbc0b5b9ce8a80e6d5bc426685845f8eea01
Comment 3 Lakshmi P Shanmugam CLA 2012-10-31 05:32:53 EDT
verified in I20121030-2000