} else {
medium = mymedium;
}
// the path of the selected medium
IPath mediumPath = designHelper.getTmlRoot().getFolder(new Path(medium)).getProjectRelativePath();
// the path to the file which we are currently editing
IPath pathOfEditedFile = activeFile.getParent().getProjectRelativePath();
pathOfEditedFile = pathOfEditedFile.removeFirstSegments(mediumPath.segmentCount());
ResourceIndexManager rsm = Plugin.getDefault().getResourceIndexManager();
if (rsm != null) {
nontmlspecificrefs = rsm.getTMLpaths(activeFile, medium);
Iterator<String> it = nontmlspecificrefs.iterator();
while (it.hasNext()) {
// current file from the db
IPath currentFile = new Path(it.next()).removeFileExtension();
// path of the current file
IPath currentFilePath = currentFile.removeLastSegments(1);
// removing the path of the elected medium
currentFilePath = currentFilePath.removeFirstSegments(mediumPath.segmentCount());
// removing the path of the elected medium
currentFile = currentFile.removeFirstSegments(mediumPath.segmentCount());
IPath tmp = null;
String reference = currentFile.toString().replaceAll("\\/", ":");
if (versionCompliance != null && versionCompliance.toWGAVersion() != null && versionCompliance.toWGAVersion().isAtLeast(5, 4)) {
if (reference.startsWith("overlay:") && pathOfEditedFile.toString().contains("overlay")) {
reference = reference.substring("overlay:".length());
} else if (pathOfEditedFile.toString().contains("overlay")) {
reference = reference + "@base";
}
}
tmlfilerefs.add(reference);
if (pathOfEditedFile.segmentCount() > 0 && (currentFilePath.segmentCount() >= pathOfEditedFile.segmentCount()) && medium.equals(mymedium)) {
int a = currentFilePath.segmentCount();
int b = pathOfEditedFile.segmentCount();
tmp = currentFilePath.removeLastSegments(a - b);
if (tmp.equals(pathOfEditedFile)) {
currentFilePath = currentFile.removeFirstSegments(tmp.segmentCount());
tmlfilerefs.add("::" + currentFilePath.toString().replaceAll("\\/", ":"));
}
}