Package org.eclipse.php.internal.debug.core.pathmapper

Examples of org.eclipse.php.internal.debug.core.pathmapper.VirtualPath


    if (!VirtualPath.isAbsolute(file)) {
      return false;
    }
    Map<VirtualPath, Type> map = getByLaunch(launch);
    for (Entry<VirtualPath, Type> entry : map.entrySet()) {
      VirtualPath tmp = new VirtualPath(file);
      VirtualPath path = entry.getKey();
      Type type = entry.getValue();
      if (type == Type.FILE) {
        if (path.equals(tmp)) {
          return true;
        }
      } else if (type == Type.FOLDER) {
        tmp.removeLastSegment();
        if (path.equals(tmp)) {
          return true;
        }
      } else if (type == Type.RECURSIVE) {
        if (path.isPrefixOf(tmp)) {
          return true;
        }
      }
    }
    return false;
View Full Code Here


        debugTarget.mapFirstDebugFile(remoteFileName);

        // set current working directory to the current script directory
        // on debugger side
        if (debugType.equals(IDebugParametersKeys.PHP_WEB_SCRIPT_DEBUG)) {
          VirtualPath remotePath = new VirtualPath(remoteFileName);
          remotePath.removeLastSegment();
          remoteDebugger.setCurrentWorkingDirectory(remotePath
              .toString());
        }
      }
      debugTarget.addBreakpointFiles(debugTarget.getProject());
    }
View Full Code Here

      PathEntry entry = (PathEntry) element;
      String path = entry.getResolvedPath();

      if (entry.getType() == Type.WORKSPACE) {
        VirtualPath tmpPath = entry.getAbstractPath().clone();
        tmpPath.removeFirstSegment();
        path = tmpPath.toString();
        if (path.startsWith("/")) { //$NON-NLS-1$
          path = path.substring(1);
        }
      }
      if (entry.getType() == Type.INCLUDE_FOLDER
View Full Code Here

    if (remotePathStr.length() == 0) {
      setError(Messages.PathMapperEntryDialog_9);
      return;
    }
    try {
      mapping.remotePath = new VirtualPath(remotePathStr);
    } catch (IllegalArgumentException e) {
      setError(Messages.PathMapperEntryDialog_10);
      return;
    }

    // Workspace file:
    if (fWorkspacePathBtn.getSelection()) {
      String workspacePath = fWorkspacePathText.getText().trim();
      if (workspacePath.length() == 0) {
        setError(Messages.PathMapperEntryDialog_11);
        return;
      }

      boolean pathExistsInWorkspace = false;
      mapping.type = (Type) fWorkspacePathText.getData();
      if (mapping.type == Type.INCLUDE_FOLDER
          || mapping.type == Type.INCLUDE_VAR) {
        pathExistsInWorkspace = new File(workspacePath).exists();
      } else {
        pathExistsInWorkspace = (ResourcesPlugin.getWorkspace()
            .getRoot().findMember(workspacePath) != null);
      }
      if (!pathExistsInWorkspace) {
        setError(NLS.bind(Messages.PathMapperEntryDialog_12,
            workspacePath));
        return;
      }
      try {
        mapping.localPath = new VirtualPath(workspacePath);
      } catch (IllegalArgumentException e) {
        setError(Messages.PathMapperEntryDialog_13);
        return;
      }
    } else if (ignoreMappingBtn.getSelection()) {
      mapping.type = Type.SERVER;
      mapping.localPath = mapping.remotePath.clone();
    } else { // External file:
      String externalPath = fExternalPathText.getText().trim();
      if (externalPath.length() == 0) {
        setError(Messages.PathMapperEntryDialog_14);
        return;
      }
      if (!new File(externalPath).exists()) {
        setError(NLS.bind(Messages.PathMapperEntryDialog_15,
            externalPath));
        return;
      }
      try {
        mapping.type = Type.EXTERNAL;
        mapping.localPath = new VirtualPath(externalPath);
      } catch (IllegalArgumentException e) {
        setError(Messages.PathMapperEntryDialog_16);
        return;
      }
    }
View Full Code Here

    }
    Map<Integer, List<PathEntry>> map = new HashMap<Integer, List<PathEntry>>();
    int mostMatchSegmentsNumber = 1;
    for (int i = 0; i < entries.length; i++) {
      PathEntry pathEntry = entries[i];
      VirtualPath virtualPath = pathEntry.getAbstractPath();
      int matchSegmentsNumber = getMatchSegmentsNumber(virtualPath,
          remotePath);
      if (matchSegmentsNumber > mostMatchSegmentsNumber) {
        mostMatchSegmentsNumber = matchSegmentsNumber;
      }
View Full Code Here

      if (result != null) {
        return result;
      }

      // Ignore path was chosen:
      VirtualPath ignorePath = selectDialog.getIgnoreResult();
      result = new PathEntry(ignorePath, PathEntry.Type.SERVER, null);
      if (debugTarget instanceof PHPDebugTarget) {
        PHPDebugTarget phpDebugTarget = (PHPDebugTarget) debugTarget;
        phpDebugTarget.getContextManager().addToResolveBlacklist(
            ignorePath, Type.RECURSIVE);
View Full Code Here

   *
   * @param initScript
   *            the initial script being executed
   */
  private void handlePDTSessionInitiation(String initScript) {
    VirtualPath vpScr = new VirtualPath(projectScript);
    VirtualPath vpInit = new VirtualPath(initScript);
    // TODO: What happens if there is a difference in case ?
    if (vpScr.getLastSegment().equals(vpInit.getLastSegment())) {
      PathEntry pe = new PathEntry(projectScript,
          PathEntry.Type.WORKSPACE, ResourcesPlugin.getWorkspace()
              .getRoot());
      pathMapper.addEntry(initScript, pe);
    } else {
View Full Code Here

            path = EnvironmentPathUtils.getLocalPath(path);
          }

          secondaryId = path.toString();
          if (VirtualPath.isAbsolute(localPath)
              && (new VirtualPath(localPath)
                  .equals(new VirtualPath(secondaryId)))
              || resource != null
              && secondaryId.equals(resource.getLocation()
                  .toString())) {
            l.add(bp);
          }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.debug.core.pathmapper.VirtualPath

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.