本文整理汇总了Java中com.intellij.openapi.project.ProjectUtilCore类的典型用法代码示例。如果您正苦于以下问题:Java ProjectUtilCore类的具体用法?Java ProjectUtilCore怎么用?Java ProjectUtilCore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProjectUtilCore类属于com.intellij.openapi.project包,在下文中一共展示了ProjectUtilCore类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFileTitle
import com.intellij.openapi.project.ProjectUtilCore; //导入依赖的package包/类
@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);
}
示例2: appendElementReference
import com.intellij.openapi.project.ProjectUtilCore; //导入依赖的package包/类
@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);
}
}
示例3: visitFile
import com.intellij.openapi.project.ProjectUtilCore; //导入依赖的package包/类
@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);
}
示例4: getCompilerSystemDirectoryName
import com.intellij.openapi.project.ProjectUtilCore; //导入依赖的package包/类
public static String getCompilerSystemDirectoryName(Project project) {
return ProjectUtilCore.getPresentableName(project) + "." + project.getLocationHash();
}
示例5: displayProjectRelativePath
import com.intellij.openapi.project.ProjectUtilCore; //导入依赖的package包/类
private static String displayProjectRelativePath(@NotNull VirtualFile virtualFile, @NotNull Project project) {
return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), project, false, false);
}
示例6: getRelativeToProjectPath
import com.intellij.openapi.project.ProjectUtilCore; //导入依赖的package包/类
public String getRelativeToProjectPath(@NotNull VirtualFile virtualFile) {
return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), getProject(), true, false);
}
示例7: displayProjectRelativePath
import com.intellij.openapi.project.ProjectUtilCore; //导入依赖的package包/类
private static String displayProjectRelativePath(@Nonnull VirtualFile virtualFile, @Nonnull Project project) {
return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), project, false, false);
}