void (final FormLayout sourceLayout, final FormLayout destinationLayout, final boolean isRow, int cellIndex, int cellCount, int targetIndex) { for(int i=0; i < cellCount; i++) { if (isRow) { RowSpec rowSpec = sourceLayout.getRowSpec(cellIndex + 1); insertOrAppendRow(destinationLayout, targetIndex+1, rowSpec); } else { ColumnSpec colSpec = sourceLayout.getColumnSpec(cellIndex + 1); insertOrAppendColumn(destinationLayout, targetIndex+1, colSpec); } cellIndex += (targetIndex < cellIndex && sourceLayout == destinationLayout) ? 2 : 1; targetIndex++; } }