com.intellij.openapi.application.ex.ApplicationInfoEx Java Examples

The following examples show how to use com.intellij.openapi.application.ex.ApplicationInfoEx. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SendFeedbackDialog.java    From freeline with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private void onOK() {
    String content = feedbackContentTextArea.getText();
    if (content == null || content.length() == 0) {
        NotificationUtils.errorNotification("Feedback content can not be empty.");
        return;
    }

    ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
    boolean eap = appInfo.isEAP();
    String buildInfo = eap?appInfo.getBuild().asStringWithoutProductCode():appInfo.getBuild().asString();
    String timezone = System.getProperty("user.timezone");
    String desc = getDescription();

    SendFeedbackAsync task = new SendFeedbackAsync(content, buildInfo + ";" + timezone + ";" + desc, this);
    ApplicationManager.getApplication().executeOnPooledThread(task);

    buttonOK.setEnabled(false);
}
 
Example #2
Source File: ErrorReportInformation.java    From IntelliJDeodorant with MIT License 5 votes vote down vote up
private ErrorReportInformation(GitHubErrorBean error,
                               ApplicationInfoEx appInfo,
                               ApplicationNamesInfo namesInfo) {
    information.put(ERROR_DESCRIPTION, error.getDescription());
    information.put(PLUGIN_NAME, error.getPluginName());
    information.put(PLUGIN_VERSION, error.getPluginVersion());
    information.put(OS_NAME, SystemInfo.OS_NAME);
    information.put(JAVA_VERSION, SystemInfo.JAVA_VERSION);
    information.put(JAVA_VM_VENDOR, SystemInfo.JAVA_VENDOR);
    information.put(APP_NAME, namesInfo.getProductName());
    information.put(APP_FULL_NAME, namesInfo.getFullProductName());
    information.put(APP_VERSION_NAME, appInfo.getVersionName());
    information.put(IS_EAP, Boolean.toString(appInfo.isEAP()));
    information.put(APP_BUILD, appInfo.getBuild().asString());
    information.put(APP_VERSION, appInfo.getFullVersion());
    information.put(PERMANENT_INSTALLATION_ID, PermanentInstallationID.get());
    information.put(LAST_ACTION, error.getLastAction());

    information.put(ERROR_MESSAGE, error.getMessage());
    information.put(ERROR_STACKTRACE, error.getStackTrace());
    information.put(ERROR_HASH, error.getExceptionHash());

    for (Attachment attachment : error.getAttachments()) {
        information.put(ATTACHMENT_NAME, attachment.getName());
        information.put(ATTACHMENT_VALUE, attachment.getEncodedBytes());
    }

}
 
Example #3
Source File: ErrorReportInformation.java    From IntelliJDeodorant with MIT License 4 votes vote down vote up
static ErrorReportInformation getUsersInformation(GitHubErrorBean error,
                                                  ApplicationInfoEx appInfo,
                                                  ApplicationNamesInfo namesInfo) {
    return new ErrorReportInformation(error, appInfo, namesInfo);
}
 
Example #4
Source File: GitHubErrorReporter.java    From IntelliJDeodorant with MIT License 4 votes vote down vote up
@SuppressWarnings("BooleanMethodNameMustStartWithQuestion")
private static boolean doSubmit(final IdeaLoggingEvent event,
                                final Component parentComponent,
                                final Consumer<SubmittedReportInfo> callback,
                                final GitHubErrorBean bean,
                                final String description) {
    final DataContext dataContext = DataManager.getInstance().getDataContext(parentComponent);

    bean.setDescription(description);
    bean.setMessage(event.getMessage());

    if (event instanceof IdeaReportingEvent) {
        IdeaReportingEvent reportingEvent = (IdeaReportingEvent) event;
        IdeaPluginDescriptor descriptor = reportingEvent.getPlugin();
        if (descriptor != null) {
            bean.setPluginName(descriptor.getName());
            bean.setPluginVersion(descriptor.getVersion());
        }
    }

    Object data = event.getData();

    if (data instanceof LogMessage) {
        bean.setAttachments(((LogMessage) data).getIncludedAttachments());
    }

    ErrorReportInformation errorReportInformation = ErrorReportInformation
            .getUsersInformation(bean,
                    (ApplicationInfoEx) ApplicationInfo.getInstance(),
                    ApplicationNamesInfo.getInstance());

    final Project project = CommonDataKeys.PROJECT.getData(dataContext);

    final CallbackWithNotification notifyingCallback = new CallbackWithNotification(callback, project);
    AnonymousFeedbackTask task =
            new AnonymousFeedbackTask(project,
                    IntelliJDeodorantBundle.message("report.error.progress.dialog.text"),
                    true,
                    errorReportInformation,
                    notifyingCallback);
    if (project == null) {
        task.run(new EmptyProgressIndicator());
    } else {
        ProgressManager.getInstance().run(task);
    }
    return true;
}