statusField.setShowHover(true);
statusField.setHoverCustomizer(new HoverCustomizer() {
@Override
public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
String statusStr = record.getAttribute(AbstractOperationHistoryDataSource.Field.STATUS);
OperationRequestStatus status = OperationRequestStatus.valueOf(statusStr);
switch (status) {
case SUCCESS: {
return MSG.common_status_success();
}
case FAILURE: {
return MSG.common_status_failed();
}
case INPROGRESS: {
return MSG.common_status_inprogress();
}
case CANCELED: {
return MSG.common_status_canceled();
}
}
// should never get here
return MSG.common_status_unknown();
}
});
statusField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
OperationRequestStatus status = OperationRequestStatus.valueOf((String) o);
String icon = ImageManager.getOperationResultsIcon(status);
return Canvas.imgHTML(icon, 16, 16);
}
});
statusField.addRecordClickHandler(new RecordClickHandler() {
@Override
public void onRecordClick(RecordClickEvent event) {
Record record = event.getRecord();
String statusStr = record.getAttribute(AbstractOperationHistoryDataSource.Field.STATUS);
OperationRequestStatus status = OperationRequestStatus.valueOf(statusStr);
if (status == OperationRequestStatus.FAILURE) {
final Window winModal = new Window();
winModal.setTitle(MSG.common_title_details());
winModal.setOverflow(Overflow.VISIBLE);
winModal.setShowMinimizeButton(false);