use of com.evolveum.midpoint.gui.api.component.password.PasswordLimitationsPanel in project midpoint by Evolveum.
the class PasswordPolicyValidationPanel method initLayout.
private void initLayout() {
IModel<DisplayType> displayModel = (IModel) () -> {
if (!Boolean.TRUE.equals(isAfterInitialization.getObject())) {
return null;
}
String status = "fa-fw " + GuiStyleConstants.CLASS_OP_RESULT_STATUS_ICON_SUCCESS_COLORED + " fa-lg";
String titleKey = "PasswordPolicyValidationPanel.valid";
for (StringLimitationResult limitation : getModelObject()) {
if (!limitation.isSuccess()) {
status = "fa-fw " + GuiStyleConstants.CLASS_OP_RESULT_STATUS_ICON_FATAL_ERROR_COLORED + " fa-lg";
titleKey = "PasswordPolicyValidationPanel.invalid";
}
}
return GuiDisplayTypeUtil.createDisplayType(status, "", getPageBase().createStringResource(titleKey).getString());
};
ImagePanel resultIcon = new ImagePanel(ID_RESULT_ICON, displayModel);
resultIcon.setOutputMarkupId(true);
add(resultIcon);
ImagePanel infoPanel = new ImagePanel(ID_INFO_ICON, Model.of(GuiDisplayTypeUtil.createDisplayType("fa fa-info-circle")));
add(infoPanel);
PasswordLimitationsPanel validationPanel = new PasswordLimitationsPanel(ID_POLICY_VALIDATION_POPOVER, getModel());
validationPanel.setOutputMarkupId(true);
add(validationPanel);
}
Aggregations