* Adds the rows to the table. Assumes there are no data rows in the table.
*/
private void populateSubTable() {
final HintletReport.Css css = getResources().hintletReportCss();
for (int i = 0, j = hintletRecords.size(); i < j; ++i) {
HintRecord record = hintletRecords.get(i);
TableRowElement rowElem = subTable.appendRow();
if (i % 2 == 0) {
rowElem.setClassName(css.reportTableEvenRow());
}
int length = columns.size();
for (int cellIndex = 0; cellIndex < length; ++cellIndex) {
TableCellElement cell = rowElem.insertCell(cellIndex);
switch (columns.get(cellIndex)) {
case COL_TIME:
cell.setClassName(css.reportRowDetailTimeCell());
cell.setInnerText(TimeStampFormatter.format(record.getTimestamp()));
break;
case COL_SEVERITY:
cell.setClassName(css.reportRowDetailSeverityCell());
// A colored square to indicate the severity
DivElement severitySquare = DocumentExt.get().createDivWithClassName(
css.reportSeverityDot());
cell.appendChild(severitySquare);
severitySquare.getStyle().setProperty("backgroundColor",
HintletIndicator.getSeverityColor(record.getSeverity()));
break;
case COL_DESCRIPTION:
cell.setClassName(css.reportRowDetailCell());
cell.setInnerText(record.getDescription());
break;
case COL_RULE_NAME:
cell.setClassName(css.reportRowDetailCell());
cell.setInnerText(record.getHintletRule());
break;
default:
// not a valid row type
assert (false);
}