Icon (@NotNull PsiDirectory directory) { ProjectFileIndex fileIndex = ProjectRootManager.getInstance(directory.getProject()).getFileIndex(); VirtualFile virtualFile = directory.getVirtualFile(); if (fileIndex.isInTestSourceContent(virtualFile)) { return PlatformIcons.MODULES_TEST_SOURCE_FOLDER; } else if (fileIndex.isInSourceContent(virtualFile)) { return PlatformIcons.MODULES_SOURCE_FOLDERS_ICON; } else { return PlatformIcons.FOLDER_ICON; } }