diff --git a/build.gradle.kts b/build.gradle.kts
index e0eb0b6..b96c0e4 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,11 +1,11 @@
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "1.9.0"
- id("org.jetbrains.intellij") version "1.16.1"
+ id("org.jetbrains.intellij") version "1.17.0"
}
group = "co.anbora.labs.jmeter"
-version = "1.2.4"
+version = "1.2.5"
repositories {
mavenCentral()
@@ -111,7 +111,7 @@ tasks {
patchPluginXml {
sinceBuild.set("232")
- untilBuild.set("233.*")
+ untilBuild.set("241.*")
changeNotes.set(file("src/main/html/change-notes.html").inputStream().readBytes().toString(Charsets.UTF_8))
pluginDescription.set(file("src/main/html/description.html").inputStream().readBytes().toString(Charsets.UTF_8))
}
diff --git a/src/main/html/change-notes.html b/src/main/html/change-notes.html
index d5cb505..d219820 100644
--- a/src/main/html/change-notes.html
+++ b/src/main/html/change-notes.html
@@ -1,10 +1,11 @@
Versions:
- - All Intellij products support: 1.2.4
+ - All Intellij products support: 1.2.5
Plugin updates:
+ - 1.2.5 (2024-01-20) - upgrade sdk
- 1.2.4 (2024-01-13) - fix issue
- fixed issue #5
diff --git a/src/main/java/org/apache/jmeter/gui/action/ExitIDECommand.java b/src/main/java/org/apache/jmeter/gui/action/ExitIDECommand.java
index 92d8763..2ade42d 100644
--- a/src/main/java/org/apache/jmeter/gui/action/ExitIDECommand.java
+++ b/src/main/java/org/apache/jmeter/gui/action/ExitIDECommand.java
@@ -17,17 +17,16 @@
package org.apache.jmeter.gui.action;
+import co.anbora.labs.jmeter.ide.actions.RestartIDEAction;
+import co.anbora.labs.jmeter.ide.notifications.JMeterNotifications;
import com.google.auto.service.AutoService;
-import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.notification.Notification;
+import com.intellij.notification.NotificationType;
+import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
-import com.intellij.openapi.updateSettings.impl.IdeRestartKt;
import java.awt.event.ActionEvent;
import java.util.HashSet;
import java.util.Set;
-import javax.swing.*;
-import kotlin.Unit;
-import org.apache.jmeter.gui.GuiPackage;
-import org.apache.jmeter.util.JMeterUtils;
@AutoService(Command.class)
public class ExitIDECommand extends AbstractActionWithNoRunningTest {
@@ -59,12 +58,17 @@ public Set getActionNames() {
*/
@Override
public void doActionAfterCheck(ActionEvent e) {
- ApplicationManager.getApplication().invokeLater(() -> {
- IdeRestartKt.restartOrNotify(
- ProjectManager.getInstance().getDefaultProject(), false, () -> {
- ApplicationManager.getApplication().restart();
- return Unit.INSTANCE;
- });
- });
+ Project[] project = ProjectManager.getInstance().getOpenProjects();
+
+ Notification notification = JMeterNotifications.createNotification(
+ "JMeter Plugin Setup", "Please restart the IDE",
+ NotificationType.INFORMATION, new RestartIDEAction());
+
+ if (project.length != 0) {
+ JMeterNotifications.showNotification(notification, project[0]);
+ } else {
+ JMeterNotifications.showNotification(
+ notification, ProjectManager.getInstance().getDefaultProject());
+ }
}
}
diff --git a/src/main/kotlin/co/anbora/labs/jmeter/ide/notifications/JMeterNotifications.kt b/src/main/kotlin/co/anbora/labs/jmeter/ide/notifications/JMeterNotifications.kt
index 880b984..e28cd71 100644
--- a/src/main/kotlin/co/anbora/labs/jmeter/ide/notifications/JMeterNotifications.kt
+++ b/src/main/kotlin/co/anbora/labs/jmeter/ide/notifications/JMeterNotifications.kt
@@ -8,6 +8,8 @@ import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.project.Project
object JMeterNotifications {
+
+ @JvmStatic
fun createNotification(
title: String,
content: String,
@@ -27,6 +29,7 @@ object JMeterNotifications {
return notification
}
+ @JvmStatic
fun showNotification(notification: Notification, project: Project?) {
try {
notification.notify(project)