@Override public String getFileTitle(@NotNull final Project project, @NotNull final VirtualFile file) { String fileTitle = EditorTabbedContainer.calcTabTitle(project, file); if (SystemInfo.isMac) return fileTitle; VirtualFile parent = file.getParent(); if (parent == null || !fileTitle.endsWith(file.getPresentableName())) return fileTitle; String url = FileUtil.getLocationRelativeToUserHome(parent.getPresentableUrl() + File.separator + file.getName()); return ProjectUtilCore.displayUrlRelativeToProject(file, url, project, !SystemInfo.isMac, false); }
@Override public void appendElementReference(final StringBuffer buf, RefElement refElement, boolean isPackageIncluded) { final HTMLComposerExtension extension = getLanguageExtension(refElement); if (extension != null) { extension.appendReferencePresentation(refElement, buf, isPackageIncluded); } else if (refElement instanceof RefFile) { buf.append(A_HREF_OPENING); if (myExporter == null) { buf.append(((RefElementImpl)refElement).getURL()); } else { buf.append(myExporter.getURL(refElement)); } buf.append("\">"); String refElementName = refElement.getName(); final PsiElement element = refElement.getElement(); if (element != null) { final VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element); if (virtualFile != null) { refElementName = ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), element.getProject(), true, false); } } buf.append(refElementName); buf.append(A_CLOSING); } }
@Override public void visitFile(PsiFile file) { final VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile != null) { String relative = ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), myProject, true, false); myContext.incrementJobDoneAmount(myContext.getStdJobDescriptors().BUILD_GRAPH, relative); } final FileViewProvider viewProvider = file.getViewProvider(); final Set<Language> relevantLanguages = viewProvider.getLanguages(); for (Language language : relevantLanguages) { visitElement(viewProvider.getPsi(language)); } myPsiManager.dropResolveCaches(); InjectedLanguageManager.getInstance(myProject).dropFileCaches(file); }
public static String getCompilerSystemDirectoryName(Project project) { return ProjectUtilCore.getPresentableName(project) + "." + project.getLocationHash(); }
private static String displayProjectRelativePath(@NotNull VirtualFile virtualFile, @NotNull Project project) { return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), project, false, false); }
public String getRelativeToProjectPath(@NotNull VirtualFile virtualFile) { return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), getProject(), true, false); }
private static String displayProjectRelativePath(@Nonnull VirtualFile virtualFile, @Nonnull Project project) { return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), project, false, false); }