class TextBoxFieldRenderer extends FieldRenderer<TextBoxBaseDefinition, DefaultFormGroup> implements RequiresValueConverter {

    @Override
    protected FormGroup getFormGroup(RenderMode renderMode) {

        DefaultFormGroup formGroup = formGroupsInstance.get();

        if (renderMode.equals(RenderMode.PRETTY_MODE)) {
            HTML html = new HTML();
            formGroup.render(html,
                             field);
        } else {
            String inputId = generateUniqueId();
            textBox.setName(fieldNS);
            textBox.setId(inputId);
            textBox.setPlaceholder(field.getPlaceHolder());
            textBox.setMaxLength(field.getMaxLength());
            textBox.setEnabled(!field.getReadOnly());
            
            registerFieldRendererPart(textBox);

            formGroup.render(inputId, textBox, field);
        }

        return formGroup;
    }

}