RowIndexByFieldName rowIndexByFieldName = new RowIndexByFieldName();
int col = 0;
int totalCols = definitionList.size();
for ( Fixture fixture : definitionList ) {
if ( fixture instanceof FactData ) {
final FactData factData = (FactData) fixture;
// Set Header
setWidget( 0,
++col,
new SmallLabel( "[" + factData.getName() + "]" ) );
Map<String, Integer> presentFields = new HashMap<String, Integer>();
// Sets row name and delete button.
for ( final FieldData fieldData : factData.getFieldData() ) {
// Avoid duplicate field rows, only one for each name.
if ( rowIndexByFieldName.doesNotContain( fieldData.getName() ) ) {
newRow( rowIndexByFieldName,
totalCols,
factData.getName(),
fieldData.getName() );
}
// Sets row data
int fieldRowIndex = rowIndexByFieldName.getRowIndex( fieldData.getName() );
setWidget( fieldRowIndex,
col,
editableCell( fieldData,
factData,
factData.getType(),
this.executionTrace ) );
presentFields.remove( fieldData.getName() );
}
//
for ( Map.Entry<String, Integer> entry : presentFields.entrySet() ) {
int fieldRow = ((Integer) entry.getValue()).intValue();
FieldData fieldData = new FieldData( (String) entry.getKey(),
"" );
factData.getFieldData().add( fieldData );
setWidget( fieldRow,
col,
editableCell( fieldData,
factData,
factData.getType(),
this.executionTrace ) );
}
// Set Delete
setWidget( rowIndexByFieldName.amountOrRows() + 1,