diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-07-25 01:29:19 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-07-25 01:29:19 +0200 |
commit | 304f57bd05b6298be8feb0fc368845249f805798 (patch) | |
tree | 92a332cdffba9918d81862f3d16c5b0561e85a0b | |
parent | dec77abcca98da50e5678008be7e5f6a2d7bb981 (diff) | |
download | lombok-304f57bd05b6298be8feb0fc368845249f805798.tar.gz lombok-304f57bd05b6298be8feb0fc368845249f805798.tar.bz2 lombok-304f57bd05b6298be8feb0fc368845249f805798.zip |
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.
-rw-r--r-- | src/installer/lombok/installer/InstallerGUI.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/installer/lombok/installer/InstallerGUI.java b/src/installer/lombok/installer/InstallerGUI.java index 2488eb13..7fbe002c 100644 --- a/src/installer/lombok/installer/InstallerGUI.java +++ b/src/installer/lombok/installer/InstallerGUI.java @@ -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(); |