From 488e91c9b770eaa8ac2c93f8099e5a9fa5257aa2 Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Thu, 23 Aug 2012 14:57:54 +0400 Subject: [PATCH] allow ExecutionException implement NotificationListener to run an action on hyperlink activation --- .../src/com/intellij/execution/runners/ExecutionUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java b/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java index 17e723a776f6..3ad3ce6a427f 100644 --- a/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java +++ b/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java @@ -23,12 +23,14 @@ import com.intellij.execution.configurations.RunProfile; import com.intellij.execution.process.ProcessNotCreatedException; import com.intellij.ide.util.PropertiesComponent; import com.intellij.notification.NotificationGroup; +import com.intellij.notification.NotificationListener; import com.intellij.notification.NotificationType; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.wm.ToolWindowManager; +import com.intellij.util.ObjectUtils; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; @@ -95,7 +97,8 @@ public class ExecutionUtil { @Override public void run() { ToolWindowManager.getInstance(project).notifyByBalloon(toolWindowId, MessageType.ERROR, fullMessage, null, finalListener); - ourNotificationGroup.createNotification(title, finalDescription, NotificationType.ERROR, null).notify(project); + NotificationListener notificationListener = ObjectUtils.tryCast(finalListener, NotificationListener.class); + ourNotificationGroup.createNotification(title, finalDescription, NotificationType.ERROR, notificationListener).notify(project); } }); }