Changeset 2281 in josm


Ignore:
Timestamp:
2009-10-12T20:59:00+02:00 (15 years ago)
Author:
Gubaer
Message:

see #3668: Upload dialog: comment textbox buggy

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r2273 r2281  
    362362    protected String getUploadComment() {
    363363        switch(southTabbedPane.getSelectedIndex()) {
    364         case 0:
    365             return pnlChangesetSelection.getUploadComment();
    366         case 1:
    367             TagModel tm = tagEditorPanel.getModel().get("comment");
    368             return tm == null? "" : tm.getValue();
     364            case 0:
     365                return pnlChangesetSelection.getUploadComment();
     366            case 1:
     367                TagModel tm = tagEditorPanel.getModel().get("comment");
     368                return tm == null? "" : tm.getValue();
    369369        }
    370370        return "";
     
    802802            setUploadComment(comment);
    803803            cmt.getEditor().selectAll();
    804             cmt.requestFocus();
     804            cmt.requestFocusInWindow();
    805805        }
    806806
  • trunk/src/org/openstreetmap/josm/gui/widgets/AutoCompleteComboBox.java

    r2231 r2281  
    1919public class AutoCompleteComboBox extends JComboBox {
    2020
     21
     22    private boolean autocompleteEnabled = true;
     23
    2124    /**
    2225     * Auto-complete a JComboBox.
     
    2427     * Inspired by http://www.orbital-computer.de/JComboBox/
    2528     */
    26     private class AutoCompleteComboBoxDocument extends PlainDocument {
     29    class AutoCompleteComboBoxDocument extends PlainDocument {
    2730        private JComboBox comboBox;
    2831        private boolean selecting = false;
     
    4851            // ActionListener informed
    4952            if (selecting)
     53                return;
     54            if (!autocompleteEnabled)
    5055                return;
    5156
     
    117122        this.getEditor().setItem(oldValue);
    118123    }
     124
     125    protected boolean isAutocompleteEnabled() {
     126        return autocompleteEnabled;
     127    }
     128
     129    protected void setAutocompleteEnabled(boolean autocompleteEnabled) {
     130        this.autocompleteEnabled = autocompleteEnabled;
     131    }
    119132}
  • trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java

    r2218 r2281  
    1919
    2020    public void setText(String value) {
     21        setAutocompleteEnabled(false);
    2122        ((JTextComponent)getEditor().getEditorComponent()).setText(value);
     23        setAutocompleteEnabled(true);
    2224    }
    2325
Note: See TracChangeset for help on using the changeset viewer.