I have developed a plugin which invoked by a custom context menu ( by right-clicking on the element and choosing my custom menu)
My problem is that I want the custom menu to be shown in the context menu only in special cases, for example only when I right-click on a special kind of element.
I know how to disable the menu dynamically in the cases i want (like the attached image) by calling action.setEnabled(false) in the overridden update() method, but this only disables the menu while I want to completely hide it from the context menu dialog
How can I implement this requirement?
Thanks in advance