source: josm/trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/TagTransferPaster.java@ 10604

Last change on this file since 10604 was 10604, checked in by Don-vip, 8 years ago

fix #12478, fix #12565, fix #11114 - Use ​Swing Copy/Paste instead of CopyAction/PasteAction with custom buffer (patch by michael2402, modified) - gsoc-core

File size: 963 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.datatransfer.importers;
3
4import java.awt.datatransfer.UnsupportedFlavorException;
5import java.io.IOException;
6import java.util.Map;
7
8import javax.swing.TransferHandler.TransferSupport;
9
10import org.openstreetmap.josm.gui.datatransfer.data.TagTransferData;
11
12/**
13 * This transfer support allows us to transfer tags from the copied primitives on to the selected ones.
14 * @author Michael Zangl
15 * @since 10604
16 */
17public final class TagTransferPaster extends AbstractTagPaster {
18 /**
19 * Create a new {@link TagTransferPaster}
20 */
21 public TagTransferPaster() {
22 super(TagTransferData.FLAVOR);
23 }
24
25 @Override
26 protected Map<String, String> getTags(TransferSupport support) throws UnsupportedFlavorException, IOException {
27 TagTransferData data = (TagTransferData) support.getTransferable().getTransferData(df);
28 return data.getTags();
29 }
30}
Note: See TracBrowser for help on using the repository browser.