commit c71170c24333954bc836ef60cdb3b45aef488fd4
Author: Simon Legner <Simon.Legner@gmail.com>
Date:   2020-04-20 23:21:12 +0200

    fix #19127 - Jump to Position: jump to place name

diff --git a/src/org/openstreetmap/josm/actions/JumpToAction.java b/src/org/openstreetmap/josm/actions/JumpToAction.java
index 52cbca965..77bccd469 100644
--- a/src/org/openstreetmap/josm/actions/JumpToAction.java
+++ b/src/org/openstreetmap/josm/actions/JumpToAction.java
@@ -8,6 +8,8 @@
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
+import java.io.IOException;
+import java.util.List;
 import java.util.Optional;
 
 import javax.swing.JLabel;
@@ -25,6 +27,7 @@
 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
 import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
+import org.openstreetmap.josm.io.NameFinder;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -39,6 +42,7 @@
 public class JumpToAction extends JosmAction {
 
     private final JosmTextField url = new JosmTextField();
+    private final JosmTextField place = new JosmTextField();
     private final JosmTextField lat = new JosmTextField();
     private final JosmTextField lon = new JosmTextField();
     private final JosmTextField zm = new JosmTextField();
@@ -131,6 +135,7 @@ public void showJumpToDialog() {
         zm.getDocument().addDocumentListener(x);
         url.getDocument().addDocumentListener(new OsmURLListener());
 
+        SelectAllOnFocusGainedDecorator.decorate(place);
         SelectAllOnFocusGainedDecorator.decorate(lat);
         SelectAllOnFocusGainedDecorator.decorate(lon);
         SelectAllOnFocusGainedDecorator.decorate(zm);
@@ -139,6 +144,9 @@ public void showJumpToDialog() {
         JPanel p = new JPanel(new GridBagLayout());
         panel.add(p, BorderLayout.NORTH);
 
+        p.add(new JLabel(tr("Areas around places")), GBC.eol());
+        p.add(place, GBC.eol().fill(GBC.HORIZONTAL));
+
         p.add(new JLabel(tr("Latitude")), GBC.eol());
         p.add(lat, GBC.eol().fill(GBC.HORIZONTAL));
 
@@ -158,6 +166,15 @@ public void showJumpToDialog() {
             final int option = new JumpToPositionDialog(buttons, panel).showDialog().getValue();
 
             if (option != 1) return;
+            if (place.hasFocus()) {
+                try {
+                    List<NameFinder.SearchResult> placeResults = NameFinder.queryNominatim(place.getText());
+                    mv.zoomTo(placeResults.get(0).getBounds());
+                    return;
+                } catch (IOException | RuntimeException ignore) {
+                    Logging.debug(ignore);
+                }
+            }
             try {
                 zoomLvl = Double.parseDouble(zm.getText());
                 ll = new LatLon(Double.parseDouble(lat.getText()), Double.parseDouble(lon.getText()));
