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

Examples of org.eclipse.php.internal.debug.core.pathmapper.PathEntry.Type


  public PathEntry getLocalFile(String remoteFile) {
    VirtualPath path = getPath(remoteToLocalMap,
        new VirtualPath(remoteFile));
    if (path != null) {
      String localFile = path.toString();
      Type type = getPathType(path);
      if (type == Type.SERVER) {
        return null;
      } else if (type == Type.WORKSPACE) {
        IResource resource = ResourcesPlugin.getWorkspace().getRoot()
            .findMember(localFile);
View Full Code Here


  }

  protected Type getPathType(VirtualPath path) {
    path = path.clone();
    while (path.getSegmentsCount() > 0) {
      Type type = localToPathEntryType.get(path);
      if (type != null) {
        return type;
      }
      path.removeLastSegment();
    }
View Full Code Here

    List<Mapping> l = new ArrayList<Mapping>(localToRemoteMap.size());
    Iterator<VirtualPath> i = localToRemoteMap.keySet().iterator();
    while (i.hasNext()) {
      VirtualPath localPath = i.next();
      VirtualPath remotePath = localToRemoteMap.get(localPath);
      Type type = localToPathEntryType.get(localPath);
      l.add(new Mapping(localPath, remotePath, type));
    }
    return l.toArray(new Mapping[l.size()]);
  }
View Full Code Here

      HashMap entryMap = (HashMap) map.get(i.next());
      String localStr = (String) entryMap.get("local"); //$NON-NLS-1$
      String remoteStr = (String) entryMap.get("remote"); //$NON-NLS-1$
      String typeStr = (String) entryMap.get("type"); //$NON-NLS-1$
      if (localStr != null && remoteStr != null && typeStr != null) {
        Type type = Type.valueOf(typeStr);
        VirtualPath local = new VirtualPath(localStr);
        VirtualPath remote = new VirtualPath(remoteStr);
        remoteToLocalMap.put(remote, local);
        localToRemoteMap.put(local, remote);
        localToPathEntryType.put(local, type);
View Full Code Here

    int c = 1;
    while (i.hasNext()) {
      HashMap entry = new HashMap();
      VirtualPath local = i.next();
      VirtualPath remote = localToRemoteMap.get(local);
      Type type = localToPathEntryType.get(local);
      entry.put("local", local); //$NON-NLS-1$
      entry.put("remote", remote); //$NON-NLS-1$
      if (type != null) {
        entry.put("type", type.name()); //$NON-NLS-1$
      }
      entries.put("item" + (c++), entry); //$NON-NLS-1$
    }
    return entries;
  }
View Full Code Here

              extFileResult.getContainer());
        }
        if (result instanceof IncludedFileResult) {
          IncludedFileResult incFileResult = (IncludedFileResult) result;
          IBuildpathEntry container = incFileResult.getContainer();
          Type type = (container.getEntryKind() == IBuildpathEntry.BPE_VARIABLE) ? Type.INCLUDE_VAR
              : Type.INCLUDE_FOLDER;
          return new PathEntry(incFileResult.getFile()
              .getAbsolutePath(), type, container);
        }
        if (result != null) {
View Full Code Here

                }
                if (entryPath != null
                    && (entryPath.isPrefixOf(Path
                        .fromOSString(remoteFile)) || entryPath
                        .isPrefixOf(remoteFilePath))) {
                  Type type = (entry.getEntryKind() == IBuildpathEntry.BPE_VARIABLE) ? Type.INCLUDE_VAR
                      : Type.INCLUDE_FOLDER;
                  localFile[0] = new PathEntry(
                      file.getAbsolutePath(), type, entry);
                  // pathMapper.addEntry(remoteFile,
                  // localFile[0]);
                  // PathMapperRegistry.storeToPreferences();
                  return Status.OK_STATUS;
                }
              }
            }

          } catch (Exception e) {
            PHPDebugPlugin.log(e);
          }
          for (IncludePath includePath : includePaths) {
            if (includePath.getEntry() instanceof IBuildpathEntry) {
              IBuildpathEntry entry = (IBuildpathEntry) includePath
                  .getEntry();
              IPath entryPath = entry.getPath();
              if (entry.getEntryKind() == IBuildpathEntry.BPE_VARIABLE) {
                entryPath = DLTKCore
                    .getResolvedVariablePath(entryPath);
              }
              if (entryPath != null
                  && entryPath.isPrefixOf(Path
                      .fromOSString(remoteFile))) {
                Type type = (entry.getEntryKind() == IBuildpathEntry.BPE_VARIABLE) ? Type.INCLUDE_VAR
                    : Type.INCLUDE_FOLDER;
                localFile[0] = new PathEntry(
                    file.getAbsolutePath(), type, entry);
                pathMapper.addEntry(remoteFile, localFile[0]);
                PathMapperRegistry.storeToPreferences();
View Full Code Here

   * @throws InterruptedException
   */
  private static void find(final File file, final VirtualPath path,
      final IBuildpathEntry container, final List<PathEntry> results) {
    if (!file.isDirectory() && file.getName().equals(path.getLastSegment())) {
      Type type = (container.getEntryKind() == IBuildpathEntry.BPE_VARIABLE) ? Type.INCLUDE_VAR
          : Type.INCLUDE_FOLDER;
      PathEntry pathEntry = new PathEntry(file.getAbsolutePath(), type,
          container);
      results.add(pathEntry);
      return;
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.debug.core.pathmapper.PathEntry.Type

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.