Prevents selectAll and deselectAll depending on delegate's allowMultipleSelection and allowEmptySelection flags. Includes unit tests.