Ticket #1676: 0001-fix-1676-make-url-copy-pastable-again-and-select-i.patch

File 0001-fix-1676-make-url-copy-pastable-again-and-select-i.patch, 2.0 KB (added by JohannesRudolph, 16 years ago)

possible fix

  • src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java

    From 830295938b91cd5e51f1ad112981eb36353d1885 Mon Sep 17 00:00:00 2001
    From: Johannes Rudolph <johannes_rudolph@gmx.de>
    Date: Sun, 26 Oct 2008 18:49:37 +0100
    Subject: [PATCH] fix #1676: make url copy-pastable again and select it when you click on it
    
    ---
     .../josm/gui/download/BoundingBoxSelection.java    |   12 +++++++++++-
     1 files changed, 11 insertions(+), 1 deletions(-)
    
    diff --git a/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java b/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
    index 8aa90a4..3a09c9b 100644
    a b package org.openstreetmap.josm.gui.download;  
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.awt.Color;
    67import java.awt.Dimension;
    78import java.awt.GridBagLayout;
    89import java.awt.event.FocusAdapter;
    910import java.awt.event.FocusEvent;
    1011import java.awt.event.FocusListener;
     12import java.awt.event.MouseAdapter;
    1113import java.util.HashMap;
    1214
    1315import javax.swing.JLabel;
    public class BoundingBoxSelection implements DownloadSelection {  
    3739                        new JTextField(11),
    3840                        new JTextField(11) };
    3941        final JTextArea osmUrl = new JTextArea();
    40         final JLabel showUrl = new JLabel();
     42        final JTextArea showUrl = new JTextArea();
    4143        String noteUrl = tr("You can paste an URL here to download the area.");
    4244       
    4345        public void addGui(final DownloadDialog gui) {
    public class BoundingBoxSelection implements DownloadSelection {  
    119121                dlg.add(new JLabel(tr("URL from www.openstreetmap.org")), GBC.eol().insets(10,20,5,0));
    120122                dlg.add(osmUrl, GBC.eop().insets(10,0,5,0).fill());
    121123                dlg.add(showUrl, GBC.eop().insets(10,0,5,5));
     124                showUrl.setEditable(false);
     125                showUrl.setBackground(new Color(255,66,66));
     126                showUrl.addFocusListener(new FocusAdapter(){
     127                   @Override
     128                    public void focusGained(FocusEvent e) {
     129                        showUrl.selectAll();
     130                    }
     131                });
    122132
    123133                gui.tabpane.addTab(tr("Bounding Box"), dlg);
    124134        }