!161 完善文件图标支持

Merge pull request !161 from 格物方能致知/develop
This commit is contained in:
格物方能致知 2023-10-10 10:14:21 +00:00 committed by Gitee
commit 559387eecc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -148,7 +148,11 @@ public class FileUtil {
return null; return null;
} }
DirFileModel dirFileModel = new DirFileModel(file.getAbsolutePath(), file.getName(), new ArrayList<>(), new FontIcon(FOLDER), new FontIcon(FOLDER_OPEN)); DirFileModel dirFileModel = new DirFileModel(
file.getAbsolutePath(),
file.getName(), new ArrayList<>(),
new FontIcon(FOLDER),
new FontIcon(FOLDER_OPEN));
File[] files = file.listFiles(); File[] files = file.listFiles();
if (files != null) { if (files != null) {
@ -158,7 +162,10 @@ public class FileUtil {
dirFileModel.getChildFile().add(childDirFileModel); dirFileModel.getChildFile().add(childDirFileModel);
} else { } else {
// todo 在此监测文件后缀设置对应的图标 // todo 在此监测文件后缀设置对应的图标
dirFileModel.getChildFile().add(new DirFileModel(f.getAbsolutePath(), f.getName(), null, getIconCorrespondingToFileName(f.getName()), new FontIcon(FILE))); dirFileModel.getChildFile().add(new DirFileModel(
f.getAbsolutePath(), f.getName(), null,
getIconCorrespondingToFileName(f.getName()),
getIconCorrespondingToFileName(f.getName())));
} }
} }
} }