Changeset 17007 in josm for trunk/src


Ignore:
Timestamp:
2020-09-03T22:12:24+02:00 (4 years ago)
Author:
simon04
Message:

fix #19753 - NPE in CopyAllKeyValueAction due to shortcut re-assignment

Location:
trunk/src/org/openstreetmap/josm/gui/dialogs/properties
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/CopyAllKeyValueAction.java

    r16438 r17007  
    3333        putValue(NAME, tr("Copy all Keys/Values"));
    3434        putValue(SHORT_DESCRIPTION, tr("Copy the key and value of all the tags to clipboard"));
     35    }
     36
     37    /**
     38     * Registers this action shortcut
     39     * @return this instance, for easy chaining
     40     */
     41    CopyAllKeyValueAction registerShortcut() {
    3542        Shortcut sc = Shortcut.registerShortcut("system:copytags", tr("Edit: {0}", tr("Copy Tags")), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE);
    3643        MainApplication.registerActionShortcut(this, sc);
    3744        sc.setAccelerator(this);
     45        return this;
    3846    }
    3947
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r16960 r17007  
    205205            tagTable, editHelper::getDataKey, OsmDataManager.getInstance()::getInProgressISelection);
    206206    private final CopyAllKeyValueAction copyAllKeyValueAction = new CopyAllKeyValueAction(
    207             tagTable, editHelper::getDataKey, OsmDataManager.getInstance()::getInProgressISelection);
     207            tagTable, editHelper::getDataKey, OsmDataManager.getInstance()::getInProgressISelection).registerShortcut();
    208208    private final SearchAction searchActionSame = new SearchAction(true);
    209209    private final SearchAction searchActionAny = new SearchAction(false);
Note: See TracChangeset for help on using the changeset viewer.