You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by pk...@apache.org on 2015/04/23 18:02:16 UTC

svn commit: r1675667 - /uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/searchStrategy/LastLaunchSearchStrategy.java

Author: pkluegl
Date: Thu Apr 23 16:02:16 2015
New Revision: 1675667

URL: http://svn.apache.org/r1675667
Log:
UIMA-4287
- fixed last launched script type system lookup

Modified:
    uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/searchStrategy/LastLaunchSearchStrategy.java

Modified: uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/searchStrategy/LastLaunchSearchStrategy.java
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/searchStrategy/LastLaunchSearchStrategy.java?rev=1675667&r1=1675666&r2=1675667&view=diff
==============================================================================
--- uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/searchStrategy/LastLaunchSearchStrategy.java (original)
+++ uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/searchStrategy/LastLaunchSearchStrategy.java Thu Apr 23 16:02:16 2015
@@ -24,9 +24,13 @@ import org.apache.uima.caseditor.ide.sea
 import org.apache.uima.ruta.addons.RutaAddonsPlugin;
 import org.apache.uima.ruta.ide.core.RutaNature;
 import org.apache.uima.ruta.ide.core.builder.RutaProjectUtils;
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.internal.resources.Workspace;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
@@ -34,6 +38,7 @@ import org.eclipse.debug.core.ILaunchCon
 import org.eclipse.debug.ui.DebugUITools;
 import org.eclipse.dltk.internal.launching.LaunchConfigurationUtils;
 import org.eclipse.dltk.launching.ScriptLaunchConfigurationConstants;
+import org.eclipse.ui.internal.Workbench;
 
 public class LastLaunchSearchStrategy implements ITypeSystemSearchStrategy {
 
@@ -62,14 +67,17 @@ public class LastLaunchSearchStrategy im
       if (scriptFile.exists()) {
         IPath path = null;
         try {
-          path = RutaProjectUtils.getTypeSystemDescriptorPath(scriptFile.getProjectRelativePath(),
+          path = RutaProjectUtils.getTypeSystemDescriptorPath(scriptFile.getLocation(),
                   project);
         } catch (CoreException e) {
           RutaAddonsPlugin.error(e);
         }
         if (path != null) {
-          IFile ts = project.getFile(path.makeRelativeTo(project.getLocation()));
-          if (ts.exists()) {
+          
+          IWorkspace workspace= ResourcesPlugin.getWorkspace();    
+          IPath location= Path.fromOSString(path.toFile().getAbsolutePath()); 
+          IFile ts= workspace.getRoot().getFileForLocation(location);
+          if (ts != null && ts.exists()) {
             return ts;
           }
         }