changeset 20099:fe931b18962c

8021379: JFileChooser Create New Folder button enabled in write proteced directory Reviewed-by: alexsch
author malenkov
date Tue, 27 Aug 2013 13:13:32 +0400
parents 7b11536bf6b3
children d127097b7717
files jdk/src/share/classes/sun/swing/FilePane.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/sun/swing/FilePane.java	Tue Aug 27 12:53:46 2013 +0400
+++ b/jdk/src/share/classes/sun/swing/FilePane.java	Tue Aug 27 13:13:32 2013 +0400
@@ -1980,18 +1980,18 @@
         }
 
         if (f instanceof ShellFolder) {
-            return ((ShellFolder) f).isFileSystem();
+            return f.canWrite();
         } else {
             if (usesShellFolder(getFileChooser())) {
                 try {
-                    return ShellFolder.getShellFolder(f).isFileSystem();
+                    return ShellFolder.getShellFolder(f).canWrite();
                 } catch (FileNotFoundException ex) {
                     // File doesn't exist
                     return false;
                 }
             } else {
                 // Ordinary file
-                return true;
+                return f.canWrite();
             }
         }
     }