From a481f25e6d45fc64413af24fb0de5ab3f5896be0 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Mon, 2 Sep 2024 11:06:58 +0300 Subject: [PATCH 1/4] ActionUpdateThread --- .../intellij/tool/window/actions/CancelScanAction.java | 6 ++++++ .../intellij/tool/window/actions/CollapseAllAction.java | 7 +++++++ .../intellij/tool/window/actions/OpenSettingsAction.java | 7 +++++++ .../intellij/tool/window/actions/StartScanAction.java | 7 +++++++ .../window/actions/selection/ResetSelectionAction.java | 6 ++++++ 5 files changed, 33 insertions(+) diff --git a/src/main/java/com/checkmarx/intellij/tool/window/actions/CancelScanAction.java b/src/main/java/com/checkmarx/intellij/tool/window/actions/CancelScanAction.java index d9ce0dcc..38246d05 100644 --- a/src/main/java/com/checkmarx/intellij/tool/window/actions/CancelScanAction.java +++ b/src/main/java/com/checkmarx/intellij/tool/window/actions/CancelScanAction.java @@ -8,6 +8,7 @@ import com.intellij.ide.ActivityTracker; import com.intellij.ide.util.PropertiesComponent; import com.intellij.notification.NotificationType; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.diagnostic.Logger; @@ -66,4 +67,9 @@ public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabled(false); } } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + } diff --git a/src/main/java/com/checkmarx/intellij/tool/window/actions/CollapseAllAction.java b/src/main/java/com/checkmarx/intellij/tool/window/actions/CollapseAllAction.java index ab0dc5f6..2687af7d 100644 --- a/src/main/java/com/checkmarx/intellij/tool/window/actions/CollapseAllAction.java +++ b/src/main/java/com/checkmarx/intellij/tool/window/actions/CollapseAllAction.java @@ -3,6 +3,7 @@ import com.checkmarx.intellij.Bundle; import com.checkmarx.intellij.Resource; import com.checkmarx.intellij.tool.window.CxToolWindowPanel; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import org.jetbrains.annotations.NotNull; @@ -28,4 +29,10 @@ public CollapseAllAction() { public void actionPerformed(@NotNull AnActionEvent e) { Optional.ofNullable(getCxToolWindowPanel(e)).ifPresent(CxToolWindowPanel::collapseAll); } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } + } diff --git a/src/main/java/com/checkmarx/intellij/tool/window/actions/OpenSettingsAction.java b/src/main/java/com/checkmarx/intellij/tool/window/actions/OpenSettingsAction.java index ebf8e342..61b85dde 100644 --- a/src/main/java/com/checkmarx/intellij/tool/window/actions/OpenSettingsAction.java +++ b/src/main/java/com/checkmarx/intellij/tool/window/actions/OpenSettingsAction.java @@ -3,6 +3,7 @@ import com.checkmarx.intellij.Bundle; import com.checkmarx.intellij.Resource; import com.checkmarx.intellij.settings.global.GlobalSettingsConfigurable; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.options.ShowSettingsUtil; @@ -27,4 +28,10 @@ public void actionPerformed(@NotNull AnActionEvent e) { ShowSettingsUtil.getInstance() .showSettingsDialog(e.getProject(), GlobalSettingsConfigurable.class); } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } + } diff --git a/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java b/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java index 4e5296b5..b2b75454 100644 --- a/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java +++ b/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java @@ -15,6 +15,7 @@ import com.intellij.ide.ActivityTracker; import com.intellij.ide.util.PropertiesComponent; import com.intellij.notification.*; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.diagnostic.Logger; @@ -311,4 +312,10 @@ public static void cancelRunningScan() { private static String msg(Resource resource, Object... params) { return Bundle.message(resource, params); } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + } diff --git a/src/main/java/com/checkmarx/intellij/tool/window/actions/selection/ResetSelectionAction.java b/src/main/java/com/checkmarx/intellij/tool/window/actions/selection/ResetSelectionAction.java index 228f948d..543f5205 100644 --- a/src/main/java/com/checkmarx/intellij/tool/window/actions/selection/ResetSelectionAction.java +++ b/src/main/java/com/checkmarx/intellij/tool/window/actions/selection/ResetSelectionAction.java @@ -4,6 +4,7 @@ import com.checkmarx.intellij.Resource; import com.checkmarx.intellij.tool.window.actions.CxToolWindowAction; import com.intellij.icons.AllIcons; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import lombok.Getter; @@ -45,4 +46,9 @@ public void actionPerformed(@NotNull AnActionEvent e) { cxToolWindowPanel.resetPanel(); }); } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } + } From 05f0a732d2fd8559d5762fded93cb5112b5f61a8 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Mon, 2 Sep 2024 11:12:17 +0300 Subject: [PATCH 2/4] delete log --- .../checkmarx/intellij/tool/window/actions/CancelScanAction.java | 1 - .../checkmarx/intellij/tool/window/actions/StartScanAction.java | 1 - 2 files changed, 2 deletions(-) diff --git a/src/main/java/com/checkmarx/intellij/tool/window/actions/CancelScanAction.java b/src/main/java/com/checkmarx/intellij/tool/window/actions/CancelScanAction.java index 38246d05..0688f1b4 100644 --- a/src/main/java/com/checkmarx/intellij/tool/window/actions/CancelScanAction.java +++ b/src/main/java/com/checkmarx/intellij/tool/window/actions/CancelScanAction.java @@ -63,7 +63,6 @@ public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabled(isScanRunning); } catch (Exception ex) { - ex.printStackTrace(); e.getPresentation().setEnabled(false); } } diff --git a/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java b/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java index b2b75454..14374e79 100644 --- a/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java +++ b/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java @@ -290,7 +290,6 @@ public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabled(!isScanRunning && !isPollingScan && !scanTriggered && projectAndBranchSelected); } catch (Exception ex) { - LOGGER.error(ex); e.getPresentation().setEnabled(false); } } From f685c6c849ff2f114ed5bdcc3a9da456aee74cc1 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Mon, 2 Sep 2024 15:44:36 +0300 Subject: [PATCH 3/4] delete log --- .../checkmarx/intellij/tool/window/actions/StartScanAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java b/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java index 14374e79..707810b0 100644 --- a/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java +++ b/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java @@ -314,7 +314,7 @@ private static String msg(Resource resource, Object... params) { @Override public @NotNull ActionUpdateThread getActionUpdateThread() { - return ActionUpdateThread.BGT; + return ActionUpdateThread.EDT; } } From 49f4f2783bf87aef9024016702a7ae734474e719 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Mon, 2 Sep 2024 15:45:58 +0300 Subject: [PATCH 4/4] delete log --- .../checkmarx/intellij/tool/window/actions/StartScanAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java b/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java index 707810b0..14374e79 100644 --- a/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java +++ b/src/main/java/com/checkmarx/intellij/tool/window/actions/StartScanAction.java @@ -314,7 +314,7 @@ private static String msg(Resource resource, Object... params) { @Override public @NotNull ActionUpdateThread getActionUpdateThread() { - return ActionUpdateThread.EDT; + return ActionUpdateThread.BGT; } }