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

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

File:
1 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    ///////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.