Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSAdjustAction.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSAdjustAction.java	(revision 22715)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSAdjustAction.java	(revision 22719)
@@ -3,28 +3,14 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.Component;
 import java.awt.Cursor;
-import java.awt.GridBagLayout;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import java.awt.event.MouseMotionListener;
-import java.util.List;
-
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.Icon;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.coor.EastNorth;
-import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.Layer;
-import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -48,16 +34,8 @@
 	@Override public void enterMode() {
 		super.enterMode();
-		if (!hasWMSLayersToAdjust()) {
-			warnNoWMSLayers();
+		if (!Main.isDisplayingMapView() || !(Main.map.mapView.getActiveLayer() instanceof WMSLayer)) {
 			return;
 		}
-		List<WMSLayer> wmsLayers = Main.map.mapView.getLayersOfType(WMSLayer.class);
-		if (wmsLayers.size() == 1) {
-			adjustingLayer = wmsLayers.get(0);
-		} else {
-			adjustingLayer = (WMSLayer)askAdjustLayer(Main.map.mapView.getLayersOfType(WMSLayer.class));
-		}
-		if (adjustingLayer == null)
-			return;
+		adjustingLayer = (WMSLayer) Main.map.mapView.getActiveLayer();
 		if (!adjustingLayer.isVisible()) {
 			adjustingLayer.setVisible(true);
@@ -126,93 +104,6 @@
 	// provided there aren't any other means to activate this tool
 	@Override public boolean layerIsSupported(Layer l) {
-		return (l instanceof WMSLayer) && l.isVisible();
+		return l instanceof WMSLayer;
 	}
 
-	/**
-	 * the list cell renderer used to render layer list entries
-	 *
-	 */
-	static public class LayerListCellRenderer extends DefaultListCellRenderer {
-
-		protected boolean isActiveLayer(Layer layer) {
-			if (Main.map == null)
-				return false;
-			if (Main.map.mapView == null)
-				return false;
-			return Main.map.mapView.getActiveLayer() == layer;
-		}
-
-		@Override
-		public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
-				boolean cellHasFocus) {
-			Layer layer = (Layer) value;
-			JLabel label = (JLabel) super.getListCellRendererComponent(list, layer.getName(), index, isSelected,
-					cellHasFocus);
-			Icon icon = layer.getIcon();
-			label.setIcon(icon);
-			label.setToolTipText(layer.getToolTipText());
-			return label;
-		}
-	}
-
-	/**
-	 * Prompts the user with a list of WMS layers which can be adjusted
-	 *
-	 * @param adjustableLayers the list of adjustable layers
-	 * @return  the selected layer; null, if no layer was selected
-	 */
-	protected Layer askAdjustLayer(List<? extends Layer> adjustableLayers) {
-		JComboBox layerList = new JComboBox();
-		layerList.setRenderer(new LayerListCellRenderer());
-		layerList.setModel(new DefaultComboBoxModel(adjustableLayers.toArray()));
-		layerList.setSelectedIndex(0);
-
-		JPanel pnl = new JPanel();
-		pnl.setLayout(new GridBagLayout());
-		pnl.add(new JLabel(tr("Please select the WMS layer to adjust.")), GBC.eol());
-		pnl.add(layerList, GBC.eol());
-
-		ExtendedDialog diag = new ExtendedDialog(
-				Main.parent,
-				tr("Select WMS layer"),
-				new String[] { tr("Start adjusting"),tr("Cancel") }
-		);
-		diag.setContent(pnl);
-		diag.setButtonIcons(new String[] { "mapmode/adjustwms", "cancel" });
-		diag.showDialog();
-		int decision = diag.getValue();
-		if (decision != 1)
-			return null;
-		Layer adjustLayer = (Layer) layerList.getSelectedItem();
-		return adjustLayer;
-	}
-
-	/**
-	 * Displays a warning message if there are no WMS layers to adjust
-	 *
-	 */
-	protected void warnNoWMSLayers() {
-		JOptionPane.showMessageDialog(
-				Main.parent,
-				tr("There are currently no WMS layer to adjust."),
-				tr("No layers to adjust"),
-				JOptionPane.WARNING_MESSAGE
-		);
-	}
-
-	/**
-	 * Replies true if there is at least one WMS layer
-	 *
-	 * @return true if there is at least one WMS layer
-	 */
-	protected boolean hasWMSLayersToAdjust() {
-		if (Main.map == null) return false;
-		if (Main.map.mapView == null) return false;
-		return ! Main.map.mapView.getLayersOfType(WMSLayer.class).isEmpty();
-	}
-
-	@Override
-	protected void updateEnabledState() {
-		setEnabled(hasWMSLayersToAdjust());
-	}
 }
