void (final FormLayout formLayout, final int index, final RowSpec rowSpec) { if (index == formLayout.getRowCount()+1) { formLayout.appendRow(rowSpec); } else { formLayout.insertRow(index, rowSpec); } }