Package com.google.collide.client.util

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


      SearchResult item = items.get(i);
      DivElement outer = Elements.createDivElement();
      if (i > 0) {
        outer.setClassName(css.second());
      }
      final PathUtil path = new PathUtil(item.getTitle());
      AnchorElement title = Elements.createAnchorElement(css.title());
      title.setTextContent(item.getTitle());
      if (item.getUrl() != null) {
        // this is unusual, but allows search results to point outside of this
        // workspace, e.g. to language API docs.
View Full Code Here


  }

  @Override
  public PlaceNavigationEvent<FileHistoryPlace> createNavigationEvent(
      JsonStringMap<String> decodedState) {
    return createNavigationEvent(new PathUtil(decodedState.get(NavigationEvent.PATH_KEY)),
        decodedState.get(NavigationEvent.ROOT_ID_KEY));
  }
View Full Code Here

    Mutation.Type mutationType = copiedNodesAreCut ? Mutation.Type.MOVE : Mutation.Type.COPY;
    WorkspaceTreeUpdate msg = fileTreeModel.makeEmptyTreeUpdate();
    for (int i = 0, n = copiedNodes.size(); i < n; i++) {
      FileTreeNode copiedNode = copiedNodes.get(i);
      PathUtil targetPath = new PathUtil.Builder().addPath(parentDirData.getNodePath())
          .addPathComponent(FileTreeUtils.allocateName(
              parentDirData.<DirInfoImpl>cast(), copiedNode.getName())).build();
      msg.getMutations().add(FileTreeUtils.makeMutation(
          mutationType, copiedNode.getNodePath(), targetPath, copiedNode.isDirectory(),
          copiedNode.getFileEditSessionKey()));
View Full Code Here

  public void handleRename(TreeNodeElement<FileTreeNode> renamedNode) {

    // We hang on to the old name in case we need to roll back the rename.
    FileTreeNode data = renamedNode.getData();
    final String oldName = data.getName();
    final PathUtil oldPath = data.getNodePath();

    // Go into "rename node" mode.
    setMode(ContextMenuMode.RENAME);
    nodeLabelMutator.enterMutation(renamedNode, new LabelRenamerCallback<FileTreeNode>() {
      @Override
View Full Code Here

      public String toString() {
        return "Download";
      }
    };

    final PathUtil rootPath = PathUtil.EMPTY_PATH;
    FileTreeMenuItem uploadFile = new FileTreeMenuItem() {
      @Override
      public void onClicked(TreeNodeElement<FileTreeNode> node) {
        place.fireEvent(new UploadClickedEvent(UploadType.FILE, node == null ? rootPath
            : node.getData().getNodePath()));
View Full Code Here

    }

    // parseBoolean maps null and non-"true" (ignoring case) to false
    boolean forceReload = Boolean.parseBoolean(decodedState.get(NavigationEvent.FORCE_RELOAD_KEY));

    return createNavigationEvent(new PathUtil(decodedState.get(NavigationEvent.PATH_KEY)),
        lineNumber, column, forceReload);
  }
View Full Code Here

    Anchor anchor = breakpoints.anchorBreakpoint(breakpoint);
    debuggingSidebar.updateBreakpoint(breakpoint, anchor.getLine().getText());
  }

  private void maybeAnchorExecutionLine() {
    PathUtil callFramePath = debuggerState.getActiveCallFramePath();
    if (callFramePath != null && callFramePath.equals(path)) {
      int lineNumber = debuggerState.getActiveCallFrameExecutionLineNumber();
      if (lineNumber >= 0) {
        debuggingModelRenderer.renderExecutionLine(lineNumber);
      }
    }
View Full Code Here

  private void handleOnCallFrameSelect(int callFrameDepth) {
    debuggerState.setActiveCallFrameIndex(callFrameDepth);
    debuggingModelRenderer.renderDebuggerCallFrame();

    PathUtil callFramePath = debuggerState.getActiveCallFramePath();
    if (callFramePath == null) {
      // Not paused, remove the execution line (if any).
      debuggingModelRenderer.removeExecutionLine();
      return;
    }
View Full Code Here

  private void setupAutocomplete() {
    AutocompleteHandler<PathUtil> handler = new AutocompleteHandler<PathUtil>() {
      @Override
      public JsonArray<PathUtil> doCompleteQuery(String query) {
        PathUtil searchPath = PathUtil.WORKSPACE_ROOT;
        // the PathUtil.createExcluding wasn't used here since it doesn't make
        // /test2/ into a path containing /test2 but instead makes it /
        if (query.lastIndexOf(PathUtil.SEP) != -1) {
          searchPath = new PathUtil(query.substring(0, query.lastIndexOf(PathUtil.SEP)));
          query = query.substring(query.lastIndexOf(PathUtil.SEP) + 1);
        }

        // Only the non folder part (if it exists) is supported for wildcards
        RegExp reQuery = RegExpUtils.createRegExpForWildcardPattern(
View Full Code Here

    JsonArray<DocumentInfo> result = JsonCollections.createArray();

    JsonArray<CssStyleSheetHeader> headers = response.getHeaders();
    for (CssStyleSheetHeader header : headers.asIterable()) {
      String url = header.getUrl();
      PathUtil path = debuggerState.getSourceMapping().getLocalSourcePath(url);
      if (path == null) {
        continue;
      }
      if (!path.getBaseName().endsWith(".css")) {
        continue;
      }
      String styleSheetId = header.getId();
      DocumentInfo docInfo = new DocumentInfo(styleSheetId, path);
      result.add(docInfo);
View Full Code Here

TOP

Related Classes of com.google.collide.client.util.PathUtil

Copyright © 2018 www.massapicom. 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.