Index: trunk/src/org/openstreetmap/josm/actions/UploadAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 2254)
+++ trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 2255)
@@ -35,5 +35,7 @@
 import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.ExceptionDialogUtil;
+import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
 import org.openstreetmap.josm.gui.help.HelpBrowser;
 import org.openstreetmap.josm.gui.help.HelpBuilder;
@@ -230,14 +232,30 @@
      */
     protected void handleUploadConflictForKnownConflict(final OsmPrimitiveType primitiveType, final long id, String serverVersion, String myVersion) {
-        JButton[] options = new JButton[] {
-                new JButton(tr("Synchronize {0} {1} only", tr(primitiveType.getAPIName()), id)),
-                new JButton(tr("Synchronize entire dataset")),
-                new JButton(tr("Cancel")),
-                new JButton(tr("Help"))
+        String lbl = "";
+        switch(primitiveType) {
+            case NODE: lbl =  tr("Synchronize node {0} only", id); break;
+            case WAY: lbl =  tr("Synchronize way {0} only", id); break;
+            case RELATION: lbl =  tr("Synchronize relation {0} only", id); break;
+        }
+        ButtonSpec[] spec = new ButtonSpec[] {
+                new ButtonSpec(
+                        lbl,
+                        ImageProvider.get("updatedata"),
+                        null,
+                        null
+                ),
+                new ButtonSpec(
+                        tr("Synchronize entire dataset"),
+                        ImageProvider.get("updatedata"),
+                        null,
+                        null
+                ),
+                new ButtonSpec(
+                        tr("Cancel"),
+                        ImageProvider.get("cancel"),
+                        null,
+                        null
+                )
         };
-        options[0].setIcon(ImageProvider.get("updatedata"));
-        options[1].setIcon(ImageProvider.get("updatedata"));
-        options[2].setIcon(ImageProvider.get("cancel"));
-        options[3].setIcon(ImageProvider.get("help"));
         String msg =  tr("<html>Uploading <strong>failed</strong> because the server has a newer version of one<br>"
                 + "of your nodes, ways, or relations.<br>"
@@ -249,55 +267,21 @@
                 + "Click <strong>{6}</strong> to abort and continue editing.<br></html>",
                 tr(primitiveType.getAPIName()), id, serverVersion, myVersion,
-                options[0].getText(), options[1].getText(), options[2].getText()
+                spec[0].text, spec[1].text, spec[2].text
         );
-        final JOptionPane pane = new JOptionPane(
+        int ret = HelpAwareOptionPane.showOptionDialog(
+                Main.parent,
                 msg,
+                tr("Conflicts detected"),
                 JOptionPane.ERROR_MESSAGE,
-                JOptionPane.DEFAULT_OPTION,
                 null,
-                options,
-                options[0]
+                spec,
+                spec[0],
+                "Concepts/Conflict"
         );
-        final JDialog dialog = new JDialog(
-                JOptionPane.getFrameForComponent(Main.parent),
-                tr("Conflicts detected"),
-                true);
-        options[0].addActionListener(
-                new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        dialog.setVisible(false);
-                        synchronizePrimitive(primitiveType, id);
-                    }
-                }
-        );
-        options[1].addActionListener(
-                new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        dialog.setVisible(false);
-                        synchronizeDataSet();
-                    }
-                }
-        );
-        options[2].addActionListener(
-                new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        dialog.setVisible(false);
-                    }
-                }
-        );
-        options[3].addActionListener(
-                new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        HelpBrowser b = new HelpBrowser();
-                        b.setUrlForHelpTopic("Help/Concepts/Conflict");
-                        b.setVisible(true);
-                    }
-                }
-        );
-        dialog.setContentPane(pane);
-        dialog.pack();
-        HelpBuilder.setHelpContext(dialog.getRootPane(), "Concepts/Conflict");
-        WindowGeometry.centerOnScreen(dialog.getSize()).applySafe(dialog);
-        dialog.setVisible(true);
+        switch(ret) {
+            case 0: synchronizePrimitive(primitiveType, id); break;
+            case 1: synchronizeDataSet(); break;
+            default: return;
+        }
     }
 
@@ -308,10 +292,18 @@
      */
     protected void handleUploadConflictForUnknownConflict() {
-        JButton[] options = new JButton[] {
-                new JButton(tr("Synchronize entire dataset")),
-                new JButton(tr("Cancel")),
-                new JButton(tr("Help"))
+        ButtonSpec[] spec = new ButtonSpec[] {
+                new ButtonSpec(
+                        tr("Synchronize entire dataset"),
+                        ImageProvider.get("updatedata"),
+                        null,
+                        null
+                ),
+                new ButtonSpec(
+                        tr("Cancel"),
+                        ImageProvider.get("cancel"),
+                        null,
+                        null
+                )
         };
-        Object defaultOption = options[0];
         String msg =  tr("<html>Uploading <strong>failed</strong> because the server has a newer version of one<br>"
                 + "of your nodes, ways, or relations.<br>"
@@ -319,48 +311,19 @@
                 + "Click <strong>{0}</strong> to synchronize the entire local dataset with the server.<br>"
                 + "Click <strong>{1}</strong> to abort and continue editing.<br></html>",
-                options[0].getText(), options[1].getText()
+                spec[0].text, spec[1].text
         );
-        final JOptionPane pane = new JOptionPane(
+        int ret = HelpAwareOptionPane.showOptionDialog(
+                Main.parent,
                 msg,
+                tr("Conflicts detected"),
                 JOptionPane.ERROR_MESSAGE,
-                JOptionPane.DEFAULT_OPTION,
                 null,
-                options,
-                options[0]
+                spec,
+                spec[0],
+                "Concepts/Conflict"
         );
-        final JDialog dialog = new JDialog(
-                JOptionPane.getFrameForComponent(Main.parent),
-                tr("Conflicts detected"),
-                true);
-
-        options[0].addActionListener(
-                new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        dialog.setVisible(false);
-                        synchronizeDataSet();
-                    }
-                }
-        );
-        options[1].addActionListener(
-                new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        dialog.setVisible(false);
-                    }
-                }
-        );
-        options[2].addActionListener(
-                new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        HelpBrowser b = new HelpBrowser();
-                        b.setUrlForHelpTopic("Help/Concepts/Conflict");
-                        b.setVisible(true);
-                    }
-                }
-        );
-        dialog.setContentPane(pane);
-        dialog.pack();
-        HelpBuilder.setHelpContext(dialog.getRootPane(), "Concepts/Conflict");
-        WindowGeometry.centerOnScreen(dialog.getSize()).applySafe(dialog);
-        dialog.setVisible(true);
+        if (ret == 0) {
+            synchronizeDataSet();
+        }
     }
 
@@ -533,5 +496,5 @@
             } catch (Exception sxe) {
                 if (uploadCancelled) {
-                    System.out.println("Ignoring exception caught because upload is cancelled. Exception is: " + sxe.toString());
+                    System.out.println("Ignoring exception caught because upload is canceled. Exception is: " + sxe.toString());
                     return;
                 }
Index: trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java	(revision 2254)
+++ trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java	(revision 2255)
@@ -46,5 +46,5 @@
                 tr("Upload selection"),
                 "uploadselection",
-                tr("Upload all changes in the current current selection to the OSM server."),
+                tr("Upload all changes in the current selection to the OSM server."),
                 null, /* no shortcut */
                 true);
Index: trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 2255)
+++ trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 2255)
@@ -0,0 +1,162 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JOptionPane;
+
+import org.openstreetmap.josm.gui.help.HelpBrowser;
+import org.openstreetmap.josm.gui.help.HelpBuilder;
+import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.WindowGeometry;
+
+public class HelpAwareOptionPane {
+
+    public static class ButtonSpec {
+        public String text;
+        public Icon icon;
+        public String tooltipText;
+        public String helpTopic;
+
+        /**
+         * 
+         * @param text  the button text
+         * @param icon  the icon to display. Can be null
+         * @param tooltipText  the tooltip text. Can be null.
+         * @param helpTopic the help topic. Can be null.
+         */
+        public ButtonSpec(String text, Icon icon, String tooltipText, String helpTopic) {
+            this.text = text;
+            this.icon = icon;
+            this.tooltipText = tooltipText;
+            this.helpTopic = helpTopic;
+        }
+    }
+
+    static private class DefaultAction implements ActionListener {
+        private JDialog dialog;
+        private JOptionPane pane;
+        private int value;
+
+        public DefaultAction(JDialog dialog, JOptionPane pane, int value) {
+            this.dialog = dialog;
+            this.pane = pane;
+            this.value = value;
+        }
+        public void actionPerformed(ActionEvent e) {
+            pane.setValue(value);
+            dialog.setVisible(false);
+        }
+    }
+
+    /**
+     * Displays an option dialog which is aware of a help context. If <code>helpTopic</code> isn't null,
+     * the dialog includes a "Help" button and launches the help browser if the user presses F1. If the
+     * user clicks on the "Help" button the option dialog remains open and JOSM launches the help
+     * browser.
+     * 
+     * In addition, the option buttons display JOSM icons, similar to ExtendedDialog.
+     * 
+     * @param parentComponent the parent component
+     * @param msg the message
+     * @param title the title
+     * @param messageType the message type (see {@see JOptionPane})
+     * @param icon the icon to display. Can be null.
+     * @param options the list of options to display. Can be null.
+     * @param defaultOption the default option. Can be null.
+     * @param helpTopic the help topic. Can be null.
+     * @return the index of the selected option or {@link JOptionPane#CLOSED_OPTION}
+     */
+    static public int showOptionDialog(Component parentComponent, Object msg, String title, int messageType, Icon icon, ButtonSpec[] options, Object defaultOption, final String helpTopic)  {
+        List<JButton> buttons = new ArrayList<JButton>();
+
+        if (options == null) {
+            buttons.add(new JButton(tr("OK")));
+        } else {
+            for (ButtonSpec spec: options) {
+                JButton b = new JButton(spec.text);
+                b.setIcon(spec.icon);
+                b.setToolTipText(spec.tooltipText == null? "" : spec.tooltipText);
+                if (helpTopic != null) {
+                    HelpBuilder.setHelpContext(b, helpTopic);
+                }
+                buttons.add(b);
+
+            }
+        }
+        if (helpTopic != null) {
+            JButton b = new JButton(tr("Help"));
+            b.setIcon(ImageProvider.get("help"));
+            b.setToolTipText(tr("Show help information"));
+            HelpBuilder.setHelpContext(b, helpTopic);
+            b.addActionListener(
+                    new ActionListener() {
+                        public void actionPerformed(ActionEvent e) {
+                            HelpBrowser browser = new HelpBrowser();
+                            browser.setUrlForHelpTopic("Help/" + helpTopic);
+                            browser.setVisible(true);
+                        }
+                    }
+            );
+            buttons.add(b);
+        }
+
+        JButton defaultButton = null;
+        if (options != null && defaultOption != null) {
+            for (int i=0; i< options.length; i++) {
+                if (options[i] == defaultOption) {
+                    defaultButton = buttons.get(i);
+                    break;
+                }
+            }
+        }
+        final JOptionPane pane = new JOptionPane(
+                msg,
+                messageType,
+                JOptionPane.DEFAULT_OPTION,
+                icon,
+                buttons.toArray(),
+                defaultButton
+        );
+
+        pane.getValue();
+        final JDialog dialog = new JDialog(
+                JOptionPane.getFrameForComponent(parentComponent),
+                title,
+                true
+        );
+        dialog.setContentPane(pane);
+        dialog.addWindowListener(
+                new WindowAdapter() {
+                    @Override
+                    public void windowClosing(WindowEvent e) {
+                        pane.setValue(JOptionPane.CLOSED_OPTION);
+                        super.windowClosed(e);
+                    }
+                }
+        );
+        if (options != null) {
+            for (int i=0; i < options.length;i++) {
+                buttons.get(i).addActionListener(new DefaultAction(dialog, pane, i));
+            }
+        }
+        dialog.pack();
+        WindowGeometry.centerOnScreen(dialog.getSize()).applySafe(dialog);
+        if (helpTopic != null) {
+            HelpBuilder.setHelpContext(dialog.getRootPane(), helpTopic);
+        }
+        dialog.setVisible(true);
+        return (Integer)pane.getValue();
+    }
+}
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java	(revision 2254)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java	(revision 2255)
@@ -118,5 +118,5 @@
      */
     public ConflictDialog() {
-        super(tr("Conflict"), "conflict", tr("Merging conflicts."),
+        super(tr("Conflict"), "conflict", tr("Resolve conflicts."),
                 Shortcut.registerShortcut("subwindow:conflict", tr("Toggle: {0}", tr("Conflict")), KeyEvent.VK_C, Shortcut.GROUP_LAYER), 100);
 
@@ -144,5 +144,5 @@
             return;
         int row = selectedRows[0];
-        Conflict c = conflicts.get(row);
+        Conflict<?> c = conflicts.get(row);
         OsmPrimitive my = c.getMy();
         OsmPrimitive their = c.getTheir();
@@ -262,4 +262,9 @@
     }
 
+    @Override
+    public String helpTopic() {
+        return "Dialogs/ConflictListDialog";
+    }
+
     /**
      * The {@see ListModel} for conflicts
@@ -328,4 +333,5 @@
             putValue(SHORT_DESCRIPTION,  tr("Open a merge dialog of all selected items in the list above."));
             putValue(SMALL_ICON, ImageProvider.get("dialogs", "conflict"));
+            putValue("help", "Dialogs/ConflictListDialog#ResolveAction");
         }
 
@@ -347,4 +353,5 @@
             putValue(SHORT_DESCRIPTION,  tr("Set the selected elements on the map to the selected items in the list above."));
             putValue(SMALL_ICON, ImageProvider.get("dialogs", "select"));
+            putValue("help", "Dialogs/ConflictListDialog#SelectAction");
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 2254)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 2255)
@@ -12,15 +12,11 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
-import java.util.logging.Logger;
 
 import javax.swing.AbstractAction;
 import javax.swing.BorderFactory;
-import javax.swing.Box;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
@@ -34,4 +30,5 @@
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.gui.dialogs.DialogsPanel.Action;
+import org.openstreetmap.josm.gui.help.HelpBuilder;
 import org.openstreetmap.josm.gui.help.Helpful;
 import org.openstreetmap.josm.tools.GBC;
@@ -348,5 +345,5 @@
      *
      */
-    private class DetachedDialog extends JDialog {
+    private class DetachedDialog extends JDialog{
         public DetachedDialog() {
             super(JOptionPane.getFrameForComponent(Main.parent));
@@ -362,4 +359,15 @@
                 }
             });
+            addMouseListener(
+                    new MouseAdapter() {
+                        @Override
+                        public void mouseEntered(MouseEvent e) {
+                            super.mouseEntered(e);
+                            System.out.println("requesting focus ...");
+                            requestFocusInWindow();
+                        }
+                    }
+            );
+
             String bounds = Main.pref.get(preferencePrefix+".bounds",null);
             if (bounds != null) {
@@ -373,4 +381,5 @@
             }
             setTitle(titleBar.getTitle());
+            HelpBuilder.setHelpContext(getRootPane(), helpTopic());
         }
 
