Change-Id: Id9b6b81b20a88f1cabd2801b092983a1107f294e
This commit is contained in:
Holger Schill 2013-02-04 15:00:45 +01:00
parent c08a03295a
commit 2e08706f69
2 changed files with 11 additions and 2 deletions

View file

@ -19,8 +19,12 @@ public class DefaultTraceURIConverter implements ITraceURIConverter {
public URI getURIForTrace(XtextResource context) {
URI uri = context.getURI();
return getURIForTrace(uri);
}
public URI getURIForTrace(URI uri) {
if (uri.isPlatform()) {
// create a URI that is relative to the contained project.
// create a URI that is relative to the contained projects.
List<String> segments = uri.segmentsList().subList(2, uri.segmentCount());
return URI.createHierarchicalURI(segments.toArray(new String[segments.size()]), null, null);
}
@ -44,5 +48,4 @@ public class DefaultTraceURIConverter implements ITraceURIConverter {
return false;
return true;
}
}

View file

@ -18,6 +18,7 @@ import com.google.inject.ImplementedBy;
* environments outside of the JARs, such as project name and source folders.
*
* @author Moritz Eysholdt - Initial contribution and API
* @author Holger Schill
*/
@ImplementedBy(DefaultTraceURIConverter.class)
public interface ITraceURIConverter {
@ -27,4 +28,9 @@ public interface ITraceURIConverter {
*/
URI getURIForTrace(XtextResource context);
/**
* Converts an absolute URI into a format that can be persisted in a trace file.
*/
URI getURIForTrace(URI uri);
}