public void populate(FormItemRepresentation rep) throws FormBuilderException {
if (!(rep instanceof MIGPanelRepresentation)) {
throw new FormBuilderException(i18n.RepNotOfType(rep.getClass().getName(), "MIGPanelRepresentation"));
}
super.populate(rep);
MIGPanelRepresentation mprep = (MIGPanelRepresentation) rep;
this.rows = mprep.getRows();
this.borderWidth = mprep.getBorderWidth();
this.cellpadding = mprep.getCellPadding();
this.cellspacing = mprep.getCellSpacing();
populate(this.table);
this.table.clear();
super.getItems().clear();
if (mprep.getWidth() != null) {
setWidth(mprep.getWidth());
}
if (mprep.getHeight() != null) {
setHeight(mprep.getHeight());
}
if (mprep.getElements() != null) {
for (int rowindex = 0; rowindex < mprep.getElements().size(); rowindex++) {
List<FormItemRepresentation> row = mprep.getElements().get(rowindex);
if(row != null) {
for (int cellindex = 0; cellindex < row.size(); cellindex++) {
FormItemRepresentation cell = row.get(cellindex);
FBFormItem subItem = super.createItem(cell);
this.table.setWidget(rowindex, cellindex, subItem);
int colspan = mprep.getColspan(rowindex, cellindex);
int rowspan = mprep.getRowspan(rowindex, cellindex);
if (colspan > 1) {
this.table.getFlexCellFormatter().setColSpan(rowindex, cellindex, colspan);
}
if (rowspan > 1) {
this.table.getFlexCellFormatter().setRowSpan(rowindex, cellindex, rowspan);