return executeCommand(handler, command, setEditStateCommand);
}
private UndoableMapCommand executeCommand( EditToolHandler handler, UndoableMapCommand command2, SetEditStateCommand setEditStateCommand ) {
UndoableMapCommand command=command2;
if (command != null) {
List<UndoableMapCommand> commands = new ArrayList<UndoableMapCommand>();
commands.add(command);
commands.add(setEditStateCommand);
UndoableComposite undoableComposite = new UndoableComposite(commands);
command=undoableComposite;
} else {
command=setEditStateCommand;
}
command.setMap(handler.getContext().getMap());
try {
command.run(new NullProgressMonitor());
} catch (Exception e1) {
throw (RuntimeException) new RuntimeException( e1 );
}
return new UndoRedoCommand(command);
}