JAL-3618 Enable appBundleIsTraversable in JFileChooser on macOS
authorBen Soares <bsoares@dundee.ac.uk>
Fri, 5 Mar 2021 11:24:16 +0000 (11:24 +0000)
committerBen Soares <bsoares@dundee.ac.uk>
Fri, 5 Mar 2021 11:24:16 +0000 (11:24 +0000)
src/jalview/jbgui/GPreferences.java

index 5af94e4..1a4a44b 100755 (executable)
@@ -1799,6 +1799,14 @@ public class GPreferences extends JPanel
     String choice = null;
     JFileChooser chooser = new JFileChooser();
 
+    // Enable appBundleIsTraversable in macOS FileChooser to allow selecting
+    // hidden executables within .app dirs
+    if (Platform.isMac())
+    {
+      chooser.putClientProperty("JFileChooser.appBundleIsTraversable",
+              true);
+    }
+
     // chooser.setFileView(new JalviewFileView());
     chooser.setDialogTitle(
             MessageManager.getString("label.open_local_file"));