Ignore:
Timestamp:
2013-02-09T18:08:26+01:00 (11 years ago)
Author:
akks
Message:

see #8412, #4828: Add tag and Edit tag dialogs: added context menu
default EN keyboard layout for tag; customize number of recent tags; paste tag/value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r5520 r5704  
    88import java.awt.event.FocusEvent;
    99import java.awt.event.FocusListener;
     10import java.awt.im.InputContext;
    1011import java.util.Collection;
     12import java.util.Locale;
    1113
    1214import javax.swing.ComboBoxEditor;
     
    3335
    3436    private int maxTextLength = -1;
     37    private boolean useFixedLocale;
    3538
    3639    /**
     
    272275
    273276    /**
     277     * If the locale is fixed, English keyboard layout will be used by default for this combobox
     278     * all other components can still have different keyboard layout selected
     279     */
     280    public void setFixedLocale(boolean f) {
     281        useFixedLocale = f;
     282        if (useFixedLocale) {
     283            privateInputContext.selectInputMethod(new Locale("en", "US"));
     284        }
     285    }
     286
     287    private static InputContext privateInputContext = InputContext.getInstance();
     288   
     289    @Override
     290    public InputContext getInputContext() {
     291        if (useFixedLocale) {
     292            return privateInputContext;
     293        }
     294        return super.getInputContext();
     295    }
     296
     297    /**
    274298     * ListCellRenderer for AutoCompletingComboBox
    275299     * renders an AutoCompletionListItem by showing only the string value part
Note: See TracChangeset for help on using the changeset viewer.