ICompareInput input = (ICompareInput) compareInput;
if (input == null) {
return null;
}
IResourceProvider rp = null;
ITypedElement te = input.getLeft();
if (te instanceof IResourceProvider) {
rp = (IResourceProvider) te;
}
if (rp == null) {
te = input.getRight();
if (te instanceof IResourceProvider) {
rp = (IResourceProvider) te;
}
}
if (rp == null) {
te = input.getAncestor();
if (te instanceof IResourceProvider) {
rp = (IResourceProvider) te;
}
}
if (rp != null) {
return rp.getResource();
}
return null;
}