Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 3098)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 3099)
@@ -19,4 +19,5 @@
 import java.util.NoSuchElementException;
 
+import javax.swing.AbstractAction;
 import javax.swing.BorderFactory;
 import javax.swing.DefaultListModel;
@@ -46,5 +47,7 @@
 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
 import org.openstreetmap.josm.gui.SideButton;
+import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -75,4 +78,6 @@
     private JPopupMenu popupMenu;
     private JMenuItem zoomToElement;
+
+    private SelectAction actSelect;
 
     /**
@@ -113,12 +118,13 @@
 
         JPanel buttonPanel = getButtonPanel(2);
-
-        selectButton = new SideButton(marktr("Select"), "select", "SelectionList",
-                tr("Set the selected elements on the map to the selected items in the list above."),
-                new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                updateMap();
-            }
-        });
+        //
+        //        selectButton = new SideButton(marktr("Select"), "select", "SelectionList",
+        //                tr("Set the selected elements on the map to the selected items in the list above."),
+        //                new ActionListener() {
+        //            public void actionPerformed(ActionEvent e) {
+        //                updateMap();
+        //            }
+        //        });
+        selectButton = new SideButton(actSelect = new SelectAction());
         buttonPanel.add(selectButton);
         BasicArrowButton selectionHistoryMenuButton = createArrowButton(selectButton);
@@ -167,4 +173,5 @@
         SelectionEventManager.getInstance().addSelectionListener(this, FireMode.IN_EDT_CONSOLIDATED);
         MapView.addEditLayerChangeListener(this);
+        MapView.addEditLayerChangeListener(actSelect);
         updateSelection();
     }
@@ -174,4 +181,5 @@
         SelectionEventManager.getInstance().removeSelectionListener(this);
         MapView.removeEditLayerChangeListener(this);
+        MapView.removeEditLayerChangeListener(actSelect);
         updateTitle(0, 0, 0);
     }
@@ -391,3 +399,26 @@
         updateSelection();
     }
+
+    class SelectAction extends AbstractAction implements EditLayerChangeListener {
+        public SelectAction() {
+            putValue(NAME, tr("Select"));
+            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"));
+            updateEnabledState();
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            updateMap();
+        }
+
+        public void updateEnabledState() {
+            setEnabled(Main.main != null && Main.main.getEditLayer() != null);
+        }
+
+        @Override
+        public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) {
+            updateEnabledState();
+        }
+    }
 }
