Index: trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java	(revision 2314)
+++ trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java	(revision 2315)
@@ -5,4 +5,5 @@
 import static org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil.completeTagCollectionForEditing;
 import static org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil.normalizeTagCollectionBeforeEditing;
+import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -29,9 +30,11 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.BackreferencedDataSet.RelationToChildReference;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
+import org.openstreetmap.josm.gui.HelpAwareOptionPane;
+import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
 import org.openstreetmap.josm.gui.conflict.tags.CombinePrimitiveResolverDialog;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Shortcut;
-
-
 /**
  * Merges a collection of nodes into one node.
@@ -161,10 +164,24 @@
                     waysToDelete.add(w);
                 } else {
-                    JOptionPane.showMessageDialog(
+                    ButtonSpec[] options = new ButtonSpec[] {
+                            new ButtonSpec(
+                                    tr("Abort Merging"),
+                                    ImageProvider.get("cancel"),
+                                    tr("Click to abort merging nodes"),
+                                    null /* no special help topic */
+                            )
+                    };
+                    HelpAwareOptionPane.showOptionDialog(
                             Main.parent,
-                            tr("Cannot merge nodes: " +
-                            "Would have to delete a way that is still used."),
+                            tr(
+                                    "Cannot merge nodes: Would have to delete way ''{0}'' which is still used.",
+                                    w.getDisplayName(DefaultNameFormatter.getInstance())
+                            ),
                             tr("Warning"),
-                            JOptionPane.WARNING_MESSAGE
+                            JOptionPane.WARNING_MESSAGE,
+                            null, /* no icon */
+                            options,
+                            options[0],
+                            ht("/Action/MergeNodes#WaysToDeleteStillInUse")
                     );
                     return null;
@@ -178,4 +195,5 @@
             }
         }
+        cmds.add(new DeleteCommand(waysToDelete));
         return cmds;
     }
Index: trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 2314)
+++ trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 2315)
@@ -7,4 +7,5 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
@@ -12,4 +13,5 @@
 import java.util.List;
 
+import javax.swing.AbstractAction;
 import javax.swing.Icon;
 import javax.swing.JButton;
@@ -17,6 +19,6 @@
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
-
-import org.openstreetmap.josm.gui.help.HelpBrowser;
+import javax.swing.KeyStroke;
+
 import org.openstreetmap.josm.gui.help.HelpBrowserProxy;
 import org.openstreetmap.josm.gui.help.HelpUtil;
@@ -47,5 +49,5 @@
     }
 
-    static private class DefaultAction implements ActionListener {
+    static private class DefaultAction extends AbstractAction {
         private JDialog dialog;
         private JOptionPane pane;
@@ -57,4 +59,5 @@
             this.value = value;
         }
+
         public void actionPerformed(ActionEvent e) {
             pane.setValue(value);
@@ -63,8 +66,20 @@
     }
 
+    /**
+     * Creates the list buttons to be displayed in the option pane dialog.
+     * 
+     * @param options the option. If null, just creates an OK button and a help button
+     * @param helpTopic the help topic. The context sensitive help of all buttons is equal
+     * to the context sensitive help of the whole dialog
+     * @return the list of buttons
+     */
     static private List<JButton> createOptionButtons(ButtonSpec[] options, String helpTopic) {
         List<JButton> buttons = new ArrayList<JButton>();
         if (options == null) {
-            buttons.add(new JButton(tr("OK")));
+            JButton b = new JButton(tr("OK"));
+            b.setIcon(ImageProvider.get("ok"));
+            b.setToolTipText(tr("Click to close the dialog"));
+            b.setFocusable(true);
+            buttons.add(b);
         } else {
             for (ButtonSpec spec: options) {
@@ -77,5 +92,4 @@
                 b.setFocusable(true);
                 buttons.add(b);
-
             }
         }
@@ -83,4 +97,10 @@
     }
 
+    /**
+     * Creates the help button
+     * 
+     * @param helpTopic the help topic
+     * @return the help button
+     */
     static private JButton createHelpButton(final String helpTopic) {
         JButton b = new JButton(tr("Help"));
@@ -91,17 +111,9 @@
                 new ActionListener() {
                     public void actionPerformed(ActionEvent e) {
-                        HelpBrowserProxy.getInstance().setUrlForHelpTopic(completeHelpTopic(helpTopic));
+                        HelpBrowserProxy.getInstance().setUrlForHelpTopic(helpTopic);
                     }
                 }
         );
         return b;
-    }
-
-    static private String completeHelpTopic(String helpTopic) {
-        if (helpTopic == null) return null;
-        if (! helpTopic.startsWith("/")) {
-            helpTopic = "/" + helpTopic;
-        }
-        return "Help" + helpTopic;
     }
 
@@ -172,4 +184,5 @@
         dialog.addWindowListener(
                 new WindowAdapter() {
+
                     @Override
                     public void windowClosing(WindowEvent e) {
@@ -187,7 +200,10 @@
                                 }
                             }
-                            if (i >= options.length) return; // default option not an option?
-
+                            if (i >= options.length) {
+                                buttons.get(0).requestFocusInWindow();
+                            }
                             buttons.get(i).requestFocusInWindow();
+                        } else {
+                            buttons.get(0).requestFocusInWindow();
                         }
                     }
@@ -196,7 +212,16 @@
         if (options != null) {
             for (int i=0; i < options.length;i++) {
-                buttons.get(i).addActionListener(new DefaultAction(dialog, pane, i));
+                final DefaultAction action = new DefaultAction(dialog, pane, i);
+                buttons.get(i).addActionListener(action);
+                buttons.get(i).getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), "enter");
+                buttons.get(i).getActionMap().put("enter", action);
             }
-        }
+        } else {
+            final DefaultAction action = new DefaultAction(dialog, pane, 0);
+            buttons.get(0).addActionListener(action);
+            buttons.get(0).getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), "enter");
+            buttons.get(0).getActionMap().put("enter", action);
+        }
+
         dialog.pack();
         WindowGeometry.centerOnScreen(dialog.getSize()).applySafe(dialog);
