Make SelectionDialog generic