Changeset 18540 in josm


Ignore:
Timestamp:
2022-08-23T15:04:23+02:00 (20 months ago)
Author:
taylor.smock
Message:

Fix #22307: Add popup menu for notes (patch by Woazboat)

The popup menu has the following actions:

  • Comment
  • Open in Browser
  • Close
  • Reopen
File:
1 edited

Legend:

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

    r18483 r18540  
    2828import javax.swing.JOptionPane;
    2929import javax.swing.JPanel;
     30import javax.swing.JPopupMenu;
    3031import javax.swing.JScrollPane;
    3132import javax.swing.ListCellRenderer;
     
    5556import org.openstreetmap.josm.gui.widgets.FilterField;
    5657import org.openstreetmap.josm.gui.widgets.JosmTextField;
     58import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
    5759import org.openstreetmap.josm.spi.preferences.Config;
    5860import org.openstreetmap.josm.tools.ImageProvider;
     
    135137                new SideButton(uploadAction, false)));
    136138        updateButtonStates();
     139
     140        JPopupMenu notesPopupMenu = new JPopupMenu();
     141        notesPopupMenu.add(addCommentAction);
     142        notesPopupMenu.add(openInBrowserAction);
     143        notesPopupMenu.add(closeAction);
     144        notesPopupMenu.add(reopenAction);
     145        displayList.addMouseListener(new PopupMenuLauncher(notesPopupMenu));
    137146    }
    138147
     
    490499    class OpenInBrowserAction extends AbstractAction {
    491500        OpenInBrowserAction() {
     501            super(tr("Open in browser"));
    492502            putValue(SHORT_DESCRIPTION, tr("Open the note in an external browser"));
    493503            new ImageProvider("help", "internet").getResource().attachImageIcon(this, true);
Note: See TracChangeset for help on using the changeset viewer.