Search in sources :

Example 41 with IdeaPluginDescriptor

use of com.intellij.ide.plugins.IdeaPluginDescriptor in project Intellij-Plugin by getgauge.

the class GaugeExceptionHandler method createNotification.

private Notification createNotification(String stacktrace) {
    IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.findId("com.thoughtworks.gauge"));
    String pluginVersion = plugin == null ? "" : plugin.getVersion();
    String apiVersion = ApplicationInfo.getInstance().getApiVersion();
    String ideaVersion = ApplicationInfo.getInstance().getFullVersion();
    String gaugeVersion = GaugeVersion.getVersion(false).version;
    String body = String.format(ISSUE_TEMPLATE, stacktrace, ideaVersion, apiVersion, pluginVersion, gaugeVersion);
    String content = String.format(NOTIFICATION_TEMPLATE, LINE_BREAK, body);
    return new Notification("Gauge Exception", NOTIFICATION_TITLE, content, NotificationType.ERROR, NotificationListener.URL_OPENING_LISTENER);
}
Also used : IdeaPluginDescriptor(com.intellij.ide.plugins.IdeaPluginDescriptor) Notification(com.intellij.notification.Notification)

Aggregations

IdeaPluginDescriptor (com.intellij.ide.plugins.IdeaPluginDescriptor)41 PluginId (com.intellij.openapi.extensions.PluginId)19 NotNull (org.jetbrains.annotations.NotNull)11 Nullable (org.jetbrains.annotations.Nullable)8 Project (com.intellij.openapi.project.Project)4 File (java.io.File)4 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 ErrorBean (com.intellij.errorreport.bean.ErrorBean)3 ApplicationInfoEx (com.intellij.openapi.application.ex.ApplicationInfoEx)3 IdeaLoggingEvent (com.intellij.openapi.diagnostic.IdeaLoggingEvent)3 URL (java.net.URL)3 LogMessageEx (com.intellij.diagnostic.LogMessageEx)2 CantRunException (com.intellij.execution.CantRunException)2 PluginClassLoader (com.intellij.ide.plugins.cl.PluginClassLoader)2 DataContext (com.intellij.openapi.actionSystem.DataContext)2 SubmittedReportInfo (com.intellij.openapi.diagnostic.SubmittedReportInfo)2 PluginDescriptor (com.intellij.openapi.extensions.PluginDescriptor)2 ShowSettingsUtil (com.intellij.openapi.options.ShowSettingsUtil)2 Sdk (com.intellij.openapi.projectRoots.Sdk)2