Index: trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- trunk/src/org/openstreetmap/josm/Main.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/Main.java	(revision 3252)
@@ -27,8 +27,11 @@
 import java.util.regex.Pattern;
 
+import javax.swing.Action;
+import javax.swing.InputMap;
 import javax.swing.JComponent;
 import javax.swing.JFrame;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
+import javax.swing.KeyStroke;
 import javax.swing.UIManager;
 
@@ -198,5 +201,5 @@
         isOpenjdk = System.getProperty("java.vm.name").toUpperCase().indexOf("OPENJDK") != -1;
         platform.startupHook();
-        contentPane.add(panel, BorderLayout.CENTER);
+        contentPanePrivate.add(panel, BorderLayout.CENTER);
         panel.add(gettingStarted, BorderLayout.CENTER);
         menu = new MainMenu();
@@ -205,10 +208,8 @@
 
         // creating toolbar
-        contentPane.add(toolbar.control, BorderLayout.NORTH);
-
-        contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
-        .put(Shortcut.registerShortcut("system:help", tr("Help"),
-                KeyEvent.VK_F1, Shortcut.GROUP_DIRECT).getKeyStroke(), "Help");
-        contentPane.getActionMap().put("Help", menu.help);
+        contentPanePrivate.add(toolbar.control, BorderLayout.NORTH);
+
+        registerActionShortcut(menu.help, Shortcut.registerShortcut("system:help", tr("Help"),
+                KeyEvent.VK_F1, Shortcut.GROUP_DIRECT));
 
         TaggingPresetPreference.initialize();
@@ -218,5 +219,5 @@
 
         toolbar.control.updateUI();
-        contentPane.updateUI();
+        contentPanePrivate.updateUI();
     }
 
@@ -226,5 +227,5 @@
     public final void addLayer(final Layer layer) {
         if (map == null) {
-            final MapFrame mapFrame = new MapFrame();
+            final MapFrame mapFrame = new MapFrame(contentPanePrivate);
             setMapFrame(mapFrame);
             mapFrame.selectMapMode((MapMode)mapFrame.getDefaultButtonAction());
@@ -281,8 +282,33 @@
     }
 
-    /**
-     * Use this to register shortcuts to
-     */
-    public static final JPanel contentPane = new JPanel(new BorderLayout());
+    protected static JPanel contentPanePrivate = new JPanel(new BorderLayout());
+
+    /**
+     * @deprecated If you just need to register shortcut for action, use registerActionShortcut instead of accessing InputMap directly
+     */
+    @Deprecated
+    public static final JPanel contentPane = contentPanePrivate;
+
+    public static void registerActionShortcut(Action action, Shortcut shortcut) {
+        registerActionShortcut(action, shortcut.getKeyStroke());
+    }
+
+    public static void registerActionShortcut(Action action, KeyStroke keyStroke) {
+        if (keyStroke == null)
+            return;
+
+        InputMap inputMap = contentPanePrivate.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+        Object existing = inputMap.get(keyStroke);
+        if (existing != null && !existing.equals(action)) {
+            System.out.println(String.format("Keystroke is already assigned to %s, will be overridden by %s", existing, action));
+        }
+        inputMap.put(keyStroke, action);
+
+        contentPanePrivate.getActionMap().put(action, action);
+    }
+
+    public static void unregisterActionShortcut(Shortcut shortcut) {
+        contentPanePrivate.getInputMap().remove(shortcut.getKeyStroke());
+    }
 
     ///////////////////////////////////////////////////////////////////////////
@@ -324,5 +350,5 @@
             }
             toolbar = new ToolbarPreferences();
-            contentPane.updateUI();
+            contentPanePrivate.updateUI();
             panel.updateUI();
         } catch (final Exception e) {
Index: trunk/src/org/openstreetmap/josm/actions/JosmAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 3252)
@@ -7,5 +7,4 @@
 
 import javax.swing.AbstractAction;
-import javax.swing.JComponent;
 
 import org.openstreetmap.josm.Main;
@@ -72,6 +71,5 @@
         sc = shortcut;
         if (sc != null) {
-            Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), name);
-            Main.contentPane.getActionMap().put(name, this);
+            Main.registerActionShortcut(this, sc);
         }
         putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc));
@@ -90,6 +88,5 @@
     public void destroy() {
         if (sc != null) {
-            Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(sc.getKeyStroke());
-            Main.contentPane.getActionMap().remove(sc.getKeyStroke());
+            Main.unregisterActionShortcut(sc);
         }
         MapView.removeLayerChangeListener(layerChangeAdapter);
Index: trunk/src/org/openstreetmap/josm/actions/UnselectAllAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UnselectAllAction.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/actions/UnselectAllAction.java	(revision 3252)
@@ -2,11 +2,9 @@
 package org.openstreetmap.josm.actions;
 
+import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
-
-import javax.swing.JComponent;
 
 import org.openstreetmap.josm.Main;
@@ -22,8 +20,8 @@
 
         // Add extra shortcut C-S-a
-        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
-                Shortcut.registerShortcut("edit:unselectallfocus", tr("Edit: {0}", tr("Unselect All (Focus)")),
-                        KeyEvent.VK_A, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT).getKeyStroke(),
-                        tr("Unselect All"));
+        Main.registerActionShortcut(this, Shortcut.registerShortcut("edit:unselectallfocus", tr("Edit: {0}", tr("Unselect All (Focus)")),
+                KeyEvent.VK_A, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT));
+
+
 
         // Add extra shortcut ESCAPE
@@ -33,8 +31,6 @@
          * for now this is a reasonable approximation.
          */
-        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
-                Shortcut.registerShortcut("edit:unselectallescape", tr("Edit: {0}", tr("Unselect All (Escape)")),
-                        KeyEvent.VK_ESCAPE, Shortcut.GROUP_DIRECT).getKeyStroke(),
-                        tr("Unselect All"));
+        Main.registerActionShortcut(this, Shortcut.registerShortcut("edit:unselectallescape", tr("Edit: {0}", tr("Unselect All (Escape)")),
+                KeyEvent.VK_ESCAPE, Shortcut.GROUP_DIRECT));
 
         putValue("help", ht("/Action/UnselectAll"));
Index: trunk/src/org/openstreetmap/josm/actions/ZoomInAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ZoomInAction.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/actions/ZoomInAction.java	(revision 3252)
@@ -8,5 +8,4 @@
 import java.awt.event.KeyEvent;
 
-import javax.swing.JComponent;
 import javax.swing.KeyStroke;
 
@@ -25,12 +24,9 @@
         );
         putValue("help", ht("/Action/ZoomIn"));
-        // make numpad + behave like + (action is already registred)
-        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD,0), tr("Zoom In"));
+        // make numpad + behave like +
+        Main.registerActionShortcut(this, KeyStroke.getKeyStroke(KeyEvent.VK_ADD, 0));
     }
 
     public void actionPerformed(ActionEvent e) {
-        Object name = Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).get(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, 0));
-        Main.contentPane.getActionMap().put(name, this);
-
         if (!Main.isDisplayingMapView()) return;
         Main.map.mapView.zoomToFactor(0.9);
Index: trunk/src/org/openstreetmap/josm/actions/ZoomOutAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ZoomOutAction.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/actions/ZoomOutAction.java	(revision 3252)
@@ -8,5 +8,4 @@
 import java.awt.event.KeyEvent;
 
-import javax.swing.JComponent;
 import javax.swing.KeyStroke;
 
@@ -21,5 +20,5 @@
         putValue("help", ht("/Action/ZoomOut"));
         // make numpad - behave like -
-        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT,0), tr("Zoom Out"));
+        Main.registerActionShortcut(this, KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT,0));
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 3252)
@@ -30,5 +30,4 @@
 import java.util.Set;
 
-import javax.swing.JComponent;
 import javax.swing.JOptionPane;
 
@@ -95,6 +94,5 @@
 
         // Add extra shortcut N
-        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
-                Shortcut.registerShortcut("mapmode:drawfocus", tr("Mode: Draw Focus"), KeyEvent.VK_N, Shortcut.GROUP_EDIT).getKeyStroke(), tr("Draw"));
+        Main.registerActionShortcut(this, Shortcut.registerShortcut("mapmode:drawfocus", tr("Mode: Draw Focus"), KeyEvent.VK_N, Shortcut.GROUP_EDIT));
 
         cursorCrosshair = getCursor();
Index: trunk/src/org/openstreetmap/josm/gui/MainApplet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplet.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplet.java	(revision 3252)
@@ -47,5 +47,5 @@
     private final class MainCaller extends Main {
         private MainCaller() {
-            setContentPane(contentPane);
+            setContentPane(contentPanePrivate);
             setJMenuBar(menu);
             setBounds(bounds);
Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 3252)
@@ -53,5 +53,5 @@
     public MainApplication(JFrame mainFrame) {
         super();
-        mainFrame.setContentPane(contentPane);
+        mainFrame.setContentPane(contentPanePrivate);
         mainFrame.setJMenuBar(menu);
         mainFrame.setBounds(bounds);
Index: trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 3252)
@@ -91,9 +91,9 @@
     public final int DEF_TOGGLE_DLG_WIDTH = 330;
 
-    public MapFrame() {
+    public MapFrame(JPanel contentPane) {
         setSize(400,400);
         setLayout(new BorderLayout());
 
-        mapView = new MapView();
+        mapView = new MapView(contentPane);
 
         new FileDrop(mapView);
Index: trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 3252)
@@ -29,10 +29,9 @@
 
 import javax.swing.AbstractButton;
-import javax.swing.JComponent;
 import javax.swing.JOptionPane;
+import javax.swing.JPanel;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.AutoScaleAction;
-import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.actions.MoveAction;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
@@ -189,5 +188,5 @@
     private Rectangle lastClipBounds = new Rectangle();
 
-    public MapView() {
+    public MapView(final JPanel contentPane) {
         Main.pref.addPreferenceChangeListener(this);
         addComponentListener(new ComponentAdapter(){
@@ -213,26 +212,9 @@
                 }
 
-                new MapMover(MapView.this, Main.contentPane);
-                JosmAction mv;
-                mv = new MoveAction(MoveAction.Direction.UP);
-                if (mv.getShortcut() != null) {
-                    Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(mv.getShortcut().getKeyStroke(), "UP");
-                    Main.contentPane.getActionMap().put("UP", mv);
-                }
-                mv = new MoveAction(MoveAction.Direction.DOWN);
-                if (mv.getShortcut() != null) {
-                    Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(mv.getShortcut().getKeyStroke(), "DOWN");
-                    Main.contentPane.getActionMap().put("DOWN", mv);
-                }
-                mv = new MoveAction(MoveAction.Direction.LEFT);
-                if (mv.getShortcut() != null) {
-                    Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(mv.getShortcut().getKeyStroke(), "LEFT");
-                    Main.contentPane.getActionMap().put("LEFT", mv);
-                }
-                mv = new MoveAction(MoveAction.Direction.RIGHT);
-                if (mv.getShortcut() != null) {
-                    Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(mv.getShortcut().getKeyStroke(), "RIGHT");
-                    Main.contentPane.getActionMap().put("RIGHT", mv);
-                }
+                new MapMover(MapView.this, contentPane);
+                new MoveAction(MoveAction.Direction.UP);
+                new MoveAction(MoveAction.Direction.DOWN);
+                new MoveAction(MoveAction.Direction.LEFT);
+                new MoveAction(MoveAction.Direction.RIGHT);
             }
         });
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 3252)
@@ -610,8 +610,6 @@
         btnAdd.getActionMap().put("onEnter", addAction);
 
-        Shortcut sc = Shortcut.registerShortcut("properties:add", tr("Add Properties"), KeyEvent.VK_B,
-                Shortcut.GROUP_MNEMONIC);
-        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), "properties:add");
-        Main.contentPane.getActionMap().put("properties:add", addAction);
+        Main.registerActionShortcut(addAction, Shortcut.registerShortcut("properties:add", tr("Add Properties"), KeyEvent.VK_B,
+                Shortcut.GROUP_MNEMONIC));
 
         // -- edit action
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java	(revision 3251)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java	(revision 3252)
@@ -17,6 +17,6 @@
 import java.awt.event.WindowEvent;
 
+import javax.swing.AbstractAction;
 import javax.swing.Box;
-import javax.swing.AbstractAction;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
@@ -54,7 +54,6 @@
 
     public static ImageViewerDialog getInstance() {
-        if (dialog == null) {
+        if (dialog == null)
             throw new AssertionError(); // a new instance needs to be created first
-        }
         return dialog;
     }
@@ -83,8 +82,7 @@
         btnPrevious.setPreferredSize(buttonDim);
         Shortcut scPrev = Shortcut.registerShortcut(
-            "geoimage:previous", tr("Geoimage: {0}", tr("Show previous Image")), KeyEvent.VK_PAGE_UP, Shortcut.GROUP_DIRECT);
+                "geoimage:previous", tr("Geoimage: {0}", tr("Show previous Image")), KeyEvent.VK_PAGE_UP, Shortcut.GROUP_DIRECT);
         final String APREVIOUS = "Previous Image";
-        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scPrev.getKeyStroke(), APREVIOUS);
-        Main.contentPane.getActionMap().put(APREVIOUS, prevAction);
+        Main.registerActionShortcut(prevAction, scPrev);
         btnPrevious.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scPrev.getKeyStroke(), APREVIOUS);
         btnPrevious.getActionMap().put(APREVIOUS, prevAction);
@@ -95,7 +93,6 @@
         btnDelete.setPreferredSize(buttonDim);
         Shortcut scDelete = Shortcut.registerShortcut(
-            "geoimage:deleteimagefromlayer", tr("Geoimage: {0}", DELETE_TEXT), KeyEvent.VK_DELETE, Shortcut.GROUP_DIRECT, Shortcut.SHIFT_DEFAULT);
-        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDelete.getKeyStroke(), DELETE_TEXT);
-        Main.contentPane.getActionMap().put(DELETE_TEXT, delAction);
+                "geoimage:deleteimagefromlayer", tr("Geoimage: {0}", DELETE_TEXT), KeyEvent.VK_DELETE, Shortcut.GROUP_DIRECT, Shortcut.SHIFT_DEFAULT);
+        Main.registerActionShortcut(delAction, scDelete);
         btnDelete.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDelete.getKeyStroke(), DELETE_TEXT);
         btnDelete.getActionMap().put(DELETE_TEXT, delAction);
@@ -105,8 +102,7 @@
         btnDeleteFromDisk.setPreferredSize(buttonDim);
         Shortcut scDeleteFromDisk = Shortcut.registerShortcut(
-            "geoimage:deletefilefromdisk", tr("Geoimage: {0}", tr("Delete File from disk")), KeyEvent.VK_DELETE, Shortcut.GROUP_DIRECT, Shortcut.GROUP_MENU + Shortcut.SHIFT_DEFAULT);
+                "geoimage:deletefilefromdisk", tr("Geoimage: {0}", tr("Delete File from disk")), KeyEvent.VK_DELETE, Shortcut.GROUP_DIRECT, Shortcut.GROUP_MENU + Shortcut.SHIFT_DEFAULT);
         final String ADELFROMDISK = "Delete image file from disk";
-        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), ADELFROMDISK);
-        Main.contentPane.getActionMap().put(ADELFROMDISK, delFromDiskAction);
+        Main.registerActionShortcut(delFromDiskAction, scDeleteFromDisk);
         btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), ADELFROMDISK);
         btnDeleteFromDisk.getActionMap().put(ADELFROMDISK, delFromDiskAction);
@@ -116,8 +112,7 @@
         btnNext.setPreferredSize(buttonDim);
         Shortcut scNext = Shortcut.registerShortcut(
-            "geoimage:next", tr("Geoimage: {0}", tr("Show next Image")), KeyEvent.VK_PAGE_DOWN, Shortcut.GROUP_DIRECT);
+                "geoimage:next", tr("Geoimage: {0}", tr("Show next Image")), KeyEvent.VK_PAGE_DOWN, Shortcut.GROUP_DIRECT);
         final String ANEXT = "Next Image";
-        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scNext.getKeyStroke(), ANEXT);
-        Main.contentPane.getActionMap().put(ANEXT, nextAction);
+        Main.registerActionShortcut(nextAction, scNext);
         btnNext.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scNext.getKeyStroke(), ANEXT);
         btnNext.getActionMap().put(ANEXT, nextAction);
@@ -192,5 +187,5 @@
             } else if (COMMAND_REMOVE.equals(action)) {
                 if (currentLayer != null) {
-                   currentLayer.removeCurrentPhoto();
+                    currentLayer.removeCurrentPhoto();
                 }
             } else if (COMMAND_REMOVE_FROM_DISK.equals(action)) {
@@ -221,8 +216,8 @@
     public void displayImage(GeoImageLayer layer, ImageEntry entry) {
         synchronized(this) {
-//            if (currentLayer == layer && currentEntry == entry) {
-//                repaint();
-//                return;
-//            }                     TODO: pop up image dialog but don't load image again
+            //            if (currentLayer == layer && currentEntry == entry) {
+            //                repaint();
+            //                return;
+            //            }                     TODO: pop up image dialog but don't load image again
 
             if (centerView && Main.map != null && entry != null && entry.getPos() != null) {
