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

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


      if (!(element instanceof PathEntry)) {
        return super.getText(element);
      }

      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
          || entry.getType() == Type.INCLUDE_VAR) {
        IBuildpathEntry includePathEntry = (IBuildpathEntry) entry
            .getContainer();
        String includePath = EnvironmentPathUtils
            .getLocalPathString(includePathEntry.getPath());
        if (includePathEntry.getEntryKind() == IBuildpathEntry.BPE_VARIABLE) {
          IPath p = DLTKCore.getResolvedVariablePath(includePathEntry
View Full Code Here


      if (element == PathEntrySelectionDialog.this) {
        return null;
      }

      if (element instanceof PathEntry) {
        PathEntry entry = (PathEntry) element;

        if (entry.getType() == Type.EXTERNAL) {
          return EXTERNAL_CONTAINER;
        } else if (entry.getType() == Type.INCLUDE_VAR
            || entry.getType() == Type.INCLUDE_FOLDER) {
          return entry.getContainer();
        } else if (entry.getType() == Type.WORKSPACE) {
          return ((IResource) entry.getContainer()).getProject();
        }
      }

      for (PathEntry entry : pathEntries) {
        if (entry.getType() == Type.EXTERNAL
            && element == EXTERNAL_CONTAINER) {
          return entry;
        } else if (entry.getType() == Type.INCLUDE_VAR
            || entry.getType() == Type.INCLUDE_FOLDER
            && entry.getContainer() == element) {
          return entry;
        } else if (entry.getType() == Type.WORKSPACE
            && ((IResource) entry.getContainer()).getProject() == element) {
          return entry;
        }
      }

      return null;
View Full Code Here

      final VirtualPath remotePath, final IDebugTarget debugTarget) {
    entries = removeDuplicate(entries);
    final List<PathEntry> l = new LinkedList<PathEntry>();
    final PathEntry[] mostMatchEntries = getMostMatchEntries(entries,
        remotePath);
    PathEntry matchByConfig = null;
    if (mostMatchEntries.length == 0 || mostMatchEntries.length > 1) {
      matchByConfig = getMatchFromLaunchConfiguration(entries,
          debugTarget.getLaunch().getLaunchConfiguration());
    }
    if (mostMatchEntries.length == 1) {
      l.add(mostMatchEntries[0]);
    } else if (matchByConfig != null) {
      l.add(matchByConfig);
    } else {
      Runnable r = new Runnable() {
        public void run() {
          // grab usable shell from somewhere:
          Shell shell = Display.getDefault().getActiveShell();
          if (shell == null) {
            IWorkbenchWindow window = PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow();
            if (window == null) {
              IWorkbenchWindow windows[] = PlatformUI
                  .getWorkbench().getWorkbenchWindows();
              window = windows[0];
            }
            if (window != null) {
              shell = window.getShell();
            }
          }
          PathEntry entry = runFilterDialog(shell, remotePath,
              mostMatchEntries, debugTarget);
          if (entry != null) {
            l.add(entry);
          }
        }
View Full Code Here

      return entries;
    }
    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

      PathEntry[] entries, IDebugTarget debugTarget) {
    PathEntrySelectionDialog selectDialog = createSelectionDialog(shell,
        remotePath, entries);
    if (selectDialog.open() == Window.OK) {
      // Path entry was chosen:
      PathEntry result = selectDialog.getResult();
      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

  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 {
      // ok, the initial script doesn't match what was passed into
View Full Code Here

   *            the initial script being executed
   */

  private void handleRemoteSessionInitiation(String initScript) {
    try {
      PathEntry pe = DebugSearchEngine.find(pathMapper, initScript, null,
          this);
      if (pe != null) {
        Object container = pe.getContainer();
        if (container != null && container instanceof IResource) {
          IResource res = (IResource) container;
          IProject prj = res.getProject();
          PHPSourceLookupDirector dir = (PHPSourceLookupDirector) getLaunch()
              .getSourceLocator();
View Full Code Here

   * @param decodedFile
   * @return absolute path to a workspace registered file.
   */
  public String mapToWorkspaceFileIfRequired(String decodedFile) {
    String mappedFile = null;
    PathEntry mappedPathEntry = null;
    // check to see if the file exists on the file system
    java.io.File fileSystemFile = new java.io.File(decodedFile);
    if (fileSystemFile.exists() && pathMapper != null) {
      mappedPathEntry = pathMapper.getLocalFile(decodedFile);
    } else {

      // file doesn't exist so we must remap it, using the PDT path mapper
      // which could end up prompting the user to create a mapping
      try {
        if (projectScript != null) {
          mappedPathEntry = DebugSearchEngine.find(decodedFile, this);
        } else {
          mappedPathEntry = DebugSearchEngine.find(pathMapper,
              decodedFile, null, this);
        }
      } catch (Exception e1) {
      }
    }

    // do we now have a remapped file ?
    if (mappedPathEntry == null) {
      final PharPath pharPath = PharPath.getPharPath(new Path(
          "phar:" + decodedFile)); //$NON-NLS-1$
      if (pharPath != null) {
        DBGpLogger
            .debug("inbound File '" + decodedFile + "' remapped to phar file"); //$NON-NLS-1$ //$NON-NLS-2$
        mappedFile = "phar:" + decodedFile; //$NON-NLS-1$
      } else {
        DBGpLogger
            .debug("inbound File '" + decodedFile + "' Not remapped"); //$NON-NLS-1$ //$NON-NLS-2$
        mappedFile = decodedFile;
      }
    } else {
      mappedFile = mappedPathEntry.getResolvedPath();
      IResource file = ResourcesPlugin.getWorkspace().getRoot()
          .findMember(new Path(mappedFile));
      if (file != null) {
        // changed as RSE resources return null for RawLocation.
        IPath t = file.getRawLocation();
View Full Code Here

TOP

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

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.