use of org.openecard.gui.definition.Text in project open-ecard by ecsec.
the class GenericPINStep method addRemainingAttempts.
private void addRemainingAttempts() {
Text txtRemainingAttempts = new Text();
txtRemainingAttempts.setText(lang.translationForKey(REMAINING_ATTEMPTS, retryCounterPIN));
getInputInfoUnits().add(txtRemainingAttempts);
}
use of org.openecard.gui.definition.Text in project open-ecard by ecsec.
the class GenericPINStep method createPINChangeGui.
private void createPINChangeGui() {
String pinChangeDescriptionText;
if (canSuccess) {
pinChangeDescriptionText = lang.translationForKey(PINSTEP_DESCRIPTION_AFTER_CAN, "PIN");
} else {
pinChangeDescriptionText = lang.translationForKey(PINSTEP_DESCRIPTION, "PIN");
}
Text pinChangeDescription = new Text(pinChangeDescriptionText);
getInputInfoUnits().add(pinChangeDescription);
Text dummy = new Text(" ");
getInputInfoUnits().add(dummy);
Text pinText = new Text(lang.translationForKey(PINSTEP_OLDPIN));
getInputInfoUnits().add(pinText);
PasswordField oldPIN = new PasswordField(OLD_PIN_FIELD);
// in case of transport pin
oldPIN.setMinLength(5);
oldPIN.setMaxLength(6);
getInputInfoUnits().add(oldPIN);
Text newPinText = new Text(lang.translationForKey(PINSTEP_NEWPIN));
getInputInfoUnits().add(newPinText);
PasswordField newPIN = new PasswordField(NEW_PIN_FIELD);
newPIN.setMaxLength(6);
newPIN.setMinLength(6);
getInputInfoUnits().add(newPIN);
Text newPinAgainText = new Text(lang.translationForKey(PINSTEP_NEWPINREPEAT));
getInputInfoUnits().add(newPinAgainText);
PasswordField newPINRepeat = new PasswordField(NEW_PIN_REPEAT_FIELD);
newPINRepeat.setMaxLength(6);
newPINRepeat.setMinLength(6);
getInputInfoUnits().add(newPINRepeat);
if (wrongPINFormat) {
// add note for mistyped PIN
Text noteWrongEntry = new Text();
noteWrongEntry.setText(lang.translationForKey(WRONG_ENTRY, "PIN"));
getInputInfoUnits().add(noteWrongEntry);
}
if (failedPINVerify) {
// add note for incorrect input
addVerifyFailed("PIN");
}
addRemainingAttempts();
}
use of org.openecard.gui.definition.Text in project open-ecard by ecsec.
the class GenericPINStep method createCANGui.
private void createCANGui() {
Text i1 = new Text();
i1.setText(lang.translationForKey(CANSTEP_NOTICE));
getInputInfoUnits().add(i1);
Text i2 = new Text();
getInputInfoUnits().add(i2);
// add description and input fields depending on terminal type
i2.setText(lang.translationForKey(CANSTEP_DESCRIPTION));
PasswordField canField = new PasswordField(CAN_FIELD);
canField.setMinLength(6);
canField.setMaxLength(6);
canField.setDescription(lang.translationForKey(CANSTEP_CAN));
getInputInfoUnits().add(canField);
if (wrongCANFormat) {
// add note for mistyped CAN
Text retryText = new Text();
retryText.setText(lang.translationForKey(WRONG_CAN));
getInputInfoUnits().add(retryText);
}
if (failedCANVerify) {
// add note for incorrect input
addVerifyFailed("CAN");
}
}
use of org.openecard.gui.definition.Text in project open-ecard by ecsec.
the class GenericPINStep method addVerifyFailed.
private void addVerifyFailed(String did) {
Text incorrectInput = new Text();
incorrectInput.setText(lang.translationForKey(INCORRECT_INPUT, did));
getInputInfoUnits().add(incorrectInput);
}
use of org.openecard.gui.definition.Text in project open-ecard by ecsec.
the class GenericPINStep method createPINChangeGuiNativ.
private void createPINChangeGuiNativ() {
String nativPinChangeDescriptionText;
if (canSuccess) {
nativPinChangeDescriptionText = lang.translationForKey(PINSTEP_NATIV_CHANGE_DESCRIPTION_AFTER_CAN);
} else {
nativPinChangeDescriptionText = lang.translationForKey(PINSTEP_NATIV_CHANGE_DESCRIPTION);
}
Text nativPinChangeDescription = new Text(nativPinChangeDescriptionText);
getInputInfoUnits().add(nativPinChangeDescription);
if (failedPINVerify || canSuccess) {
addVerifyFailed("PIN");
}
addRemainingAttempts();
}
Aggregations