@Test public void testUnBoundGetDragComponentTitleWithoutTranslation() { when(translationService.getTranslation(anyString())).thenReturn(NAME); field.setBinding(null); component.getDragComponentTitle(); verify(renderer).getName(); verify(translationService).getTranslation(anyString()); }
@Override public String getDragComponentTitle() { String name = ""; if (field.getBinding() != null) { name = field.getBinding(); } else { name = translationService.getTranslation(fieldRenderer.getName()); if (name == null || name.isEmpty()) { name = fieldRenderer.getName(); } } return name; }
FieldLayoutComponent implements FormLayoutComponent,
                                             LayoutDragComponent { @Override public String getDragComponentTitle() { String name = ""; if (field.getBinding() != null) { name = field.getBinding(); } else { name = translationService.getTranslation(fieldRenderer.getName()); if (name == null || name.isEmpty()) { name = fieldRenderer.getName(); } } return name; } }
FieldLayoutComponent implements FormLayoutComponent,
                                             LayoutDragComponent { @Override public String getDragComponentTitle() { String name = ""; if (field.getBinding() != null) { name = field.getBinding(); } else { name = translationService.getTranslation(fieldRenderer.getName()); if (name == null || name.isEmpty()) { name = fieldRenderer.getName(); } } return name; } @Inject  FieldLayoutComponent(FieldRendererManager fieldRendererManager, TranslationService translationService); }
FieldLayoutComponent implements FormLayoutComponent,
                                             LayoutDragComponent { @Override public String getDragComponentTitle() { String name = ""; if (field.getBinding() != null) { name = field.getBinding(); } else { name = translationService.getTranslation(fieldRenderer.getName()); if (name == null || name.isEmpty()) { name = fieldRenderer.getName(); } } return name; } @Inject  FieldLayoutComponent(FieldRendererManager fieldRendererManager, TranslationService translationService); void init(FormRenderingContext renderingContext,
                     FieldDefinition field); @Override String getDragComponentTitle(); @Override IsWidget getPreviewWidget(RenderingContext ctx); @Override IsWidget getShowWidget(RenderingContext ctx); Optional<IsWidget> getContentPart(String partId, RenderingContext componentContext); void addComponentParts(LayoutComponent component); String getFieldId(); String getFormId(); FieldRenderer getFieldRenderer(); FieldDefinition getField(); @PreDestroy void destroy(); }
FieldLayoutComponent implements FormLayoutComponent,
                                             LayoutDragComponent { @Override public String getDragComponentTitle() { String name = ""; if (field.getBinding() != null) { name = field.getBinding(); } else { name = translationService.getTranslation(fieldRenderer.getName()); if (name == null || name.isEmpty()) { name = fieldRenderer.getName(); } } return name; } @Inject  FieldLayoutComponent(FieldRendererManager fieldRendererManager, TranslationService translationService); void init(FormRenderingContext renderingContext,
                     FieldDefinition field); @Override String getDragComponentTitle(); @Override IsWidget getPreviewWidget(RenderingContext ctx); @Override IsWidget getShowWidget(RenderingContext ctx); Optional<IsWidget> getContentPart(String partId, RenderingContext componentContext); void addComponentParts(LayoutComponent component); String getFieldId(); String getFormId(); FieldRenderer getFieldRenderer(); FieldDefinition getField(); @PreDestroy void destroy();  }