mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
AppCode: xcode templates reworked
This commit is contained in:
+7
-2
@@ -80,10 +80,10 @@ public class NativeFileIconProvider implements FileIconProvider {
|
||||
assert SwingComponentHolder.ourFileChooser != null || !ApplicationManager.getApplication().isReadAccessAllowed();
|
||||
|
||||
if (SystemInfo.isMac && virtualFile.isDirectory() && (flags & Iconable.ICON_FLAG_OPEN) == Iconable.ICON_FLAG_OPEN) {
|
||||
icon = Foundation.isPackageAtPath(f) ? SwingComponentHolder.ourFileChooser.getIcon(f) : DIR_OPEN_ICON;
|
||||
icon = Foundation.isPackageAtPath(f) ? getNativeIcon(f) : DIR_OPEN_ICON;
|
||||
}
|
||||
else {
|
||||
icon = SwingComponentHolder.ourFileChooser.getIcon(f);
|
||||
icon = getNativeIcon(f);
|
||||
}
|
||||
}
|
||||
catch (Exception e) { // see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4854174
|
||||
@@ -104,6 +104,11 @@ public class NativeFileIconProvider implements FileIconProvider {
|
||||
});
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Icon getNativeIcon(@Nullable File file) {
|
||||
return file == null ? null : SwingComponentHolder.ourFileChooser.getIcon(file);
|
||||
}
|
||||
|
||||
private static Ext getExtension(final VirtualFile file, final int flags) {
|
||||
if (file.isDirectory()) {
|
||||
if (file.getExtension() == null) {
|
||||
|
||||
@@ -48,10 +48,26 @@ public class FileUtil extends FileUtilRt {
|
||||
|
||||
@NonNls public static final String ASYNC_DELETE_EXTENSION = ".__del__";
|
||||
|
||||
public static final int REGEX_PATTERN_FLAGS = SystemInfo.isFileSystemCaseSensitive ? 0 : Pattern.CASE_INSENSITIVE;
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public static final TObjectHashingStrategy<String> PATH_HASHING_STRATEGY =
|
||||
SystemInfo.isFileSystemCaseSensitive ? TObjectHashingStrategy.CANONICAL : CaseInsensitiveStringHashingStrategy.INSTANCE;
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public static final TObjectHashingStrategy<File> FILE_HASHING_STRATEGY =
|
||||
SystemInfo.isFileSystemCaseSensitive ? TObjectHashingStrategy.CANONICAL : new TObjectHashingStrategy<File>() {
|
||||
@Override
|
||||
public int computeHashCode(File object) {
|
||||
return fileHashCode(object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(File o1, File o2) {
|
||||
return filesEqual(o1, o2);
|
||||
}
|
||||
};
|
||||
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.util.io.FileUtil");
|
||||
|
||||
// do not use channels to copy files larger than 5 Mb because of possible MapFailed error
|
||||
|
||||
Reference in New Issue
Block a user