Index: /trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/Main.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/Main.java	(revision 12639)
@@ -28,7 +28,4 @@
 
 import javax.swing.Action;
-import javax.swing.InputMap;
-import javax.swing.JComponent;
-import javax.swing.KeyStroke;
 
 import org.openstreetmap.josm.actions.JosmAction;
@@ -156,14 +153,4 @@
 
     /**
-     * The same main panel, required to be static for {@code MapFrameListener} handling.
-     */
-    protected static MainPanel mainPanel;
-
-    /**
-     * The private content pane of {@code MainFrame}, required to be static for shortcut handling.
-     */
-    protected static JComponent contentPanePrivate;
-
-    /**
      * The file watcher service.
      */
@@ -649,7 +636,9 @@
      * Registers a {@code JosmAction} and its shortcut.
      * @param action action defining its own shortcut
-     */
+     * @deprecated use {@link MainApplication#registerActionShortcut(JosmAction)} instead
+     */
+    @Deprecated
     public static void registerActionShortcut(JosmAction action) {
-        registerActionShortcut(action, action.getShortcut());
+        MainApplication.registerActionShortcut(action);
     }
 
@@ -658,18 +647,9 @@
      * @param action action to register
      * @param shortcut shortcut to associate to {@code action}
-     */
+     * @deprecated use {@link MainApplication#registerActionShortcut(Action, Shortcut)} instead
+     */
+    @Deprecated
     public static void registerActionShortcut(Action action, Shortcut shortcut) {
-        KeyStroke keyStroke = shortcut.getKeyStroke();
-        if (keyStroke == null)
-            return;
-
-        InputMap inputMap = contentPanePrivate.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
-        Object existing = inputMap.get(keyStroke);
-        if (existing != null && !existing.equals(action)) {
-            Logging.info(String.format("Keystroke %s is already assigned to %s, will be overridden by %s", keyStroke, existing, action));
-        }
-        inputMap.put(keyStroke, action);
-
-        contentPanePrivate.getActionMap().put(action, action);
+        MainApplication.registerActionShortcut(action, shortcut);
     }
 
@@ -677,7 +657,9 @@
      * Unregisters a shortcut.
      * @param shortcut shortcut to unregister
-     */
+     * @deprecated use {@link MainApplication#unregisterShortcut(Shortcut)} instead
+     */
+    @Deprecated
     public static void unregisterShortcut(Shortcut shortcut) {
-        contentPanePrivate.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(shortcut.getKeyStroke());
+        MainApplication.unregisterShortcut(shortcut);
     }
 
@@ -685,7 +667,9 @@
      * Unregisters a {@code JosmAction} and its shortcut.
      * @param action action to unregister
-     */
+     * @deprecated use {@link MainApplication#unregisterActionShortcut(JosmAction)} instead
+     */
+    @Deprecated
     public static void unregisterActionShortcut(JosmAction action) {
-        unregisterActionShortcut(action, action.getShortcut());
+        MainApplication.unregisterActionShortcut(action);
     }
 
@@ -694,8 +678,9 @@
      * @param action action to unregister
      * @param shortcut shortcut to unregister
-     */
+     * @deprecated use {@link MainApplication#unregisterActionShortcut(Action, Shortcut)} instead
+     */
+    @Deprecated
     public static void unregisterActionShortcut(Action action, Shortcut shortcut) {
-        unregisterShortcut(shortcut);
-        contentPanePrivate.getActionMap().remove(action);
+        MainApplication.unregisterActionShortcut(action, shortcut);
     }
 
@@ -704,14 +689,10 @@
      * @param shortcut The shortcut to look for
      * @return the registered action for the given shortcut
+     * @deprecated use {@link MainApplication#getRegisteredActionShortcut(Shortcut)} instead
      * @since 5696
      */
+    @Deprecated
     public static Action getRegisteredActionShortcut(Shortcut shortcut) {
-        KeyStroke keyStroke = shortcut.getKeyStroke();
-        if (keyStroke == null)
-            return null;
-        Object action = contentPanePrivate.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).get(keyStroke);
-        if (action instanceof Action)
-            return (Action) action;
-        return null;
+        return MainApplication.getRegisteredActionShortcut(shortcut);
     }
 
@@ -936,8 +917,10 @@
      * @return {@code true} if the listeners collection changed as a result of the call
      * @see #addMapFrameListener
+     * @deprecated use {@link MainApplication#addAndFireMapFrameListener} instead
      * @since 11904
      */
+    @Deprecated
     public static boolean addAndFireMapFrameListener(MapFrameListener listener) {
-        return mainPanel != null && mainPanel.addAndFireMapFrameListener(listener);
+        return MainApplication.addAndFireMapFrameListener(listener);
     }
 
@@ -947,8 +930,10 @@
      * @return {@code true} if the listeners collection changed as a result of the call
      * @see #addAndFireMapFrameListener
+     * @deprecated use {@link MainApplication#addMapFrameListener} instead
      * @since 5957
      */
+    @Deprecated
     public static boolean addMapFrameListener(MapFrameListener listener) {
-        return mainPanel != null && mainPanel.addMapFrameListener(listener);
+        return MainApplication.addMapFrameListener(listener);
     }
 
@@ -957,8 +942,10 @@
      * @param listener The MapFrameListener
      * @return {@code true} if the listeners collection changed as a result of the call
+     * @deprecated use {@link MainApplication#removeMapFrameListener} instead
      * @since 5957
      */
+    @Deprecated
     public static boolean removeMapFrameListener(MapFrameListener listener) {
-        return mainPanel != null && mainPanel.removeMapFrameListener(listener);
+        return MainApplication.removeMapFrameListener(listener);
     }
 
Index: /trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 12639)
@@ -394,5 +394,5 @@
         //
         MapView.addZoomChangeListener(new ZoomChangeAdapter());
-        Main.addMapFrameListener(new MapFrameAdapter());
+        MainApplication.addMapFrameListener(new MapFrameAdapter());
         initEnabledState();
     }
Index: /trunk/src/org/openstreetmap/josm/actions/CopyAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/CopyAction.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/actions/CopyAction.java	(revision 12639)
@@ -16,4 +16,5 @@
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
 import org.openstreetmap.josm.gui.datatransfer.PrimitiveTransferable;
@@ -36,5 +37,5 @@
         putValue("help", ht("/Action/Copy"));
         // CUA shortcut for copy (https://en.wikipedia.org/wiki/IBM_Common_User_Access#Description)
-        Main.registerActionShortcut(this,
+        MainApplication.registerActionShortcut(this,
                 Shortcut.registerShortcut("system:copy:cua", tr("Edit: {0}", tr("Copy")), KeyEvent.VK_INSERT, Shortcut.CTRL));
     }
Index: /trunk/src/org/openstreetmap/josm/actions/JosmAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 12639)
@@ -79,5 +79,5 @@
         sc = shortcut;
         if (sc != null && !sc.isAutomatic()) {
-            Main.registerActionShortcut(this, sc);
+            MainApplication.registerActionShortcut(this, sc);
         }
         setTooltip(tooltip);
@@ -218,5 +218,5 @@
     public void destroy() {
         if (sc != null && !sc.isAutomatic()) {
-            Main.unregisterActionShortcut(this);
+            MainApplication.unregisterActionShortcut(this);
         }
         if (layerChangeAdapter != null) {
Index: /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 12639)
@@ -216,5 +216,5 @@
         super.installAdapters();
         // make this action listen to mapframe change events
-        Main.addMapFrameListener((o, n) -> updateEnabledState());
+        MainApplication.addMapFrameListener((o, n) -> updateEnabledState());
     }
 }
Index: /trunk/src/org/openstreetmap/josm/actions/PasteAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/PasteAction.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/actions/PasteAction.java	(revision 12639)
@@ -8,5 +8,5 @@
 import java.awt.event.KeyEvent;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -25,5 +25,5 @@
         putValue("help", ht("/Action/Paste"));
         // CUA shortcut for paste (https://en.wikipedia.org/wiki/IBM_Common_User_Access#Description)
-        Main.registerActionShortcut(this,
+        MainApplication.registerActionShortcut(this,
                 Shortcut.registerShortcut("system:paste:cua", tr("Edit: {0}", tr("Paste")), KeyEvent.VK_INSERT, Shortcut.SHIFT));
     }
Index: /trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java	(revision 12639)
@@ -75,5 +75,5 @@
                 null, toolbar, "save_as-session", installAdapters);
         putValue("help", ht("/Action/SessionSaveAs"));
-        Main.addMapFrameListener(this);
+        MainApplication.addMapFrameListener(this);
     }
 
Index: /trunk/src/org/openstreetmap/josm/actions/ZoomInAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ZoomInAction.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/actions/ZoomInAction.java	(revision 12639)
@@ -8,5 +8,4 @@
 import java.awt.event.KeyEvent;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -32,13 +31,13 @@
         putValue("help", ht("/Action/ZoomIn"));
         // On standard QWERTY, AZERTY and other common layouts the '+' key is obtained with Shift+EQUALS
-        Main.registerActionShortcut(this,
+        MainApplication.registerActionShortcut(this,
                 Shortcut.registerShortcut("view:zoominbis", tr("View: {0}", tr("Zoom In")),
                     KeyEvent.VK_EQUALS, Shortcut.SHIFT));
         // But on some systems (Belgian keyboard under Ubuntu) it seems not to work, so use also EQUALS
-        Main.registerActionShortcut(this,
+        MainApplication.registerActionShortcut(this,
                 Shortcut.registerShortcut("view:zoominter", tr("View: {0}", tr("Zoom In")),
                     KeyEvent.VK_EQUALS, Shortcut.DIRECT));
         // make numpad + behave like +
-        Main.registerActionShortcut(this,
+        MainApplication.registerActionShortcut(this,
             Shortcut.registerShortcut("view:zoominkeypad", tr("View: {0}", tr("Zoom In (Keypad)")),
                 KeyEvent.VK_ADD, Shortcut.DIRECT));
Index: /trunk/src/org/openstreetmap/josm/actions/ZoomOutAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ZoomOutAction.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/actions/ZoomOutAction.java	(revision 12639)
@@ -8,5 +8,4 @@
 import java.awt.event.KeyEvent;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -26,5 +25,5 @@
         putValue("help", ht("/Action/ZoomOut"));
         // make numpad - behave like -
-        Main.registerActionShortcut(this,
+        MainApplication.registerActionShortcut(this,
             Shortcut.registerShortcut("view:zoomoutkeypad", tr("View: {0}", tr("Zoom Out (Keypad)")),
                 KeyEvent.VK_SUBTRACT, Shortcut.DIRECT));
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 12639)
@@ -274,5 +274,5 @@
         MapFrame map = MainApplication.getMap();
         map.statusLine.getAnglePanel().addMouseListener(snapHelper.anglePopupListener);
-        Main.registerActionShortcut(backspaceAction, backspaceShortcut);
+        MainApplication.registerActionShortcut(backspaceAction, backspaceShortcut);
 
         map.mapView.addMouseListener(this);
@@ -294,5 +294,5 @@
         map.mapView.removeTemporaryLayer(this);
         SelectionEventManager.getInstance().removeSelectionListener(this);
-        Main.unregisterActionShortcut(backspaceAction, backspaceShortcut);
+        MainApplication.unregisterActionShortcut(backspaceAction, backspaceShortcut);
         snapHelper.unsetFixedMode();
         snapCheckboxMenuItem.getAction().setEnabled(false);
Index: /trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java	(revision 12639)
@@ -59,5 +59,5 @@
         );
         launchAction = new LaunchEditorAction();
-        Main.registerActionShortcut(launchAction, shortcut);
+        MainApplication.registerActionShortcut(launchAction, shortcut);
     }
 
@@ -115,5 +115,5 @@
     @Override
     public void destroy() {
-        Main.unregisterActionShortcut(launchAction, shortcut);
+        MainApplication.unregisterActionShortcut(launchAction, shortcut);
         super.destroy();
     }
Index: /trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12639)
@@ -44,6 +44,9 @@
 
 import javax.net.ssl.SSLSocketFactory;
+import javax.swing.Action;
+import javax.swing.InputMap;
 import javax.swing.JComponent;
 import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
 import javax.swing.LookAndFeel;
 import javax.swing.RepaintManager;
@@ -55,4 +58,5 @@
 import org.openstreetmap.gui.jmapviewer.FeatureAdapter;
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.actions.OpenFileAction;
 import org.openstreetmap.josm.actions.PreferencesAction;
@@ -131,4 +135,14 @@
 
     /**
+     * The same panel as {@link Main#panel}, required to be static for {@link MapFrameListener} handling.
+     */
+    static MainPanel mainPanel;
+
+    /**
+     * The private content pane of {@link MainFrame}, required to be static for shortcut handling.
+     */
+    static JComponent contentPanePrivate;
+
+    /**
      * The MapFrame.
      */
@@ -390,4 +404,123 @@
     public static void redirectToMainContentPane(JComponent source) {
         RedirectInputMap.redirect(source, contentPanePrivate);
+    }
+
+    /**
+     * Registers a new {@code MapFrameListener} that will be notified of MapFrame changes.
+     * <p>
+     * It will fire an initial mapFrameInitialized event when the MapFrame is present.
+     * Otherwise will only fire when the MapFrame is created or destroyed.
+     * @param listener The MapFrameListener
+     * @return {@code true} if the listeners collection changed as a result of the call
+     * @see #addMapFrameListener
+     * @since 12639 (as a replacement to {@code Main.addAndFireMapFrameListener})
+     */
+    @SuppressWarnings("deprecation")
+    public static boolean addAndFireMapFrameListener(MapFrameListener listener) {
+        return mainPanel != null && mainPanel.addAndFireMapFrameListener(listener);
+    }
+
+    /**
+     * Registers a new {@code MapFrameListener} that will be notified of MapFrame changes
+     * @param listener The MapFrameListener
+     * @return {@code true} if the listeners collection changed as a result of the call
+     * @see #addAndFireMapFrameListener
+     * @since 12639 (as a replacement to {@code Main.addMapFrameListener})
+     */
+    @SuppressWarnings("deprecation")
+    public static boolean addMapFrameListener(MapFrameListener listener) {
+        return mainPanel != null && mainPanel.addMapFrameListener(listener);
+    }
+
+    /**
+     * Unregisters the given {@code MapFrameListener} from MapFrame changes
+     * @param listener The MapFrameListener
+     * @return {@code true} if the listeners collection changed as a result of the call
+     * @since 12639 (as a replacement to {@code Main.removeMapFrameListener})
+     */
+    @SuppressWarnings("deprecation")
+    public static boolean removeMapFrameListener(MapFrameListener listener) {
+        return mainPanel != null && mainPanel.removeMapFrameListener(listener);
+    }
+
+    /**
+     * Registers a {@code JosmAction} and its shortcut.
+     * @param action action defining its own shortcut
+     * @since 12639 (as a replacement to {@code Main.registerActionShortcut})
+     */
+    @SuppressWarnings("deprecation")
+    public static void registerActionShortcut(JosmAction action) {
+        registerActionShortcut(action, action.getShortcut());
+    }
+
+    /**
+     * Registers an action and its shortcut.
+     * @param action action to register
+     * @param shortcut shortcut to associate to {@code action}
+     * @since 12639 (as a replacement to {@code Main.registerActionShortcut})
+     */
+    @SuppressWarnings("deprecation")
+    public static void registerActionShortcut(Action action, Shortcut shortcut) {
+        KeyStroke keyStroke = shortcut.getKeyStroke();
+        if (keyStroke == null)
+            return;
+
+        InputMap inputMap = contentPanePrivate.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+        Object existing = inputMap.get(keyStroke);
+        if (existing != null && !existing.equals(action)) {
+            Logging.info(String.format("Keystroke %s is already assigned to %s, will be overridden by %s", keyStroke, existing, action));
+        }
+        inputMap.put(keyStroke, action);
+
+        contentPanePrivate.getActionMap().put(action, action);
+    }
+
+    /**
+     * Unregisters a shortcut.
+     * @param shortcut shortcut to unregister
+     * @since 12639 (as a replacement to {@code Main.unregisterShortcut})
+     */
+    @SuppressWarnings("deprecation")
+    public static void unregisterShortcut(Shortcut shortcut) {
+        contentPanePrivate.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(shortcut.getKeyStroke());
+    }
+
+    /**
+     * Unregisters a {@code JosmAction} and its shortcut.
+     * @param action action to unregister
+     * @since 12639 (as a replacement to {@code Main.unregisterActionShortcut})
+     */
+    @SuppressWarnings("deprecation")
+    public static void unregisterActionShortcut(JosmAction action) {
+        unregisterActionShortcut(action, action.getShortcut());
+    }
+
+    /**
+     * Unregisters an action and its shortcut.
+     * @param action action to unregister
+     * @param shortcut shortcut to unregister
+     * @since 12639 (as a replacement to {@code Main.unregisterActionShortcut})
+     */
+    @SuppressWarnings("deprecation")
+    public static void unregisterActionShortcut(Action action, Shortcut shortcut) {
+        unregisterShortcut(shortcut);
+        contentPanePrivate.getActionMap().remove(action);
+    }
+
+    /**
+     * Replies the registered action for the given shortcut
+     * @param shortcut The shortcut to look for
+     * @return the registered action for the given shortcut
+     * @since 12639 (as a replacement to {@code Main.getRegisteredActionShortcut})
+     */
+    @SuppressWarnings("deprecation")
+    public static Action getRegisteredActionShortcut(Shortcut shortcut) {
+        KeyStroke keyStroke = shortcut.getKeyStroke();
+        if (keyStroke == null)
+            return null;
+        Object action = contentPanePrivate.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).get(keyStroke);
+        if (action instanceof Action)
+            return (Action) action;
+        return null;
     }
 
@@ -551,7 +684,7 @@
         final MainFrame mainFrame = new MainFrame(geometry);
         if (mainFrame.getContentPane() instanceof JComponent) {
-            Main.contentPanePrivate = (JComponent) mainFrame.getContentPane();
-        }
-        Main.mainPanel = mainFrame.getPanel();
+            contentPanePrivate = (JComponent) mainFrame.getContentPane();
+        }
+        mainPanel = mainFrame.getPanel();
         Main.parent = mainFrame;
 
Index: /trunk/src/org/openstreetmap/josm/gui/MapMover.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapMover.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/gui/MapMover.java	(revision 12639)
@@ -153,5 +153,5 @@
 
     private void registerActionShortcut(ZoomerAction action, Shortcut shortcut) {
-        Main.registerActionShortcut(action, shortcut);
+        MainApplication.registerActionShortcut(action, shortcut);
         registeredShortcuts.add(new Pair<>(action, shortcut));
     }
@@ -271,5 +271,5 @@
     public void destroy() {
         for (Pair<ZoomerAction, Shortcut> shortcut : registeredShortcuts) {
-            Main.unregisterActionShortcut(shortcut.a, shortcut.b);
+            MainApplication.unregisterActionShortcut(shortcut.a, shortcut.b);
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 12639)
@@ -672,7 +672,7 @@
                 final boolean activeLayerSupported = mode.layerIsSupported(layerManager.getActiveLayer());
                 if (activeLayerSupported) {
-                    Main.registerActionShortcut(mode, mode.getShortcut()); //fix #6876
+                    MainApplication.registerActionShortcut(mode, mode.getShortcut()); //fix #6876
                 } else {
-                    Main.unregisterShortcut(mode.getShortcut());
+                    MainApplication.unregisterShortcut(mode.getShortcut());
                 }
                 b.setEnabled(activeLayerSupported);
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 12639)
@@ -161,5 +161,5 @@
                     tr("Toggle visibility of layer: {0}", i1), KeyEvent.VK_0 + (i1 % 10), Shortcut.ALT);
             visibilityToggleActions[i] = new ToggleLayerIndexVisibility(i);
-            Main.registerActionShortcut(visibilityToggleActions[i], visibilityToggleShortcuts[i]);
+            MainApplication.registerActionShortcut(visibilityToggleActions[i], visibilityToggleShortcuts[i]);
         }
     }
@@ -372,5 +372,5 @@
     public void destroy() {
         for (int i = 0; i < 10; i++) {
-            Main.unregisterActionShortcut(visibilityToggleActions[i], visibilityToggleShortcuts[i]);
+            MainApplication.unregisterActionShortcut(visibilityToggleActions[i], visibilityToggleShortcuts[i]);
         }
         MultikeyActionsHandler.getInstance().removeAction(activateLayerAction);
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 12639)
@@ -515,5 +515,5 @@
         MainApplication.getLayerManager().addActiveLayerChangeListener(this);
         for (JosmAction action : josmActions) {
-            Main.registerActionShortcut(action);
+            MainApplication.registerActionShortcut(action);
         }
         updateSelection();
@@ -526,5 +526,5 @@
         MainApplication.getLayerManager().removeActiveLayerChangeListener(this);
         for (JosmAction action : josmActions) {
-            Main.unregisterActionShortcut(action);
+            MainApplication.unregisterActionShortcut(action);
         }
     }
@@ -1335,5 +1335,5 @@
             putValue(SHORT_DESCRIPTION, tr("Copy the key and value of all the tags to clipboard"));
             Shortcut sc = Shortcut.registerShortcut("system:copytags", tr("Edit: {0}", tr("Copy Tags")), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE);
-            Main.registerActionShortcut(this, sc);
+            MainApplication.registerActionShortcut(this, sc);
             sc.setAccelerator(this);
         }
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java	(revision 12639)
@@ -22,5 +22,4 @@
 import javax.swing.JToggleButton;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.dialogs.DialogsPanel.Action;
@@ -101,5 +100,5 @@
                 "geoimage:previous", tr("Geoimage: {0}", tr("Show previous Image")), KeyEvent.VK_PAGE_UP, Shortcut.DIRECT);
         final String previousImage = "Previous Image";
-        Main.registerActionShortcut(prevAction, scPrev);
+        MainApplication.registerActionShortcut(prevAction, scPrev);
         btnPrevious.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scPrev.getKeyStroke(), previousImage);
         btnPrevious.getActionMap().put(previousImage, prevAction);
@@ -112,5 +111,5 @@
         Shortcut scDelete = Shortcut.registerShortcut(
                 "geoimage:deleteimagefromlayer", tr("Geoimage: {0}", tr("Remove photo from layer")), KeyEvent.VK_DELETE, Shortcut.SHIFT);
-        Main.registerActionShortcut(delAction, scDelete);
+        MainApplication.registerActionShortcut(delAction, scDelete);
         btnDelete.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDelete.getKeyStroke(), removePhoto);
         btnDelete.getActionMap().put(removePhoto, delAction);
@@ -123,5 +122,5 @@
                 "geoimage:deletefilefromdisk", tr("Geoimage: {0}", tr("Delete File from disk")), KeyEvent.VK_DELETE, Shortcut.CTRL_SHIFT);
         final String deleteImage = "Delete image file from disk";
-        Main.registerActionShortcut(delFromDiskAction, scDeleteFromDisk);
+        MainApplication.registerActionShortcut(delFromDiskAction, scDeleteFromDisk);
         btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), deleteImage);
         btnDeleteFromDisk.getActionMap().put(deleteImage, delFromDiskAction);
@@ -133,5 +132,5 @@
                 "geoimage:copypath", tr("Geoimage: {0}", tr("Copy image path")), KeyEvent.VK_C, Shortcut.ALT_CTRL_SHIFT);
         final String copyImage = "Copy image path";
-        Main.registerActionShortcut(copyPathAction, scCopyPath);
+        MainApplication.registerActionShortcut(copyPathAction, scCopyPath);
         btnCopyPath.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scCopyPath.getKeyStroke(), copyImage);
         btnCopyPath.getActionMap().put(copyImage, copyPathAction);
@@ -143,15 +142,15 @@
                 "geoimage:next", tr("Geoimage: {0}", tr("Show next Image")), KeyEvent.VK_PAGE_DOWN, Shortcut.DIRECT);
         final String nextImage = "Next Image";
-        Main.registerActionShortcut(nextAction, scNext);
+        MainApplication.registerActionShortcut(nextAction, scNext);
         btnNext.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scNext.getKeyStroke(), nextImage);
         btnNext.getActionMap().put(nextImage, nextAction);
         btnNext.setEnabled(false);
 
-        Main.registerActionShortcut(
+        MainApplication.registerActionShortcut(
                 new ImageAction(COMMAND_FIRST, null, null),
                 Shortcut.registerShortcut(
                         "geoimage:first", tr("Geoimage: {0}", tr("Show first Image")), KeyEvent.VK_HOME, Shortcut.DIRECT)
         );
-        Main.registerActionShortcut(
+        MainApplication.registerActionShortcut(
                 new ImageAction(COMMAND_LAST, null, null),
                 Shortcut.registerShortcut(
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 12639)
@@ -1245,6 +1245,6 @@
             sc = Shortcut.registerShortcut("toolbar:"+name, tr("Toolbar: {0}", desc),
                 KeyEvent.CHAR_UNDEFINED, Shortcut.NONE);
-            Main.unregisterShortcut(sc);
-            Main.registerActionShortcut(act, sc);
+            MainApplication.unregisterShortcut(sc);
+            MainApplication.registerActionShortcut(act, sc);
 
             // add shortcut info to the tooltip if needed
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java	(revision 12639)
@@ -17,4 +17,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -147,7 +148,7 @@
             KeyStroke ks = shortcut.getKeyStroke();
             if (hasToBeDisabled(ks)) {
-                Action action = Main.getRegisteredActionShortcut(shortcut);
+                Action action = MainApplication.getRegisteredActionShortcut(shortcut);
                 if (action != null) {
-                    Main.unregisterActionShortcut(action, shortcut);
+                    MainApplication.unregisterActionShortcut(action, shortcut);
                     unregisteredActionShortcuts.add(new Pair<>(action, shortcut));
                 }
@@ -182,5 +183,5 @@
     protected void restoreActionShortcuts() {
         for (Pair<Action, Shortcut> p : unregisteredActionShortcuts) {
-            Main.registerActionShortcut(p.a, p.b);
+            MainApplication.registerActionShortcut(p.a, p.b);
         }
         unregisteredActionShortcuts.clear();
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 12639)
@@ -781,5 +781,5 @@
                 PluginProxy pluginProxy = plugin.load(klass, pluginClassLoader);
                 pluginList.add(pluginProxy);
-                Main.addAndFireMapFrameListener(pluginProxy);
+                MainApplication.addAndFireMapFrameListener(pluginProxy);
             }
             msg = null;
Index: /trunk/src/org/openstreetmap/josm/tools/MultikeyActionsHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/MultikeyActionsHandler.java	(revision 12638)
+++ /trunk/src/org/openstreetmap/josm/tools/MultikeyActionsHandler.java	(revision 12639)
@@ -212,5 +212,5 @@
             MyAction myAction = new MyAction(action);
             myActions.put(action, myAction);
-            Main.registerActionShortcut(myAction, myAction.shortcut);
+            MainApplication.registerActionShortcut(myAction, myAction.shortcut);
         }
     }
@@ -223,5 +223,5 @@
         MyAction a = myActions.get(action);
         if (a != null) {
-            Main.unregisterActionShortcut(a, a.shortcut);
+            MainApplication.unregisterActionShortcut(a, a.shortcut);
             myActions.remove(action);
         }
Index: /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 12638)
+++ /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 12639)
@@ -6,5 +6,4 @@
 import static org.junit.Assert.fail;
 
-import java.awt.BorderLayout;
 import java.io.File;
 import java.io.IOException;
@@ -15,10 +14,7 @@
 import java.util.TimeZone;
 
-import javax.swing.JPanel;
-
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MainApplicationTest;
-import org.openstreetmap.josm.gui.MainPanel;
 import org.openstreetmap.josm.gui.layer.LayerManagerTest.TestLayer;
 import org.openstreetmap.josm.gui.util.GuiHelper;
@@ -158,5 +154,5 @@
             if (Main.main.panel == null) {
                 initMainPanel(false);
-                Main.main.panel = Main.mainPanel;
+                Main.main.panel = MainApplicationTest.getMainPanel();
             }
             Main.main.panel.reAddListeners();
@@ -167,14 +163,12 @@
 
     /**
-     * Make sure {@code Main.contentPanePrivate} is initialized.
+     * Make sure {@code MainApplication.contentPanePrivate} is initialized.
      */
     public static void initContentPane() {
-        if (Main.contentPanePrivate == null) {
-            Main.contentPanePrivate = new JPanel(new BorderLayout());
-        }
+        MainApplicationTest.initContentPane();
     }
 
     /**
-     * Make sure {@code Main.mainPanel} is initialized.
+     * Make sure {@code MainApplication.mainPanel} is initialized.
      */
     public static void initMainPanel() {
@@ -183,28 +177,16 @@
 
     /**
-     * Make sure {@code Main.mainPanel} is initialized.
+     * Make sure {@code MainApplication.mainPanel} is initialized.
      * @param reAddListeners {@code true} to re-add listeners
      */
     public static void initMainPanel(boolean reAddListeners) {
-        if (Main.mainPanel == null) {
-            Main.mainPanel = new MainPanel(MainApplication.getLayerManager());
-        }
-        if (reAddListeners) {
-            Main.mainPanel.reAddListeners();
-        }
-        if (Main.main != null) {
-            Main.main.panel = Main.mainPanel;
-        }
+        MainApplicationTest.initMainPanel(reAddListeners);
     }
 
     /**
-     * Make sure {@code Main.toolbar} is initialized.
+     * Make sure {@code MainApplication.toolbar} is initialized.
      */
-    @SuppressWarnings("deprecation")
     public static void initToolbar() {
         MainApplicationTest.initToolbar();
-        if (Main.toolbar == null) {
-            Main.toolbar = MainApplication.getToolbar();
-        }
     }
 }
Index: /trunk/test/unit/org/openstreetmap/josm/MainTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/MainTest.java	(revision 12638)
+++ /trunk/test/unit/org/openstreetmap/josm/MainTest.java	(revision 12639)
@@ -8,5 +8,4 @@
 import static org.junit.Assert.assertTrue;
 
-import java.awt.event.KeyEvent;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -18,9 +17,6 @@
 import org.openstreetmap.josm.Main.InitStatusListener;
 import org.openstreetmap.josm.Main.InitializationTask;
-import org.openstreetmap.josm.actions.AboutAction;
-import org.openstreetmap.josm.gui.MapFrameListener;
 import org.openstreetmap.josm.io.OnlineResource;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
-import org.openstreetmap.josm.tools.Shortcut;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -125,31 +121,4 @@
     }
 
-    /**
-     * Unit test of {@link Main#getRegisteredActionShortcut}.
-     */
-    @Test
-    public void testGetRegisteredActionShortcut() {
-        Shortcut noKeystroke = Shortcut.registerShortcut("no", "keystroke", 0, 0);
-        assertNull(noKeystroke.getKeyStroke());
-        assertNull(Main.getRegisteredActionShortcut(noKeystroke));
-        Shortcut noAction = Shortcut.registerShortcut("foo", "bar", KeyEvent.VK_AMPERSAND, Shortcut.SHIFT);
-        assertNotNull(noAction.getKeyStroke());
-        assertNull(Main.getRegisteredActionShortcut(noAction));
-        AboutAction about = new AboutAction();
-        assertEquals(about, Main.getRegisteredActionShortcut(about.getShortcut()));
-    }
-
-    /**
-     * Unit test of {@link Main#addMapFrameListener} and {@link Main#removeMapFrameListener}.
-     */
-    @Test
-    public void testMapFrameListener() {
-        MapFrameListener listener = (o, n) -> { };
-        assertTrue(Main.addMapFrameListener(listener));
-        assertFalse(Main.addMapFrameListener(null));
-        assertTrue(Main.removeMapFrameListener(listener));
-        assertFalse(Main.removeMapFrameListener(null));
-    }
-
     private static class InitStatusListenerStub implements InitStatusListener {
 
Index: /trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java	(revision 12638)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java	(revision 12639)
@@ -6,5 +6,8 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
-
+import static org.junit.Assert.assertTrue;
+
+import java.awt.BorderLayout;
+import java.awt.event.KeyEvent;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -19,4 +22,6 @@
 import java.util.concurrent.Future;
 
+import javax.swing.JComponent;
+import javax.swing.JPanel;
 import javax.swing.UIManager;
 
@@ -25,4 +30,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.TestUtils;
+import org.openstreetmap.josm.actions.AboutAction;
 import org.openstreetmap.josm.data.Version;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -37,4 +43,5 @@
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Shortcut;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -53,9 +60,54 @@
 
     /**
+     * Make sure {@link MainApplication#contentPanePrivate} is initialized.
+     */
+    public static void initContentPane() {
+        if (MainApplication.contentPanePrivate == null) {
+            MainApplication.contentPanePrivate = new JPanel(new BorderLayout());
+        }
+    }
+
+    /**
+     * Returns {@link MainApplication#contentPanePrivate} (not public).
+     * @return {@link MainApplication#contentPanePrivate}
+     */
+    public static JComponent getContentPane() {
+        return MainApplication.contentPanePrivate;
+    }
+
+    /**
+     * Make sure {@code MainApplication.mainPanel} is initialized.
+     * @param reAddListeners {@code true} to re-add listeners
+     */
+    public static void initMainPanel(boolean reAddListeners) {
+        if (MainApplication.mainPanel == null) {
+            MainApplication.mainPanel = new MainPanel(MainApplication.getLayerManager());
+        }
+        if (reAddListeners) {
+            MainApplication.mainPanel.reAddListeners();
+        }
+        if (Main.main != null) {
+            Main.main.panel = MainApplication.mainPanel;
+        }
+    }
+
+    /**
+     * Returns {@link MainApplication#mainPanel} (not public).
+     * @return {@link MainApplication#mainPanel}
+     */
+    public static MainPanel getMainPanel() {
+        return MainApplication.mainPanel;
+    }
+
+    /**
      * Make sure {@link MainApplication#toolbar} is initialized.
      */
+    @SuppressWarnings("deprecation")
     public static void initToolbar() {
         if (MainApplication.toolbar == null) {
             MainApplication.toolbar = new ToolbarPreferences();
+        }
+        if (Main.toolbar == null) {
+            Main.toolbar = MainApplication.getToolbar();
         }
     }
@@ -236,4 +288,31 @@
 
     /**
+     * Unit test of {@link MainApplication#getRegisteredActionShortcut}.
+     */
+    @Test
+    public void testGetRegisteredActionShortcut() {
+        Shortcut noKeystroke = Shortcut.registerShortcut("no", "keystroke", 0, 0);
+        assertNull(noKeystroke.getKeyStroke());
+        assertNull(MainApplication.getRegisteredActionShortcut(noKeystroke));
+        Shortcut noAction = Shortcut.registerShortcut("foo", "bar", KeyEvent.VK_AMPERSAND, Shortcut.SHIFT);
+        assertNotNull(noAction.getKeyStroke());
+        assertNull(MainApplication.getRegisteredActionShortcut(noAction));
+        AboutAction about = new AboutAction();
+        assertEquals(about, MainApplication.getRegisteredActionShortcut(about.getShortcut()));
+    }
+
+    /**
+     * Unit test of {@link MainApplication#addMapFrameListener} and {@link MainApplication#removeMapFrameListener}.
+     */
+    @Test
+    public void testMapFrameListener() {
+        MapFrameListener listener = (o, n) -> { };
+        assertTrue(MainApplication.addMapFrameListener(listener));
+        assertFalse(MainApplication.addMapFrameListener(null));
+        assertTrue(MainApplication.removeMapFrameListener(listener));
+        assertFalse(MainApplication.removeMapFrameListener(null));
+    }
+
+    /**
      * Unit test of {@link DownloadParamType} enum.
      */
