protected void setGroups(Collection fromList, Collection toList) {
switch (whatChanged(fromList, toList)) {
case ONLY_SORTING_CHANGE:
for (Iterator iter = toList.iterator(); iter.hasNext(); ) {
GroupWinListItem item = (GroupWinListItem)iter.next();
item.getGroup().setSortOrder(item.getSortOrder());
}
break;
case DRASTIC_CHANGE:
report.removeAllGroups();
for (Iterator iter = toList.iterator(); iter.hasNext(); ) {
GroupWinListItem item = (GroupWinListItem)iter.next();
Group g = item.getGroup();
if (g == null)
g = Group.create(report, item.getSelectable());
g.setSortOrder(item.getSortOrder());
report.addGroup(g);
}
designer.rebuildGroups();
break;
case NO_CHANGE: