Check whether useContextMenu is true or not.

Throw error if not enabled.