本文整理汇总了Java中com.intellij.openapi.diagnostic.SubmittedReportInfo类的典型用法代码示例。如果您正苦于以下问题:Java SubmittedReportInfo类的具体用法?Java SubmittedReportInfo怎么用?Java SubmittedReportInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SubmittedReportInfo类属于com.intellij.openapi.diagnostic包,在下文中一共展示了SubmittedReportInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: submit
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo,
@NotNull Component parentComponent, @NotNull Consumer<SubmittedReportInfo> consumer) {
log(events, additionalInfo);
consumer.consume(new SubmittedReportInfo(null, null, NEW_ISSUE));
Messages.showInfoMessage(parentComponent, DEFAULT_RESPONSE, DEFAULT_RESPONSE_TITLE);
return true;
}
示例2: popupResultInfo
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
private void popupResultInfo(final SubmittedReportInfo reportInfo, final Project project) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
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);
}
});
}
示例3: submit
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo,
@NotNull Component parentComponent, @NotNull Consumer<SubmittedReportInfo> consumer) {
EventBuilder eventBuilder = createEvent(events, additionalInfo);
sentry.sendEvent(eventBuilder);
consumer.consume(new SubmittedReportInfo(null, null, NEW_ISSUE));
Messages.showInfoMessage(parentComponent, DEFAULT_RESPONSE, DEFAULT_RESPONSE_TITLE);
return true;
}
示例4: submit
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events,
String additionalInfo,
@NotNull Component parentComponent,
@NotNull Consumer<SubmittedReportInfo> consumer) {
ErrorBean errorBean = new ErrorBean(events[0].getThrowable(), IdeaLogger.ourLastActionId);
return doSubmit(events[0], parentComponent, consumer, errorBean, additionalInfo);
}
示例5: submit
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
@Override
public boolean submit(
@NotNull IdeaLoggingEvent[] events,
String additionalInfo,
@NotNull Component parentComponent,
@NotNull Consumer<SubmittedReportInfo> consumer) {
ErrorBean errorBean = new ErrorBean(events[0].getThrowable(), IdeaLogger.ourLastActionId);
return doSubmit(events[0], parentComponent, consumer, errorBean, additionalInfo);
}
示例6: trySubmitAsync
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
@Override
public boolean trySubmitAsync(IdeaLoggingEvent[] events,
String additionalInfo,
Component parentComponent,
Consumer<SubmittedReportInfo> consumer) {
return sendError(events[0], additionalInfo, parentComponent, consumer);
}
示例7: sendError
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
/**
* @noinspection ThrowablePrintStackTrace
*/
private static boolean sendError(IdeaLoggingEvent event,
String additionalInfo,
final Component parentComponent,
final Consumer<SubmittedReportInfo> callback) {
ErrorBean errorBean = new ErrorBean(event.getThrowable(), IdeaLogger.ourLastActionId);
return doSubmit(event, parentComponent, callback, errorBean, additionalInfo);
}
示例8: sendError
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
/**
* @noinspection ThrowablePrintStackTrace
*/
private static boolean sendError(IdeaLoggingEvent event,
String additionalInfo,
final Component parentComponent,
final Consumer<SubmittedReportInfo> callback) {
ErrorBean errorBean = new ErrorBean(event.getThrowable(), IdeaLogger.ourLastActionId);
return doSubmit(event, parentComponent, callback, errorBean, additionalInfo);
}
示例9: submit
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo,
@NotNull Component parentComponent, @NotNull Consumer<SubmittedReportInfo> consumer) {
return submit(events, additionalInfo, "<anonymous>", parentComponent, consumer);
}
示例10: setSubmitted
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
public void setSubmitted(SubmittedReportInfo info) {
myIsSubmitting = false;
mySubmissionInfo = info;
}
示例11: getSubmissionInfo
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
public SubmittedReportInfo getSubmissionInfo() {
return mySubmissionInfo;
}
示例12: isSubmitted
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
public boolean isSubmitted() {
return mySubmissionInfo != null &&
(mySubmissionInfo.getStatus() == SubmittedReportInfo.SubmissionStatus.NEW_ISSUE ||
mySubmissionInfo.getStatus() == SubmittedReportInfo.SubmissionStatus.DUPLICATE);
}
示例13: submit
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events, String additionalInfo, @NotNull Component parentComponent, @NotNull Consumer<SubmittedReportInfo> consumer) {
ErrorBean errorBean = new ErrorBean(events[0].getThrowable(), IdeaLogger.ourLastActionId);
return doSubmit(events[0], parentComponent, consumer, errorBean, additionalInfo);
}
示例14: doSubmit
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
private static boolean doSubmit(final IdeaLoggingEvent event,
final Component parentComponent,
final Consumer<SubmittedReportInfo> callback,
final ErrorBean bean,
final String description) {
final DataContext dataContext = DataManager.getInstance().getDataContext(parentComponent);
bean.setDescription(description);
bean.setMessage(event.getMessage());
Throwable t = event.getThrowable();
if (t != null) {
final PluginId pluginId = IdeErrorsDialog.findPluginId(t);
if (pluginId != null) {
final IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(pluginId);
if (ideaPluginDescriptor != null && !ideaPluginDescriptor.isBundled()) {
bean.setPluginName(ideaPluginDescriptor.getName());
bean.setPluginVersion(ideaPluginDescriptor.getVersion());
}
}
}
Object data = event.getData();
if (data instanceof AbstractMessage) {
bean.setAttachments(((AbstractMessage)data).getAttachments());
}
List<Pair<String, String>> kv = IdeaITNProxy
.getKeyValuePairs(null, null, bean, IdeaLogger.getOurCompilationTimestamp(),
ApplicationManager.getApplication(),
(ApplicationInfoEx)ApplicationInfo.getInstance(),
ApplicationNamesInfo.getInstance(), UpdateSettings.getInstance());
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 e) {
// TODO: check for updates
String message = AndroidBundle.message("error.report.at.b.android", e.getMessage());
ReportMessages.GROUP.createNotification(ReportMessages.ERROR_REPORT,
message,
NotificationType.ERROR,
NotificationListener.URL_OPENING_LISTENER).setImportant(false).notify(project);
}
};
AnonymousFeedbackTask task =
new AnonymousFeedbackTask(project, "Submitting error report", true, t, pair2map(kv),
bean.getMessage(), bean.getDescription(),
ApplicationInfo.getInstance().getFullVersion(),
successCallback, errorCallback);
if (project == null) {
task.run(new EmptyProgressIndicator());
} else {
ProgressManager.getInstance().run(task);
}
return true;
}
示例15: doSubmit
import com.intellij.openapi.diagnostic.SubmittedReportInfo; //导入依赖的package包/类
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;
}