final DialogOption showYesNoCancelMessage(String message,IntSetting defValue){
  DialogOption ret=DialogOption.parseInt(defValue.getValue());
  if (ret == DialogOption.YES || ret == DialogOption.NO)   return ret;
  int option;
  try {
    option=JOptionPane.showConfirmDialog(getParentComponent(),alwaysUseThisAnswerLabel(message,defValue),I18n.tr("Message"),JOptionPane.YES_NO_CANCEL_OPTION);
  }
 catch (  ArrayIndexOutOfBoundsException aioobe) {
    option=JOptionPane.CANCEL_OPTION;
  }
catch (  InternalError ie) {
    option=JOptionPane.CANCEL_OPTION;
  }
  if (option == JOptionPane.YES_OPTION)   ret=DialogOption.YES;
 else   if (option == JOptionPane.NO_OPTION)   ret=DialogOption.NO;
 else   ret=DialogOption.CANCEL;
  if (defValue.getValue() == REMEMBER_ANSWER && ret != DialogOption.CANCEL)   defValue.setValue(ret.toInt());
 else   defValue.setValue(FORGET_ANSWER);
  return ret;
}

final DialogOption showYesNoCancelMessage ( String message , IntSetting defValue ) { DialogOption ret = DialogOption . parseInt ( defValue . getValue ( ) ) ; if ( ret == DialogOption . YES || ret == DialogOption . NO ) return ret ; int option ; try { option = JOptionPane . showConfirmDialog ( getParentComponent ( ) , alwaysUseThisAnswerLabel ( message , defValue ) , I18n . tr ( "Message" ) , JOptionPane . YES_NO_CANCEL_OPTION ) ; } catch ( ArrayIndexOutOfBoundsException aioobe ) { option = JOptionPane . CANCEL_OPTION ; } catch ( InternalError ie ) { option = JOptionPane . CANCEL_OPTION ; } if ( option == JOptionPane . YES_OPTION ) ret = DialogOption . YES ; else if ( option == JOptionPane . NO_OPTION ) ret = DialogOption . NO ; else ret = DialogOption . CANCEL ; if ( defValue . getValue ( ) == REMEMBER_ANSWER && ret != DialogOption . CANCEL ) defValue . setValue ( ret . toInt ( ) ) ; else defValue . setValue ( FORGET_ANSWER ) ; return ret ; }
displays a message to the user and returns messageservice . yes_option if the user selects yes and messageservice . no_option if the user selects no . messageservice . cancel_option if the user selects cancel . stores the default response in intsetting default .
