use of com.evolveum.midpoint.web.model.PrismPropertyRealValueFromContainerableModel in project midpoint by Evolveum.
the class AbstractSummaryPanel method initLayoutCommon.
protected void initLayoutCommon() {
box = new WebMarkupContainer(ID_BOX);
add(box);
box.add(new AttributeModifier("class", BOX_CSS_CLASS + " " + getBoxAdditionalCssClass()));
box.add(new Label(ID_DISPLAY_NAME, new PrismPropertyRealValueFromContainerableModel<>(getModel(), getDisplayNamePropertyName())));
WebMarkupContainer identifierPanel = new WebMarkupContainer(ID_IDENTIFIER_PANEL);
identifierPanel.add(new Label(ID_IDENTIFIER, new PrismPropertyRealValueFromContainerableModel<>(getModel(), getIdentifierPropertyName())));
identifierPanel.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return isIdentifierVisible();
}
});
box.add(identifierPanel);
if (getTitlePropertyName() != null) {
box.add(new Label(ID_TITLE, new PrismPropertyRealValueFromContainerableModel<>(getModel(), getTitlePropertyName())));
} else if (getTitleModel() != null) {
box.add(new Label(ID_TITLE, getTitleModel()));
} else {
box.add(new Label(ID_TITLE, " "));
}
if (getTitle2PropertyName() != null) {
box.add(new Label(ID_TITLE2, new PrismPropertyRealValueFromContainerableModel<>(getModel(), getTitle2PropertyName())));
} else if (getTitle2Model() != null) {
box.add(new Label(ID_TITLE2, getTitle2Model()));
} else {
Label label = new Label(ID_TITLE2, " ");
label.setVisible(false);
box.add(label);
}
if (getTitle3PropertyName() != null) {
box.add(new Label(ID_TITLE3, new PrismPropertyRealValueFromContainerableModel<>(getModel(), getTitle3PropertyName())));
} else if (getTitle3Model() != null) {
box.add(new Label(ID_TITLE3, getTitle3Model()));
} else {
Label label = new Label(ID_TITLE3, " ");
label.setVisible(false);
box.add(label);
}
Label parentOrgLabel = new Label(ID_ORGANIZATION, getParentOrgModel());
parentOrgLabel.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return getParentOrgModel().getObject() != null;
}
});
box.add(parentOrgLabel);
iconBox = new WebMarkupContainer(ID_ICON_BOX);
box.add(iconBox);
if (getIconBoxAdditionalCssClass() != null) {
iconBox.add(new AttributeModifier("class", ICON_BOX_CSS_CLASS + " " + getIconBoxAdditionalCssClass()));
}
Label icon = new Label(ID_ICON, "");
icon.add(new AttributeModifier("class", getIconCssClass()));
icon.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return getPhotoModel().getObject() == null;
}
});
iconBox.add(icon);
NonCachingImage img = new NonCachingImage(ID_PHOTO, getPhotoModel());
img.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return getPhotoModel().getObject() != null;
}
});
iconBox.add(img);
tagBox = new WebMarkupContainer(ID_TAG_BOX);
if (getTagBoxCssClass() != null) {
tagBox.add(new AttributeModifier("class", getTagBoxCssClass()));
}
box.add(tagBox);
}
Aggregations