Skip to content

Commit

Permalink
Specify the action update thread in the ClearAllAction.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhdunn committed Aug 8, 2024
1 parent 7ea53d0 commit 8145de2
Showing 1 changed file with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
/*
* Copyright (C) 2019 Reece H. Dunn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright (C) 2019-2024 Reece H. Dunn. SPDX-License-Identifier: Apache-2.0
package uk.co.reecedunn.intellij.plugin.core.execution.ui

import com.intellij.execution.ExecutionBundle
import com.intellij.execution.ui.ConsoleView
import com.intellij.icons.AllIcons
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.actionSystem.LangDataKeys
Expand All @@ -28,6 +15,8 @@ class ClearAllAction internal constructor(private val consoleView: ConsoleView?)
ExecutionBundle.message("clear.all.from.console.action.description"),
AllIcons.Actions.GC
) {
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.EDT

override fun update(e: AnActionEvent) {
var enabled = consoleView != null && consoleView.contentSize > 0
if (!enabled) {
Expand Down

0 comments on commit 8145de2

Please sign in to comment.