public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
String ackSubject = listGridRecord.getAttribute("acknowledgingSubject");
if (ackSubject == null) {
return " ";
} else {
Img checkedImg = new Img(ImageManager.getAlertStatusCheckedIcon(),80,16);
checkedImg.setImageType(ImageStyle.CENTER);
return checkedImg.getInnerHTML();
}
}
});
statusField.setShowHover(true);
statusField.setHoverCustomizer(new HoverCustomizer() {
public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
String ackSubject = record.getAttribute("acknowledgingSubject");
StringBuilder sb = new StringBuilder("<p");
if (ackSubject == null) {
sb.append(" style='width:150px'>");
sb.append(MSG.view_alerts_field_ack_status_noAckHover());
} else {
sb.append(" style='width:500px'>");
Date ackDateTime = record.getAttributeAsDate("acknowledgeTime");
String ackDateTimeString = TimestampCellFormatter.format(ackDateTime,
TimestampCellFormatter.DATE_TIME_FORMAT_FULL);
sb.append(MSG.view_alerts_field_ack_status_ackHover(ackSubject, ackDateTimeString));
}
sb.append("</p>");
return sb.toString();
}
});
fields.add(statusField);
ListGridField recoveredField = new ListGridField("recovered", MSG.common_title_recovered());
recoveredField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
Long recovered = listGridRecord.getAttributeAsLong("recovered");
if(recovered.longValue() > 0) {
Img checkedImg = new Img(ImageManager.getAlertStatusCheckedIcon(),80,16);
checkedImg.setImageType(ImageStyle.CENTER);
return checkedImg.getInnerHTML();
} else {
return " ";
}
}
});