this.visibleIf = visibleIf;
}
@Override
protected Layout getLayout(Object object, Class type) {
final Layout layout = super.getLayout(object, type);
return new Layout() {
@Override
public HtmlComponent createComponent(Object object, Class type) {
Boolean visible = Boolean.FALSE;
try {
visible = (Boolean) RendererPropertyUtils.getProperty(getTargetObject(object), getVisibleIf(), false);
} catch (ClassCastException e) {
logger.error(e.getMessage(), e);
}
if (visible) {
return layout.createComponent(object, type);
} else {
String text = getText();
return (text != null) ? new HtmlText(text) : renderValue(object,
RenderKit.getInstance().findSchema(getSubSchema()), getSubLayout());
}