New actions on toolbar

Answered

 

Hi 

I want to add several actions for our developers like Git's section above

currently, all our plugins are in the main menu 

<group id="MyPlugin.SampleMenu" text="IDIT" description="IDIT menu">
<add-to-group group-id="MainMenu" anchor="last"/>
<action id="Myplugin.Textboxes" class="DBChangesFileAction" text="DBChangesFile"
description="DbChanges File"/>
</group>

Can you please explain to me how to do it

 

thanks a lot

0
4 comments

You can add "add-to-group" section with "VcsToobarActions" and "VcsNavBarToobarActions" group ids.
Or with the outer groups ids - "MainToolBarSettings" / "NavBarVcsGroup".

1
Avatar
Permanently deleted user

thank you helped me.

 

additional question: 

I got exception com.intellij.diagnostic.PluginException: Icon cannot be found in 'pluginIcon.svg'

 

in action tag I added icon="pluginIcon.svg"

the svg exists under resources/META-INF

 

0

`pluginIcon.svg` is used in plugin marketpace.
https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_icon_file.html

Action icons use different mechanism:
https://www.jetbrains.org/intellij/sdk/docs/reference_guide/work_with_icons_and_images.html

Icon might not be found by different reasons. Ex: because the path should be "/META-INF/pluginIcon.svg".
You can try loading icon using `IconLoader.getIcon` and debug this call.

0

Also, icon might not be shown on toolbar if it is too big (actions use 16/32px images, and plugin icons are 40/80px).

0

Please sign in to leave a comment.