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;
|
| 3 | 3 | |
| 4 | 4 | import static org.openstreetmap.josm.tools.I18n.tr; |
| 5 | 5 | |
| | 6 | import java.awt.Color; |
| 6 | 7 | import java.awt.Dimension; |
| 7 | 8 | import java.awt.GridBagLayout; |
| 8 | 9 | import java.awt.event.FocusAdapter; |
| 9 | 10 | import java.awt.event.FocusEvent; |
| 10 | 11 | import java.awt.event.FocusListener; |
| | 12 | import java.awt.event.MouseAdapter; |
| 11 | 13 | import java.util.HashMap; |
| 12 | 14 | |
| 13 | 15 | import javax.swing.JLabel; |
| … |
… |
public class BoundingBoxSelection implements DownloadSelection {
|
| 37 | 39 | new JTextField(11), |
| 38 | 40 | new JTextField(11) }; |
| 39 | 41 | final JTextArea osmUrl = new JTextArea(); |
| 40 | | final JLabel showUrl = new JLabel(); |
| | 42 | final JTextArea showUrl = new JTextArea(); |
| 41 | 43 | String noteUrl = tr("You can paste an URL here to download the area."); |
| 42 | 44 | |
| 43 | 45 | public void addGui(final DownloadDialog gui) { |
| … |
… |
public class BoundingBoxSelection implements DownloadSelection {
|
| 119 | 121 | dlg.add(new JLabel(tr("URL from www.openstreetmap.org")), GBC.eol().insets(10,20,5,0)); |
| 120 | 122 | dlg.add(osmUrl, GBC.eop().insets(10,0,5,0).fill()); |
| 121 | 123 | 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 | }); |
| 122 | 132 | |
| 123 | 133 | gui.tabpane.addTab(tr("Bounding Box"), dlg); |
| 124 | 134 | } |