use of org.eclipse.scout.rt.client.ui.basic.table.ITableRowDataMapper in project scout.rt by eclipse.
the class ContentAssistFieldTable method setLookupRows.
@Override
public void setLookupRows(List<? extends ILookupRow<LOOKUP_KEY>> lookupRows) {
List<ITableRow> rows = new ArrayList<ITableRow>();
for (ILookupRow<LOOKUP_KEY> lookupRow : lookupRows) {
ITableRow row = createRow();
// Note: we should use a ComparableLookupRow here because restoreSelection does not work
// since LookupRow does not implement equals/hashCode [awe]
row.getCellForUpdate(getKeyColumn()).setValue(lookupRow);
rows.add(row);
row.setEnabled(lookupRow.isEnabled());
AbstractTableRowData tableRowBean = lookupRow.getAdditionalTableRowData();
if (tableRowBean != null) {
ITableRowDataMapper mapper = createTableRowDataMapper(tableRowBean.getClass());
mapper.importTableRowData(row, tableRowBean);
}
}
try {
setTableChanging(true);
replaceRows(rows);
} finally {
setTableChanging(false);
}
}
Aggregations