We use a MenuDetectListener to determine which tab the context menu was opened on, so we can perform actions on the correct CTabItem.
Currently, the menu for org.eclipse.swt.custom.CTabFolder opens on MouseDown, while the MenuDetectListener is triggered on MouseUp. This means that to trigger the listener you need to left-click, move the mouse outside of the menu area, and only then release the mouse button. As a result, the MenuDetectListener is either never triggered or is triggered after menuAboutToShow.
On standard widgets such as Label, both menuAboutToShow and MenuDetectListener are fired on mouse up and in the correct order — this behavior was fixed by:
#346
I’ve attached a snippet example linked with 4.5.0-SNAPSHOT. It can be started by running mvn jetty:run, and the test is available under /menu.
eclipe-menu-snippet.zip