I am new to Eclipse plugin development and am trying to disable the command handler of a menu item if the active workbench window is not a .js or .html file.
I found code to disable it when it is not a text editor as follows:
<activeWhen>
<with variable="activeEditorId">
<equals value="org.eclipse.ui.DefaultTextEditor"/>
</with>
</activeWhen>
I want the similar functionality for javascript and html editors.
This can be done by using definitions as follows:
And then we need to use this definition id in the tag of the corresponding command handler as follows:
I am using this code. It’s working fine.