// show link...
markupContainer.add(link);
link.add(label);
if(this.description != null) {
label.add(new AttributeModifier("title", Model.of(description)));
}
if(this.blobOrClob) {
link.add(new CssClassAppender("noVeil"));
}
if(this.prototype) {
link.add(new CssClassAppender("btn-warning"));
} else {
link.add(new CssClassAppender("btn-default"));
}
if(this.cssClass != null) {
link.add(new CssClassAppender(this.cssClass));
}
link.add(new CssClassAppender(this.actionIdentifier));
String cssClassFa = getCssClassFa();
if (Strings.isNullOrEmpty(cssClassFa)) {
Components.permanentlyHide(link, "menuLinkFontAwesome");
} else {
Label dummy = new Label("menuLinkFontAwesome", "");
dummy.add(new CssClassAppender(cssClassFa));
link.add(dummy);
}
// .. and hide label
Components.permanentlyHide(markupContainer, CssMenuItem.ID_MENU_LABEL);
return link;
} else {
// hide link...
Components.permanentlyHide(markupContainer, ID_MENU_LINK);
// ... and show label, along with disabled reason
label.add(new AttributeModifier("title", Model.of(this.getDisabledReason())));
label.add(new AttributeModifier("class", Model.of("disabled")));
markupContainer.add(label);
return label;
}