Implement selection handler and visibility in CorpusEditor