new ResourceModel(MKEY_MESSAGE_SUBECT), Message.FIELD_SUBJECT) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<Message>> cellItem,
String componentId, IModel<Message> rowModel) {
final Message message = rowModel.getObject();
if(message.getReadDate() == null) {
cellItem.add(new AttributeAppender("class", CSSCLASS_UNREAD_MESSAGE));
}
cellItem.add(new LinkPanel(componentId, new Model<String>(message.getSubject())) {
private static final long serialVersionUID = 1L;
@Override
protected void onClick() {
setResponsePage(MessageDetails.class, new PageParameters().
add(MessageDetails.PARAM_MESSAGE_ID, message.getId()));
}
});
}
});
// Message delivery date
columns.add(new AbstractColumn<Message, String>(
new ResourceModel(MKEY_MESSAGE_DELIVERY_DATE), Message.FIELD_DELIVERY_DATE) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<Message>> cellItem,
String componentId, IModel<Message> rowModel) {
final Message message = rowModel.getObject();
cellItem.add(new Label(componentId,
representationFactory.getRepresentation(message.getDeliveryDate(), 100)));
}
});
return columns;
}