protected function validateField(SwatDetailsViewField $field)
    {
        // note: This works because the id property is set before children are
        // added to parents in SwatUI.
        if ($field->id !== null) {
            if (array_key_exists($field->id, $this->fields_by_id)) {
                throw new SwatDuplicateIdException(
                    "A field with the id '{$field->id}' already exists " .
                        'in this details-view.',
                    0,
                    $field->id
                );
            }
        }
    }