for (BundleGroup bundleGroup : bundleGroups) {
idsFilter[i++] = bundleGroup.getId();
}
List<ListGridRecord> initiallyAssigned = new ArrayList<ListGridRecord>(bundleGroups.size());
BundleGroupsDataSource ds = new BundleGroupsDataSource();
for (BundleGroup bundleGroup : bundleGroups) {
if (map.get(bundleGroup) == Boolean.TRUE) {
initiallyAssigned.add(ds.copyValues(bundleGroup));
}
}
result = new BundleGroupSelector(idsFilter, initiallyAssigned.toArray(new ListGridRecord[initiallyAssigned
.size()]), readOnly);
}