Implement setSelection.