Search in sources :

Example 21 with Step

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

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

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

Example 24 with Step

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

the class InstantReturnTest 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.setInstantReturn(true);
    s.setAction(waitAction);
    Text desc1 = new Text();
    s.getInputInfoUnits().add(desc1);
    desc1.setText("This test opens a step with instantreturn set. An action waits for two seconds.");
    Text desc2 = new Text();
    s.getInputInfoUnits().add(desc2);
    desc2.setText("If the window is closed after these two seconds, the test is successful.");
    SwingUserConsent sc = new SwingUserConsent(new SwingDialogWrapper());
    return sc.obtainNavigator(ucd);
}
Also used : UserConsentDescription(org.openecard.gui.definition.UserConsentDescription) Text(org.openecard.gui.definition.Text) Step(org.openecard.gui.definition.Step)

Example 25 with Step

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

the class RunGUI method providerInfoStep.

private Step providerInfoStep() {
    Step step = new Step("Anbieter");
    Text decription = new Text();
    decription.setText("Zu dem Dienstanbieter und seiner Berechtigung liegen folgende Information vor.");
    step.getInputInfoUnits().add(decription);
    ToggleText name = new ToggleText();
    name.setTitle("Name");
    name.setText("Fraunhofer FOKUS");
    step.getInputInfoUnits().add(name);
    ToggleText url = new ToggleText();
    url.setTitle("Internetadresse");
    url.setText("http://www.fraunhofer.de");
    // url.setCollapsed(true);
    step.getInputInfoUnits().add(url);
    ToggleText termsofUsage = new ToggleText();
    termsofUsage.setTitle("Nutzungsbestimmungen");
    termsofUsage.setText("Anschrift:\nTest-Diensteanbieter\nTest-Strasse 1\n12345 Test-Ort\n\n" + "E-Mail-Adresse:\ninfo@test-diensteanbieter.de\n\n" + "Zweck des Auslesevorgangs:\nEntwicklung und Test von Software\n\n" + "Zuständige Datenschutzbehörde:\nTest-Datenschutzbehörde\nTest-Strasse 1\n12345 Test-Ort");
    termsofUsage.setCollapsed(true);
    step.getInputInfoUnits().add(termsofUsage);
    ToggleText validation = new ToggleText();
    validation.setTitle("Gültigkeit");
    validation.setText("Von 01.01.2012 bis zum 02.01.2012");
    validation.setCollapsed(true);
    step.getInputInfoUnits().add(validation);
    ToggleText subjectName = new ToggleText();
    subjectName.setTitle("Aussteller des Berechtigung");
    subjectName.setText("D-Trust GmbH");
    subjectName.setCollapsed(true);
    step.getInputInfoUnits().add(subjectName);
    ToggleText subjectURL = new ToggleText();
    subjectURL.setTitle("Internetadresse des Ausstellers");
    subjectURL.setText("http://www.dtrust.de");
    subjectURL.setCollapsed(true);
    step.getInputInfoUnits().add(subjectURL);
    return step;
}
Also used : ToggleText(org.openecard.gui.definition.ToggleText) ToggleText(org.openecard.gui.definition.ToggleText) Text(org.openecard.gui.definition.Text) 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