|
27 | 27 | import javax.swing.JList; |
28 | 28 | import javax.swing.JOptionPane; |
29 | 29 | import javax.swing.JPanel; |
| 30 | +import javax.swing.JPopupMenu; |
30 | 31 | import javax.swing.JScrollPane; |
31 | 32 | import javax.swing.ListCellRenderer; |
32 | 33 | import javax.swing.ListSelectionModel; |
|
54 | 55 | import org.openstreetmap.josm.gui.widgets.DisableShortcutsOnFocusGainedTextField; |
55 | 56 | import org.openstreetmap.josm.gui.widgets.FilterField; |
56 | 57 | import org.openstreetmap.josm.gui.widgets.JosmTextField; |
| 58 | +import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; |
57 | 59 | import org.openstreetmap.josm.spi.preferences.Config; |
58 | 60 | import org.openstreetmap.josm.tools.ImageProvider; |
59 | 61 | import org.openstreetmap.josm.tools.OpenBrowser; |
@@ -134,6 +136,13 @@ public void mouseClicked(MouseEvent e) { |
134 | 136 | new SideButton(openInBrowserAction, false), |
135 | 137 | new SideButton(uploadAction, false))); |
136 | 138 | 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)); |
137 | 146 | } |
138 | 147 |
|
139 | 148 | private void updateButtonStates() { |
@@ -489,6 +498,7 @@ public void actionPerformed(ActionEvent e) { |
489 | 498 |
|
490 | 499 | class OpenInBrowserAction extends AbstractAction { |
491 | 500 | OpenInBrowserAction() { |
| 501 | + super(tr("Open in browser")); |
492 | 502 | putValue(SHORT_DESCRIPTION, tr("Open the note in an external browser")); |
493 | 503 | new ImageProvider("help", "internet").getResource().attachImageIcon(this, true); |
494 | 504 | } |
|
0 commit comments