Search in sources :

Example 31 with Text

use of org.openecard.gui.definition.Text in project open-ecard by ecsec.

the class PINStep method initialize.

private void initialize() {
    step.setDescription(lang.translationForKey(STEP_DESCRIPTION));
    String decriptionText = lang.translationForKey(DESCRIPTION, passwordType);
    Text description = new Text();
    description.setText(decriptionText);
    step.getInputInfoUnits().add(description);
    PasswordField pinInputField = new PasswordField(passwordType);
    pinInputField.setDescription(lang.translationForKey(passwordType));
    step.getInputInfoUnits().add(pinInputField);
}
Also used : Text(org.openecard.gui.definition.Text) PasswordField(org.openecard.gui.definition.PasswordField)

Example 32 with Text

use of org.openecard.gui.definition.Text in project open-ecard by ecsec.

the class PINStep method addCANEntry.

protected void addCANEntry() {
    PasswordField canField = new PasswordField(CAN_FIELD);
    canField.setDescription(LANG_PACE.translationForKey("can"));
    canField.setMaxLength(6);
    canField.setMinLength(6);
    getInputInfoUnits().add(canField);
    Text canNotice = new Text();
    canNotice.setText(LANG_EAC.translationForKey("eac_can_notice"));
    canNotice.setID(CAN_NOTICE_ID);
    getInputInfoUnits().add(canNotice);
}
Also used : Text(org.openecard.gui.definition.Text) PasswordField(org.openecard.gui.definition.PasswordField)

Example 33 with Text

use of org.openecard.gui.definition.Text in project open-ecard by ecsec.

the class AbstractTerminal method pinUserConsent.

private UserConsentDescription pinUserConsent(String title, StepAction action) {
    UserConsentDescription uc = new UserConsentDescription(LANG.translationForKey(title), "pin_entry_dialog");
    // create step
    Step s = new Step("enter-pin", LANG.translationForKey("action.changepin.userconsent.pinstep.title"));
    s.setAction(action);
    uc.getSteps().add(s);
    s.setInstantReturn(true);
    // add text instructing user
    Text i1 = new Text();
    s.getInputInfoUnits().add(i1);
    i1.setText(LANG.translationForKey("action.pinentry.userconsent.pinstep.enter_pin_term"));
    return uc;
}
Also used : UserConsentDescription(org.openecard.gui.definition.UserConsentDescription) Text(org.openecard.gui.definition.Text) Step(org.openecard.gui.definition.Step)

Example 34 with Text

use of org.openecard.gui.definition.Text in project open-ecard by ecsec.

the class BackgroundTaskTest method testWait.

@Test()
public void testWait() {
    UserConsent uc = new SwingUserConsent(new SwingDialogWrapper());
    UserConsentDescription ucd = new UserConsentDescription("Test background wait");
    Step s = new Step("Wait Step");
    s.getInputInfoUnits().add(new Text("Please wait for the background task to complete ..."));
    s.setBackgroundTask(new BackgroundTask() {

        @Override
        public StepActionResult call() throws Exception {
            // first wait
            Thread.sleep(1000);
            // then repeat ;-)
            Step replacement = new Step("Replacement Step");
            replacement.getInputInfoUnits().add(new Text("Super cool it works."));
            replacement.setInstantReturn(true);
            return new StepActionResult(StepActionResultStatus.REPEAT, replacement);
        }
    });
    ucd.getSteps().add(s);
    ExecutionEngine e = new ExecutionEngine(uc.obtainNavigator(ucd));
    e.process();
}
Also used : ExecutionEngine(org.openecard.gui.executor.ExecutionEngine) UserConsentDescription(org.openecard.gui.definition.UserConsentDescription) Text(org.openecard.gui.definition.Text) Step(org.openecard.gui.definition.Step) UserConsent(org.openecard.gui.UserConsent) StepActionResult(org.openecard.gui.executor.StepActionResult) BackgroundTask(org.openecard.gui.executor.BackgroundTask) Test(org.testng.annotations.Test)

Example 35 with Text

use of org.openecard.gui.definition.Text in project open-ecard by ecsec.

the class InputFieldValidationTest method createNavigator.

private UserConsentNavigator createNavigator(StepAction waitAction) {
    // create step
    UserConsentDescription ucd = new UserConsentDescription("consent title");
    Step s = new Step("step title");
    ucd.getSteps().add(s);
    s.setID("step1");
    s.setAction(waitAction);
    Text desc1 = new Text();
    s.getInputInfoUnits().add(desc1);
    desc1.setText("This test shows a text input field to the user with a minimum length of 4 and a maximum " + "length of 6 to test the input validation.");
    TextField input = new TextField("input1");
    input.setMaxLength(6);
    input.setMinLength(4);
    s.getInputInfoUnits().add(input);
    SwingUserConsent sc = new SwingUserConsent(new SwingDialogWrapper());
    return sc.obtainNavigator(ucd);
}
Also used : UserConsentDescription(org.openecard.gui.definition.UserConsentDescription) TextField(org.openecard.gui.definition.TextField) 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