From fa3e33f2f1cf6626f72afd5174669bc2673605a9 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Tue, 28 Jun 2022 12:11:52 +0200 Subject: [PATCH] [action-update-thread] problems view GitOrigin-RevId: 266fadd21d2d4a4399ede3ef21324311c02a0a37 --- .../analysis/problemsView/toolWindow/NodeAction.kt | 7 ++++++- .../problemsView/toolWindow/ProblemsViewToggleAction.kt | 9 +++++++-- .../documentation/actions/CopyQuickDocAction.java | 6 ++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/NodeAction.kt b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/NodeAction.kt index e20706746c53..40348c82e0a2 100644 --- a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/NodeAction.kt +++ b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/NodeAction.kt @@ -1,7 +1,8 @@ -// Copyright 2000-2020 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.analysis.problemsView.toolWindow import com.intellij.analysis.problemsView.Problem +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.PlatformCoreDataKeys.CONTEXT_COMPONENT import com.intellij.openapi.ide.CopyPasteManager @@ -24,6 +25,10 @@ internal abstract class NodeAction : DumbAwareAction() { event.presentation.isEnabledAndVisible = data != null && isEnabled(data) } + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + override fun actionPerformed(event: AnActionEvent) { val data = getData(getSelectedNode(event)) if (data != null) actionPerformed(data) diff --git a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsViewToggleAction.kt b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsViewToggleAction.kt index 6b975ed7c03f..fcad23de028b 100644 --- a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsViewToggleAction.kt +++ b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsViewToggleAction.kt @@ -1,6 +1,7 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. 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.analysis.problemsView.toolWindow +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.ToggleOptionAction import com.intellij.openapi.project.DumbAware @@ -13,4 +14,8 @@ internal class SortBySeverity : ProblemsViewToggleAction({ it.sortBySeverity }) internal class SortByName : ProblemsViewToggleAction({ it.sortByName }) abstract class ProblemsViewToggleAction(optionSupplier: (ProblemsViewPanel) -> Option?) - : DumbAware, ToggleOptionAction({ ProblemsView.getSelectedPanel(it.project)?.let(optionSupplier) }) + : DumbAware, ToggleOptionAction({ ProblemsView.getSelectedPanel(it.project)?.let(optionSupplier) }) { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } +} diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/actions/CopyQuickDocAction.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/actions/CopyQuickDocAction.java index 18eb43fce3aa..cb556f96b97c 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/actions/CopyQuickDocAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/actions/CopyQuickDocAction.java @@ -3,6 +3,7 @@ package com.intellij.codeInsight.documentation.actions; import com.intellij.codeInsight.documentation.DocumentationManager; import com.intellij.codeInsight.hint.HintManagerImpl; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.ide.CopyPasteManager; @@ -35,4 +36,9 @@ public class CopyQuickDocAction extends AnAction implements DumbAware, HintManag String selected = e.getData(DocumentationManager.SELECTED_QUICK_DOC_TEXT); e.getPresentation().setEnabledAndVisible(selected != null && !selected.isEmpty()); } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } }