Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Actions: fix "Plugin DevKit | Code | ActionUpdateThread is missing" i…
Browse files Browse the repository at this point in the history
…ssues
  • Loading branch information
YannCebron committed Mar 30, 2024
1 parent b1a5b6e commit d571c1e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -80,7 +80,7 @@ public abstract class M68kBrowserPaneBase<T> extends SimpleToolWindowPanel imple

private final History history = new History(this);

private final Class<T> clazz ;
private final Class<T> clazz;

protected M68kBrowserPaneBase(Class<T> valueClazz) {
super(true, true);
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -57,7 +58,7 @@

import java.util.*;

public class M68kProjectStatisticsAction extends AnAction {
final class M68kProjectStatisticsAction extends AnAction {

private static final Condition<M68kPsiElement> NO_DATA_SIZE_CONDITION = m68kPsiElement -> {
if (m68kPsiElement instanceof M68kDataSized) {
Expand All @@ -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);
Expand Down

0 comments on commit d571c1e

Please sign in to comment.