private void _addRow(CheckBox cb, Widget left, Widget center, Widget right, String style,
final MappingAssoc ma
) {
final int row = flexPanel.getRowCount();
FlexCellFormatter cf = flexPanel.getFlexCellFormatter();
flexPanel.getRowFormatter().setStyleName(row, style);
HorizontalPanel hp = new HorizontalPanel();
if ( cb != null ) {
hp.add(cb);
}
// hp.add(Main.images.delete().createImage());
// #169: metadata association per mapping
Widget mdWidget = _prepareMappingMetadata(row, ma);
hp.add(mdWidget);
flexPanel.setWidget(row, 0, new FocusableRowElement(row, hp));
flexPanel.setWidget(row, 1, new FocusableRowElement(row, left));
flexPanel.getCellFormatter().setStyleName(row, 2, "MappingsTable-row");
flexPanel.setWidget(row, 2, new FocusableRowElement(row, center));
flexPanel.setWidget(row, 3, new FocusableRowElement(row, right));
if ( center instanceof Image ) {
Image img = (Image) center;
String width = String.valueOf(img.getWidth());
cf.setWidth(row, 2, width);
}
_setAlignments(row);
// add (empty) row for expansion
flexPanel.getRowFormatter().setStyleName(row + 1, style);
cf.setColSpan(row + 1, 0, 4);
cf.setAlignment(row + 1, 0,
HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE
);
}