1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import java.awt.event.ActionEvent;
|
---|
7 | import java.awt.event.KeyEvent;
|
---|
8 |
|
---|
9 | import org.openstreetmap.josm.tools.BugReportExceptionHandler;
|
---|
10 | import org.openstreetmap.josm.tools.OpenBrowser;
|
---|
11 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
12 | import org.openstreetmap.josm.tools.Utils;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Reports a ticket to JOSM bugtracker.
|
---|
16 | * @since 7624
|
---|
17 | */
|
---|
18 | public class ReportBugAction extends JosmAction {
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Constructs a new {@code ReportBugAction}.
|
---|
22 | */
|
---|
23 | public ReportBugAction() {
|
---|
24 | super(tr("Report bug"), "bug", tr("Report a ticket to JOSM bugtracker"),
|
---|
25 | Shortcut.registerShortcut("reportbug", tr("Report a ticket to JOSM bugtracker"),
|
---|
26 | KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), true);
|
---|
27 | }
|
---|
28 |
|
---|
29 | @Override
|
---|
30 | public void actionPerformed(ActionEvent e) {
|
---|
31 | reportBug();
|
---|
32 | }
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * Reports a ticket to JOSM bugtracker.
|
---|
36 | */
|
---|
37 | public static void reportBug() {
|
---|
38 | reportBug(ShowStatusReportAction.getReportHeader());
|
---|
39 | }
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * Reports a ticket to JOSM bugtracker with given status report.
|
---|
43 | * @param report Status report header containing technical, non-personal information
|
---|
44 | */
|
---|
45 | public static void reportBug(String report) {
|
---|
46 | OpenBrowser.displayUrl(BugReportExceptionHandler.getBugReportUrl(
|
---|
47 | Utils.strip(report)).toExternalForm());
|
---|
48 | }
|
---|
49 | }
|
---|