@Test public void testAddExistingComponentPart() { LayoutComponent layoutComponent = new LayoutComponent(); component.addComponentParts(layoutComponent); Assertions.assertThat(layoutComponent.getParts()) .isNotEmpty() .hasSize(parts.size()) .anyMatch(part -> part.getPartId().equals(PART_1)) .anyMatch(part -> part.getPartId().equals(PART_2)) .anyMatch(part -> part.getPartId().equals(PART_3)); }
public void addComponentParts(LayoutComponent component) { Set<String> parts = fieldRenderer.getFieldParts(); component.removePartIf(partId -> !parts.contains(partId)); parts.forEach(component::addPartIfAbsent); }
FieldLayoutComponent implements FormLayoutComponent,
                                             LayoutDragComponent { public void addComponentParts(LayoutComponent component) { Set<String> parts = fieldRenderer.getFieldParts(); component.removePartIf(partId -> !parts.contains(partId)); parts.forEach(component::addPartIfAbsent); } }
FieldLayoutComponent implements FormLayoutComponent,
                                             LayoutDragComponent { public void addComponentParts(LayoutComponent component) { Set<String> parts = fieldRenderer.getFieldParts(); component.removePartIf(partId -> !parts.contains(partId)); parts.forEach(component::addPartIfAbsent); } @Inject  FieldLayoutComponent(FieldRendererManager fieldRendererManager, TranslationService translationService); }
FieldLayoutComponent implements FormLayoutComponent,
                                             LayoutDragComponent { public void addComponentParts(LayoutComponent component) { Set<String> parts = fieldRenderer.getFieldParts(); component.removePartIf(partId -> !parts.contains(partId)); parts.forEach(component::addPartIfAbsent); } @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 { public void addComponentParts(LayoutComponent component) { Set<String> parts = fieldRenderer.getFieldParts(); component.removePartIf(partId -> !parts.contains(partId)); parts.forEach(component::addPartIfAbsent); } @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();  }