Search in sources :

Example 26 with Text

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();
    }
}
Also used : Text(org.openecard.gui.definition.Text)

Example 27 with Text

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);
    }
}
Also used : Text(org.openecard.gui.definition.Text)

Example 28 with Text

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);
    }
}
Also used : PasswordAttributesType(iso.std.iso_iec._24727.tech.schema.PasswordAttributesType) Text(org.openecard.gui.definition.Text) PasswordField(org.openecard.gui.definition.PasswordField)

Example 29 with Text

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);
}
Also used : Text(org.openecard.gui.definition.Text)

Example 30 with Text

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;
}
Also used : UserConsentDescription(org.openecard.gui.definition.UserConsentDescription) Text(org.openecard.gui.definition.Text) Step(org.openecard.gui.definition.Step)

Aggregations

Text (org.openecard.gui.definition.Text)49 Step (org.openecard.gui.definition.Step)19 PasswordField (org.openecard.gui.definition.PasswordField)10 ToggleText (org.openecard.gui.definition.ToggleText)7 UserConsentDescription (org.openecard.gui.definition.UserConsentDescription)7 BoxItem (org.openecard.gui.definition.BoxItem)4 Checkbox (org.openecard.gui.definition.Checkbox)3 PasswordAttributesType (iso.std.iso_iec._24727.tech.schema.PasswordAttributesType)1 DateFormat (java.text.DateFormat)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Calendar (java.util.Calendar)1 CHAT (org.openecard.crypto.common.asn1.cvc.CHAT)1 UserConsent (org.openecard.gui.UserConsent)1 Document (org.openecard.gui.definition.Document)1 Hyperlink (org.openecard.gui.definition.Hyperlink)1 InputInfoUnit (org.openecard.gui.definition.InputInfoUnit)1 Radiobox (org.openecard.gui.definition.Radiobox)1 TextField (org.openecard.gui.definition.TextField)1 BackgroundTask (org.openecard.gui.executor.BackgroundTask)1 ExecutionEngine (org.openecard.gui.executor.ExecutionEngine)1