本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}