当前位置: 首页>>代码示例>>Java>>正文


Java ErrorBean.getDescription方法代码示例

本文整理汇总了Java中com.intellij.errorreport.bean.ErrorBean.getDescription方法的典型用法代码示例。如果您正苦于以下问题:Java ErrorBean.getDescription方法的具体用法?Java ErrorBean.getDescription怎么用?Java ErrorBean.getDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.errorreport.bean.ErrorBean的用法示例。

在下文中一共展示了ErrorBean.getDescription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doSubmit

import com.intellij.errorreport.bean.ErrorBean; //导入方法依赖的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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:74,代码来源:ErrorReporter.java


示例2: doSubmit

import com.intellij.errorreport.bean.ErrorBean; //导入方法依赖的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;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:77,代码来源:GoogleFeedbackErrorReporter.java



注:本文中的com.intellij.errorreport.bean.ErrorBean.getDescription方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。