| 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.Shortcut;
|
|---|
| 10 | import org.openstreetmap.josm.tools.bugreport.BugReportSender;
|
|---|
| 11 |
|
|---|
| 12 | /**
|
|---|
| 13 | * Reports a ticket to JOSM bugtracker.
|
|---|
| 14 | * @since 7624
|
|---|
| 15 | */
|
|---|
| 16 | public class ReportBugAction extends JosmAction {
|
|---|
| 17 |
|
|---|
| 18 | private final String text;
|
|---|
| 19 |
|
|---|
| 20 | /**
|
|---|
| 21 | * Constructs a new {@code ReportBugAction} that reports the normal status report.
|
|---|
| 22 | */
|
|---|
| 23 | public ReportBugAction() {
|
|---|
| 24 | this(null);
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | /**
|
|---|
| 28 | * Constructs a new {@link ReportBugAction} for the given debug text.
|
|---|
| 29 | * @param text The text to send
|
|---|
| 30 | */
|
|---|
| 31 | public ReportBugAction(String text) {
|
|---|
| 32 | super(tr("Report bug"), "bug", tr("Report a ticket to JOSM bugtracker"),
|
|---|
| 33 | Shortcut.registerShortcut("reportbug", tr("Help: {0}", tr("Report bug")),
|
|---|
| 34 | KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), true, false);
|
|---|
| 35 | this.text = text;
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 | @Override
|
|---|
| 39 | public void actionPerformed(ActionEvent e) {
|
|---|
| 40 | BugReportSender.reportBug(text == null ? ShowStatusReportAction.getReportHeader() : text);
|
|---|
| 41 | }
|
|---|
| 42 | }
|
|---|