Search in sources :

Example 16 with Step

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

the class InsertCardNavigator method next.

@Override
public StepResult next() {
    idx++;
    Step s = uc.getSteps().get(idx);
    return new AndroidResult(s, ResultStatus.OK, Collections.EMPTY_LIST);
}
Also used : Step(org.openecard.gui.definition.Step)

Example 17 with Step

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

the class EacNavigatorFactoryTest method testGivenCorrectValuesThenCreateFromShouldBeCorrect.

@Test
public void testGivenCorrectValuesThenCreateFromShouldBeCorrect() {
    final List<Step> expectedSteps = createInitialSteps();
    new Expectations() {

        {
            ucd.getDialogType();
            result = "EAC";
            ucd.getSteps();
            result = expectedSteps;
        }
    };
    EacNavigatorFactory sut = new EacNavigatorFactory();
    final UserConsentNavigator result = sut.createFrom(ucd);
    assertNotNull(result);
    assertTrue(result.hasNext());
}
Also used : Expectations(mockit.Expectations) Step(org.openecard.gui.definition.Step) UserConsentNavigator(org.openecard.gui.UserConsentNavigator) Test(org.testng.annotations.Test)

Example 18 with Step

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

the class EacGuiImplTest method createInitialSteps.

private List<Step> createInitialSteps() {
    Step step1 = new Step("PROTOCOL_EAC_GUI_STEP_CVC", "CVC");
    ToggleText sub = new ToggleText();
    sub.setID("SubjectName");
    sub.setText("Test Subject");
    step1.getInputInfoUnits().add(sub);
    final Step step2 = new Step("PROTOCOL_EAC_GUI_STEP_CHAT", "CHAT");
    Checkbox readBox = new Checkbox("ReadCHATCheckBoxes");
    readBox.getBoxItems().add(makeBoxItem("DG04", false, false));
    readBox.getBoxItems().add(makeBoxItem("RESTRICTED_IDENTIFICATION", true, true));
    step2.getInputInfoUnits().add(readBox);
    step1.setAction(new StepAction(step1) {

        @Override
        public StepActionResult perform(Map<String, ExecutionResults> oldResults, StepResult result) {
            return new StepActionResult(StepActionResultStatus.NEXT, step2);
        }
    });
    final Step step3 = new PINStep(eacData, true, paceMarker, EacPinStatus.RC3);
    step2.setAction(new StepAction(step2) {

        @Override
        public StepActionResult perform(Map<String, ExecutionResults> oldResults, StepResult result) {
            return new StepActionResult(StepActionResultStatus.NEXT, step3);
        }
    });
    final Step step4 = new Step("PROTOCOL_GUI_STEP_PROCESSING", "Finished");
    return Arrays.asList(step1, step2, step3, step4);
}
Also used : ToggleText(org.openecard.gui.definition.ToggleText) StepAction(org.openecard.gui.executor.StepAction) Checkbox(org.openecard.gui.definition.Checkbox) ExecutionResults(org.openecard.gui.executor.ExecutionResults) PINStep(org.openecard.sal.protocol.eac.gui.PINStep) PINStep(org.openecard.sal.protocol.eac.gui.PINStep) Step(org.openecard.gui.definition.Step) StepResult(org.openecard.gui.StepResult) StepActionResult(org.openecard.gui.executor.StepActionResult)

Example 19 with Step

use of org.openecard.gui.definition.Step 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)

Example 20 with Step

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

the class PINStep method createDummy.

public static Step createDummy(String passwordType) {
    Step s = new Step(STEP_ID);
    String pinType = LANG_PACE.translationForKey(passwordType);
    s.setTitle(LANG_PACE.translationForKey(TITLE, pinType));
    s.setDescription(LANG_PACE.translationForKey(STEP_DESCRIPTION));
    return s;
}
Also used : Step(org.openecard.gui.definition.Step)

Aggregations

Step (org.openecard.gui.definition.Step)38 Text (org.openecard.gui.definition.Text)19 UserConsentDescription (org.openecard.gui.definition.UserConsentDescription)8 ToggleText (org.openecard.gui.definition.ToggleText)6 StepAction (org.openecard.gui.executor.StepAction)5 StepActionResult (org.openecard.gui.executor.StepActionResult)5 ArrayList (java.util.ArrayList)4 BoxItem (org.openecard.gui.definition.BoxItem)3 Checkbox (org.openecard.gui.definition.Checkbox)3 ExecutionResults (org.openecard.gui.executor.ExecutionResults)3 Test (org.testng.annotations.Test)3 DIDAuthenticationDataType (iso.std.iso_iec._24727.tech.schema.DIDAuthenticationDataType)2 EstablishChannel (iso.std.iso_iec._24727.tech.schema.EstablishChannel)2 EstablishChannelResponse (iso.std.iso_iec._24727.tech.schema.EstablishChannelResponse)2 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)2 Expectations (mockit.Expectations)2 DynamicContext (org.openecard.common.DynamicContext)2 WSException (org.openecard.common.WSHelper.WSException)2 AuthDataMap (org.openecard.common.anytype.AuthDataMap)2 AuthDataResponse (org.openecard.common.anytype.AuthDataResponse)2