if (expandRestoreStates == null)
expandRestoreStates = new ArrayList();
// Assemble lists of expanded items and completed items.
for (int i = 0; i < items.size(); i++) {
ViewItem item = (ViewItem) items.get(i);
if (item.isCompleted()) {
completedList.add(Integer.toString(i));
}
if (item.isExpanded()) {
expandedList.add(Integer.toString(i));
}
if (item instanceof CoreItem) {
CoreItem withsubs = (CoreItem) item;