Q:

Difference between currentSelection and activeMenuSelection

This feels like a n00b question, but I cannot find any exact documentation for this.
What exactly is the difference between
HandlerUtil.getCurrentSelection()

and 
HandlerUtil.getActiveMenuSelection()

?
Obviously both access different keys/variables in the Eclipse context, so the question is more precisely: what is the difference between these underlying variables?
According to my observations, in some cases, both can return the same object, but in others the return values differ. Can anyone explain the background or point me to some documentation about this? I have tried to search but nothing usable turned up...

A:

The current selection is the item that the currently active part has set as the current selection using the selection service.
The active menu selection is the item that was selected to display a context menu. The menu might be displayed for a part which is not the active part or a selection which is not the 'current' selection. 
activeMenuSelection is most often used for the <visibleWhen> section of the menuContribution element in the org.eclipse.ui.menus extension point. HandlerUtil.getActiveMenuSelection() is rarely used - in fact in the core Eclipse I don't see any uses at all.

