本文整理汇总了Java中com.intellij.testFramework.LightVirtualFile.setOriginalFile方法的典型用法代码示例。如果您正苦于以下问题:Java LightVirtualFile.setOriginalFile方法的具体用法?Java LightVirtualFile.setOriginalFile怎么用?Java LightVirtualFile.setOriginalFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.testFramework.LightVirtualFile
的用法示例。
在下文中一共展示了LightVirtualFile.setOriginalFile方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFileFromText
import com.intellij.testFramework.LightVirtualFile; //导入方法依赖的package包/类
@Nullable
@Override
public PsiFile createFileFromText(@Nonnull String name,
@Nonnull LanguageVersion languageVersion,
@Nonnull CharSequence text,
boolean physical,
boolean markAsCopy,
boolean noSizeLimit,
@Nullable VirtualFile original) {
LightVirtualFile virtualFile = new LightVirtualFile(name, languageVersion.getLanguage(), text);
if (original != null) virtualFile.setOriginalFile(original);
virtualFile.putUserData(LanguageVersion.KEY, languageVersion);
if (noSizeLimit) {
SingleRootFileViewProvider.doNotCheckFileSizeLimit(virtualFile);
}
return trySetupPsiForFile(virtualFile, languageVersion.getLanguage(), languageVersion, physical, markAsCopy);
}
示例2: getFile
import com.intellij.testFramework.LightVirtualFile; //导入方法依赖的package包/类
@Override
@Nullable
public VirtualFile getFile() {
if (myFileType instanceof UIBasedFileType) {
final VirtualFile file = findVirtualFile();
if (file != null) {
final LightVirtualFile lightFile = new LightVirtualFile(file, new String(myBytes), 1);
lightFile.setOriginalFile(file);
return lightFile;
}
}
return null;
}
示例3: clone
import com.intellij.testFramework.LightVirtualFile; //导入方法依赖的package包/类
@Override
public FileViewProvider clone() {
final VirtualFile origFile = getVirtualFile();
LightVirtualFile copy = new LightVirtualFile(origFile.getName(), myFileType, getContents(), origFile.getCharset(), getModificationStamp());
copy.setOriginalFile(origFile);
copy.putUserData(UndoConstants.DONT_RECORD_UNDO, Boolean.TRUE);
copy.setCharset(origFile.getCharset());
return createCopy(copy);
}
示例4: createFileFromText
import com.intellij.testFramework.LightVirtualFile; //导入方法依赖的package包/类
@Override
public PsiFile createFileFromText(@NotNull String name, @NotNull Language language, @NotNull CharSequence text,
boolean eventSystemEnabled, boolean markAsCopy, boolean noSizeLimit,
@Nullable VirtualFile original) {
LightVirtualFile virtualFile = new LightVirtualFile(name, language, text);
if (original != null) virtualFile.setOriginalFile(original);
if (noSizeLimit) {
SingleRootFileViewProvider.doNotCheckFileSizeLimit(virtualFile);
}
return trySetupPsiForFile(virtualFile, language, eventSystemEnabled, markAsCopy);
}
示例5: createFile
import com.intellij.testFramework.LightVirtualFile; //导入方法依赖的package包/类
@Override
protected PsiFile createFile(String name, String text) {
LightVirtualFile originalFile = new LightVirtualFile(name, myLanguage, text);
LightVirtualFile virtualFile = new LightVirtualFile(name, myLanguage, text);
virtualFile.setOriginalFile(originalFile);
originalFile.setCharset(CharsetToolkit.UTF8_CHARSET);
originalFile.putUserData(LanguageLevel.KEY, myLanguageLevel);
PyConsoleUtil.markIPython(originalFile);
return createFile(virtualFile);
}
示例6: getFile
import com.intellij.testFramework.LightVirtualFile; //导入方法依赖的package包/类
@Nullable
public VirtualFile getFile() {
if (myFileType instanceof UIBasedFileType) {
final VirtualFile file = LocalFileSystem.getInstance().findFileByIoFile(new File(myFilePath));
if (file != null) {
final LightVirtualFile lightFile = new LightVirtualFile(file, new String(myBytes), 1);
lightFile.setOriginalFile(file);
return lightFile;
}
}
return null;
}
示例7: clone
import com.intellij.testFramework.LightVirtualFile; //导入方法依赖的package包/类
@Override
public FileViewProvider clone() {
final VirtualFile origFile = getVirtualFile();
LightVirtualFile copy = new LightVirtualFile(origFile.getName(), origFile.getFileType(), getContents(), origFile.getCharset(), getModificationStamp());
copy.setOriginalFile(origFile);
copy.putUserData(UndoConstants.DONT_RECORD_UNDO, Boolean.TRUE);
copy.setCharset(origFile.getCharset());
return createCopy(copy);
}
示例8: clone
import com.intellij.testFramework.LightVirtualFile; //导入方法依赖的package包/类
@SuppressWarnings("MethodDoesntCallSuperMethod")
@Override
public FileViewProvider clone() {
VirtualFile origFile = getVirtualFile();
LightVirtualFile copy = new LightVirtualFile(origFile.getName(), myFileType, getContents(), origFile.getCharset(), getModificationStamp());
copy.setOriginalFile(origFile);
copy.putUserData(UndoConstants.DONT_RECORD_UNDO, Boolean.TRUE);
copy.setCharset(origFile.getCharset());
return createCopy(copy);
}