本文整理汇总了Java中com.intellij.openapi.vfs.pointers.VirtualFilePointer.getUrl方法的典型用法代码示例。如果您正苦于以下问题:Java VirtualFilePointer.getUrl方法的具体用法?Java VirtualFilePointer.getUrl怎么用?Java VirtualFilePointer.getUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vfs.pointers.VirtualFilePointer
的用法示例。
在下文中一共展示了VirtualFilePointer.getUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
示例2: writeExternal
import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@Override
public void writeExternal(@NotNull final Element element, @NotNull final String childElementName) {
for (VirtualFilePointer pointer : myList) {
String url = pointer.getUrl();
final Element rootPathElement = new Element(childElementName);
rootPathElement.setAttribute(URL_ATTR, url);
element.addContent(rootPathElement);
}
}
示例3: 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;
}
示例4: getMapping
import com.intellij.openapi.vfs.pointers.VirtualFilePointer; //导入方法依赖的package包/类
@Override
@Nullable
public String getMapping(@NotNull PsiFile file) {
final VirtualFilePointer pointer = getMappedPointer(file);
return pointer != null ? pointer.getUrl() : null;
}