Search in sources :

Example 1 with I18nTextField

use of pl.edu.icm.unity.webui.common.i18n.I18nTextField in project unity by unity-idm.

the class OTPAuthenticatorEditor method buildInteractiveLoginSettingsSection.

private CollapsibleLayout buildInteractiveLoginSettingsSection() {
    FormLayoutWithFixedCaptionWidth interactiveLoginSettings = new FormLayoutWithFixedCaptionWidth();
    interactiveLoginSettings.setMargin(false);
    I18nTextField retrievalName = new I18nTextField(msg);
    retrievalName.setCaption(msg.getMessage("OTPAuthenticatorEditor.formName"));
    configBinder.forField(retrievalName).bind("retrievalName");
    interactiveLoginSettings.addComponents(retrievalName);
    CollapsibleLayout wrapper = new CollapsibleLayout(msg.getMessage("BaseAuthenticatorEditor.interactiveLoginSettings"), interactiveLoginSettings);
    return wrapper;
}
Also used : CollapsibleLayout(pl.edu.icm.unity.webui.common.CollapsibleLayout) FormLayoutWithFixedCaptionWidth(pl.edu.icm.unity.webui.common.FormLayoutWithFixedCaptionWidth) I18nTextField(pl.edu.icm.unity.webui.common.i18n.I18nTextField)

Example 2 with I18nTextField

use of pl.edu.icm.unity.webui.common.i18n.I18nTextField in project unity by unity-idm.

the class PamAuthenticatorEditor method buildInteractiveLoginSettingsSection.

private CollapsibleLayout buildInteractiveLoginSettingsSection() {
    FormLayoutWithFixedCaptionWidth interactiveLoginSettings = new FormLayoutWithFixedCaptionWidth();
    interactiveLoginSettings.setMargin(false);
    I18nTextField retrievalName = new I18nTextField(msg);
    retrievalName.setCaption(msg.getMessage("PamAuthenticatorEditor.displayedName"));
    configBinder.forField(retrievalName).bind("retrievalName");
    interactiveLoginSettings.addComponent(retrievalName);
    CheckBox accountAssociation = new CheckBox(msg.getMessage("PamAuthenticatorEditor.accountAssociation"));
    configBinder.forField(accountAssociation).bind("accountAssociation");
    interactiveLoginSettings.addComponent(accountAssociation);
    ComboBox<String> registrationForm = new ComboBox<>(msg.getMessage("PamAuthenticatorEditor.registrationForm"));
    registrationForm.setItems(registrationForms);
    configBinder.forField(registrationForm).bind("registrationForm");
    interactiveLoginSettings.addComponent(registrationForm);
    return new CollapsibleLayout(msg.getMessage("BaseAuthenticatorEditor.interactiveLoginSettings"), interactiveLoginSettings);
}
Also used : CollapsibleLayout(pl.edu.icm.unity.webui.common.CollapsibleLayout) FormLayoutWithFixedCaptionWidth(pl.edu.icm.unity.webui.common.FormLayoutWithFixedCaptionWidth) CheckBox(com.vaadin.ui.CheckBox) ComboBox(com.vaadin.ui.ComboBox) I18nTextField(pl.edu.icm.unity.webui.common.i18n.I18nTextField) I18nString(pl.edu.icm.unity.types.I18nString)

Example 3 with I18nTextField

use of pl.edu.icm.unity.webui.common.i18n.I18nTextField in project unity by unity-idm.

the class PasswordAuthenticatorEditor method buildInteractiveLoginSettingsSection.

private CollapsibleLayout buildInteractiveLoginSettingsSection() {
    FormLayoutWithFixedCaptionWidth interactiveLoginSettings = new FormLayoutWithFixedCaptionWidth();
    interactiveLoginSettings.setMargin(false);
    I18nTextField retrievalName = new I18nTextField(msg);
    retrievalName.setCaption(msg.getMessage("PasswordAuthenticatorEditor.passwordName"));
    configBinder.forField(retrievalName).bind("retrievalName");
    interactiveLoginSettings.addComponent(retrievalName);
    CollapsibleLayout wrapper = new CollapsibleLayout(msg.getMessage("BaseAuthenticatorEditor.interactiveLoginSettings"), interactiveLoginSettings);
    return wrapper;
}
Also used : CollapsibleLayout(pl.edu.icm.unity.webui.common.CollapsibleLayout) FormLayoutWithFixedCaptionWidth(pl.edu.icm.unity.webui.common.FormLayoutWithFixedCaptionWidth) I18nTextField(pl.edu.icm.unity.webui.common.i18n.I18nTextField)

Example 4 with I18nTextField

use of pl.edu.icm.unity.webui.common.i18n.I18nTextField in project unity by unity-idm.

the class SMSAuthenticatorEditor method buildInteractiveLoginSettingsSection.

private CollapsibleLayout buildInteractiveLoginSettingsSection() {
    FormLayoutWithFixedCaptionWidth interactiveLoginSettings = new FormLayoutWithFixedCaptionWidth();
    interactiveLoginSettings.setMargin(false);
    I18nTextField retrievalName = new I18nTextField(msg);
    retrievalName.setCaption(msg.getMessage("SMSAuthenticatorEditor.formName"));
    configBinder.forField(retrievalName).bind("retrievalName");
    interactiveLoginSettings.addComponents(retrievalName);
    CollapsibleLayout wrapper = new CollapsibleLayout(msg.getMessage("BaseAuthenticatorEditor.interactiveLoginSettings"), interactiveLoginSettings);
    return wrapper;
}
Also used : CollapsibleLayout(pl.edu.icm.unity.webui.common.CollapsibleLayout) FormLayoutWithFixedCaptionWidth(pl.edu.icm.unity.webui.common.FormLayoutWithFixedCaptionWidth) I18nTextField(pl.edu.icm.unity.webui.common.i18n.I18nTextField)

Example 5 with I18nTextField

use of pl.edu.icm.unity.webui.common.i18n.I18nTextField in project unity by unity-idm.

the class GroupEditDialog method getContents.

@Override
protected Component getContents() {
    FormLayout fl = new CompactFormLayout();
    fl.setMargin(true);
    fl.setSpacing(true);
    path = new TextField(msg.getMessage("GroupEditDialog.groupPath"));
    path.setValue(originalGroup.getPathEncoded());
    path.setReadOnly(true);
    path.setWidthFull();
    fl.addComponent(path);
    displayedName = new I18nTextField(msg, msg.getMessage("displayedNameF"));
    displayedName.setValue(originalGroup.getDisplayedName());
    description = new I18nTextArea(msg, msg.getMessage("GroupEditDialog.groupDesc"));
    description.setValue(originalGroup.getDescription());
    isPublic = new CheckBox(msg.getMessage("GroupEditDialog.public"));
    isPublic.setValue(originalGroup.isPublic());
    propertiesEditor = new GridWithEditor<>(msg, GroupPropertyBean.class, t -> false, false, false);
    propertiesEditor.setCaption(msg.getMessage("GroupEditDialog.groupProperties"));
    propertiesEditor.getEditor().addOpenListener(e -> edited = e.getBean());
    propertiesEditor.addTextColumn(s -> s.key, (t, v) -> t.setKey(v), msg.getMessage("GroupEditDialog.propertyName"), 10, true, Optional.of((value, context) -> {
        if (propertiesEditor.getValue().stream().filter(k -> !k.key.equals(edited.key)).map(k -> k.key).anyMatch(k -> k.equals(value))) {
            return ValidationResult.error(msg.getMessage("GroupEditDialog.propertyNameExists"));
        }
        return new StringLengthValidator(msg.getMessage("maxLength", GroupProperty.MAX_KEY_LENGTH), 0, GroupProperty.MAX_KEY_LENGTH).apply(value, context);
    }));
    propertiesEditor.addTextColumn(s -> s.getValue(), (t, v) -> t.setValue(v), msg.getMessage("GroupEditDialog.propertyValue"), 40, false, Optional.of(new StringLengthValidator(msg.getMessage("maxLength", GroupProperty.MAX_VALUE_LENGHT), 0, GroupProperty.MAX_VALUE_LENGHT)));
    propertiesEditor.setValue(originalGroup.getProperties().values().stream().map(p -> new GroupPropertyBean(p)).collect(Collectors.toList()));
    fl.addComponents(displayedName, description, isPublic, propertiesEditor);
    description.focus();
    return fl;
}
Also used : CompactFormLayout(pl.edu.icm.unity.webui.common.CompactFormLayout) FormLayout(com.vaadin.ui.FormLayout) StringLengthValidator(com.vaadin.data.validator.StringLengthValidator) CompactFormLayout(pl.edu.icm.unity.webui.common.CompactFormLayout) TextField(com.vaadin.ui.TextField) GridWithEditor(pl.edu.icm.unity.webui.common.GridWithEditor) I18nString(pl.edu.icm.unity.types.I18nString) ValidationResult(com.vaadin.data.ValidationResult) Collectors(java.util.stream.Collectors) GroupProperty(pl.edu.icm.unity.types.basic.GroupProperty) CheckBox(com.vaadin.ui.CheckBox) I18nTextField(pl.edu.icm.unity.webui.common.i18n.I18nTextField) FormLayout(com.vaadin.ui.FormLayout) Optional(java.util.Optional) UserError(com.vaadin.server.UserError) Group(pl.edu.icm.unity.types.basic.Group) I18nTextArea(pl.edu.icm.unity.webui.common.i18n.I18nTextArea) MessageSource(pl.edu.icm.unity.MessageSource) AbstractDialog(pl.edu.icm.unity.webui.common.AbstractDialog) Component(com.vaadin.ui.Component) CompactFormLayout(pl.edu.icm.unity.webui.common.CompactFormLayout) CheckBox(com.vaadin.ui.CheckBox) StringLengthValidator(com.vaadin.data.validator.StringLengthValidator) I18nTextField(pl.edu.icm.unity.webui.common.i18n.I18nTextField) TextField(com.vaadin.ui.TextField) I18nTextField(pl.edu.icm.unity.webui.common.i18n.I18nTextField) I18nTextArea(pl.edu.icm.unity.webui.common.i18n.I18nTextArea)

Aggregations

I18nTextField (pl.edu.icm.unity.webui.common.i18n.I18nTextField)36 FormLayoutWithFixedCaptionWidth (pl.edu.icm.unity.webui.common.FormLayoutWithFixedCaptionWidth)17 CheckBox (com.vaadin.ui.CheckBox)15 CollapsibleLayout (pl.edu.icm.unity.webui.common.CollapsibleLayout)14 TextField (com.vaadin.ui.TextField)13 FormLayout (com.vaadin.ui.FormLayout)12 VerticalLayout (com.vaadin.ui.VerticalLayout)12 I18nString (pl.edu.icm.unity.types.I18nString)11 ValidationResult (com.vaadin.data.ValidationResult)10 MessageSource (pl.edu.icm.unity.MessageSource)10 Binder (com.vaadin.data.Binder)9 HorizontalLayout (com.vaadin.ui.HorizontalLayout)8 Label (com.vaadin.ui.Label)8 List (java.util.List)8 Collectors (java.util.stream.Collectors)8 I18nTextArea (pl.edu.icm.unity.webui.common.i18n.I18nTextArea)8 ComboBox (com.vaadin.ui.ComboBox)7 Component (com.vaadin.ui.Component)7 Set (java.util.Set)6 FieldSizeConstans (pl.edu.icm.unity.webui.common.FieldSizeConstans)6