Changeset 417 in josm for trunk


Ignore:
Timestamp:
2007-10-25T01:59:23+02:00 (17 years ago)
Author:
framm
Message:
  • automatically select the contents of the "URL from www.openstreetmap.org" text area on the download dialog when the field receives focus.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java

    r298 r417  
    2121import javax.swing.JTextField;
    2222import javax.swing.SwingUtilities;
     23import javax.swing.text.JTextComponent;
    2324
    2425import org.openstreetmap.josm.Main;
     
    99100               
    100101                osmUrl.addKeyListener(osmUrlRefresher);
     102               
     103                // select content on receiving focus. this seems to be the default in the
     104                // windows look+feel but not for others. needs invokeLater to avoid strange
     105                // side effects that will cancel out the newly made selection otherwise.
     106                osmUrl.addFocusListener(new FocusAdapter() {
     107                        @Override public void focusGained(FocusEvent e) {
     108                        SwingUtilities.invokeLater(new Runnable() {
     109                                public void run() {
     110                                        osmUrl.selectAll();
     111                                        }
     112                                });
     113                        }
     114                });
    101115                osmUrl.setLineWrap(true);
    102116                osmUrl.setBorder(latlon[0].getBorder());
Note: See TracChangeset for help on using the changeset viewer.