diff --git a/api/plugin-api/src/main/java/com/yanncebron/m68kplugin/browser/M68kBrowserPaneBase.java b/api/plugin-api/src/main/java/com/yanncebron/m68kplugin/browser/M68kBrowserPaneBase.java index 1881be3c..ed834d3a 100644 --- a/api/plugin-api/src/main/java/com/yanncebron/m68kplugin/browser/M68kBrowserPaneBase.java +++ b/api/plugin-api/src/main/java/com/yanncebron/m68kplugin/browser/M68kBrowserPaneBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Authors + * Copyright 2024 The Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,7 +80,7 @@ public abstract class M68kBrowserPaneBase extends SimpleToolWindowPanel imple private final History history = new History(this); - private final Class clazz ; + private final Class clazz; protected M68kBrowserPaneBase(Class valueClazz) { super(true, true); @@ -278,6 +278,11 @@ protected final AnAction createToggleAction(String text, Icon icon, return new DumbAwareToggleAction(text, null, icon) { + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void update(@NotNull AnActionEvent e) { super.update(e); diff --git a/platforms/amiga/src/main/java/com/yanncebron/m68kplugin/amiga/hardware/M68kAmigaHardwareBrowserPane.java b/platforms/amiga/src/main/java/com/yanncebron/m68kplugin/amiga/hardware/M68kAmigaHardwareBrowserPane.java index 13e7afb4..49750860 100644 --- a/platforms/amiga/src/main/java/com/yanncebron/m68kplugin/amiga/hardware/M68kAmigaHardwareBrowserPane.java +++ b/platforms/amiga/src/main/java/com/yanncebron/m68kplugin/amiga/hardware/M68kAmigaHardwareBrowserPane.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Authors + * Copyright 2024 The Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,7 @@ import com.intellij.icons.AllIcons; import com.intellij.ide.util.PropertiesComponent; -import com.intellij.openapi.actionSystem.ActionGroup; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.DefaultActionGroup; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.actionSystem.ex.ComboBoxAction; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.DumbAwareToggleAction; @@ -190,6 +187,11 @@ private static M68kAmigaHardwareRegister.Chipset getSelectedChipset() { private class ChooseChipsetAction extends ComboBoxAction implements DumbAware { + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void update(@NotNull AnActionEvent e) { e.getPresentation().setText(getSelectedChipset().getDisplayName()); diff --git a/src/com/yanncebron/m68kplugin/internal/M68kProjectStatisticsAction.java b/src/com/yanncebron/m68kplugin/internal/M68kProjectStatisticsAction.java index 7bf52ce7..a2664ee9 100644 --- a/src/com/yanncebron/m68kplugin/internal/M68kProjectStatisticsAction.java +++ b/src/com/yanncebron/m68kplugin/internal/M68kProjectStatisticsAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Authors + * Copyright 2024 The Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package com.yanncebron.m68kplugin.internal; +import com.intellij.openapi.actionSystem.ActionUpdateThread; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; @@ -57,7 +58,7 @@ import java.util.*; -public class M68kProjectStatisticsAction extends AnAction { +final class M68kProjectStatisticsAction extends AnAction { private static final Condition NO_DATA_SIZE_CONDITION = m68kPsiElement -> { if (m68kPsiElement instanceof M68kDataSized) { @@ -66,6 +67,11 @@ public class M68kProjectStatisticsAction extends AnAction { return false; }; + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } + @Override public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(e.getProject() != null);