Examples of VFile


Examples of jetbrains.communicator.core.vfs.VFile

  private interface Updater {
    void update(ModifiableRootModel modifiableModel);
  }

  private VFile checkVFile(VirtualFile file, Project project, String expectedPath, String expectedFullPath) {
    VFile vFile = VFSUtil.createFileFrom(file, project);

    if (project != null) {
      assertEquals("Wrong project", project.getName(), vFile.getProjectName());
    }
    else {
      assertNull("No project expected", vFile.getProjectName());
    }

    assertEquals("Wrong content path", expectedPath, vFile.getContentPath());
    assertEquals("Wrong full path", expectedFullPath, vFile.getFullPath());
    assertEquals("Should restore Virtual File from " + vFile,
        file, VFSUtil.getVirtualFile(vFile));

    return vFile;
  }
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

  public void fillRequest(Element element) {
    myFile.saveTo(element);
  }

  public void processResponse(Element responseElement) {
    VFile from = VFile.createFrom(responseElement);
    if (from != null) {
      myFile.setContents(from.getContents());
    }
  }
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

    return result[0];
  }

  private static VFile _createFileFrom(Project project, VirtualFile file) {
    VFile result = null;

    Document document = FileDocumentManager.getInstance().getDocument(file);

    Project[] openProjects = getOpenProjects();
    for (int i = 0; i < openProjects.length && result == null; i++) {
      Project openProject = openProjects[i];
      if (!openProject.isInitialized() && !ApplicationManager.getApplication().isUnitTestMode()) continue;

      if (document != null) {
        PsiFile psiFile = PsiDocumentManager.getInstance(openProject).getPsiFile(document);
        if (isJavaFile(psiFile)) {
          PsiJavaFile psiJavaFile = (PsiJavaFile) psiFile;
          assert psiJavaFile != null;
          final PsiClass[] classes = psiJavaFile.getClasses();
          if (classes.length > 0) {
            result = createResultIfNeeded(result, file);
            result.setFQName(classes[0].getQualifiedName());
          }
        }
      }

      ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(openProject).getFileIndex();
      if (projectFileIndex.isInSource(file)) {
        VirtualFile sourceRoot = projectFileIndex.getSourceRootForFile(file);
        result = createResultIfNeeded(result, file);
        result.setSourcePath(getRelativePath(file, sourceRoot));
      }

      if (projectFileIndex.isInContent(file)) {
        VirtualFile contentRoot = projectFileIndex.getContentRootForFile(file);
        result = createResultIfNeeded(result, file);
        result.setContentPath(getRelativePath(file, contentRoot));
      }
    }

    if (result == null) {
      result = VFile.create(file.getPath(), null, file.isWritable());
    }

    if (project != null) {
      result.setProjectName(project.getName());
    }

    return result;
  }
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

    }
  }

  private PositionCorrector createPositionCorrector() {
    updateFacade();
    VFile localFile = (VFile) myRemoteFile.clone();
    myFacade.fillFileContents(localFile);
    return new PositionCorrector(myFacade, myRemoteFile.getContents(), localFile.getContents());
  }
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

  private void fillProjectData(Project openProject, final ProjectsData result) {
    VirtualFile[] openFiles = FileEditorManager.getInstance(openProject).getOpenFiles();

    List<VFile> fileInfos = new ArrayList<VFile>(openFiles.length);
    for (VirtualFile openFile : openFiles) {
      VFile vFile = VFSUtil.createFileFrom(openFile, openProject);
      if (vFile != null) {
        if (vFile.getProjectName() != null) {
          fileInfos.add(vFile);
        } else {
          result.addNonProjectFile(vFile);
        }
      }
View Full Code Here

Examples of org.maqetta.server.VFile

          IVResource parent = this.workspace;
          for (int i = me.matchingFirstSegments(a); i < segments.length; i++) {
              int segsToEnd = segments.length - i - 1;
              String s = a.removeLastSegments(segsToEnd).toOSString();
              IStorage f = this.userDirectory.newInstance(s);
              parent = new VFile(f, parent, segments[i]);
          }
         
          if(parent==this.workspace)
              parent = new VFile(this.userDirectory, this.workspace);
         
          return parent;

  }
View Full Code Here

Examples of org.maqetta.server.VFile

      path = path.replace('/', File.separatorChar);
      VFile linkFile = new VFile(this.userDirectory.newInstance(path));
      return linkFile;
    }
    */
    IVResource directory = new VFile(this.userDirectory, this.workspace);
    /* make sure the new resoruce is within the user directory */
   
    IVResource userFile = directory.create(path);

    return userFile;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.