Java 类com.intellij.openapi.vfs.LocalFileProvider 实例源码

项目:intellij-ce-playground    文件:ProjectUtilCore.java   
public static String displayUrlRelativeToProject(@NotNull VirtualFile file,
                                                 @NotNull String url,
                                                 @NotNull Project project,
                                                 boolean includeFilePath,
                                                 boolean keepModuleAlwaysOnTheLeft) {
  final VirtualFile baseDir = project.getBaseDir();
  if (baseDir != null && includeFilePath) {
    //noinspection ConstantConditions
    final String projectHomeUrl = baseDir.getPresentableUrl();
    if (url.startsWith(projectHomeUrl)) {
      url = "..." + url.substring(projectHomeUrl.length());
    }
  }

  if (SystemInfo.isMac && file.getFileSystem() instanceof LocalFileProvider) {
    final VirtualFile fileForJar = ((LocalFileProvider)file.getFileSystem()).getLocalVirtualFileFor(file);
    if (fileForJar != null) {
      final OrderEntry libraryEntry = LibraryUtil.findLibraryEntry(file, project);
      if (libraryEntry != null) {
        if (libraryEntry instanceof JdkOrderEntry) {
          url = url + " - [" + ((JdkOrderEntry)libraryEntry).getJdkName() + "]";
        }
        else {
          url = url + " - [" + libraryEntry.getPresentableName() + "]";
        }
      }
      else {
        url = url + " - [" + fileForJar.getName() + "]";
      }
    }
  }

  final Module module = ModuleUtilCore.findModuleForFile(file, project);
  if (module == null) return url;
  return !keepModuleAlwaysOnTheLeft && SystemInfo.isMac ?
         url + " - [" + module.getName() + "]" :
         "[" + module.getName() + "] - " + url;
}
项目:intellij-ce-playground    文件:PathUtil.java   
@NotNull
public static VirtualFile getLocalFile(@NotNull VirtualFile file) {
  if (!file.isValid()) {
    return file;
  }
  if (file.getFileSystem() instanceof LocalFileProvider) {
    final VirtualFile localFile = ((LocalFileProvider)file.getFileSystem()).getLocalVirtualFileFor(file);
    if (localFile != null) {
      return localFile;
    }
  }
  return file;
}
项目:tools-idea    文件:ProjectUtilCore.java   
public static String displayUrlRelativeToProject(@NotNull VirtualFile file,
                                                 @NotNull String url,
                                                 @NotNull Project project,
                                                 boolean includeFilePath,
                                                 boolean keepModuleAlwaysOnTheLeft) {
  final VirtualFile baseDir = project.getBaseDir();
  if (baseDir != null && includeFilePath) {
    //noinspection ConstantConditions
    final String projectHomeUrl = baseDir.getPresentableUrl();
    if (url.startsWith(projectHomeUrl)) {
      url = "..." + url.substring(projectHomeUrl.length());
    }
  }

  if (SystemInfo.isMac && file.getFileSystem() instanceof LocalFileProvider) {
    final VirtualFile fileForJar = ((LocalFileProvider)file.getFileSystem()).getLocalVirtualFileFor(file);
    if (fileForJar != null) {
      final OrderEntry libraryEntry = LibraryUtil.findLibraryEntry(file, project);
      if (libraryEntry != null) {
        if (libraryEntry instanceof JdkOrderEntry) {
          url = url + " - [" + ((JdkOrderEntry)libraryEntry).getJdkName() + "]";
        }
        else {
          url = url + " - [" + libraryEntry.getPresentableName() + "]";
        }
      }
      else {
        url = url + " - [" + fileForJar.getName() + "]";
      }
    }
  }

  final Module module = ModuleUtilCore.findModuleForFile(file, project);
  if (module == null) return url;
  return !keepModuleAlwaysOnTheLeft && SystemInfo.isMac ?
         url + " - [" + module.getName() + "]" :
         "[" + module.getName() + "] - " + url;
}
项目:tools-idea    文件:PathUtil.java   
@NotNull
public static VirtualFile getLocalFile(@NotNull VirtualFile file) {
  if (!file.isValid()) {
    return file;
  }
  if (file.getFileSystem() instanceof LocalFileProvider) {
    final VirtualFile localFile = ((LocalFileProvider)file.getFileSystem()).getLocalVirtualFileFor(file);
    if (localFile != null) {
      return localFile;
    }
  }
  return file;
}
项目:consulo    文件:PathUtil.java   
@Nonnull
public static VirtualFile getLocalFile(@Nonnull VirtualFile file) {
  if (!file.isValid()) {
    return file;
  }
  if (file.getFileSystem() instanceof LocalFileProvider) {
    final VirtualFile localFile = ((LocalFileProvider)file.getFileSystem()).getLocalVirtualFileFor(file);
    if (localFile != null) {
      return localFile;
    }
  }
  return file;
}
项目:consulo    文件:ProjectUtilCore.java   
public static String displayUrlRelativeToProject(@Nonnull VirtualFile file,
                                                 @Nonnull String url,
                                                 @Nonnull Project project,
                                                 boolean includeFilePath,
                                                 boolean keepModuleAlwaysOnTheLeft) {
  final VirtualFile baseDir = project.getBaseDir();
  if (baseDir != null && includeFilePath) {
    //noinspection ConstantConditions
    final String projectHomeUrl = baseDir.getPresentableUrl();
    if (url.startsWith(projectHomeUrl)) {
      url = "..." + url.substring(projectHomeUrl.length());
    }
  }

  if (SystemInfo.isMac && file.getFileSystem() instanceof LocalFileProvider) {
    final VirtualFile fileForJar = ((LocalFileProvider)file.getFileSystem()).getLocalVirtualFileFor(file);
    if (fileForJar != null) {
      final OrderEntry libraryEntry = LibraryUtil.findLibraryEntry(file, project);
      if (libraryEntry != null) {
        if (libraryEntry instanceof ModuleExtensionWithSdkOrderEntry) {
          url = url + " - [" + ((ModuleExtensionWithSdkOrderEntry)libraryEntry).getSdkName() + "]";
        }
        else {
          url = url + " - [" + libraryEntry.getPresentableName() + "]";
        }
      }
      else {
        url = url + " - [" + fileForJar.getName() + "]";
      }
    }
  }

  final Module module = ModuleUtilCore.findModuleForFile(file, project);
  if (module == null) return url;
  return !keepModuleAlwaysOnTheLeft && SystemInfo.isMac ?
         url + " - [" + module.getName() + "]" :
         "[" + module.getName() + "] - " + url;
}
项目:intellij-ce-playground    文件:LibrariesUtil.java   
private static VirtualFile getLocalFor(VirtualFile virtualFile) {
  VirtualFileSystem fileSystem = virtualFile == null ? null : virtualFile.getFileSystem();
  return fileSystem instanceof LocalFileProvider ? ((LocalFileProvider)fileSystem).getLocalVirtualFileFor(virtualFile) : null;
}
项目:intellij-ce-playground    文件:VirtualFileManagerEx.java   
public abstract List<LocalFileProvider> getLocalFileProviders();
项目:tools-idea    文件:VirtualFileManagerEx.java   
public abstract List<LocalFileProvider> getLocalFileProviders();
项目:consulo    文件:VirtualFileManagerEx.java   
public abstract List<LocalFileProvider> getLocalFileProviders();