Examples of PathUtil


Examples of com.google.collide.client.util.PathUtil

      RunTarget currentTarget = targetPopup.getRunTarget();
      if (currentTarget == null || currentTarget.getAlwaysRunFilename() == null) {
        return;
      }

      PathUtil currentAlwaysRunPath = new PathUtil(currentTarget.getAlwaysRunFilename());
      PathUtil relativePath = currentAlwaysRunPath.makeRelativeToParent(oldPath);
      if (relativePath != null) {
        // Either this node, or some ancestor node got renamed.
        PathUtil newFilePath = PathUtil.concatenate(newPath, relativePath);
        RunTargetImpl impl = (RunTargetImpl) currentTarget;
        impl.setAlwaysRunFilename(newFilePath.getPathString());
        targetPopup.setRunTarget(impl);
      }
    }
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

      // If this gets more complicated, make it a visitor type thing
      boolean isAlwaysRun = target.getRunMode() == RunMode.ALWAYS_RUN;
      boolean hasClearedCurrentFile = currentFilePath == null;
      boolean hasClearedAlwaysRun = !isAlwaysRun;
      PathUtil alwaysRunPath = isAlwaysRun ? new PathUtil(target.getAlwaysRunFilename()) : null;

      for (int i = 0; (!hasClearedCurrentFile || !hasClearedAlwaysRun) && i < oldNodes.size();
          i++) {
        FileTreeNode node = oldNodes.get(i);
        if (!hasClearedCurrentFile) {
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

    documentManager.getDocument(navigationEvent.getPath(), this);
  }

  @Override
  public void onDocumentReceived(Document document) {
    PathUtil path = DocumentMetadata.getPath(document);

    if (mostRecentNavigationEvent == null || !mostRecentNavigationEvent.isActiveLeaf()
        || !path.equals(mostRecentNavigationEvent.getPath())) {
      // User selected another file or navigated away since this request, ignore
      return;
    }

    openDocument(document, path);
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

  @Override
  public void onUneditableFileContentsReceived(FileContents uneditableFile) {
    showDisplayOnly(uneditableFile);
    WorkspacePlace.PLACE.fireEvent(
        new FileOpenedEvent(false, new PathUtil(uneditableFile.getPath())));
  }
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

  /**
   * Changes the display for an uneditable file.
   */
  private void showDisplayOnly(FileContents uneditableFile) {
    PathUtil filePath = new PathUtil(uneditableFile.getPath());
    if (!filePath.equals(mostRecentNavigationEvent.getPath())) {
      // User selected another file since this request, ignore
      return;
    }

    isSelectedFileEditable = false;

    // Set the tab title to the current open file
    Elements.setCollideTitle(filePath.getBaseName());

    contentArea.setContent(uneditableDisplay);
    uneditableDisplay.displayUneditableFileContents(uneditableFile);
    editorBundle.getBreadcrumbs().setPath(filePath);
  }
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

   * Adds a node to our model from a broadcasted workspace tree mutation.
   */
  private void handleExternalAdd(String newPath, TreeNodeInfo newNode, String newTipId) {

    String ourClientId = BootstrapSession.getBootstrapSession().getActiveClientId();
    PathUtil path = new PathUtil(newPath);
    FileTreeNode rootNode = fileTreeModel.getWorkspaceRoot();

    // If the root is null... then we are receiving mutations before we even got
    // the workspace in the first place. So we should ignore.
    // TODO: This is a potential race. We need to schedule a pending
    // referesh for the tree!!
    if (rootNode == null) {
      Log.warn(getClass(), "Receiving ADD tree mutations before the root node is set for node: "
          + path.getPathString());
      return;
    }

    FileTreeNode existingNode = rootNode.findChildNode(path);
    if (existingNode == null) {
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

      fileTreeModel.dispatchAddNode(existingNode.getParent(), existingNode, newTipId);
    }
  }

  private void handleExternalCopy(String newpath, TreeNodeInfo newNode, String newTipId) {
    PathUtil path = new PathUtil(newpath);
    FileTreeNode rootNode = fileTreeModel.getWorkspaceRoot();

    // If the root is null... then we are receiving mutations before we even got
    // the workspace in the first place. So we should ignore.
    // TODO: This is a potential race. We need to schedule a pending
    // referesh for the tree!!
    if (rootNode == null) {
      Log.warn(getClass(), "Receiving COPY tree mutations before the root node is set for node: "
          + path.getPathString());
      return;
    }

    FileTreeNode installedNode = (FileTreeNode) newNode;
    fileTreeModel.addNode(path, installedNode, newTipId);
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

    // Note that for deletes we do NOT currently optimistically update the UI.
    // So we need to remove the node, even if we triggered said delete.
    JsonArray<PathUtil> pathsToDelete = JsonCollections.createArray();
    for (int i = 0; i < deletedNodes.size(); i++) {
      pathsToDelete.add(new PathUtil(deletedNodes.get(i).getOldPath()));
    }
    fileTreeModel.removeNodes(pathsToDelete, newTipId);
  }
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

    }
    fileTreeModel.removeNodes(pathsToDelete, newTipId);
  }

  private void handleExternalMove(String oldPathStr, String newPathStr, String newTipId) {
    PathUtil oldPath = new PathUtil(oldPathStr);
    PathUtil newPath = new PathUtil(newPathStr);
    FileTreeNode rootNode = fileTreeModel.getWorkspaceRoot();

    // If the root is null... then we are receiving mutations before we even got
    // the workspace in the first place. So we should ignore.
    // TODO: This is a potential race. We need to schedule a pending
View Full Code Here

Examples of com.google.collide.client.util.PathUtil

  }

  public void handleSubtreeReplaced(GetDirectoryResponse response) {
    FileTreeNode incomingSubtree = FileTreeNode.transform(response.getBaseDirectory());
    fileTreeModel.replaceNode(
        new PathUtil(response.getPath()), incomingSubtree, response.getRootId());
    if (PathUtil.WORKSPACE_ROOT.equals(new PathUtil(response.getPath()))) {
      fileTreeModel.maybeSetLastAppliedTreeMutationRevision(response.getRootId());
    }
  }
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.