use of com.intellij.openapi.application.ex.ApplicationInfoEx in project google-cloud-intellij by GoogleCloudPlatform.
the class GoogleFeedbackErrorReporter method doSubmit.
private static boolean doSubmit(final IdeaLoggingEvent event, final Component parentComponent, final Consumer<SubmittedReportInfo> callback, final ErrorBean error, final String description) {
error.setDescription(description);
error.setMessage(event.getMessage());
configureErrorFromEvent(event, error);
ApplicationNamesInfo intelliJAppNameInfo = ApplicationNamesInfo.getInstance();
ApplicationInfoEx intelliJAppExtendedInfo = ApplicationInfoEx.getInstanceEx();
Map<String, String> params = buildKeyValuesMap(error, intelliJAppNameInfo, intelliJAppExtendedInfo, ApplicationManager.getApplication());
DataContext dataContext = DataManager.getInstance().getDataContext(parentComponent);
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
Consumer<String> successCallback = new Consumer<String>() {
@Override
public void consume(String token) {
final SubmittedReportInfo reportInfo = new SubmittedReportInfo(null, "Issue " + token, SubmittedReportInfo.SubmissionStatus.NEW_ISSUE);
callback.consume(reportInfo);
ReportMessages.GROUP.createNotification(ReportMessages.ERROR_REPORT, "Submitted", NotificationType.INFORMATION, null).setImportant(false).notify(project);
}
};
Consumer<Exception> errorCallback = new Consumer<Exception>() {
@Override
public void consume(Exception ex) {
String message = ErrorReporterBundle.message("error.googlefeedback.error", ex.getMessage());
ReportMessages.GROUP.createNotification(ReportMessages.ERROR_REPORT, message, NotificationType.ERROR, NotificationListener.URL_OPENING_LISTENER).setImportant(false).notify(project);
}
};
GoogleAnonymousFeedbackTask task = new GoogleAnonymousFeedbackTask(project, "Submitting error report", true, event.getThrowable(), params, error.getMessage(), error.getDescription(), ApplicationInfo.getInstance().getFullVersion(), successCallback, errorCallback);
if (project == null) {
task.run(new EmptyProgressIndicator());
} else {
ProgressManager.getInstance().run(task);
}
return true;
}
Aggregations