void (@NotNull PresentationData data) { Project project = getProject(); assert project != null : this; PsiDirectory psiDirectory = getValue(); assert psiDirectory != null : this; VirtualFile directoryFile = psiDirectory.getVirtualFile(); Object parentValue = getParentValue(); synchronized (chain) { if (chain.isEmpty()) { VirtualFile ancestor = getVirtualFile(parentValue); if (ancestor != null) { for (VirtualFile file = directoryFile; file != null && VfsUtilCore.isAncestor(ancestor, file, true); file = file.getParent()) { chain.add(file); } } if (chain.isEmpty()) chain.add(directoryFile); } } if (ProjectRootsUtil.isModuleContentRoot(directoryFile, project)) { ProjectFileIndex fi = ProjectRootManager.getInstance(project).getFileIndex(); Module module = fi.getModuleForFile(directoryFile); data.setPresentableText(directoryFile.getName()); if (module != null) { if (!(parentValue instanceof Module)) { if (ModuleType.isInternal(module) || !shouldShowModuleName()) { data.addText(directoryFile.getName() + " ", SimpleTextAttributes.REGULAR_ATTRIBUTES); } else if (moduleNameMatchesDirectoryName(module, directoryFile, fi)) { data.addText(directoryFile.getName(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); } else { data.addText(directoryFile.getName() + " ", SimpleTextAttributes.REGULAR_ATTRIBUTES); data.addText("[" + module.getName() + "]", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); } } else { data.addText(directoryFile.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES); } boolean shouldShowUrl = getSettings().isShowURL() && (parentValue instanceof Module || parentValue instanceof Project); data.setLocationString(ProjectViewDirectoryHelper.getInstance(project).getLocationString(psiDirectory, shouldShowUrl, shouldShowSourcesRoot())); setupIcon(data, psiDirectory); return; } } String name = parentValue instanceof Project ? psiDirectory.getVirtualFile().getPresentableUrl() : ProjectViewDirectoryHelper.getInstance(psiDirectory.getProject()).getNodeName(getSettings(), parentValue, psiDirectory); if (name == null) { setValue(null); return; } data.setPresentableText(name); data.setLocationString(ProjectViewDirectoryHelper.getInstance(project).getLocationString(psiDirectory, false, false)); setupIcon(data, psiDirectory); }