Problem with default file path

Help
2006-06-29
2013-04-23
  • Steven Slegel
    Steven Slegel
    2006-06-29

    I tried your plugin using ExamDiff Pro. When I diff two files ExamDiff cannot find the files because the path starts in the workspace directory.  My project is not in the workspace directory.  Is there any way to work around this?

     
    • Kurt
      Kurt
      2006-07-31

      Hmmm.  The plugin was written with Eclipse Projects in mind.  I'll have to look at it and see if anything can be done.

      Kurt

       
    • daniel g
      daniel g
      2007-01-23

      Hi Guys,

      so here i have an solution for this problem:

      change line 81 in file LaunchExternalDiffTool.

      //old:  IPath path = ResourcesPlugin.getWorkspace().getRoot().getRawLocation();
            
      //new:  by DG          
              IProject project = ((IResource) myList.get(0)).getProject();
              IPath path = project.getRawLocation().addTrailingSeparator();                     
             
              path1 = path1.removeFirstSegments(1);
              path2 = path2.removeFirstSegments(1);

      So you have an reference to the local project dir. Independent form the workspace.

      Daniel G

       
      • Rob Voyer
        Rob Voyer
        2008-07-11

        Just wondering if this was implemented as I am having the same issue.

        Rob

         
      • ducati
        ducati
        2008-10-14

        Hi,
        I placed compiled plugin in the tracker for thoose who don't have time to fidle with rebuilding plugin.
        It is exact daniel_gue's patch .
        Thank you daniel.

        http://sourceforge.net/tracker/index.php?func=detail&aid=2165559&group_id=166350&atid=838676

         
    • AdrianIssott
      AdrianIssott
      2009-01-03

      Is there any chance of this fix being implemented in the main branch of the tool? I recently fixed this myself and only noticed it had already had a fix when I came back to the site to raise a bug.

      Incidentally I fixed the issue as follows which I think is a slight improvement on the above fix as it's simpler.

      74,75c74,75
      <         IPath path1 = firstResource.getFullPath();
      <         IPath path2 = secondResource.getFullPath();
      ---
      >         IPath path1 = firstResource.getLocation();
      >         IPath path2 = secondResource.getLocation();
      81,88c80,82
      <         IPath path = ResourcesPlugin.getWorkspace().getRoot().getRawLocation();
      < //        MessageDialog.openInformation(
      < //        shell,
      < //        "External diff Tool Plug-in",
      < //        "Path: " + path);
      <        
      <         String firstArg = path.toString() + path1.toString();
      <         String secondArg = path.toString() + path2.toString();
      ---
      >         String firstArg = path1.toString();
      >         String secondArg = path2.toString();
      96c90
      <        
      ---
      >