@Test public void testGetFormGroup() { renderer.getFormGroup(RenderMode.EDIT_MODE); verify(formGroupsInstance).get(); verify(integerBox).setId(any()); verify(integerBox).setPlaceholder(eq(fieldDefinition.getPlaceHolder())); verify(integerBox).setMaxLength(eq(fieldDefinition.getMaxLength())); verify(integerBox).setEnabled(eq(!fieldDefinition.getReadOnly())); verify(integerBox).asWidget(); verify(formGroup).render(anyString(), any(), eq(fieldDefinition)); }
@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; }
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; } }
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  IntegerBoxFieldRenderer(IntegerBox integerBox); }
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  IntegerBoxFieldRenderer(IntegerBox integerBox); @Override String getName(); @Override Converter getConverter(); }
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  IntegerBoxFieldRenderer(IntegerBox integerBox); @Override String getName(); @Override Converter getConverter();  }