public File next() {
if(firstVisit){
firstVisit = false;
if(monitor != null){
monitor.beginTask(ProjectSupportResourceHandler.getString(ProjectSupportResourceHandler.Exporting_archive, new Object [] { getContainer().getURI() }), files.size() * FILE_SAVE_WORK);
}
}
if(lastSubMon != null){
lastSubMon.done();
lastSubMon = null;
} else if(monitor != null){
monitor.worked(FILE_SAVE_WORK);
}
File file = super.next();
if(monitor != null){
if(file.isContainer() && ComponentLoadStrategyImpl.class.isInstance(((ContainerImpl)file).getLoadStrategy())){
ComponentLoadStrategyImpl ls = (ComponentLoadStrategyImpl)((ContainerImpl)file).getLoadStrategy();
lastSubMon = new SubProgressMonitor(monitor, FILE_SAVE_WORK, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
ls.setProgressMonitor(lastSubMon);
} else {
monitor.subTask(file.getURI());
}
}
return file;
}
};