private void prepareUpdatedGroupPickup() { targetGroup = new ArrayList<String>(); sourceGroup = new ArrayList<String>(); for (UserGroup userGroup : registrationDao.findGroupsByUser(userToUpdate)) { targetGroup.add(userGroup.getGroupName()); } for (UserGroup group : registrationDao.findNotAssignedUserGroupsByUser(userToUpdate)) { sourceGroup.add(group.getGroupName()); } groupDefinitions = new DualListModel<String>(sourceGroup, targetGroup); }
// ################################################################### // private methods // ################################################################### private List<String> initBasicGroups() { List<String> sourceGroup = new ArrayList<String>(); targetGroup = new ArrayList<String>(); List<UserGroup> availableGroups = registrationDao.findAllGroups(); for (UserGroup group : availableGroups) { sourceGroup.add(group.getGroupName()); } Collections.sort(sourceGroup); groupDefinitions = new DualListModel<String>(sourceGroup, targetGroup); return sourceGroup; }