Search in sources :

Example 1 with BoxItem

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

the class RunGUI method requestedDataStep.

private Step requestedDataStep() throws Exception {
    Step requestedData_Step1 = new Step("Angefragte Daten");
    requestedData_Step1.setAction(new RequestedDataAction(requestedData_Step1));
    Text requestedDataDescription = new Text();
    requestedDataDescription.setText("Der Anbieter \"Test-Diensteanbieter\"  fordert zum Zweck \"Entwicklung und Test von Software\" die folgenden Daten von Ihnen an:");
    requestedData_Step1.getInputInfoUnits().add(requestedDataDescription);
    // Hyperlink dataPrivacyDescriptionLink = new Hyperlink();
    // dataPrivacyDescriptionLink.setHref("http://www.dataprivacy.eu");
    // pinInputStep.getInputInfoUnits().add(dataPrivacyDescriptionLink);
    Checkbox dataToSendSelection = new Checkbox("c1");
    BoxItem vornameBoxItem = new BoxItem();
    vornameBoxItem.setName("vornameBoxItem");
    vornameBoxItem.setChecked(true);
    vornameBoxItem.setDisabled(false);
    vornameBoxItem.setText("Vorname");
    BoxItem nameBoxItem = new BoxItem();
    nameBoxItem.setName("nameBoxItem");
    nameBoxItem.setChecked(true);
    nameBoxItem.setDisabled(false);
    nameBoxItem.setText("Name");
    BoxItem doctordegreeBoxItem = new BoxItem();
    doctordegreeBoxItem.setName("doctordegreeBoxItem");
    doctordegreeBoxItem.setChecked(true);
    doctordegreeBoxItem.setDisabled(true);
    doctordegreeBoxItem.setText("Doktorgrad");
    BoxItem addressBoxItem = new BoxItem();
    addressBoxItem.setName("addressBoxItem");
    addressBoxItem.setChecked(true);
    addressBoxItem.setDisabled(false);
    addressBoxItem.setText("Anschrift");
    BoxItem birthdayBoxItem = new BoxItem();
    birthdayBoxItem.setName("birthdayBoxItem");
    birthdayBoxItem.setChecked(false);
    birthdayBoxItem.setDisabled(false);
    birthdayBoxItem.setText("Geburtstag");
    BoxItem birthplaceBoxItem = new BoxItem();
    birthplaceBoxItem.setName("birthplaceBoxItem");
    birthplaceBoxItem.setChecked(false);
    birthplaceBoxItem.setDisabled(false);
    birthplaceBoxItem.setText("Geburtsort");
    // BoxItem pseudonymBoxItem = new BoxItem();
    // pseudonymBoxItem.setName("pseudonymBoxItem");
    // pseudonymBoxItem.setChecked(false);
    // pseudonymBoxItem.setDisabled(true);
    // pseudonymBoxItem.setText("Ordens-oder Künstlername");
    BoxItem identiycardtypeBoxItem = new BoxItem();
    identiycardtypeBoxItem.setName("identiycardtypeBoxItem");
    identiycardtypeBoxItem.setChecked(false);
    identiycardtypeBoxItem.setDisabled(true);
    identiycardtypeBoxItem.setText("Ausweistyp");
    BoxItem certificationcountryBoxItem = new BoxItem();
    certificationcountryBoxItem.setName("certificationcountryBoxItem");
    certificationcountryBoxItem.setChecked(false);
    certificationcountryBoxItem.setDisabled(true);
    certificationcountryBoxItem.setText("Ausstellendes Land");
    BoxItem habitationBoxItem = new BoxItem();
    habitationBoxItem.setName("habitationBoxItem");
    habitationBoxItem.setChecked(false);
    habitationBoxItem.setDisabled(true);
    habitationBoxItem.setText("Wohnort");
    BoxItem ageverificationBoxItem = new BoxItem();
    ageverificationBoxItem.setName("ageverificationBoxItem");
    ageverificationBoxItem.setChecked(false);
    ageverificationBoxItem.setDisabled(true);
    // 
    // Text sendAgreement_Text = new Text ();
    // sendAgreement_Text.setText("Wenn Sie mit der Übermittlung der ausgewählten Daten einverstanden sind  , geben Sie bitte Ihre 6/stellige PIN ein.");
    // ageverificationBoxItem.setText("Alterverifikation");
    // Passwordfield p1 = new Passwordfield();
    // p1.setName("pass input1");
    // p1.setText("PIN:");
    dataToSendSelection.getBoxItems().add(vornameBoxItem);
    dataToSendSelection.getBoxItems().add(nameBoxItem);
    dataToSendSelection.getBoxItems().add(doctordegreeBoxItem);
    // dataToSendSelection.getBoxItems().add(addressBoxItem);
    // dataToSendSelection.getBoxItems().add(birthdayBoxItem);
    // dataToSendSelection.getBoxItems().add(birthplaceBoxItem);
    // dataToSendSelection.getBoxItems().add(identiycardtypeBoxItem);
    // dataToSendSelection.getBoxItems().add(certificationcountryBoxItem);
    // dataToSendSelection.getBoxItems().add(habitationBoxItem);
    // dataToSendSelection.getBoxItems().add(ageverificationBoxItem);
    requestedData_Step1.getInputInfoUnits().add(dataToSendSelection);
    ToggleText requestedDataDescription1 = new ToggleText();
    requestedDataDescription1.setTitle("Hinweis");
    requestedDataDescription1.setText("Die markierten Elemente benötigt der Anbieter zur Durchführung seiner Dienstleistung. Optionale Daten können Sie hinzufügen.");
    requestedDataDescription1.setCollapsed(!true);
    requestedData_Step1.getInputInfoUnits().add(requestedDataDescription1);
    return requestedData_Step1;
}
Also used : ToggleText(org.openecard.gui.definition.ToggleText) Checkbox(org.openecard.gui.definition.Checkbox) ToggleText(org.openecard.gui.definition.ToggleText) Text(org.openecard.gui.definition.Text) Step(org.openecard.gui.definition.Step) BoxItem(org.openecard.gui.definition.BoxItem)

Example 2 with BoxItem

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

the class CardSelectionAction method perform.

@Override
public StepActionResult perform(Map<String, ExecutionResults> oldResults, StepResult result) {
    if (result.isOK()) {
        ExecutionResults results = oldResults.get(getStepID());
        OutputInfoUnit out = results.getResult("credentialSelectionBox");
        Radiobox rBox = (Radiobox) out;
        for (BoxItem item : rBox.getBoxItems()) {
            if (item.isChecked()) {
                this.resultCardTypetName = item.getName();
                break;
            }
        }
        if (resultCardTypetName != null) {
            return new StepActionResult(StepActionResultStatus.NEXT);
        } else {
            return new StepActionResult(StepActionResultStatus.REPEAT);
        }
    } else {
        // user has added or removed a card
        if (result.isReload()) {
            updateCards();
            step.update(avCard);
            if (avCard.isEmpty()) {
                return new StepActionResult(StepActionResultStatus.CANCEL);
            }
            return new StepActionResult(StepActionResultStatus.REPEAT);
        }
        // user has canceled the dialog so return that
        return new StepActionResult(StepActionResultStatus.CANCEL);
    }
}
Also used : ExecutionResults(org.openecard.gui.executor.ExecutionResults) OutputInfoUnit(org.openecard.gui.definition.OutputInfoUnit) Radiobox(org.openecard.gui.definition.Radiobox) BoxItem(org.openecard.gui.definition.BoxItem) StepActionResult(org.openecard.gui.executor.StepActionResult)

Example 3 with BoxItem

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

the class CardSelectionStep method addElements.

/**
 * Add the UI elements to the step.
 */
private void addElements() {
    Text description = new Text();
    description.setText(lang.translationForKey("card.selection.message"));
    Radiobox radioBox = new Radiobox("credentialSelectionBox");
    radioBox.setGroupText("Available Credentials");
    for (String cardName : avCardWithName.keySet()) {
        BoxItem item = new BoxItem();
        item.setName(avCardWithName.get(cardName).getRecognitionInfo().getCardType());
        item.setText(cardName);
        radioBox.getBoxItems().add(item);
    }
    getInputInfoUnits().add(description);
    getInputInfoUnits().add(radioBox);
}
Also used : Text(org.openecard.gui.definition.Text) Radiobox(org.openecard.gui.definition.Radiobox) BoxItem(org.openecard.gui.definition.BoxItem)

Example 4 with BoxItem

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

the class CHATStep method makeBoxItem.

private BoxItem makeBoxItem(Enum<?> value, boolean checked, boolean disabled, Object... textData) {
    BoxItem item = new BoxItem();
    item.setName(value.name());
    item.setChecked(checked);
    item.setDisabled(disabled);
    item.setText(LANG.translationForKey(value.name(), textData));
    return item;
}
Also used : BoxItem(org.openecard.gui.definition.BoxItem)

Example 5 with BoxItem

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

the class RunGUI method pinInputStep.

private Step pinInputStep(Step requestedDataStep) throws Exception {
    Step pinInputStep = new Step("PIN-Eingabe");
    pinInputStep.setAction(new PinInputAction(pinInputStep, requestedDataStep));
    Text t = new Text();
    t.setText("Durch die Eingabe Ihrer PIN bestätigen Sie, dass folgende markierte Daten an den Anbieter übermittelt werden.");
    pinInputStep.getInputInfoUnits().add(t);
    Checkbox dataToSendSelection = new Checkbox("c1");
    BoxItem vornameBoxItem = new BoxItem();
    vornameBoxItem.setName("vornameBoxItem");
    vornameBoxItem.setChecked(true);
    vornameBoxItem.setDisabled(true);
    vornameBoxItem.setText("Vorname");
    BoxItem nameBoxItem = new BoxItem();
    nameBoxItem.setName("nameBoxItem");
    nameBoxItem.setChecked(true);
    nameBoxItem.setDisabled(true);
    nameBoxItem.setText("Name");
    BoxItem doctordegreeBoxItem = new BoxItem();
    doctordegreeBoxItem.setName("doctordegreeBoxItem");
    doctordegreeBoxItem.setChecked(false);
    doctordegreeBoxItem.setDisabled(true);
    doctordegreeBoxItem.setText("Doktorgrad");
    BoxItem addressBoxItem = new BoxItem();
    addressBoxItem.setName("addressBoxItem");
    addressBoxItem.setChecked(true);
    addressBoxItem.setDisabled(true);
    addressBoxItem.setText("Anschrift");
    BoxItem birthdayBoxItem = new BoxItem();
    birthdayBoxItem.setName("birthdayBoxItem");
    birthdayBoxItem.setChecked(false);
    birthdayBoxItem.setDisabled(true);
    birthdayBoxItem.setText("Geburtstag");
    BoxItem birthplaceBoxItem = new BoxItem();
    birthplaceBoxItem.setName("birthplaceBoxItem");
    birthplaceBoxItem.setChecked(false);
    birthplaceBoxItem.setDisabled(true);
    birthplaceBoxItem.setText("Geburtsort");
    BoxItem pseudonymBoxItem = new BoxItem();
    pseudonymBoxItem.setName("pseudonymBoxItem");
    pseudonymBoxItem.setChecked(false);
    pseudonymBoxItem.setDisabled(true);
    pseudonymBoxItem.setText("Ordens-oder Künstlername");
    BoxItem identiycardtypeBoxItem = new BoxItem();
    identiycardtypeBoxItem.setName("identiycardtypeBoxItem");
    identiycardtypeBoxItem.setChecked(false);
    identiycardtypeBoxItem.setDisabled(true);
    identiycardtypeBoxItem.setText("Ausweistyp");
    BoxItem certificationcountryBoxItem = new BoxItem();
    certificationcountryBoxItem.setName("certificationcountryBoxItem");
    certificationcountryBoxItem.setChecked(false);
    certificationcountryBoxItem.setDisabled(true);
    certificationcountryBoxItem.setText("Ausstellendes Land");
    BoxItem habitationBoxItem = new BoxItem();
    habitationBoxItem.setName("habitationBoxItem");
    habitationBoxItem.setChecked(false);
    habitationBoxItem.setDisabled(true);
    habitationBoxItem.setText("Wohnort");
    BoxItem ageverificationBoxItem = new BoxItem();
    ageverificationBoxItem.setName("ageverificationBoxItem");
    ageverificationBoxItem.setChecked(false);
    ageverificationBoxItem.setDisabled(true);
    ageverificationBoxItem.setText("Altersverifikation");
    Text sendAgreement_Text = new Text();
    sendAgreement_Text.setText("Wenn Sie mit der Übermittlung der ausgewählten\n" + "Daten einverstanden sind, geben Sie bitte\n" + "Ihre 6-stellige PIN ein.");
    PasswordField p1 = new PasswordField("pf1");
    p1.setDescription("pass input1");
    p1.setDescription("PIN:");
    p1.setMaxLength(6);
    dataToSendSelection.getBoxItems().add(vornameBoxItem);
    dataToSendSelection.getBoxItems().add(nameBoxItem);
    // dataToSendSelection.getBoxItems().add(doctordegreeBoxItem);
    // dataToSendSelection.getBoxItems().add(addressBoxItem);
    // dataToSendSelection.getBoxItems().add(birthdayBoxItem);
    // dataToSendSelection.getBoxItems().add(birthplaceBoxItem);
    // dataToSendSelection.getBoxItems().add(identiycardtypeBoxItem);
    // dataToSendSelection.getBoxItems().add(certificationcountryBoxItem);
    // dataToSendSelection.getBoxItems().add(habitationBoxItem);
    // dataToSendSelection.getBoxItems().add(ageverificationBoxItem);
    pinInputStep.getInputInfoUnits().add(dataToSendSelection);
    // pinInputStep.getInputInfoUnits().add(sendAgreement_Text);
    pinInputStep.getInputInfoUnits().add(p1);
    return pinInputStep;
}
Also used : Checkbox(org.openecard.gui.definition.Checkbox) ToggleText(org.openecard.gui.definition.ToggleText) Text(org.openecard.gui.definition.Text) Step(org.openecard.gui.definition.Step) PasswordField(org.openecard.gui.definition.PasswordField) BoxItem(org.openecard.gui.definition.BoxItem)

Aggregations

BoxItem (org.openecard.gui.definition.BoxItem)8 Text (org.openecard.gui.definition.Text)4 Checkbox (org.openecard.gui.definition.Checkbox)3 Step (org.openecard.gui.definition.Step)3 ToggleText (org.openecard.gui.definition.ToggleText)3 Radiobox (org.openecard.gui.definition.Radiobox)2 ExecutionResults (org.openecard.gui.executor.ExecutionResults)2 CHAT (org.openecard.crypto.common.asn1.cvc.CHAT)1 OutputInfoUnit (org.openecard.gui.definition.OutputInfoUnit)1 PasswordField (org.openecard.gui.definition.PasswordField)1 StepActionResult (org.openecard.gui.executor.StepActionResult)1