if (relativeToWorkspace) {
IWorkspaceRoot workspaceRoot = getWorkspaceRoot();
if (workspaceRoot != null) {
IPath wsRootPath = workspaceRoot.getLocation();
IPath srcPath = new Path(newSourceLocation);
if (workspaceRoot.findMember(srcPath) != null) {
sourceLocation = newSourceLocation;
} else if (wsRootPath.isPrefixOf(srcPath)) {
int segmentsMatched = wsRootPath.matchingFirstSegments(srcPath);
srcPath = srcPath.removeFirstSegments(segmentsMatched).setDevice(null);
sourceLocation = srcPath.toOSString();