private Icon getIconByExtension() { if (myFileTypeManager != null) { FileType fileType = myFileTypeManager.getFileTypeByExtension(getExtension()); return fileType.getIcon(); } return IdetalkCoreIcons.Nodes.Unknown; }
@Nullable public static Icon getIcon(@NotNull ErlangFile file) { if (!file.isValid()) return null; VirtualFile virtualFile = file.getViewProvider().getVirtualFile(); FileType fileType = virtualFile.getFileType(); if (ErlangFileType.MODULE == fileType) { ErlangModule module = file.getModule(); boolean isEunit = module != null && ErlangPsiImplUtil.isEunitTestFile(file); return isEunit ? ErlangIcons.EUNIT : getModuleType(file).icon; } return fileType.getIcon(); }
@NotNull @Override public CellAppearanceEx forIoFile(@NotNull final File file) { final String absolutePath = file.getAbsolutePath(); if (!file.exists()) { return forInvalidUrl(absolutePath); } if (file.isDirectory()) { return SimpleTextCellAppearance.regular(absolutePath, PlatformIcons.FOLDER_ICON); } final String name = file.getName(); final FileType fileType = FileTypeManager.getInstance().getFileTypeByFileName(name); final File parent = file.getParentFile(); final CompositeAppearance appearance = CompositeAppearance.textComment(name, parent.getAbsolutePath()); appearance.setIcon(fileType.getIcon()); return appearance; }
@Override public Icon getIcon() { return fileType.getIcon(); }
@Override protected Icon iconForFilterValue(@NotNull FileType value) { return value.getIcon(); }