Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding button in toolbar for intellij plugin

I am writing a Plugin for intelliJ IDEA and I have been trying to add a button in the main toolbar, besides the run button:

enter image description here

I have been looking for guides to help me do it, but I haven't found any. It has to be possible, this is just my first plugin and I lack the necessary experience. Any help is greatly appreciated.

like image 990
Manuel Cárdenas Avatar asked Sep 19 '25 08:09

Manuel Cárdenas


1 Answers

It's simple. You have to create an action (descendant of AnAction) and put it in Actions tag within your plugin.xml:

    <actions>
      <action id="your.action.id" class="your.Action"
            text="Some label" description="Action description" icon="AllIcons.General.AddJdk">
        <add-to-group group-id="ToolbarRunGroup" anchor="first" />
      </action>
    </actions>

The "add-to-group" tag will tell IDEA to put it together with other execution related buttons.

like image 69
Argb32 Avatar answered Sep 22 '25 07:09

Argb32