Object obj = getObjectForHandle(handle);
if (obj instanceof IBeansProject) {
return SpringCore.getModel().getProject(((IBeansProject) obj).getProject()).getElementID();
}
else if (obj instanceof ISpringProject) {
AbstractContextStructureBridge parentBridge = ContextCore.getStructureBridge(parentContentType);
if (parentBridge != null && parentBridge instanceof ResourceStructureBridge) {
return parentBridge.getHandleIdentifier(((ISpringProject) obj).getProject());
}
}
else if (obj != null && obj instanceof IModelElement) {
IModelElement parent = ((IModelElement) obj).getElementParent();
if (parent != null) {
return parent.getElementID();
}
}
else {
AbstractContextStructureBridge parentBridge = ContextCore.getStructureBridge(parentContentType);
if (parentBridge != null && parentBridge instanceof ResourceStructureBridge) {
return parentBridge.getParentHandle(handle);
}
}
return null;
}