How to add a custom action to the RunTab.TopToolbar of a ConsoleView just for my Run Configuration?
已回答
Hi,
I'm developing a plugin that has a Run Configuration, so I'm creating a ConsoleView to show to the user. It has the `createConsoleActions` but this makes my actions be in the left vertical toolbar and I want to add the actions to the top toolbar.
I was able to get the group ID of the top Toolbar that is `RunTab.TopToolbar`, and if I register my action to that group it shows there, but show for every Run, even if is not from my plugin.
Is there a way to do that? Add the action to the top Toolbar but only for my ConsoleView component?
请先登录再写评论。
Hi Arthur,
Please try overriding the update() method, which enables and sets the action visible only in your run configuration context.
You can find some inspiration here:
https://github.com/JetBrains/intellij-community/blob/243/platform/execution-impl/src/com/intellij/execution/runners/FakeRerunAction.java#L33