001// License: GPL. For details, see LICENSE file.
002// Author: David Earl
003package org.openstreetmap.josm.actions;
004
005import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
006import static org.openstreetmap.josm.tools.I18n.tr;
007
008import java.awt.event.KeyEvent;
009
010import org.openstreetmap.josm.Main;
011import org.openstreetmap.josm.tools.Shortcut;
012
013/**
014 * Paste OSM primitives from clipboard to the current edit layer.
015 * @since 404
016 */
017public final class PasteAction extends AbstractPasteAction {
018
019    /**
020     * Constructs a new {@code PasteAction}.
021     */
022    public PasteAction() {
023        super(tr("Paste"), "paste", tr("Paste contents of clipboard."),
024                Shortcut.registerShortcut("system:paste", tr("Edit: {0}", tr("Paste")), KeyEvent.VK_V, Shortcut.CTRL), true);
025        putValue("help", ht("/Action/Paste"));
026        // CUA shortcut for paste (https://en.wikipedia.org/wiki/IBM_Common_User_Access#Description)
027        Main.registerActionShortcut(this,
028                Shortcut.registerShortcut("system:paste:cua", tr("Edit: {0}", tr("Paste")), KeyEvent.VK_INSERT, Shortcut.SHIFT));
029    }
030}