I am developing an Eclipse plugin that has a toolbar menu item that will enable / disable the function. I know how to set the icon and tooltip text for it using the plugin.xml file, but I want to be able to change the icon and especially the tooltip text for it depending on the state of the project that it was working on. That is, if the function is not enabled, I want an icon that shows the inclusion of the function along with the tooltip text that says βenable the functionβ, but if the function is enabled, I want an icon that shows the function is disabled along with the text text that says "disable function". Right now, the only option I see is a common icon and a tooltip text that says "enable / disable feature, "but that seems awkward to me.
Edit to add: In response to the indigomonkey answer, which is good based on what I originally wrote, I would like to clarify that the behavior that the toolbar button activates is that we really prevent the shutdown from being activated (and appears dialog box, when it allows you to make sure that they want to turn it on, because it should not start easily, and also prevent them from turning off after turning it on). Because of this, I would like the icon to change to the one that suggests "don't click on me."
source
share