How to add action programmatically into main toolbar

any idea?

0
2 comments

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(...)

0

The constants in ActionPlaces are not action group IDs. The constant for the group ID that you need is IdeActions.GROUP_MAIN_TOOLBAR.

0

Please sign in to leave a comment.