@Override public void add(Component childComponent, int column, int row) { checkArgument(column >= 0 && column < this.component.getColumns(), "Illegal column number %s, available amount of columns is %s", column, this.component.getColumns()); List<Component> colFields = columnComponentMapping.get(column); checkArgument(row >= 0 && row <= colFields.size(), "Illegal row number %s, available amount of rows is %s", row, this.component.getRows()); addComponentInternal(childComponent, column, row); }
@Override public void addField(FieldConfig fc, int colIndex, int rowIndex) { checkArgument(!fields.containsKey(fc.getId()), "Field '%s' is already registered", fc.getId()); checkArgument(this == ((FieldConfigImpl) fc).getOwner(), "Field does not belong to this FieldGroup"); if (colIndex < 0 || colIndex >= component.getColumns()) { throw new IllegalArgumentException(String.format("Illegal column number %s, available amount of columns is %s", colIndex, component.getColumns())); } List<FieldConfig> colFields = columnFieldMapping.get(colIndex); if (rowIndex < 0 || rowIndex > colFields.size()) { throw new IllegalArgumentException(String.format("Illegal row number %s, available amount of rows is %s", rowIndex, component.getRows())); } addFieldInternal(fc, colIndex, rowIndex); }
protected void reattachColumnFields(int colIndex) { for (int i = 0; i < component.getRows(); i++) { component.removeComponent(colIndex, i); } List<Component> columnFields = columnComponentMapping.get(colIndex); int insertRowIndex = 0; for (Component field : columnFields) { com.vaadin.ui.Component composition = WebComponentsHelper.getComposition(field); this.component.addComponent(composition, colIndex, insertRowIndex++); } }
protected void reattachColumnFields(int colIndex) { for (int i = 0; i < component.getRows(); i++) { component.removeComponent(colIndex, i); } List<FieldConfig> columnFCs = columnFieldMapping.get(colIndex); int insertRowIndex = 0; for (FieldConfig fc : columnFCs) { if (fc.isBound()) { com.vaadin.ui.Component composition = WebComponentsHelper.getComposition(fc.getComponentNN()); component.addComponent(composition, colIndex, insertRowIndex); insertRowIndex++; } } }