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


Java VirtualFilePointer.isValid方法代码示例

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


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

示例1: getInvalidRootUrls

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@Override
public List<String> getInvalidRootUrls(OrderRootType type) {
  final VirtualFilePointerContainer container = myRoots.get(type);
  if (container == null) return Collections.emptyList();
  final List<VirtualFilePointer> pointers = container.getList();
  List<String> invalidPaths = null;
  for (VirtualFilePointer pointer : pointers) {
    if (!pointer.isValid()) {
      if (invalidPaths == null) {
        invalidPaths = new SmartList<String>();
      }
      invalidPaths.add(pointer.getUrl());
    }
  }
  return invalidPaths == null ? Collections.<String>emptyList() : invalidPaths;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:JpsLibraryDelegate.java

示例2: getInvalidRootUrls

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@Override
public List<String> getInvalidRootUrls(OrderRootType type) {
  if (myDisposed) return Collections.emptyList();

  final List<VirtualFilePointer> pointers = myRoots.get(type).getList();
  List<String> invalidPaths = null;
  for (VirtualFilePointer pointer : pointers) {
    if (!pointer.isValid()) {
      if (invalidPaths == null) {
        invalidPaths = new SmartList<String>();
      }
      invalidPaths.add(pointer.getUrl());
    }
  }
  return invalidPaths == null ? Collections.<String>emptyList() : invalidPaths;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:LibraryImpl.java

示例3: 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

示例4: getAssociationsFor

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
public PsiFile[] getAssociationsFor(PsiFile file, FileType... fileTypes) {
  final VirtualFile virtualFile = file.getVirtualFile();
  if (virtualFile == null) return PsiFile.EMPTY_ARRAY;

  for (VirtualFilePointer pointer : myAssociations.keySet()) {
    if (pointer.isValid() && pointer.getUrl().equals(virtualFile.getUrl())) {
      final VirtualFilePointerContainer container = myAssociations.get(pointer);
      if (container != null) {
        final VirtualFile[] files = container.getFiles();
        final Set<PsiFile> list = new HashSet<PsiFile>();
        final PsiManager psiManager = PsiManager.getInstance(myProject);
        for (VirtualFile assoc : files) {
          final PsiFile psiFile = psiManager.findFile(assoc);
          if (psiFile != null && (fileTypes.length == 0 || matchesFileType(psiFile, fileTypes))) {
            list.add(psiFile);
          }
        }
        return PsiUtilCore.toPsiFileArray(list);
      }
      else {
        return PsiFile.EMPTY_ARRAY;
      }
    }
  }
  return PsiFile.EMPTY_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:FileAssociationsManagerImpl.java

示例5: isValid

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@Override
public boolean isValid(@NotNull String url, @NotNull OrderRootType rootType) {
  final VirtualFilePointerContainer container = myRoots.get(rootType);
  if (container == null) return false;
  final VirtualFilePointer fp = container.findByUrl(url);
  return fp != null && fp.isValid();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:JpsLibraryDelegate.java

示例6: 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

示例7: isValid

import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@Override
public boolean isValid(@NotNull final String url, @NotNull final OrderRootType rootType) {
  final VirtualFilePointerContainer container = myRoots.get(rootType);
  final VirtualFilePointer fp = container.findByUrl(url);
  return fp != null && fp.isValid();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:LibraryImpl.java


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