Ignore:
Timestamp:
2009-10-03T13:57:27+02:00 (17 years ago)
Author:
Gubaer
Message:

Make sure the changeset comment field has focus and is selected when the upload dialog is launched

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/AutoCompleteComboBox.java

    r2218 r2231  
    22package org.openstreetmap.josm.gui.widgets;
    33
     4import java.awt.event.FocusEvent;
     5import java.awt.event.FocusListener;
    46import java.util.Collection;
    57
     
    9395
    9496    public AutoCompleteComboBox() {
    95         JTextComponent editor = (JTextComponent) this.getEditor().getEditorComponent();
     97        final JTextComponent editor = (JTextComponent) this.getEditor().getEditorComponent();
    9698        editor.setDocument(new AutoCompleteComboBoxDocument(this));
     99        editor.addFocusListener(
     100                new FocusListener() {
     101                    public void focusLost(FocusEvent e) {
     102                    }
     103                    public void focusGained(FocusEvent e) {
     104                        editor.selectAll();
     105                    }
     106                }
     107        );
    97108    }
    98109
Note: See TracChangeset for help on using the changeset viewer.