}
public void updateSystemControlledColumnValues() {
DynamicData data = widget.getData();
List<DynamicColumn<DTColumnConfig>> columns = widget.getColumns();
for ( DynamicColumn<DTColumnConfig> col : columns ) {
DTColumnConfig modelColumn = col.getModelColumn();
if ( modelColumn instanceof RowNumberCol ) {
// Update Row Number column values
for ( int iRow = 0; iRow < data.size(); iRow++ ) {
data.get( iRow ).get( col.getColumnIndex() ).setValue( iRow + 1 );
}
} else if ( modelColumn instanceof AttributeCol ) {
// Update Salience values
AttributeCol attrCol = (AttributeCol) modelColumn;
if ( attrCol.getAttribute().equals( RuleAttributeWidget.SALIENCE_ATTR ) ) {
if ( attrCol.isUseRowNumber() ) {
col.setSortDirection( SortDirection.NONE );
final int MAX_ROWS = data.size();
for ( int iRow = 0; iRow < data.size(); iRow++ ) {
int salience = iRow + 1;
if ( attrCol.isReverseOrder() ) {
salience = Math.abs( iRow
- MAX_ROWS );
}
data.get( iRow ).get( col.getColumnIndex() )
.setValue( salience );
}
}
// Ensure Salience cells are rendered with the correct Cell
col.setCell( cellFactory.getCell( attrCol ) );