use of org.openecard.gui.definition.Text in project open-ecard by ecsec.
the class PinChangeStep method createPukChangeGui.
private void createPukChangeGui() {
setInstantReturn(false);
if (lastTryFailed) {
addVerifyFailed("PIN");
} else if (lastTryPukFailed) {
addVerifyFailed("PUK");
} else {
String desc = LANG.translationForKey("action.unblockpin.userconsent.pukstep.description");
Text descText = new Text(desc);
getInputInfoUnits().add(descText);
}
getInputInfoUnits().add(puk);
getInputInfoUnits().add(newPin1);
getInputInfoUnits().add(newPin2);
if (pinsDoNotMatch) {
addPinsDoNotMatch();
}
}
use of org.openecard.gui.definition.Text in project open-ecard by ecsec.
the class PinChangeStep method createPinChangeNativeGui.
private void createPinChangeNativeGui() {
setInstantReturn(true);
if (lastTryFailed) {
addVerifyFailed("PIN");
} else {
String desc = LANG.translationForKey("action.changepin.userconsent.pinstep.description", "PIN");
Text descText = new Text(desc);
getInputInfoUnits().add(descText);
}
if (pinState == PinState.PIN_COUNT_LOW) {
String pinLowStr = LANG.translationForKey("action.changepin.userconsent.pinstep.remaining_attempts", 2);
Text pinLowText = new Text(pinLowStr);
getInputInfoUnits().add(pinLowText);
} else if (pinState == PinState.PIN_FINAL_TRY) {
String noteStr = LANG.translationForKey("action.pinentry.userconsent.pinstep.final_try_note");
Text noteText = new Text(noteStr);
getInputInfoUnits().add(noteText);
}
}
use of org.openecard.gui.definition.Text in project open-ecard by ecsec.
the class PinEntryStep method createPinEntryGui.
private void createPinEntryGui() {
setInstantReturn(false);
if (lastTryFailed) {
addVerifyFailed();
} else {
String desc = LANG.translationForKey("action.pinentry.userconsent.pinstep.enter_pin");
Text descText = new Text(desc);
getInputInfoUnits().add(descText);
}
PasswordField pass = new PasswordField(PIN_FIELD);
pass.setDescription("PIN");
// set length restrictions based on DID description. No info means no value set
PasswordAttributesType pwAttr = pinMarker.getPasswordAttributes();
if (pwAttr != null) {
if (pwAttr.getMinLength() != null) {
pass.setMinLength(pwAttr.getMinLength().intValue());
}
if (pwAttr.getMaxLength() != null) {
pass.setMaxLength(pwAttr.getMaxLength().intValue());
}
}
getInputInfoUnits().add(pass);
if (pinState == PinState.PIN_FINAL_TRY) {
String noteStr = LANG.translationForKey("action.pinentry.userconsent.pinstep.final_try_note");
Text noteText = new Text(noteStr);
getInputInfoUnits().add(noteText);
}
}
use of org.openecard.gui.definition.Text in project open-ecard by ecsec.
the class PinEntryStep method addVerifyFailed.
private void addVerifyFailed() {
Text incorrectInput = new Text();
incorrectInput.setText(LANG.translationForKey("action.changepin.userconsent.pinstep.incorrect_input", "PIN"));
getInputInfoUnits().add(incorrectInput);
}
use of org.openecard.gui.definition.Text in project open-ecard by ecsec.
the class InsertCardDialog method createInsertCardUserConsent.
/**
* Create the UI dialog.
*
* @param insertCardAction A action for this step.
* @return A {@link UserConsentDescription} which may be executed by the {@link ExecutionEngine}.
*/
private UserConsentDescription createInsertCardUserConsent(StepAction insertCardAction) {
UserConsentDescription uc = new UserConsentDescription(lang.translationForKey("title", AppVersion.getName()), "insert_card_dialog");
// create step
Step s = new Step(STEP_ID, lang.translationForKey("step.title"));
s.setInstantReturn(true);
s.setAction(insertCardAction);
// create and add text instructing user
Text i1 = new Text();
if (cardNameAndType.size() == 1) {
i1.setText(lang.translationForKey("step.message.singletype"));
} else {
i1.setText(lang.translationForKey("step.message.multipletypes"));
}
s.getInputInfoUnits().add(i1);
for (String key : cardNameAndType.keySet()) {
Text item = new Text(" - " + key);
s.getInputInfoUnits().add(item);
}
// add step
uc.getSteps().add(s);
return uc;
}
Aggregations