use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.
the class CompositedButtonPanel method initLayout.
private void initLayout() {
WebMarkupContainer buttonContainer = new WebMarkupContainer(ID_COMPOSITED_BUTTON);
add(buttonContainer);
CompositedIconPanel compositedIconPanel = new CompositedIconPanel(ID_COMPOSITED_ICON, new PropertyModel<>(getModel(), CompositedIconButtonDto.F_COMPOSITED_ICON));
buttonContainer.add(compositedIconPanel);
Label label = new Label(ID_LABEL, new ReadOnlyModel<>(() -> {
DisplayType displayType = getModelObject().getAdditionalButtonDisplayType();
return WebComponentUtil.getTranslatedPolyString(displayType.getLabel());
}));
buttonContainer.add(label);
buttonContainer.add(AttributeAppender.append("title", new ReadOnlyModel<>(() -> {
DisplayType displayType = getModelObject().getAdditionalButtonDisplayType();
return WebComponentUtil.getTranslatedPolyString(displayType.getTooltip());
})));
buttonContainer.add(new TooltipBehavior());
buttonContainer.add(new AjaxEventBehavior("click") {
@Override
protected void onEvent(AjaxRequestTarget target) {
onButtonClicked(target, getModelObject());
}
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
attributes.setPreventDefault(true);
super.updateAjaxAttributes(attributes);
}
});
// Label description = new Label(ID_DESCRIPTION, new ReadOnlyModel<>(() -> {
// DisplayType displayType = getModelObject().getAdditionalButtonDisplayType();
// return WebComponentUtil.getTranslatedPolyString(displayType.getTooltip());
// }));
// buttonContainer.add(description);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.
the class BasicMultivalueContainerListPanel method createNewButtonDescription.
@Override
protected List<CompositedIconButtonDto> createNewButtonDescription() {
String title = getPageBase().createStringResource("PageAdminObjectDetails.title.new", getContainerNameForNewButton()).getString();
DisplayType defaultButtonDisplayType = GuiDisplayTypeUtil.createDisplayType("fa fa-plus", "green", title);
CompositedIconButtonDto defaultButton = new CompositedIconButtonDto();
CompositedIconBuilder builder = new CompositedIconBuilder();
builder.setBasicIcon(WebComponentUtil.getIconCssClass(defaultButtonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(defaultButtonDisplayType));
defaultButton.setAdditionalButtonDisplayType(defaultButtonDisplayType);
defaultButton.setCompositedIcon(builder.build());
return Collections.singletonList(defaultButton);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.
the class DashboardWidgetDto method createIconCssClass.
private String createIconCssClass(DashboardWidget dashboardWidget) {
if (dashboardWidget == null) {
return DEFAULT_ICON;
}
DisplayType displayType = dashboardWidget.getDisplay();
if (displayType == null) {
return DEFAULT_ICON;
}
IconType icon = displayType.getIcon();
if (icon == null) {
return DEFAULT_ICON;
}
String cssClass = icon.getCssClass();
if (StringUtils.isNoneBlank(cssClass)) {
return cssClass;
}
return DEFAULT_ICON;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType in project midpoint by Evolveum.
the class DashboardWidgetDto method createMessage.
private String createMessage(DashboardWidget dashboardWidget) {
if (dashboardWidget == null) {
return null;
}
DisplayType displayType = dashboardWidget.getDisplay();
if (displayType != null && displayType.getLabel() != null) {
// TODO translate?
return displayType.getLabel().getOrig();
}
DashboardWidgetType dashboardWidgetType = dashboardWidget.getWidget();
if (dashboardWidgetType == null) {
return null;
}
return dashboardWidgetType.getIdentifier();
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType 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