if (sender instanceof ERDObjectSaverInterface) {
if (((ERDObjectSaverInterface)sender).objectWasSaved()) {
// The user saved the object instead of hitting cancel, better hook it up
// to the releationship
// Have to use our interface as EditPageInterface doesn't have object().
EOEnterpriseObject talent = EOUtilities.localInstanceOfObject(movie.editingContext(),
((ERDEditPageInterface)sender).object());
movie.addObjectToBothSidesOfRelationshipWithKey(talent, "directors");
}
} else {
log.error("Using CreateDirectorDelegate with a sender that does not implement ERDObjectSaverInterface! Sender class: " + sender.getClass().getName());