Changeset 5696 in josm for trunk


Ignore:
Timestamp:
2013-02-06T01:04:27+01:00 (7 years ago)
Author:
Don-vip
Message:

Disable single-char JOSM shortcuts when relation dialog filter textfield has focus (see r5616 comment)

Location:
trunk/src/org/openstreetmap/josm
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r5670 r5696  
    511511        contentPanePrivate.getActionMap().remove(action);
    512512    }
     513   
     514    /**
     515     * Replies the registered action for the given shortcut
     516     * @param shortcut The shortcut to look for
     517     * @return the registered action for the given shortcut
     518     * @since 5696
     519     */
     520    public static Action getRegisteredActionShortcut(Shortcut shortcut) {
     521        KeyStroke keyStroke = shortcut.getKeyStroke();
     522        if (keyStroke == null)
     523            return null;
     524        Object action = contentPanePrivate.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).get(keyStroke);
     525        if (action instanceof Action)
     526            return (Action) action;
     527        return null;
     528    }
    513529
    514530    ///////////////////////////////////////////////////////////////////////////
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r5619 r5696  
    7474import org.openstreetmap.josm.gui.layer.Layer;
    7575import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     76import org.openstreetmap.josm.gui.widgets.DisableShortcutsOnFocusGainedTextField;
    7677import org.openstreetmap.josm.gui.widgets.ListPopupMenu;
    7778import org.openstreetmap.josm.tools.ImageProvider;
     
    153154        displaylist.addListSelectionListener(selectAction);
    154155
    155         final JTextField filter = new JTextField();
     156        final JTextField filter = new DisableShortcutsOnFocusGainedTextField();
    156157        filter.setToolTipText(tr("Relation list filter"));
    157158        filter.getDocument().addDocumentListener(new DocumentListener() {
Note: See TracChangeset for help on using the changeset viewer.