use of pl.edu.icm.unity.webui.common.webElements.SubViewSwitcher in project unity by unity-idm.
the class CompositePasswordAuthenticatorEditor method getEditor.
@Override
public Component getEditor(AuthenticatorDefinition toEdit, SubViewSwitcher switcher, boolean forceNameEditable) {
this.subViewSwitcher = switcher;
boolean editMode = init(msg.getMessage("CompositePasswordAuthenticatorEditor.defaultName"), toEdit, forceNameEditable);
configBinder = new Binder<>(CompositePasswordConfiguration.class);
ChipsWithDropdown<String> localCredentials = new ChipsWithDropdown<>(i -> i, true);
localCredentials.setItems(credentialDefinitions.stream().filter(c -> c.getTypeId().equals(PasswordVerificator.NAME)).map(c -> c.getName()).collect(Collectors.toList()));
localCredentials.setCaption(msg.getMessage("CompositePasswordAuthenticatorEditor.localCredentials"));
configBinder.forField(localCredentials).bind("localCredentials");
remoteAuthn = new RemoteAuthenticatorsComponent();
remoteAuthn.setCaption(msg.getMessage("CompositePasswordAuthenticatorEditor.remoteAuthenticators"));
configBinder.forField(remoteAuthn).bind("remoteAuthenticators");
CollapsibleLayout interactiveLoginSettings = buildInteractiveLoginSettingsSection();
CompositePasswordConfiguration config = new CompositePasswordConfiguration();
if (editMode) {
config.fromProperties(toEdit.configuration, msg);
}
configBinder.setBean(config);
FormLayoutWithFixedCaptionWidth header = new FormLayoutWithFixedCaptionWidth();
header.addComponent(name);
header.addComponent(localCredentials);
header.addComponent(remoteAuthn);
VerticalLayout main = new VerticalLayout();
main.setMargin(false);
main.addComponent(header);
main.addComponent(interactiveLoginSettings);
return main;
}
Aggregations