List of usage examples for com.vaadin.ui FormLayout removeComponent
@Override public void removeComponent(Component c)
From source file:net.sourceforge.javydreamercsw.validation.manager.web.component.DataEntryPropertyComponent.java
License:Apache License
@Override protected Component initContent() { Panel p = new Panel(); FormLayout l = new FormLayout(); getInternalValue().forEach(prop -> { if (!prop.getPropertyName().equals("property.expected.result")) { HorizontalLayout hl = new HorizontalLayout(); TextField tf = new TextField(TRANSLATOR.translate(prop.getPropertyName()), prop.getPropertyValue()); hl.addComponent(tf);// www . ja v a 2s . c o m if (edit) { //Add button for deleting this property. Button delete = new Button(); delete.setIcon(VaadinIcons.MINUS); delete.addClickListener(listener -> { getInternalValue().remove(prop); l.removeComponent(hl); }); hl.addComponent(delete); } l.addComponent(hl); } }); p.setContent(l); return p; }