class IntegerBoxFieldRenderer extends FieldRenderer<IntegerBoxFieldDefinition, DefaultFormGroup> implements RequiresValueConverter {

    @Override
    protected FormGroup getFormGroup(RenderMode renderMode) {

        Widget widget;

        String inputId = generateUniqueId();

        if (renderMode.equals(RenderMode.PRETTY_MODE)) {
            widget = new HTML();
            widget.getElement().setId(inputId);
        } else {
            integerBox.setId(inputId);
            integerBox.setPlaceholder(field.getPlaceHolder());
            integerBox.setMaxLength(field.getMaxLength());
            integerBox.setEnabled(!field.getReadOnly());
            widget = integerBox.asWidget();
        }

        DefaultFormGroup formGroup = formGroupsInstance.get();

        formGroup.render(inputId, widget, field);
        registerFieldRendererPart(widget);

        return formGroup;
    }

    @Inject public  IntegerBoxFieldRenderer(IntegerBox integerBox);

}