protected int getLeafPopupIndex(MenuElement[] path) {

		if (path != null) {
			for (int i = path.length - 1; i >= 0; i--) {
				MenuElement menuElement = path[i];
				if (menuElement instanceof JPopupMenu) {
					return i;
				}
			}
		}
		return -1;
	}
The work method of this handler.  This method will only be called when a menu or popup
menu is open.

@param manager the active menu selection manager
@param path the active menu path
Ghidra/Framework/Docking/src/main/java/docking/menu/keys/MenuKeyHandler.java