Fixed a bug in the mac os X installer's "Choose Location..." dialog which _only_ let you choose directories, which is problematic for e.g. netbeans. Now you can pick any app, which isn't right either, but the mac's deplorable java filechoosers are to blame for this. I can't fix it, tried everything. This will have to do.

This commit is contained in:
Reinier Zwitserloot committed 2010-07-25 01:29:19 +02:00
1 parent dec77abcca
commit 304f57bd05
1 file changed
+3 -3
@@ -313,20 +313,20 @@ public class InstallerGUI {
String file = null;
if (IdeFinder.getOS() == OS.MAC_OS_X) {
System.setProperty("apple.awt.fileDialogForDirectories", "true");
FileDialog chooser = new FileDialog(appWindow);
chooser.setMode(FileDialog.LOAD);
chooser.setFilenameFilter(new FilenameFilter() {
@Override public boolean accept(File dir, String fileName) {
for (Pattern exeName : exeNames) if (exeName.matcher(fileName).matches()) return true;
if (new File(dir, fileName).isDirectory()) return true;
return false;
}
});
chooser.setVisible(true);
file = new File(chooser.getDirectory(), chooser.getFile()).getAbsolutePath();
if (chooser.getDirectory() != null && chooser.getFile() != null) {
file = new File(chooser.getDirectory(), chooser.getFile()).getAbsolutePath();
}
} else {
JFileChooser chooser = new JFileChooser();