Example usage for com.intellij.openapi.diagnostic SubmittedReportInfo getURL

List of usage examples for com.intellij.openapi.diagnostic SubmittedReportInfo getURL

Introduction

In this page you can find the example usage for com.intellij.openapi.diagnostic SubmittedReportInfo getURL.

Prototype

public String getURL() 

Source Link

Usage

From source file:bazaar4idea.util.BzrErrorReportSubmitter.java

License:Apache License

@SuppressWarnings({ "ThrowableInstanceNeverThrown" })
public static void main(String[] args) throws Exception {
    Exception e = new Exception("test exception");
    IdeaLoggingEvent ev = new IdeaLoggingEvent("a test exception occurred", e);
    BzrErrorReportSubmitter submitter = new BzrErrorReportSubmitter();
    SubmittedReportInfo reportInfo = submitter.submit(new IdeaLoggingEvent[] { ev }, null);
    System.out.printf("url: \"%s\"\nlinkText: \"%s\"\nstatus: \"%s\"\n", reportInfo.getURL(),
            reportInfo.getLinkText(), reportInfo.getStatus());
}

From source file:com.intellij.diagnostic.IdeErrorsDialog.java

License:Apache License

@Nullable
public static String getUrl(SubmittedReportInfo info, boolean reportedToJetbrains) {
    if (info.getStatus() == SubmittedReportInfo.SubmissionStatus.FAILED || info.getLinkText() == null) {
        return null;
    }/*from w ww  . ja  v  a  2  s  .c  o  m*/
    if (reportedToJetbrains) {
        return "http://ea.jetbrains.com/browser/ea_reports/" + info.getLinkText();
    } else {
        return info.getURL();
    }
}

From source file:com.perl5.errorHandler.YoutrackErrorHandler.java

License:Apache License

private static void popupResultInfo(final SubmittedReportInfo reportInfo, final Project project) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override/*from w w w  . j  ava2s.  c  o m*/
        public void run() {
            StringBuilder text = new StringBuilder("<html>");
            final String url = reportInfo.getStatus() == SubmittedReportInfo.SubmissionStatus.FAILED
                    || reportInfo.getLinkText() == null ? null : reportInfo.getURL();
            IdeErrorsDialog.appendSubmissionInformation(reportInfo, text);
            text.append(".");
            final SubmittedReportInfo.SubmissionStatus status = reportInfo.getStatus();
            if (status == SubmittedReportInfo.SubmissionStatus.NEW_ISSUE) {
                text.append("<br/>").append(DiagnosticBundle.message("error.report.gratitude"));
            } else if (status == SubmittedReportInfo.SubmissionStatus.DUPLICATE) {
                text.append("<br/>Possible duplicate report");
            }
            text.append("</html>");
            NotificationType type;
            if (status == SubmittedReportInfo.SubmissionStatus.FAILED) {
                type = NotificationType.ERROR;
            } else if (status == SubmittedReportInfo.SubmissionStatus.DUPLICATE) {
                type = NotificationType.WARNING;
            } else {
                type = NotificationType.INFORMATION;
            }
            NotificationListener listener = url != null ? new NotificationListener() {
                @Override
                public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
                    BrowserUtil.launchBrowser(url);
                    notification.expire();
                }
            } : null;
            ReportMessages.GROUP
                    .createNotification(ReportMessages.ERROR_REPORT, text.toString(), type, listener)
                    .notify(project);
        }
    });
}

From source file:com.sylvanaar.idea.errorreporting.YouTrackBugReporter.java

License:Apache License

private void popupResultInfo(final SubmittedReportInfo reportInfo, final Project project) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override//from   w  w  w. j  a v a  2  s.  com
        public void run() {
            StringBuilder text = new StringBuilder("<html>");
            final String url = reportInfo.getURL();
            IdeErrorsDialog.appendSubmissionInformation(reportInfo, text);
            text.append(".");
            final SubmittedReportInfo.SubmissionStatus status = reportInfo.getStatus();
            if (status == SubmittedReportInfo.SubmissionStatus.NEW_ISSUE) {
                text.append("<br/>").append(DiagnosticBundle.message("error.report.gratitude"));
            } else if (status == SubmittedReportInfo.SubmissionStatus.DUPLICATE) {
                text.append("<br/>Possible duplicate report");
            }
            text.append("</html>");
            NotificationType type;
            if (status == SubmittedReportInfo.SubmissionStatus.FAILED) {
                type = NotificationType.ERROR;
            } else if (status == SubmittedReportInfo.SubmissionStatus.DUPLICATE) {
                type = NotificationType.WARNING;
            } else {
                type = NotificationType.INFORMATION;
            }
            NotificationListener listener = url != null ? new NotificationListener() {
                @Override
                public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
                    BrowserUtil.browse(url);
                    notification.expire();
                }
            } : null;
            ReportMessages.GROUP
                    .createNotification(ReportMessages.ERROR_REPORT, text.toString(), type, listener)
                    .notify(project);
        }
    });
}

From source file:de.halirutan.mathematica.errorreporting.YouTrackBugReporter.java

License:Open Source License

private void popupResultInfo(final SubmittedReportInfo reportInfo, final Project project) {
    //noinspection OverlyComplexAnonymousInnerClass
    ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override/*  ww w .ja  v a  2  s .c  o  m*/
        public void run() {
            StringBuilder text = new StringBuilder("<html>");

            final String url = reportInfo.getURL();
            IdeErrorsDialog.appendSubmissionInformation(reportInfo, text);
            text.append(".");
            final SubmissionStatus status = reportInfo.getStatus();
            if (status == NEW_ISSUE) {
                text.append("<br/>").append(DiagnosticBundle.message("error.report.gratitude"));
            } else if (status == DUPLICATE) {
                text.append("<br/>Possible duplicate report");
            }
            text.append("</html>");
            NotificationType type;
            if (status == FAILED) {
                type = NotificationType.ERROR;
            } else if (status == DUPLICATE) {
                type = NotificationType.WARNING;
            } else {
                type = NotificationType.INFORMATION;
            }
            NotificationListener listener = url != null ? new NotificationListener() {
                @Override
                public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
                    BrowserUtil.browse(url);
                    notification.expire();
                }
            } : null;
            ReportMessages.GROUP
                    .createNotification(ReportMessages.ERROR_REPORT, text.toString(), type, listener)
                    .notify(project);
        }
    });
}

From source file:ro.redeul.google.go.diagnostics.error.ErrorReporter.java

License:Apache License

@NotNull
private static String computeSubmittedText(SubmittedReportInfo reportInfo) {
    return "<html>Submitted <a href='" + reportInfo.getURL() + "'>issue " + reportInfo.getLinkText()
            + "</a> on Github issue tracker.</html>";
}