|
12 | 12 | import com.intellij.notification.*;
|
13 | 13 | import com.intellij.openapi.actionSystem.ActionManager;
|
14 | 14 | import com.intellij.openapi.actionSystem.ActionPopupMenu;
|
| 15 | +import com.intellij.openapi.actionSystem.AnActionEvent; |
15 | 16 | import com.intellij.openapi.application.ApplicationManager;
|
16 | 17 | import com.intellij.openapi.editor.Document;
|
17 | 18 | import com.intellij.openapi.fileEditor.*;
|
|
54 | 55 | import java.awt.event.KeyListener;
|
55 | 56 | import java.awt.event.MouseAdapter;
|
56 | 57 | import java.awt.event.MouseEvent;
|
| 58 | +import java.io.File; |
57 | 59 | import java.text.DecimalFormat;
|
58 | 60 | import java.util.*;
|
59 | 61 |
|
@@ -389,8 +391,23 @@ public void launchSwan(HashMap<String, String> values) {
|
389 | 391 | bus.connect().subscribe(SecucheckNotifier.END_SECUCHECK_PROCESS_TOPIC, new SecucheckNotifier() {
|
390 | 392 | @Override
|
391 | 393 | public void launchSecuCheck() {
|
392 |
| - String notificationContent = "SecuCheck results exported to "+PropertiesComponent.getInstance(project).getValue(Constants.OUTPUT_DIRECTORY); |
393 |
| - NotificationGroupManager.getInstance().getNotificationGroup("Process_Completed").createNotification(notificationContent, NotificationType.INFORMATION).notify(project); |
| 394 | + String notificationContent = "Taint analysis results exported successfully."; |
| 395 | + NotificationGroupManager.getInstance() |
| 396 | + .getNotificationGroup("Analysis Notification") |
| 397 | + .createNotification(notificationContent, NotificationType.INFORMATION) |
| 398 | + .addAction(new NotificationAction("Open Results") { |
| 399 | + @Override |
| 400 | + public void actionPerformed(@NotNull AnActionEvent anActionEvent, @NotNull Notification notification) { |
| 401 | + |
| 402 | + File results = new File(Objects.requireNonNull(PropertiesComponent.getInstance(project).getValue(Constants.LAST_SARIF_FILE))); |
| 403 | + Optional<VirtualFile> file = FilenameIndex |
| 404 | + .getVirtualFilesByName(results.getName(), |
| 405 | + GlobalSearchScope.projectScope(project)).stream().findFirst(); |
| 406 | + |
| 407 | + file.ifPresent(virtualFile -> new OpenFileDescriptor(project, virtualFile).navigate(true)); |
| 408 | + } |
| 409 | + }) |
| 410 | + .notify(project); |
394 | 411 | }
|
395 | 412 | });
|
396 | 413 |
|
|
0 commit comments