Changeset 30668 in osm


Ignore:
Timestamp:
2014-09-23T02:34:08+02:00 (10 years ago)
Author:
donvip
Message:

[josm_commandline] disable core shortcuts in textfields when the gain focus

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java

    r30436 r30668  
    11/*
    22 *      CommandLine.java
    3  * 
     3 *
    44 *      Copyright 2011 Hind <foxhind@gmail.com>
    5  * 
     5 *
    66 *      This program is free software; you can redistribute it and/or modify
    77 *      it under the terms of the GNU General Public License as published by
    88 *      the Free Software Foundation; either version 2 of the License, or
    99 *      (at your option) any later version.
    10  * 
     10 *
    1111 *      This program is distributed in the hope that it will be useful,
    1212 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
    1313 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1414 *      GNU General Public License for more details.
    15  * 
     15 *
    1616 *      You should have received a copy of the GNU General Public License
    1717 *      along with this program; if not, write to the Free Software
     
    1919 *      MA 02110-1301, USA.
    2020 */
    21 
    2221package CommandLine;
    2322
     
    6160import org.openstreetmap.josm.gui.layer.ImageryLayer;
    6261import org.openstreetmap.josm.gui.layer.Layer;
     62import org.openstreetmap.josm.gui.widgets.DisableShortcutsOnFocusGainedTextField;
    6363import org.openstreetmap.josm.io.GpxWriter;
    6464import org.openstreetmap.josm.io.OsmWriter;
     
    8989        commandSymbol = ": ";
    9090        history = new History(100);
    91         historyField = new JTextField();
    92         textField = new JTextField() {
     91        historyField = new DisableShortcutsOnFocusGainedTextField();
     92        textField = new DisableShortcutsOnFocusGainedTextField() {
    9393            @Override
    9494            protected void processKeyEvent(KeyEvent e) {
    9595                if (e.getID() == KeyEvent.KEY_PRESSED) {
    96                     //String text = textField.getText();
    9796                    int code = e.getKeyCode();
    9897                    if (code == KeyEvent.VK_ENTER) {
Note: See TracChangeset for help on using the changeset viewer.