CustomComponentAction not rendering my custom component


I'm trying to design a component that will be in a toolbar sub item. But I cannot make it work. No matter what I put in createCustomComponent it renders a simple action.

I use this in my plugin.xml

<!-- Add your actions here -->
<group id="AsciiDoc" class="org.asciidoc.intellij.actions.asciidoc.AsciiDocActionGroup">
<group id="AsciiDoc.TextFormatting" compact="true" description="Text Markup Actions" popup="true"
text="AsciiDoc" class="org.asciidoc.intellij.actions.asciidoc.AsciiDocActionGroup">
<group id="AsciiDoc.MyId" compact="true" description="Description"
icon="AsciiDocIcons.EditorActions.TABLE" popup="true"
text="Text" class="com.intellij.openapi.actionSystem.DefaultActionGroup">
<action class="org.asciidoc.intellij.actions.asciidoc.MyCustomComponentAction"
text="My text">

With that class:

public class MyCustomComponentAction extends AnAction implements CustomComponentAction {

public MyCustomComponentAction() {

public void actionPerformed(@NotNull AnActionEvent eve) {


public JComponent createCustomComponent(@NotNull Presentation presentation) {
JComboBox jComboBox = new JComboBox( new String[]{ "haha", "hehe" } );

return jComboBox;


And it renders as this:

Any idea on what I missed?

Comment actions Permalink

Custom components are not supported for menus.
You can remove `popup="true"` from "AsciiDoc.MyId"/"AsciiDoc.TextFormatting" groups, and the combobox should become visible on toolbar.

Comment actions Permalink

Ho that's too bad that it's not supported in menus, thanks for your help.

Comment actions Permalink

You can show a custom popup menu when toolbar button is clicked and have full control over it.

Smth like this:

`com.intellij.openapi.ui.popup.JBPopupFactory` or `com.intellij.ui.popup.WizardPopup` could be a starting point.


Please sign in to leave a comment.