use of com.vaadin.ui.TextField in project unity by unity-idm.
the class AttributePolicyConfigurationEditor method init.
private void init() {
binder = new Binder<>(AttributePolicyBean.class);
main = new VerticalLayout();
FormLayoutWithFixedCaptionWidth header = new FormLayoutWithFixedCaptionWidth();
header.setMargin(false);
main.addComponent(header);
name = new TextField(msg.getMessage("AttributePolicyConfigurationEditor.name"));
header.addComponent(name);
binder.forField(name).bind("name");
ChipsWithDropdown<String> targetIdps = new ChipsWithDropdown<>(p -> getDisplayeName(p), true);
targetIdps.setItems(idPs.keySet());
targetIdps.setWidth(FieldSizeConstans.WIDE_FIELD_WIDTH, FieldSizeConstans.WIDE_FIELD_WIDTH_UNIT);
targetIdps.setCaption(msg.getMessage("AttributePolicyConfigurationEditor.targetIdps"));
binder.forField(targetIdps).bind("targetIdps");
header.addComponent(targetIdps);
ChipsWithDropdown<String> targetFederations = new ChipsWithDropdown<>(p -> getGroupDisplayeName(p), true);
targetFederations.setItems(IdPsGroups.keySet());
targetFederations.setWidth(FieldSizeConstans.WIDE_FIELD_WIDTH, FieldSizeConstans.WIDE_FIELD_WIDTH_UNIT);
targetFederations.setCaption(msg.getMessage("AttributePolicyConfigurationEditor.targetFederations"));
binder.forField(targetFederations).bind("targetFederations");
header.addComponent(targetFederations);
AttributesGrid attributes = new AttributesGrid(msg);
binder.forField(attributes).bind("attributes");
main.addComponent(attributes);
binder.addValueChangeListener(e -> fireEvent(new ValueChangeEvent<>(this, getValue(), true)));
}
use of com.vaadin.ui.TextField in project unity by unity-idm.
the class RegistrationFormEditor method initDisplaySettingsTab.
private void initDisplaySettingsTab() throws EngineException {
FormLayout main = new CompactFormLayout();
initCommonDisplayedFields();
title2ndStage = new I18nTextField(msg, msg.getMessage("RegistrationFormViewer.title2ndStage"));
showGotoSignin = new CheckBox(msg.getMessage("RegistrationFormViewer.showGotoSignin"));
showGotoSignin.addValueChangeListener(v -> signInUrl.setEnabled(showGotoSignin.getValue()));
signInUrl = new TextField(msg.getMessage("RegistrationFormEditor.signinURL"));
signInUrl.setWidth(100, Unit.PERCENTAGE);
signInUrl.setEnabled(false);
showCancel = new CheckBox(msg.getMessage("FormLayoutEditor.showCancel"));
localSignupEmbeddedAsButton = new CheckBox(msg.getMessage("FormLayoutEditor.localSignupEmbeddedAsButton"));
switchToEnquiryInfo = new I18nTextArea(msg, msg.getMessage("RegistrationFormEditor.switchToEnquiryInfo"));
switchToEnquiryInfo.setValue(RegistrationForm.getDefaultSwitchToEnquiryInfo(msg));
tooltip(switchToEnquiryInfo, msg.getMessage("RegistrationFormEditor.switchToEnquiryInfo.tip"));
main.addComponents(displayedName, title2ndStage, formInformation, switchToEnquiryInfo, pageTitle, showGotoSignin, signInUrl, showCancel, localSignupEmbeddedAsButton);
layoutSettingsEditor = new RegistrationFormLayoutSettingsEditor(msg, serverConfig, fileStorageService, uriAccessService, imageAccessService);
VerticalLayout wrapper = new VerticalLayout(main, layoutSettingsEditor);
wrapper.setMargin(true);
wrapper.setSpacing(false);
tabs.addTab(wrapper, msg.getMessage("RegistrationFormViewer.displayTab"));
}
use of com.vaadin.ui.TextField in project unity by unity-idm.
the class RegistrationFormLayoutSettingsEditor method initUI.
private void initUI() {
FormLayout main = new FormLayout();
main.setSpacing(true);
CheckBox compactInputs = new CheckBox(msg.getMessage("FormLayoutEditor.compactInputs"));
ImageField logo = new ImageField(msg, uriAccessService, serverConfig.getFileSizeLimit());
logo.setCaption(msg.getMessage("FormLayoutEditor.logo"));
logo.setDescription(msg.getMessage("FormLayoutEditor.logoDesc"));
TextField columnWidth = new TextField(msg.getMessage("FormLayoutEditor.columnWidth"));
ComboBox<String> columnWidthUnit = new NotNullComboBox<>(msg.getMessage("FormLayoutEditor.columnWidthUnit"));
columnWidthUnit.setItems(Stream.of(Unit.values()).map(Unit::toString));
main.addComponents(logo, columnWidth, columnWidthUnit, compactInputs);
setCompositionRoot(main);
binder = new Binder<>(FormLayoutSettingsWithLogo.class);
binder.forField(compactInputs).bind("compactInputs");
logo.configureBinding(binder, "logo");
binder.forField(columnWidth).asRequired(msg.getMessage("fieldRequired")).withConverter(new StringToFloatConverter(msg.getMessage("FormLayoutEditor.columnWidth.mustBeFloat"))).withValidator(new FloatRangeValidator(msg.getMessage("FormLayoutEditor.columnWidth.mustBePositive"), 0f, Float.MAX_VALUE)).bind("columnWidth");
binder.forField(columnWidthUnit).asRequired(msg.getMessage("fieldRequired")).bind("columnWidthUnit");
binder.setBean(new FormLayoutSettingsWithLogo(FormLayoutSettings.DEFAULT, imageAccessService));
}
use of com.vaadin.ui.TextField in project unity by unity-idm.
the class LdapAuthenticatorEditor method buildGroupRetrievalSettingsSection.
private CollapsibleLayout buildGroupRetrievalSettingsSection() {
FormLayoutWithFixedCaptionWidth groupRetSettingsLayout = new FormLayoutWithFixedCaptionWidth();
groupRetSettingsLayout.setMargin(false);
CheckBox delegateGroupFiltering = new CheckBox(msg.getMessage("LdapAuthenticatorEditor.delegateGroupFiltering"));
configBinder.forField(delegateGroupFiltering).bind("delegateGroupFiltering");
groupRetSettingsLayout.addComponent(delegateGroupFiltering);
TextField groupsBaseName = new TextField(msg.getMessage("LdapAuthenticatorEditor.groupsBaseName"));
groupsBaseName.setWidth(FieldSizeConstans.WIDE_FIELD_WIDTH, FieldSizeConstans.WIDE_FIELD_WIDTH_UNIT);
configBinder.forField(groupsBaseName).bind("groupsBaseName");
groupRetSettingsLayout.addComponent(groupsBaseName);
TextField memberOfAttribute = new TextField(msg.getMessage("LdapAuthenticatorEditor.memberOfAttribute"));
memberOfAttribute.setWidth(FieldSizeConstans.WIDE_FIELD_WIDTH, FieldSizeConstans.WIDE_FIELD_WIDTH_UNIT);
configBinder.forField(memberOfAttribute).bind("memberOfAttribute");
groupRetSettingsLayout.addComponent(memberOfAttribute);
TextField memberOfGroupAttribute = new TextField(msg.getMessage("LdapAuthenticatorEditor.memberOfGroupAttribute"));
memberOfGroupAttribute.setWidth(FieldSizeConstans.WIDE_FIELD_WIDTH, FieldSizeConstans.WIDE_FIELD_WIDTH_UNIT);
configBinder.forField(memberOfGroupAttribute).bind("memberOfGroupAttribute");
groupRetSettingsLayout.addComponent(memberOfGroupAttribute);
GridWithEditor<GroupSpecification> groupConfig = new GridWithEditor<>(msg, GroupSpecification.class);
groupConfig.setCaption(msg.getMessage("LdapAuthenticatorEditor.groupSpecifications"));
groupRetSettingsLayout.addComponent(groupConfig);
groupConfig.addTextColumn(s -> s.getMatchByMemberAttribute(), (t, v) -> t.setMatchByMemberAttribute(v), msg.getMessage("LdapAuthenticatorEditor.groupSpecification.matchByMemberAttribute"), 20, false);
groupConfig.addTextColumn(s -> s.getMemberAttribute(), (t, v) -> t.setMemberAttribute(v), msg.getMessage("LdapAuthenticatorEditor.groupSpecification.memberAttribute"), 20, true);
groupConfig.addTextColumn(s -> s.getGroupNameAttribute(), (t, v) -> t.setGroupNameAttribute(v), msg.getMessage("LdapAuthenticatorEditor.groupSpecification.nameAttribute"), 20, false);
groupConfig.addTextColumn(s -> s.getObjectClass(), (t, v) -> t.setObjectClass(v), msg.getMessage("LdapAuthenticatorEditor.groupSpecification.objectClass"), 20, true);
groupConfig.setWidth(100, Unit.PERCENTAGE);
configBinder.forField(groupConfig).bind("groupSpecifications");
return new CollapsibleLayout(msg.getMessage("LdapAuthenticatorEditor.groupRetrievalSettings"), groupRetSettingsLayout);
}
use of com.vaadin.ui.TextField in project unity by unity-idm.
the class LdapAuthenticatorEditor method buildAdvancedAttributeSearchSettingsSection.
private CollapsibleLayout buildAdvancedAttributeSearchSettingsSection() {
FormLayoutWithFixedCaptionWidth advancedAttrSearchLayout = new FormLayoutWithFixedCaptionWidth();
advancedAttrSearchLayout.setMargin(false);
ChipsWithTextfield retrievalLdapAttr = new ChipsWithTextfield(msg);
retrievalLdapAttr.setCaption(msg.getMessage("LdapAuthenticatorEditor.retrievedAttributes"));
advancedAttrSearchLayout.addComponent(retrievalLdapAttr);
configBinder.forField(retrievalLdapAttr).bind("retrievalLdapAttributes");
GridWithEditor<SearchSpecification> searchConfig = new GridWithEditor<>(msg, SearchSpecification.class);
searchConfig.setCaption(msg.getMessage("LdapAuthenticatorEditor.searchSpecifications"));
advancedAttrSearchLayout.addComponent(searchConfig);
searchConfig.addTextColumn(s -> s.getBaseDN(), (t, v) -> t.setBaseDN(v), msg.getMessage("LdapAuthenticatorEditor.searchSpecification.baseName"), 30, true);
searchConfig.addTextColumn(s -> s.getFilter(), (t, v) -> t.setFilter(v), msg.getMessage("LdapAuthenticatorEditor.searchSpecification.filter"), 30, true, Optional.of(getFilterValidator()));
searchConfig.addTextColumn(s -> s.getAttributes(), (t, v) -> t.setAttributes(v), msg.getMessage("LdapAuthenticatorEditor.searchSpecification.attributes"), 20, true);
searchConfig.addComboColumn(s -> s.getScope(), (t, v) -> t.setScope(v), SearchScope.class, msg.getMessage("LdapAuthenticatorEditor.searchSpecification.scope"), 10);
searchConfig.setWidth(100, Unit.PERCENTAGE);
configBinder.forField(searchConfig).bind("searchSpecifications");
TextField usernameExtractorRegexp = new TextField(msg.getMessage("LdapAuthenticatorEditor.usernameExtractorRegexp"));
usernameExtractorRegexp.setWidth(FieldSizeConstans.WIDE_FIELD_WIDTH, FieldSizeConstans.WIDE_FIELD_WIDTH_UNIT);
configBinder.forField(usernameExtractorRegexp).bind("usernameExtractorRegexp");
advancedAttrSearchLayout.addComponent(usernameExtractorRegexp);
return new CollapsibleLayout(msg.getMessage("LdapAuthenticatorEditor.advancedAttributeSearchSettings"), advancedAttrSearchLayout);
}
Aggregations