protected void ok() {
   function = null;
   int selectionIndex = wResult.getSelectionIndex();
   if (selectionIndex >= 0 && selectionIndex < functionList.size()) {
     function = functionList.get(selectionIndex);
   }
   dispose();
 }