{
final List<IColumn<GroupDO, String>> columns = new ArrayList<IColumn<GroupDO, String>>();
final CellItemListener<GroupDO> cellItemListener = new CellItemListener<GroupDO>() {
public void populateItem(final Item<ICellPopulator<GroupDO>> item, final String componentId, final IModel<GroupDO> rowModel)
{
final GroupDO group = rowModel.getObject();
appendCssClasses(item, group.getId(), group.isDeleted());
}
};
columns.add(new CellItemListenerPropertyColumn<GroupDO>(new Model<String>(getString("name")), getSortable("name", sortable), "name",
cellItemListener) {
/**
* @see org.projectforge.web.wicket.CellItemListenerPropertyColumn#populateItem(org.apache.wicket.markup.repeater.Item,
* java.lang.String, org.apache.wicket.model.IModel)
*/
@Override
public void populateItem(final Item<ICellPopulator<GroupDO>> item, final String componentId, final IModel<GroupDO> rowModel)
{
final boolean updateAccess = groupDao.hasLoggedInUserAccess(null, null, OperationType.UPDATE, false);
final GroupDO group = rowModel.getObject();
if (isSelectMode() == true) {
item.add(new ListSelectActionPanel(componentId, rowModel, caller, selectProperty, group.getId(), group.getName()));
addRowClick(item);
} else if (updateAccess == true) {
item.add(new ListSelectActionPanel(componentId, rowModel, GroupEditPage.class, group.getId(), returnToPage, group.getName()));
addRowClick(item);
} else {
item.add(new Label(componentId, group.getName()));
}
cellItemListener.populateItem(item, componentId, rowModel);
}
});
columns.add(new CellItemListenerPropertyColumn<GroupDO>(new Model<String>(getString("organization")), getSortable("organization",