| Line | |
|---|
| 1 | // License: GPL. For details, see LICENSE file.
|
|---|
| 2 | package org.openstreetmap.josm.actions;
|
|---|
| 3 |
|
|---|
| 4 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
|---|
| 5 | import static org.openstreetmap.josm.tools.I18n.tr;
|
|---|
| 6 |
|
|---|
| 7 | import java.awt.event.ActionEvent;
|
|---|
| 8 | import java.awt.event.KeyEvent;
|
|---|
| 9 |
|
|---|
| 10 | import org.openstreetmap.josm.data.coor.EastNorth;
|
|---|
| 11 | import org.openstreetmap.josm.tools.Shortcut;
|
|---|
| 12 |
|
|---|
| 13 | /**
|
|---|
| 14 | * A special version of the {@link PasteAction} that pastes at the exact source location the item was copied from.
|
|---|
| 15 | * @author Michael Zangl
|
|---|
| 16 | * @since 10765
|
|---|
| 17 | */
|
|---|
| 18 | public class PasteAtSourcePositionAction extends AbstractPasteAction {
|
|---|
| 19 |
|
|---|
| 20 | /**
|
|---|
| 21 | * Constructs a new {@link PasteAtSourcePositionAction}.
|
|---|
| 22 | */
|
|---|
| 23 | public PasteAtSourcePositionAction() {
|
|---|
| 24 | super(tr("Paste at source position"), "paste", tr("Paste contents of clipboard at the position they were copied from."),
|
|---|
| 25 | Shortcut.registerShortcut("menu:edit:pasteAtSource", tr("Edit: {0}", tr("Paste at source position")),
|
|---|
| 26 | KeyEvent.VK_V, Shortcut.ALT_CTRL), true, "pasteatsource");
|
|---|
| 27 | setHelpId(ht("/Action/PasteAtSourcePosition"));
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | @Override
|
|---|
| 31 | protected EastNorth computePastePosition(ActionEvent e) {
|
|---|
| 32 | // null means use old position
|
|---|
| 33 | return null;
|
|---|
| 34 | }
|
|---|
| 35 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.