I've got a toolbar item with its own icon, defined in the plugin.xml file like:
<action
class="MyActionClass"
id="MyActionID"
label="MyActionLabel"
menubarPath="MyActionMenuBarPath"
toolbarPath="MyActionToolBarPath"
icon="icon/myicon.png" <---- this one
...
</action>
How do I change this dynamically when needed? I mean changing it from code
Use org.eclipse.ui.menus
extension point instead and add menuContribution with dynamic. The class of dynamic should subclass ControlContribution
and implement createControl
method to create a button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With