table.clearCell(row, col);
} else {
haveReview = true;
final ApprovalCategoryValue acv = type.getValue(ca);
final AccountInfo ai = aic.get(ca.getAccountId());
if (type.isMaxNegative(ca)) {
if (showUsernameInReviewCategory) {
FlowPanel fp = new FlowPanel();
fp.add(new Image(Gerrit.RESOURCES.redNot()));
fp.add(new InlineLabel(FormatUtil.name(ai)));
table.setWidget(row, col, fp);
} else {
table.setWidget(row, col, new Image(Gerrit.RESOURCES.redNot()));
}
} else if (type.isMaxPositive(ca)) {
if (showUsernameInReviewCategory) {
FlowPanel fp = new FlowPanel();
fp.add(new Image(Gerrit.RESOURCES.greenCheck()));
fp.add(new InlineLabel(FormatUtil.name(ai)));
table.setWidget(row, col, fp);
} else {
table.setWidget(row, col, new Image(Gerrit.RESOURCES.greenCheck()));
}
} else {
String vstr = String.valueOf(ca.getValue());
if (showUsernameInReviewCategory) {
vstr = vstr + " " + FormatUtil.name(ai);
}
if (ca.getValue() > 0) {
vstr = "+" + vstr;
fmt.addStyleName(row, col, Gerrit.RESOURCES.css().posscore());
} else {
fmt.addStyleName(row, col, Gerrit.RESOURCES.css().negscore());
}
table.setText(row, col, vstr);
}
// Some web browsers ignore the embedded newline; some like it;
// so we include a space before the newline to accommodate both.
//
fmt.getElement(row, col).setTitle(
acv.getName() + " \nby " + FormatUtil.nameEmail(ai));
}
col++;
}