use of com.evolveum.midpoint.web.component.util.LocalizableMessageModel in project midpoint by Evolveum.
the class EvaluatedTriggerPanel method initLayout.
protected void initLayout() {
EvaluatedTriggerDto trigger = getModelObject();
WebMarkupContainer frame = new WebMarkupContainer(ID_FRAME);
if (trigger.isHighlighted()) {
// TODO skin
frame.add(new AttributeAppender("style", "background-color: #fcffd3"));
}
add(frame);
frame.add(new Label(ID_MESSAGE, new LocalizableMessageModel(Model.of(trigger.getMessage()), this)));
EvaluatedTriggerGroupDto children = trigger.getChildren();
EvaluatedTriggerGroupPanel childrenPanel = new EvaluatedTriggerGroupPanel(ID_CHILDREN, Model.of(children));
childrenPanel.setVisible(!children.getTriggers().isEmpty());
frame.add(childrenPanel);
}
use of com.evolveum.midpoint.web.component.util.LocalizableMessageModel in project midpoint by Evolveum.
the class InformationPanel method initLayout.
private void initLayout() {
Label titleLabel = new Label(ID_TITLE, new LocalizableMessageModel(new IModel<LocalizableMessageType>() {
@Override
public LocalizableMessageType getObject() {
InformationType info = getModelObject();
if (info == null || info.getTitle() == null && info.getLocalizableTitle() == null) {
return new SingleLocalizableMessageType().fallbackMessage("ApprovalStageDefinitionType.additionalInformation");
}
return getLocalizableMessageOrDefault(info.getLocalizableTitle(), info.getTitle());
}
}, this));
titleLabel.add(new VisibleBehaviour(() -> getModelObject() != null));
add(titleLabel);
ListView<InformationPartType> list = new ListView<InformationPartType>(ID_PARTS, new PropertyModel<>(getModel(), InformationType.F_PART.getLocalPart())) {
@Override
protected void populateItem(ListItem<InformationPartType> item) {
InformationPartType part = item.getModelObject();
Label label = new Label(ID_PART, part != null ? WebComponentUtil.resolveLocalizableMessage(getLocalizableMessageOrDefault(part.getLocalizableText(), part.getText()), InformationPanel.this) : "");
if (Boolean.TRUE.equals(part.isHasMarkup())) {
label.setEscapeModelStrings(false);
}
item.add(label);
}
};
add(list);
}
Aggregations