Community
Participate
Working Groups
This code won't work for me. I want the user to be able to select either a file named "git" or one named "gitconfg" in whatever directory the user chooses, but the dialog does not enable selection of matching file names, they are greyed out and so is the Open button. FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN); fileDialog.setText("Select the system-wide configuration file, or the git-executable"); fileDialog.setFilterExtensions(new String[] { "gitconfig", "git" }); String file = fileDialog.open();
It is working as designed. FileDialog.setFilterExtensions() sets the filter for the file extensions and not for the filename. So, in your example it is using the names as extensions. Please see its javadoc for details.
WORKSFORME can't be true if the dialog does not work for this case by design. Any suggestion on how to solve this?