i have debugged the source to find out how the context menu could be expanded. there i saw that the context menu is "really" a context menu. the items in the content menu depends on the selection in the editor . when the context menu should be displayed every attached listener
is asked if the item is appropriate for the selection. if so the item will be shown in the context menu.
so to remove items from the context menu the listeners must not be added. the listeners are typically added, when a plugin is loaded on start up. so the plugin has to be excluded from the configuration.
here the sample with clipboard excluded (no cut, copy, paste is shown in the context menu):
it is important to remove the plugin 'pastetext' too, since it requires the plugin 'clipboard'. if 'clipboard' is excluded but 'pastetext' not the plugin 'clipboard' will be loaded nevertheless because 'pastetext' requires 'clipboard'.
Re: How to add new items to the ContextMenu?
have a look at hack below. maybe it helps you.
- jeehm
Re: How to add new items to the ContextMenu?
It works perfectly.
Is it possible to remove all or some items from the contextmenu?
Thanks,
Bob
Re: How to add new items to the ContextMenu?
i have debugged the source to find out how the context menu could be expanded. there i saw that the context menu is "really" a context menu. the items in the content menu depends on the selection in the editor . when the context menu should be displayed every attached listener is asked if the item is appropriate for the selection. if so the item will be shown in the context menu.
so to remove items from the context menu the listeners must not be added. the listeners are typically added, when a plugin is loaded on start up. so the plugin has to be excluded from the configuration.
here the sample with clipboard excluded (no cut, copy, paste is shown in the context menu):
it is important to remove the plugin 'pastetext' too, since it requires the plugin 'clipboard'. if 'clipboard' is excluded but 'pastetext' not the plugin 'clipboard' will be loaded nevertheless because 'pastetext' requires 'clipboard'.
- jeehm.
Re: How to add new items to the ContextMenu?
That's exactly what I needed.
Cheers,
Bob
Re: How to add new items to the ContextMenu?