public function buildField(FormBuilderInterface $builder, $property, array $widget, $editMode)
    {
        if (!isset($widget['options'])) {
            $widget['options'] = array();
        }
        if( !isset($widget['attr']) ) {
            $widget['attr'] = array();
        }

        if (!isset($widget['type'])) {
            throw new \RuntimeException("You must specify a type for property $property");
        }

        $options = $widget['options'];
        $options['attr'] =  $widget['attr'];
        $type = $widget['type'];


        if( isset($widget['default']) && !$editMode) {
            $options['data'] = $widget['default'];
        }

        if( !isset($options['attr']) ) {
            $options['attr'] = array();
        }

        $options['attr']['data-property'] = $property;
        if( isset($parameters['data']) ) {
            $options['attr']['data-default-value'] = $parameters['data'];
        }

        // Transform validation constraints
        if (isset($options['constraints'])) {
            $options['constraints'] = $this->buildConstraints($options['constraints']);
        }

        $builder->add($property, $type, $options);
    }