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


Java LightVirtualFile.setOriginalFile方法代码示例

本文整理汇总了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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:PsiFileFactoryImpl.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:BinaryContent.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SingleRootFileViewProvider.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PsiFileFactoryImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PythonConsoleParsingTest.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:BinaryContent.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:SingleRootFileViewProvider.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:AbstractFileViewProvider.java


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