use of org.olat.group.model.BGMembership in project OpenOLAT by OpenOLAT.
the class BGRoleCellRenderer method render.
private void render(StringOutput sb, Object val) {
if (val instanceof BusinessGroupMembership) {
BusinessGroupMembership membership = (BusinessGroupMembership) val;
boolean and = false;
if (membership.isOwner()) {
and = and(sb, and);
sb.append(trans.translate("owned.groups"));
}
if (membership.isParticipant()) {
and = and(sb, and);
sb.append(trans.translate("search.attendee"));
}
if (membership.isWaiting()) {
and = and(sb, and);
sb.append(trans.translate("search.waiting"));
}
} else if (val instanceof BGMembership) {
BGMembership membership = (BGMembership) val;
switch(membership) {
case owner:
sb.append(trans.translate("owned.groups"));
break;
case participant:
sb.append(trans.translate("search.attendee"));
break;
case waiting:
sb.append(trans.translate("search.waiting"));
break;
}
}
}
use of org.olat.group.model.BGMembership in project openolat by klemens.
the class BGRoleCellRenderer method render.
private void render(StringOutput sb, Object val) {
if (val instanceof BusinessGroupMembership) {
BusinessGroupMembership membership = (BusinessGroupMembership) val;
boolean and = false;
if (membership.isOwner()) {
and = and(sb, and);
sb.append(trans.translate("owned.groups"));
}
if (membership.isParticipant()) {
and = and(sb, and);
sb.append(trans.translate("search.attendee"));
}
if (membership.isWaiting()) {
and = and(sb, and);
sb.append(trans.translate("search.waiting"));
}
} else if (val instanceof BGMembership) {
BGMembership membership = (BGMembership) val;
switch(membership) {
case owner:
sb.append(trans.translate("owned.groups"));
break;
case participant:
sb.append(trans.translate("search.attendee"));
break;
case waiting:
sb.append(trans.translate("search.waiting"));
break;
}
}
}
use of org.olat.group.model.BGMembership in project openolat by klemens.
the class BGUserManagementController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == cmc) {
cleanupPopup();
} else if (source == addCtrl) {
List<Identity> identitiesToAdd = extractIdentities(event);
BGMembership type = (BGMembership) addCtrl.getUserObject();
switch(type) {
case owner:
userTableModel.addOwners(identitiesToAdd);
break;
case participant:
userTableModel.addParticipants(identitiesToAdd);
break;
case waiting:
userTableModel.addToWaitingList(identitiesToAdd);
break;
}
usersCtrl.modelChanged();
cmc.deactivate();
cleanupPopup();
} else if (source == usersCtrl) {
if (event.getCommand().equals(Table.COMMAND_MULTISELECT)) {
TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
if (tmse.getAction().equals(COMMAND_REMOVEUSER)) {
List<Identity> toRemove = userTableModel.getObjects(tmse.getSelection());
removeIdentities(toRemove);
}
}
}
super.event(ureq, source, event);
}
use of org.olat.group.model.BGMembership in project OpenOLAT by OpenOLAT.
the class BGUserManagementController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == cmc) {
cleanupPopup();
} else if (source == addCtrl) {
List<Identity> identitiesToAdd = extractIdentities(event);
BGMembership type = (BGMembership) addCtrl.getUserObject();
switch(type) {
case owner:
userTableModel.addOwners(identitiesToAdd);
break;
case participant:
userTableModel.addParticipants(identitiesToAdd);
break;
case waiting:
userTableModel.addToWaitingList(identitiesToAdd);
break;
}
usersCtrl.modelChanged();
cmc.deactivate();
cleanupPopup();
} else if (source == usersCtrl) {
if (event.getCommand().equals(Table.COMMAND_MULTISELECT)) {
TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
if (tmse.getAction().equals(COMMAND_REMOVEUSER)) {
List<Identity> toRemove = userTableModel.getObjects(tmse.getSelection());
removeIdentities(toRemove);
}
}
}
super.event(ureq, source, event);
}
Aggregations