Index: trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java	(revision 10342)
+++ trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java	(revision 10345)
@@ -108,5 +108,5 @@
                 FileExporter exporter = exporterClass.getConstructor().newInstance();
                 exporters.add(exporter);
-                MapView.addLayerChangeListener(exporter);
+                Main.getLayerManager().addAndFireActiveLayerChangeListener(exporter);
             } catch (ReflectiveOperationException e) {
                 if (Main.isDebugEnabled()) {
Index: trunk/src/org/openstreetmap/josm/actions/JosmAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 10342)
+++ trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 10345)
@@ -16,10 +16,9 @@
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.gui.MapView;
-import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
-import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
+import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
+import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
-import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.tools.Destroyable;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -184,5 +183,7 @@
             Main.unregisterActionShortcut(this);
         }
-        MapView.removeLayerChangeListener(layerChangeAdapter);
+        if (layerChangeAdapter != null) {
+            Main.getLayerManager().removeActiveLayerChangeListener(layerChangeAdapter);
+        }
         DataSet.removeSelectionListener(selectionChangeAdapter);
     }
@@ -226,8 +227,7 @@
     protected void installAdapters() {
         // make this action listen to layer change and selection change events
-        //
         layerChangeAdapter = new LayerChangeAdapter();
         selectionChangeAdapter = new SelectionChangeAdapter();
-        MapView.addLayerChangeListener(layerChangeAdapter);
+        Main.getLayerManager().addActiveLayerChangeListener(layerChangeAdapter);
         DataSet.addSelectionListener(selectionChangeAdapter);
         initEnabledState();
@@ -291,34 +291,20 @@
 
     /**
-     * Adapter for layer change events
-     *
-     */
-    protected class LayerChangeAdapter implements MapView.LayerChangeListener {
-        private void updateEnabledStateInEDT() {
-            GuiHelper.runInEDT(new Runnable() {
-                @Override public void run() {
-                    updateEnabledState();
-                }
-            });
-        }
-
+     * Adapter for layer change events. Runs updateEnabledState() whenever the active layer changed.
+     */
+    protected class LayerChangeAdapter implements ActiveLayerChangeListener {
         @Override
-        public void activeLayerChange(Layer oldLayer, Layer newLayer) {
-            updateEnabledStateInEDT();
+        public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
+            updateEnabledState();
         }
 
         @Override
-        public void layerAdded(Layer newLayer) {
-            updateEnabledStateInEDT();
-        }
-
-        @Override
-        public void layerRemoved(Layer oldLayer) {
-            updateEnabledStateInEDT();
-        }
-    }
-
-    /**
-     * Adapter for selection change events
+        public String toString() {
+            return "LayerChangeAdapter [" + JosmAction.this.toString() + ']';
+        }
+    }
+
+    /**
+     * Adapter for selection change events. Runs updateEnabledState() whenever the selection changed.
      */
     protected class SelectionChangeAdapter implements SelectionChangedListener {
@@ -327,4 +313,9 @@
             updateEnabledState(newSelection);
         }
+
+        @Override
+        public String toString() {
+            return "SelectionChangeAdapter [" + JosmAction.this.toString() + ']';
+        }
     }
 }
Index: trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java	(revision 10342)
+++ trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java	(revision 10345)
@@ -21,8 +21,12 @@
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.gui.DefaultNameFormatter;
-import org.openstreetmap.josm.gui.MapView;
-import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
+import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
+import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
+import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
+import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
+import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener;
@@ -33,5 +37,5 @@
  * Action for accessing recent relations.
  */
-public class RecentRelationsAction implements ActionListener, CommandQueueListener, LayerChangeListener {
+public class RecentRelationsAction implements ActionListener, CommandQueueListener, LayerChangeListener, ActiveLayerChangeListener {
 
     private final SideButton editButton;
@@ -48,5 +52,6 @@
         arrow.setToolTipText(tr("List of recent relations"));
         Main.main.undoRedo.addCommandQueueListener(this);
-        MapView.addLayerChangeListener(this);
+        Main.getLayerManager().addLayerChangeListener(this);
+        Main.getLayerManager().addActiveLayerChangeListener(this);
         enableArrow();
         shortcut = Shortcut.registerShortcut(
@@ -109,15 +114,20 @@
 
     @Override
-    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
+    public void layerAdded(LayerAddEvent e) {
         enableArrow();
     }
 
     @Override
-    public void layerAdded(Layer newLayer) {
+    public void layerRemoving(LayerRemoveEvent e) {
         enableArrow();
     }
 
     @Override
-    public void layerRemoved(Layer oldLayer) {
+    public void layerOrderChanged(LayerOrderChangeEvent e) {
+        enableArrow();
+    }
+
+    @Override
+    public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
         enableArrow();
     }
@@ -182,3 +192,4 @@
         }
     }
+
 }
