diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-12-04 22:10:23 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-12-04 22:10:23 +0100 |
commit | 3fc9fdb4855d666224322732ff7011d2eb1626d4 (patch) | |
tree | c7c481af2843113e37cd4044a36224cfc7640d5c /src | |
parent | 770975ea6bf382898db03090a8919326506cf76e (diff) | |
download | lombok-3fc9fdb4855d666224322732ff7011d2eb1626d4.tar.gz lombok-3fc9fdb4855d666224322732ff7011d2eb1626d4.tar.bz2 lombok-3fc9fdb4855d666224322732ff7011d2eb1626d4.zip |
Fix for issue #76: Can't select directories in the 'specify location...' dialog of the installer. This was by design before (you pick the executable), but issue #76 convinced me the past design was stupid.
Diffstat (limited to 'src')
-rw-r--r-- | src/installer/lombok/installer/InstallerGUI.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/installer/lombok/installer/InstallerGUI.java b/src/installer/lombok/installer/InstallerGUI.java index 7d266546..173aadd4 100644 --- a/src/installer/lombok/installer/InstallerGUI.java +++ b/src/installer/lombok/installer/InstallerGUI.java @@ -311,8 +311,10 @@ 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; @@ -327,11 +329,11 @@ public class InstallerGUI { JFileChooser chooser = new JFileChooser(); chooser.setAcceptAllFileFilterUsed(false); - chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); chooser.setFileFilter(new FileFilter() { @Override public boolean accept(File f) { - for (Pattern exeName : exeNames) if (exeName.matcher(f.getName()).matches()) return true; if (f.isDirectory()) return true; + for (Pattern exeName : exeNames) if (exeName.matcher(f.getName()).matches()) return true; return false; } |