mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[action-update-thread] problems view
GitOrigin-RevId: 266fadd21d2d4a4399ede3ef21324311c02a0a37
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c9235ea982
commit
fa3e33f2f1
@@ -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)
|
||||
|
||||
+7
-2
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user