From 304f57bd05b6298be8feb0fc368845249f805798 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sun, 25 Jul 2010 01:29:19 +0200 Subject: 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. --- src/installer/lombok/installer/InstallerGUI.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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(); -- cgit