Java 类com.intellij.openapi.project.ProjectUtilCore 实例源码

项目:intellij-ce-playground    文件:IdeaFrameTitleBuilder.java   
@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);
}
项目:intellij-ce-playground    文件:HTMLComposerImpl.java   
@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);
  }
}
项目:intellij-ce-playground    文件:RefManagerImpl.java   
@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);
}
项目:tools-idea    文件:HTMLComposerImpl.java   
@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);
  }
}
项目:tools-idea    文件:RefManagerImpl.java   
@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);
}
项目:consulo    文件:RefManagerImpl.java   
@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);
}
项目:consulo    文件:HTMLComposerImpl.java   
@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);
  }
}
项目:intellij-ce-playground    文件:CompilerPaths.java   
public static String getCompilerSystemDirectoryName(Project project) {
  return ProjectUtilCore.getPresentableName(project) + "." + project.getLocationHash();
}
项目:intellij-ce-playground    文件:AnalysisScope.java   
private static String displayProjectRelativePath(@NotNull VirtualFile virtualFile, @NotNull Project project) {
  return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), project, false, false);
}
项目:intellij-ce-playground    文件:DependenciesBuilder.java   
public String getRelativeToProjectPath(@NotNull VirtualFile virtualFile) {
  return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), getProject(), true, false);
}
项目:tools-idea    文件:AnalysisScope.java   
private static String displayProjectRelativePath(@NotNull VirtualFile virtualFile, @NotNull Project project) {
  return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), project, false, false);
}
项目:tools-idea    文件:DependenciesBuilder.java   
public String getRelativeToProjectPath(@NotNull VirtualFile virtualFile) {
  return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), getProject(), true, false);
}
项目:consulo    文件:AnalysisScope.java   
private static String displayProjectRelativePath(@Nonnull VirtualFile virtualFile, @Nonnull Project project) {
  return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), project, false, false);
}