Toolbar names madness

Hello.

I'm writing plugin which allows to use Run/Debug configurations as actions (E.g. allows to assign shortcut or add them to toolbar) https://github.com/turbanoff/RunConfigurationAsAction
For proper work my plugin need to refresh all toolbars. At least 2 toolbars: main toolbar and navigation toolbar.
As far as I could see, there is no special place for toolbar names. For example navigation bar toolbar has name "NavBarToolBar". But there is no such constant in IDEA community sources. But there is constant for string "NavBartoolbar" - com.intellij.openapi.actionSystem.ActionPlaces#NAVIGATION_BAR_TOOLBAR

1. It's very misleading that toolbar and action places has different names.
2. Is there any available API to obtain names of toolbars?
3. It would be nice to have access in public API: for keyset of com.intellij.ide.ui.customization.CustomActionsSchema#myIdToActionGroup (now I just hardcoded 2 names) and for com.intellij.ide.ui.customization.CustomisedActionGroup#myForceUpdate (now I forced to use reflection)

0
正式评论
>my plugin need to refresh all toolbars
ActionToolbarImpl.updateAllToolbarsImmediately()
Avatar
Permanently deleted user

Andrey, that's a great  idea for a plugin! I was wondering a couple of times in the past already why such a functionality is not part of the core-idea. Especially since it is possible to assign shortcuts to grade/ant/maven tasks. But somehow the more UI-prominent run-configurations don't seem so relevant anymore to the jb devs.

Looking forward to your plugin,

cheers,
Holger

 

0

>ActionToolbarImpl.updateAllToolbarsImmediately()

Looks like it doesn't reload custom actions. Once actions loaded they aren't reloaded anymore: CustomisedActionGroup#getChildren sets myForceUpdate to false.

0

请先登录再写评论。