use of org.activityinfo.ui.client.component.importDialog.model.strategy.FieldImporterColumn in project activityinfo by bedatadriven.
the class AbstractImporterTest method dumpHeaders.
protected void dumpHeaders(List<FieldImporterColumn> importColumns) {
System.out.print(" ");
for (FieldImporterColumn col : importColumns) {
System.out.print(" " + cell(col.getAccessor().getHeading()));
}
System.out.println();
System.out.println(Strings.repeat("-", COLUMN_WIDTH * importColumns.size()));
}
use of org.activityinfo.ui.client.component.importDialog.model.strategy.FieldImporterColumn in project activityinfo by bedatadriven.
the class AbstractImporterTest method dumpRows.
protected void dumpRows(ValidatedRowTable table) {
int numRows = table.getRows().size();
int numColumns = table.getColumns().size();
for (int i = 0; i != numRows; ++i) {
SourceRow sourceRow = importModel.getSource().getRows().get(i);
ValidatedRow resultRow = table.getRows().get(i);
for (int j = 0; j != numColumns; ++j) {
FieldImporterColumn column = table.getColumns().get(j);
String importedValue = Strings.nullToEmpty(column.getAccessor().getValue(sourceRow));
ValidationResult result = resultRow.getResult(j);
String cell = "";
if (result.wasConverted()) {
cell = importedValue + " [" + result.getTargetValue() + "]";
} else {
cell = importedValue;
}
System.out.print(" " + icon(result) + Strings.padEnd(cell, COLUMN_WIDTH - 2, ' '));
}
System.out.println();
}
}
use of org.activityinfo.ui.client.component.importDialog.model.strategy.FieldImporterColumn in project activityinfo by bedatadriven.
the class ValidationGrid method refresh.
public void refresh(ValidatedRowTable table) {
while (dataGrid.getColumnCount() > 0) {
dataGrid.removeColumn(0);
}
for (int i = 0; i < table.getColumns().size(); i++) {
final FieldImporterColumn column = table.getColumns().get(i);
String columnHeader = column.getAccessor().getHeading();
dataGrid.addColumn(new ValidationRowGridColumn(column.getAccessor(), i), new TextHeader(columnHeader));
dataGrid.setColumnWidth(i, GwtUtil.columnWidthInEm(columnHeader), Style.Unit.EM);
}
dataGrid.setRowData(table.getRows());
}
Aggregations