[action-update-thread] problems view

GitOrigin-RevId: 266fadd21d2d4a4399ede3ef21324311c02a0a37
This commit is contained in:
Anna Kozlova
2022-06-28 15:33:58 +00:00
committed by intellij-monorepo-bot
parent c9235ea982
commit fa3e33f2f1
3 changed files with 19 additions and 3 deletions
@@ -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<Data> : 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)
@@ -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
}
}
@@ -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;
}
}