monitor.worked(2);
boolean changedState=false;
try{
for (MapCommand command : commands) {
command.setMap(getMap());
SubProgressMonitor subProgressMonitor = new SubProgressMonitor(monitor, 10);
if( command instanceof PostDeterminedEffectCommand){
boolean change=((PostDeterminedEffectCommand) command).execute(subProgressMonitor);
changedState=changedState||change;
}else{
command.run(subProgressMonitor);
changedState=true;
}
subProgressMonitor.done();
}
}finally{
for (MapCommand command : finalizerCommands) {
command.setMap(getMap());
SubProgressMonitor subProgressMonitor = new SubProgressMonitor(monitor, 10);
if( command instanceof PostDeterminedEffectCommand){
boolean change=((PostDeterminedEffectCommand) command).execute(subProgressMonitor);
changedState=changedState||change;
}else{
command.run(subProgressMonitor);
changedState=true;
}
subProgressMonitor.done();
}
}
monitor.done();