Java 类com.intellij.openapi.vfs.newvfs.impl.VirtualFileImpl 实例源码

项目:JNomad-Plugin    文件:JNomadInspection.java   
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
    if (JNomadInspection.jnomad == null) {
        setupJNomad();
    }

    List<EnvFileFullReport> fileFullReports;
    VirtualFile virtualFile = holder.getFile().getVirtualFile();
    if (virtualFile.getPath().endsWith("java") && virtualFile instanceof VirtualFileImpl) {
        CharSequence contents = holder.getFile().getViewProvider().getContents();
        fileFullReports = getFileFullReports(contents);
        return new JNomadQueryVisitor(holder, holder.getFile().getVirtualFile(), fileFullReports.toArray(new EnvFileFullReport[0]));
    }
    return new JNomadQueryVisitor(holder, holder.getFile().getVirtualFile(), null);
}
项目:intellij-perl-plugin    文件:PerlRunProfileState.java   
public PerlRunProfileState(ExecutionEnvironment executionEnvironment) {
    this.executionEnvironment = executionEnvironment;
    this.project = executionEnvironment.getProject();
    String file = "";
    Object vFile = executionEnvironment.getDataContext().getData("virtualFile");
    if(vFile != null && vFile instanceof VirtualFileImpl && ((VirtualFileImpl) vFile).getExtension().equals("pl")) {
        //get file path from context
        file = ((VirtualFileImpl) vFile).getPath();
    }else{
        //get file from selected text editor
        file = FileDocumentManager.getInstance().getFile(FileEditorManager.getInstance(executionEnvironment.getProject()).getSelectedTextEditor().getDocument()).toString();
    }
    if(file.endsWith("pl")) {
        PerlCli.runFile(executionEnvironment.getProject(), file);
    }
}
项目:vue-for-idea    文件:FileUtils.java   
public static List<String> getAllFilesInDirectory(VirtualFile directory, String target, String replacement) {
    List<String> files = new ArrayList<String>();
    VirtualFile[] children = directory.getChildren();
    for (VirtualFile child : children) {
        if (child instanceof VirtualDirectoryImpl) {
            files.addAll(getAllFilesInDirectory(child, target, replacement));
        } else if (child instanceof VirtualFileImpl) {
            files.add(child.getPath().replace(target, replacement));
        }
    }
    return files;
}
项目:WebStormRequireJsPlugin    文件:FileUtils.java   
public static List<String> getAllFilesInDirectory(VirtualFile directory, String target, String replacement) {
    List<String> files = new ArrayList<String>();
    VirtualFile[] children = directory.getChildren();
    for (VirtualFile child : children) {
        if (child instanceof VirtualDirectoryImpl) {
            files.addAll(getAllFilesInDirectory(child, target, replacement));
        } else if (child instanceof VirtualFileImpl) {
            files.add(child.getPath().replace(target, replacement));
        }
    }
    return files;
}