open directory dialog: respect 'show hidden files' option (WI-191)
authorKirill.Safonov <kirill.safonov@swiftteams.com>
Fri, 12 Mar 2010 17:41:44 +0000 (20:41 +0300)
committerKirill.Safonov <kirill.safonov@swiftteams.com>
Fri, 12 Mar 2010 17:41:44 +0000 (20:41 +0300)
platform/platform-impl/src/com/intellij/ide/actions/OpenProjectFileChooserDescriptor.java

index e527436d6d7ae0fd9111b94cfaa28cf46bc7a426..8248da96c861f9b258f2767ddbef59c4111b7d0d 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.ide.highlighter.ProjectFileType;
 import com.intellij.ide.impl.ProjectUtil;
 import com.intellij.openapi.application.impl.ApplicationInfoImpl;
 import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.fileChooser.FileElement;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.IconLoader;
 import com.intellij.openapi.vfs.VirtualFile;
@@ -66,6 +67,7 @@ public class OpenProjectFileChooserDescriptor extends FileChooserDescriptor {
   }
 
   public boolean isFileVisible(final VirtualFile file, final boolean showHiddenFiles) {
+    if (!showHiddenFiles && FileElement.isFileHidden(file)) return false;
     return isProjectFile(file) || super.isFileVisible(file, showHiddenFiles) && file.isDirectory();
   }