*/
public static void deleteRelation(OsmDataLayer layer, Relation toDelete) {
CheckParameterUtil.ensureParameterNotNull(layer, "layer");
CheckParameterUtil.ensureParameterNotNull(toDelete, "toDelete");
Command cmd = DeleteCommand.delete(layer, Collections.singleton(toDelete));
if (cmd != null) {
// cmd can be null if the user cancels dialogs DialogCommand displays
Main.main.undoRedo.add(cmd);
if (getCurrentDataSet().getSelectedRelations().contains(toDelete)) {
getCurrentDataSet().toggleSelected(toDelete);