import com.dci.intellij.dbn.object.common.list.DBObjectRelation;
public class DBObjectListFromRelationListLoader<T extends DynamicContentElement> extends DynamicSubcontentCustomLoader<T> {
public T resolveElement(DynamicContent<T> dynamicContent, DynamicContentElement sourceElement) {
DBObjectList objectList = (DBObjectList) dynamicContent;
DBObjectRelation objectRelation = (DBObjectRelation) sourceElement;
DBObject object = (DBObject) objectList.getTreeParent();
if (object.equals(objectRelation.getSourceObject())) {
return (T) objectRelation.getTargetObject();
}
if (object.equals(objectRelation.getTargetObject())) {
return (T) objectRelation.getSourceObject();
}
return null;
}