ActionGroup is disabled. Why?


I found that it's caused by this.

The actiongroup will check whether it's children visible. And the check called here.

Why is canceled?

Here's the code of my action group. It's a dynamic group. Source settings state is a PersistentStateComponent saving settings.

My temp workaround is implements the AlwaysVisibleActionGroup.


package net.kaiba.source.settings;

import com.intellij.openapi.actionSystem.ActionGroup;
import com.intellij.openapi.actionSystem.AlwaysVisibleActionGroup;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.List;

public class ServerActionGroup extends ActionGroup implements AlwaysVisibleActionGroup {

public AnAction[] getChildren(@Nullable AnActionEvent e) {
List<AnAction> anActionList = new ArrayList<>();
for (int i = 0; i < SourceSettingsState.getInstance().serverList.size(); i++) {
SourceSettingsState.Server server = SourceSettingsState.getInstance().serverList.get(i);
ServerAction serverAction = new ServerAction(, i);
return anActionList.toArray(new AnAction[0]);
Comment actions Permalink

It's working after I make children actions implement DumbAware. What's it? No documentaiton for it.

Comment actions Permalink


Thanks for pointing it out - we'll try improve the SDK Documentation regarding the DumbAware.


Please sign in to leave a comment.