IDEA-154631 wrong directory's icon

caused by: IDEA-149590 Open File dialog should display icons for registered directory types (e.g. bundles on OS X)
we now only show directory icons for specific file types (namely DirectoryFileTypes)
This commit is contained in:
Anton Makeev
2016-04-20 16:47:41 +02:00
parent 428993f3d7
commit 194a451607
2 changed files with 24 additions and 2 deletions
@@ -16,8 +16,8 @@
package com.intellij.ide.presentation;
import com.intellij.ide.TypePresentationService;
import com.intellij.openapi.fileTypes.DirectoryFileType;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.UnknownFileType;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
@@ -40,7 +40,7 @@ public class VirtualFilePresentation {
return icon;
}
FileType fileType = vFile.getFileType();
if (fileType == UnknownFileType.INSTANCE && vFile.isDirectory() && vFile.isInLocalFileSystem()) {
if (vFile.isDirectory() && vFile.isInLocalFileSystem() && !(fileType instanceof DirectoryFileType)) {
return PlatformIcons.FOLDER_ICON;
}
return fileType.getIcon();
@@ -0,0 +1,22 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi.fileTypes;
/**
* Use this marker interface to indicate that the file type signifies a directory (not a file)
*/
public interface DirectoryFileType extends FileType {
}