Implemented selection listener.