From b56651ab448be49cc97345f106dfe13b287bbf11 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Tue, 12 Jul 2022 20:25:30 +0200 Subject: [PATCH] [action-update-thread] misc actions: duplicates, thumbnails, etc GitOrigin-RevId: 8e5b4a1247d3827390306b38b9a85c1aff4315de --- .../thumbnail/actions/ToggleFileNameAction.java | 8 +++++++- .../thumbnail/actions/ToggleFileSizeAction.java | 8 +++++++- .../javaFX/actions/OpenInSceneBuilderAction.java | 12 +++++++----- .../sh/src/com/intellij/sh/run/ShRunFileAction.java | 8 +++++++- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/images/src/org/intellij/images/thumbnail/actions/ToggleFileNameAction.java b/images/src/org/intellij/images/thumbnail/actions/ToggleFileNameAction.java index ff9ae548eb8f..309b19fc8748 100644 --- a/images/src/org/intellij/images/thumbnail/actions/ToggleFileNameAction.java +++ b/images/src/org/intellij/images/thumbnail/actions/ToggleFileNameAction.java @@ -1,8 +1,9 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.images.thumbnail.actions; import com.intellij.ide.IdeBundle; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.ToggleAction; import org.intellij.images.options.OptionsManager; @@ -32,4 +33,9 @@ public final class ToggleFileNameAction extends ToggleAction { e.getPresentation().setEnabled(decorator != null && decorator.isEnabledForActionPlace(e.getPlace())); e.getPresentation().setText(isSelected(e) ? IdeBundle.message("action.text.hide.file.name") : IdeBundle.message("action.text.show.file.name")); } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } } diff --git a/images/src/org/intellij/images/thumbnail/actions/ToggleFileSizeAction.java b/images/src/org/intellij/images/thumbnail/actions/ToggleFileSizeAction.java index af697f8f8264..4dc543308a2e 100644 --- a/images/src/org/intellij/images/thumbnail/actions/ToggleFileSizeAction.java +++ b/images/src/org/intellij/images/thumbnail/actions/ToggleFileSizeAction.java @@ -1,8 +1,9 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.images.thumbnail.actions; import com.intellij.ide.IdeBundle; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.ToggleAction; import org.intellij.images.options.OptionsManager; @@ -32,4 +33,9 @@ public final class ToggleFileSizeAction extends ToggleAction { e.getPresentation().setEnabled(decorator != null && decorator.isEnabledForActionPlace(e.getPlace())); e.getPresentation().setText(isSelected(e) ? IdeBundle.message("action.text.hide.file.size") : IdeBundle.message("action.text.show.file.size")); } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.EDT; + } } diff --git a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/OpenInSceneBuilderAction.java b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/OpenInSceneBuilderAction.java index 8361389e21bb..748fe176dd4e 100644 --- a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/OpenInSceneBuilderAction.java +++ b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/OpenInSceneBuilderAction.java @@ -1,12 +1,9 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.plugins.javaFX.actions; import com.intellij.CommonBundle; import com.intellij.execution.configurations.GeneralCommandLine; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; -import com.intellij.openapi.actionSystem.Presentation; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; @@ -69,4 +66,9 @@ public class OpenInSceneBuilderAction extends AnAction { presentation.setEnabledAndVisible(true); } } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } } diff --git a/plugins/sh/src/com/intellij/sh/run/ShRunFileAction.java b/plugins/sh/src/com/intellij/sh/run/ShRunFileAction.java index eddce3f0c4a8..e460c29fffc9 100644 --- a/plugins/sh/src/com/intellij/sh/run/ShRunFileAction.java +++ b/plugins/sh/src/com/intellij/sh/run/ShRunFileAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.sh.run; import com.intellij.execution.ExecutionManager; @@ -8,6 +8,7 @@ import com.intellij.execution.actions.ConfigurationContext; import com.intellij.execution.actions.RunConfigurationProducer; import com.intellij.execution.executors.DefaultRunExecutor; import com.intellij.execution.runners.ExecutionEnvironmentBuilder; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.project.DumbAwareAction; @@ -74,6 +75,11 @@ final class ShRunFileAction extends DumbAwareAction { e.getPresentation().setEnabledAndVisible(isEnabled(e)); } + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + private static @NotNull Pair parseInterpreterAndOptions(@NotNull String shebang) { String[] splitShebang = shebang.split(" "); if (splitShebang.length > 1) {