How to dynamically change icons in the tool bar?

I want to dynamically change images based on the status of the plugin.


How do I go about it?

Thanks.

2 comments
Comment actions Permalink

Override AnAction.update(AnActionEvent) and update the Presentation object obtained from com.intellij.openapi.actionSystem.AnActionEvent.getPresentation(). If your action is shown in other places than the toolbar you can check AnActionEvent.getPlace() to see what place is being updated.

0
Comment actions Permalink

And what if `StatusBarWidget` instance is used instead of `AnAction`? How would you update this presentation created with `StatusBarWidget.WidgetPresentation getPresentation()`?

UPDATE: This has been answered on stackoverflow.

0

Please sign in to leave a comment.