List wrapped = new ArrayList();
// buddy groups
List groups = bgm.findBusinessGroupsOwnedBy(BusinessGroup.TYPE_BUDDYGROUP, identity, null);
Iterator iter = groups.iterator();
while (iter.hasNext()) {
BusinessGroup group = (BusinessGroup) iter.next();
wrapped.add(wrapGroup(group, Boolean.TRUE, Boolean.TRUE));
}
groups = bgm.findBusinessGroupsAttendedBy(BusinessGroup.TYPE_BUDDYGROUP, identity, null);
iter = groups.iterator();
while (iter.hasNext()) {
BusinessGroup group = (BusinessGroup) iter.next();
wrapped.add(wrapGroup(group, Boolean.TRUE, null));
}
// learning groups
groups = bgm.findBusinessGroupsOwnedBy(BusinessGroup.TYPE_LEARNINGROUP, identity, null);
iter = groups.iterator();
while (iter.hasNext()) {
BusinessGroup group = (BusinessGroup) iter.next();
wrapped.add(wrapGroup(group, null, null));
}
groups = bgm.findBusinessGroupsAttendedBy(BusinessGroup.TYPE_LEARNINGROUP, identity, null);
iter = groups.iterator();
while (iter.hasNext()) {
BusinessGroup group = (BusinessGroup) iter.next();
wrapped.add(wrapGroup(group, null, null));
}
// right groups
groups = bgm.findBusinessGroupsAttendedBy(BusinessGroup.TYPE_RIGHTGROUP, identity, null);
iter = groups.iterator();
while (iter.hasNext()) {
BusinessGroup group = (BusinessGroup) iter.next();
wrapped.add(wrapGroup(group, null, null));
}
groupListModel.setEntries(wrapped);
groupListCtr.modelChanged();
}