This commit is contained in:
peter
2012-07-19 13:46:48 +02:00
parent 55dc4d4d21
commit 1afc56ddb6
2 changed files with 5 additions and 3 deletions
@@ -112,7 +112,7 @@ public class FileChooserDescriptor implements Cloneable {
* If true, the user will be able to choose multiple files.
*/
public final boolean getChooseMultiple() {
return myChooseMultiple;
return isChooseMultiple();
}
/**
@@ -139,8 +139,10 @@ public class FileTypeChooser extends DialogWrapper {
* @return Known file type or null. Never returns {@link com.intellij.openapi.fileTypes.FileTypes#UNKNOWN}.
*/
@Nullable
public static FileType getKnownFileTypeOrAssociate(@NotNull VirtualFile file, @NotNull Project project) {
((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().findFile(file); // autodetect text file if needed
public static FileType getKnownFileTypeOrAssociate(@NotNull VirtualFile file, @Nullable Project project) {
if (project != null) {
((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().findFile(file); // autodetect text file if needed
}
FileType type = file.getFileType();
if (type == FileTypes.UNKNOWN) {
type = getKnownFileTypeOrAssociate(file.getName());