Пример #1
0
 public void selectionChanged() {
   currentForm =
       (MedicForm) uiController.getAttachedObject(uiController.getSelectedItem(resultsList));
   if (delegate != null) {
     delegate.selectionChanged(currentForm);
   }
 }
Пример #2
0
 /**
  * The callback function for when a user attempts to recover their security questions by answering
  * their security questions.
  *
  * @throws GeneralSecurityException
  */
 public void attemptRecoverPassword() throws GeneralSecurityException {
   // TODO: error handling
   int correct = 0;
   for (int i = 0; i < questions.length; i++) {
     String a = ui.getText(answers[i]);
     // find the SecurityQuestion object that corrosponds to the string
     SecurityQuestion sq = ui.getAttachedObject(questions[i], SecurityQuestion.class);
     if (sq.verifyAnswer(a)) {
       correct++;
     }
   }
   System.out.println(correct);
   if (correct >= settings.getRequiredAnswersRange().value()) {
     changeModeNewPassword();
   } else {
     Object label = ui.find(mainPanel, MULTI_LABEL);
     String text = getI18NString("password.reset.wrong.answer");
     // text = text.replaceFirst("<X>", "" );
     ui.setText(label, text);
   }
 }
Пример #3
0
 public MedicForm getCurrentlySelectedForm() {
   return (MedicForm) uiController.getAttachedObject(uiController.getSelectedItem(resultsList));
 }