Changeset 8503 in josm


Ignore:
Timestamp:
2015-06-19T22:44:25+02:00 (2 years ago)
Author:
simon04
Message:

see #11217 - Notes: copy note URL to clipboard when right clicking tooltip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java

    r8474 r8503  
    2020import javax.swing.ImageIcon;
    2121import javax.swing.JToolTip;
     22import javax.swing.SwingUtilities;
    2223
    2324import org.openstreetmap.josm.Main;
     
    3738import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    3839import org.openstreetmap.josm.io.NoteExporter;
     40import org.openstreetmap.josm.io.OsmApi;
    3941import org.openstreetmap.josm.io.XmlWriter;
    4042import org.openstreetmap.josm.tools.ColorHelper;
     43import org.openstreetmap.josm.tools.Utils;
    4144import org.openstreetmap.josm.tools.date.DateUtils;
    4245
     
    224227    @Override
    225228    public void mouseClicked(MouseEvent e) {
    226         if (e.getButton() != MouseEvent.BUTTON1) {
     229        if (SwingUtilities.isRightMouseButton(e) && noteData.getSelectedNote() != null) {
     230            final String url = OsmApi.getOsmApi().getBaseUrl() + "notes/" + noteData.getSelectedNote().getId();
     231            Utils.copyToClipboard(url);
     232            return;
     233        } else if (!SwingUtilities.isLeftMouseButton(e)) {
    227234            return;
    228235        }
Note: See TracChangeset for help on using the changeset viewer.