if( c==null )
continue;
c.setMap(getMap());
IProgressMonitor submonitor = new SubProgressMonitor(monitor, 10);
if (c instanceof PostDeterminedEffectCommand) {
PostDeterminedEffectCommand command = (PostDeterminedEffectCommand) c;
if( command.execute(submonitor) )
commandsRan.add(command);
}else{
c.run(submonitor);
commandsRan.add(c);
}
submonitor.done();
}catch(Exception e){
EditPlugin.trace( e.getClass().getName()+" executing "+c+":"+e.getMessage(), e);
behaviour.handleError(handler, e, c);
}
}
}
}else{
monitor.beginTask(getName(), commandsRan.size()*12);
monitor.worked(2);
for( UndoableMapCommand command : commandsRan ) {
command.setMap(getMap());
IProgressMonitor submonitor = new SubProgressMonitor(monitor, 10);
if (command instanceof PostDeterminedEffectCommand) {
((PostDeterminedEffectCommand)command).execute(submonitor);
}else{
command.run(submonitor);
}
submonitor.done();
}
}
return !commandsRan.isEmpty();