private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<Invitation>> cellItem,
String componentId, IModel<Invitation> rowModel) {
User inviter = rowModel.getObject().getInviter();
cellItem.add(new Label(componentId, new Model<String>(inviter == null ? "" : inviter.getDisplayName())));
}
});
columns.add(new AbstractColumn<Invitation, String>(new ResourceModel(MKEY_INVITEE)) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<Invitation>> cellItem,
String componentId, IModel<Invitation> rowModel) {
User invitee = rowModel.getObject().getInvitee();
cellItem.add(new Label(componentId, new Model<String>(invitee == null ? "" : invitee.getDisplayName())));
}
});
columns.add(new AbstractColumn<Invitation, String>(new ResourceModel(MKEY_INVITATION_DATE)) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<Invitation>> cellItem,
String componentId, IModel<Invitation> rowModel) {
Date invitationDate = rowModel.getObject().getInvitationDate();
//TODO: make date format configurable
cellItem.add(new Label(componentId, new Model<String>(invitationDate == null ? "" : DateFormat.getInstance().format(invitationDate))));
}
});
columns.add(new AbstractColumn<Invitation, String>(new Model<String>("")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<Invitation>> cellItem,
String componentId, IModel<Invitation> rowModel) {
User inviter = rowModel.getObject().getInviter();
User currentUser = authorizedUserService.getCurrentUser();
final Integer invitationId = rowModel.getObject().getId();
if(inviter != null && inviter.equals(currentUser)) {
cellItem.add(new AjaxLinkPanel<Void>(componentId, new ResourceModel(MKEY_REJECT)) {
private static final long serialVersionUID = 1L;