Changeset 11030 in josm
- Timestamp:
- 2016-09-19T21:12:05+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java
r10611 r11030 45 45 import org.openstreetmap.josm.gui.layer.NoteLayer; 46 46 import org.openstreetmap.josm.tools.ImageProvider; 47 import org.openstreetmap.josm.tools.OpenBrowser; 47 48 import org.openstreetmap.josm.tools.date.DateUtils; 48 49 … … 62 63 private final ReopenAction reopenAction; 63 64 private final SortAction sortAction; 65 private final OpenInBrowserAction openInBrowserAction; 64 66 private final UploadNotesAction uploadAction; 65 67 … … 75 77 reopenAction = new ReopenAction(); 76 78 sortAction = new SortAction(); 79 openInBrowserAction = new OpenInBrowserAction(); 77 80 uploadAction = new UploadNotesAction(); 78 81 buildDialog(); … … 113 116 new SideButton(reopenAction, false), 114 117 new SideButton(sortAction, false), 118 new SideButton(openInBrowserAction, false), 115 119 new SideButton(uploadAction, false)})); 116 120 updateButtonStates(); … … 131 135 reopenAction.setEnabled(true); 132 136 } 137 openInBrowserAction.setEnabled(noteData != null && noteData.getSelectedNote() != null && noteData.getSelectedNote().getId() > 0); 133 138 if (noteData == null || !noteData.isModified()) { 134 139 uploadAction.setEnabled(false); … … 402 407 } 403 408 } 409 410 class OpenInBrowserAction extends AbstractAction { 411 OpenInBrowserAction() { 412 putValue(SHORT_DESCRIPTION, tr("Open the note in an external browser")); 413 putValue(SMALL_ICON, ImageProvider.get("help", "internet")); 414 } 415 416 @Override 417 public void actionPerformed(ActionEvent e) { 418 final Note note = displayList.getSelectedValue(); 419 if (note.getId() > 0) { 420 final String url = Main.getBaseBrowseUrl() + "/note/" + note.getId(); 421 OpenBrowser.displayUrl(url); 422 } 423 } 424 } 404 425 }
Note:
See TracChangeset
for help on using the changeset viewer.