8025503: [macosx] FileDialog allows file selection with apple.awt.fileDialogForDirectories = true
authorpchelko
Fri, 27 Sep 2013 17:04:16 +0400
changeset 20430 8cc1a2344d8f
parent 20429 e1f6e3b0978b
child 20431 3845c63e933d
8025503: [macosx] FileDialog allows file selection with apple.awt.fileDialogForDirectories = true Reviewed-by: serb, anthony
jdk/src/macosx/native/sun/awt/CFileDialog.m
--- a/jdk/src/macosx/native/sun/awt/CFileDialog.m	Fri Sep 27 14:29:27 2013 +0400
+++ b/jdk/src/macosx/native/sun/awt/CFileDialog.m	Fri Sep 27 17:04:16 2013 +0400
@@ -110,7 +110,7 @@
         if (fMode == java_awt_FileDialog_LOAD) {
             NSOpenPanel *openPanel = (NSOpenPanel *)thePanel;
             [openPanel setAllowsMultipleSelection:fMultipleMode];
-            [openPanel setCanChooseFiles:YES];
+            [openPanel setCanChooseFiles:!fChooseDirectories];
             [openPanel setCanChooseDirectories:fChooseDirectories];
             [openPanel setCanCreateDirectories:YES];
         }