String type = region.getAttributeValue("type");
if (type != null && type.equals("file") && region.hasAttribute("doc") && !region.isDynamicAttributeValue("doc")) {
String containername = region.getAttributeValue("doc");
//final IFolder fContainer = new WGADesignStructureHelper(activeFile).getFileContainer(containername);
final IFolder fContainer = WGADesignStructureHelper.findReferencedFileContainer(activeFile, containername);
if (fContainer != null) {
final Set<String> fReferences = references;
try {
fContainer.accept(new IResourceVisitor() {
public boolean visit(IResource resource) throws CoreException {
if (resource instanceof IFile) {
fReferences.add(resource.getName().toLowerCase());
return true;
} else if (resource.equals(fContainer)) {
return true;
} else {
return false;
}
}
});
} catch (CoreException e) {
Plugin.getDefault().logError("Unable to lookup container file references of filecontainer '" + fContainer.getLocation() + "'.", e);
}
}
}
}
if (tagName.equals("image") || tagName.equals("img")) {
if (region.hasAttribute("doc") && !region.isDynamicAttributeValue("doc") && !region.hasAttribute("db")) {
String containername = region.getAttributeValue("doc");
//final IFolder fContainer = new WGADesignStructureHelper(activeFile).getFileContainer(containername);
final IFolder fContainer = WGADesignStructureHelper.findReferencedFileContainer(activeFile, containername);
if (fContainer != null) {
final Set<String> fReferences = references;
try {
fContainer.accept(new IResourceVisitor() {
public boolean visit(IResource resource) throws CoreException {
if (resource instanceof IFile) {
fReferences.add(resource.getName().toLowerCase());
return true;
} else if (resource.equals(fContainer)) {
return true;
} else {
return false;
}
}
});
} catch (CoreException e) {
Plugin.getDefault().logError("Unable to lookup container file references of filecontainer '" + fContainer.getLocation() + "'.", e);
}
}
}
}