use of org.olat.group.ui.main.OnlineIconRenderer in project openolat by klemens.
the class WaitingGroupController method initGroupTable.
/**
* Init WaitingList-table-controller for waitinglist with addional column action=move user to participant-list.
* Show added-date attribute and sort waiting list per default by added date.
*/
@Override
protected void initGroupTable(TableController tableCtr, UserRequest ureq, boolean enableTablePreferences, boolean enableUserSelection) {
List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser);
// first the login name
if (isAdministrativeUser) {
// first the login name, but only if administrative user
DefaultColumnDescriptor cd0 = new DefaultColumnDescriptor("table.user.login", 0, COMMAND_VCARD, ureq.getLocale());
cd0.setIsPopUpWindowAction(true, "height=700, width=900, location=no, menubar=no, resizable=yes, status=no, scrollbars=yes, toolbar=no");
tableCtr.addColumnDescriptor(cd0);
}
if (chatEnabled) {
tableCtr.addColumnDescriptor(new CustomRenderColumnDescriptor("table.header.online", 1, COMMAND_IM, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, new OnlineIconRenderer()));
}
int visibleColId = 0;
// followed by the users fields
for (int i = 0; i < userPropertyHandlers.size(); i++) {
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
boolean visible = userManager.isMandatoryUserProperty(usageIdentifyer, userPropertyHandler);
ColumnDescriptor cd = userPropertyHandler.getColumnDescriptor(i + 3, COMMAND_VCARD, ureq.getLocale());
// make all user attributes clickable to open visiting card
if (cd instanceof DefaultColumnDescriptor) {
DefaultColumnDescriptor dcd = (DefaultColumnDescriptor) cd;
dcd.setIsPopUpWindowAction(true, "height=700, width=900, location=no, menubar=no, resizable=yes, status=no, scrollbars=yes, toolbar=no");
}
tableCtr.addColumnDescriptor(visible, cd);
if (visible) {
visibleColId++;
}
}
// in the end
if (enableTablePreferences) {
tableCtr.addColumnDescriptor(true, new DefaultColumnDescriptor("table.subject.addeddate", 2, COMMAND_VCARD, ureq.getLocale()));
tableCtr.setSortColumn(++visibleColId, true);
}
if (mayModifyMembers) {
tableCtr.addMultiSelectAction("action.waitinglist.move", COMMAND_MOVE_USER_WAITINGLIST);
tableCtr.addMultiSelectAction("action.remove", COMMAND_REMOVEUSER);
tableCtr.setMultiSelect(true);
}
}
Aggregations