How to add action programmatically into main toolbar Vojtěch Krása Created November 08, 2012 21:42 any idea?
never mind, I figured it out, I was so close the whole time, unfortunately I was using constant ActionPlaces.MAIN_TOOLBAR, which is "MainToolbar" :|
DefaultActionGroup mainToolBar = (DefaultActionGroup) ActionManager.getInstance().getAction("MainToolBar");
mainToolBar.addAction(...)
The constants in ActionPlaces are not action group IDs. The constant for the group ID that you need is IdeActions.GROUP_MAIN_TOOLBAR.