当前位置: 首页>>代码示例>>Java>>正文


Java VirtualFilePointer.getFile方法代码示例

本文整理汇总了Java中com.intellij.openapi.vfs.pointers.VirtualFilePointer.getFile方法的典型用法代码示例。如果您正苦于以下问题:Java VirtualFilePointer.getFile方法的具体用法?Java VirtualFilePointer.getFile怎么用?Java VirtualFilePointer.getFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.vfs.pointers.VirtualFilePointer的用法示例。


在下文中一共展示了VirtualFilePointer.getFile方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFiles

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@NotNull
@Override
public VirtualFile[] getFiles(@NotNull OrderRootType rootType) {
  final VirtualFilePointerContainer container = myRoots.get(rootType);
  if (container == null) return VirtualFile.EMPTY_ARRAY;
  final List<VirtualFile> expanded = new ArrayList<VirtualFile>();
  for (JpsLibraryRoot root : myJpsLibrary.getRoots(getJpsRootType(rootType))) {
    final VirtualFilePointer pointer = container.findByUrl(root.getUrl());
    if (pointer == null) continue;
    VirtualFile file = pointer.getFile();
    if (file == null) continue;

    if (file.isDirectory() && root.getInclusionOptions() != JpsLibraryRoot.InclusionOptions.ROOT_ITSELF) {
      LibraryImpl.collectJarFiles(file, expanded, root.getInclusionOptions() == JpsLibraryRoot.InclusionOptions.ARCHIVES_UNDER_ROOT_RECURSIVELY);
      continue;
    }
    expanded.add(file);
  }
  return VfsUtilCore.toVirtualFileArray(expanded);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:JpsLibraryDelegate.java

示例2: acceptFilter

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@Override
protected boolean acceptFilter(Pair<PackageSetBase, NamedScopesHolder> filter, boolean showOnlyFilteredItems) {
  try {
    VirtualFilePointer filePointer = getFilePointer();
    if (!filePointer.isValid()) {
      return false;
    }
    VirtualFile file = filePointer.getFile();
    if (file != null && file.isValid() && filter.first.contains(file, getProject(), filter.second)) {
      applyFilter(true);
      return true;
    }
  }
  catch (Throwable e) {
    // TODO: catch and ignore exceptions: see to FilePatternPackageSet
    // sometimes for new file DirectoryFileIndex.getContentRootForFile() return random path
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:FileTreeNode.java

示例3: duplicate

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@Override
@NotNull
public synchronized VirtualFilePointer duplicate(@NotNull VirtualFilePointer pointer,
                                                 @NotNull Disposable parent,
                                                 @Nullable VirtualFilePointerListener listener) {
  VirtualFile file = pointer.getFile();
  return file == null ? create(pointer.getUrl(), parent, listener) : create(file, parent, listener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:VirtualFilePointerManagerImpl.java

示例4: duplicate

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@NotNull
@Override
public VirtualFilePointer duplicate(@NotNull VirtualFilePointer pointer,
                                    @NotNull Disposable parent,
                                    @Nullable VirtualFilePointerListener listener) {
  return new IdentityVirtualFilePointer(pointer.getFile(), pointer.getUrl());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:CoreVirtualFilePointerManager.java

示例5: cacheThings

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@NotNull
private Trinity<String[], VirtualFile[], VirtualFile[]> cacheThings() {
  Trinity<String[], VirtualFile[], VirtualFile[]> result;
  if (myList.isEmpty()) {
    result = EMPTY;
  }
  else {
    List<VirtualFile> cachedFiles = new ArrayList<VirtualFile>(myList.size());
    List<String> cachedUrls = new ArrayList<String>(myList.size());
    List<VirtualFile> cachedDirectories = new ArrayList<VirtualFile>(myList.size() / 3);
    boolean allFilesAreDirs = true;
    for (VirtualFilePointer v : myList) {
      VirtualFile file = v.getFile();
      String url = v.getUrl();
      cachedUrls.add(url);
      if (file != null) {
        cachedFiles.add(file);
        if (file.isDirectory()) {
          cachedDirectories.add(file);
        }
        else {
          allFilesAreDirs = false;
        }
      }
    }
    VirtualFile[] directories = VfsUtilCore.toVirtualFileArray(cachedDirectories);
    VirtualFile[] files = allFilesAreDirs ? directories : VfsUtilCore.toVirtualFileArray(cachedFiles);
    String[] urlsArray = ArrayUtil.toStringArray(cachedUrls);
    result = Trinity.create(urlsArray, files, directories);
  }
  myCachedThings = result;
  myTimeStampOfCachedThings = myVirtualFilePointerManager.getModificationCount();
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:VirtualFilePointerContainerImpl.java

示例6: isSettingsFile

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
private boolean isSettingsFile(String path) {
  for (VirtualFilePointer each : mySettingsFilesPointers) {
    VirtualFile f = each.getFile();
    if (f != null && FileUtil.pathsEqual(path, f.getPath())) return true;
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:MavenProjectsManagerWatcher.java

示例7: getAssociations

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
public Map<VirtualFile, VirtualFile[]> getAssociations() {
  final HashMap<VirtualFile, VirtualFile[]> map = new LinkedHashMap<VirtualFile, VirtualFile[]>();
  final Set<VirtualFilePointer> set = myAssociations.keySet();
  for (VirtualFilePointer pointer : set) {
    if (pointer.isValid()) {
      final VirtualFile file = pointer.getFile();
      map.put(file, myAssociations.get(pointer).getFiles());
    }
  }
  return map;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:FileAssociationsManagerImpl.java

示例8: verifyPointersInCorrectState

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
private static void verifyPointersInCorrectState(VirtualFilePointer[] pointers) {
  for (VirtualFilePointer pointer : pointers) {
    final VirtualFile file = pointer.getFile();
    assertTrue(file == null || file.isValid());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:VirtualFilePointerTest.java

示例9: getMappedFile

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@Override
public VirtualFile getMappedFile(@NotNull PsiFile file) {
  final VirtualFilePointer url = getMappedPointer(file);
  return url != null ? url.getFile() : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:NoNamespaceConfigImpl.java


注:本文中的com.intellij.openapi.vfs.pointers.VirtualFilePointer.getFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。