if (this.cutRequested && this.copyRequested) {
throw new IllegalStateException("The object cannot request cut and copy operations all at once.");
}
if (this.cutRequested) {
for (Iterator it = this.selectedCollections.iterator(); it.hasNext(); ){
ViewCollection viewCollection = (ViewCollection) it.next();
Collection cutCollection = viewCollection.getCollection();
collectionDao.cutTo(cutCollection, destinationCollection);
this.cutRequested = false;
}
} else if (this.copyRequested) {
for (Iterator it = this.selectedCollections.iterator(); it.hasNext(); ){
ViewCollection viewCollection = (ViewCollection) it.next();
Collection copiedCollection = viewCollection.getCollection();
collectionDao.copyTo(copiedCollection, destinationCollection);
this.copyRequested = false;
}
} else {
//All false: nothing to do
}
this.selectedCollections = null;
this.selectedCollection = new ViewCollection(CollectionDao.createInstance().retrieve(this.selectedCollection.getId()));
this.collections = this.selectedCollection.getCollectionsModel();
}
return "";
}