Search in sources :

Example 6 with StatisticsResult

use of com.intellij.internal.statistic.connect.StatisticsResult in project intellij-community by JetBrains.

the class SendStatisticsAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
    final Project project = e.getProject();
    if (project == null) {
        return;
    }
    ProgressManager.getInstance().run(new Task.Backgroundable(project, "Sending Statistics", false) {

        @Override
        public void run(@NotNull ProgressIndicator indicator) {
            StatisticsService service = StatisticsUploadAssistant.getStatisticsService();
            final StatisticsResult result = service.send();
            ApplicationManager.getApplication().invokeLater(() -> Messages.showMultilineInputDialog(project, "Result: " + result.getCode(), "Statistics Result", StringUtil.replace(result.getDescription(), ";", "\n"), null, null), ModalityState.NON_MODAL, project.getDisposed());
        }
    });
}
Also used : Project(com.intellij.openapi.project.Project) StatisticsService(com.intellij.internal.statistic.connect.StatisticsService) Task(com.intellij.openapi.progress.Task) StatisticsResult(com.intellij.internal.statistic.connect.StatisticsResult) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator)

Aggregations

StatisticsResult (com.intellij.internal.statistic.connect.StatisticsResult)6 StatisticsConnectionService (com.intellij.internal.statistic.connect.StatisticsConnectionService)5 StatisticsUploadAssistant (com.intellij.internal.statistic.StatisticsUploadAssistant)4 RemotelyConfigurableStatisticsService (com.intellij.internal.statistic.connect.RemotelyConfigurableStatisticsService)4 StatisticsHttpClientSender (com.intellij.internal.statistic.connect.StatisticsHttpClientSender)4 Test (org.junit.Test)4 StatisticsService (com.intellij.internal.statistic.connect.StatisticsService)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 Task (com.intellij.openapi.progress.Task)1 Project (com.intellij.openapi.project.Project)1