public MenuItemRenderedContent render(OutputBuffer buffer, MenuItem item)
throws RendererException {
MenuLabel label = item.getLabel();
MenuText text = label.getText();
ElementDetails elementDetails = text.getElementDetails();
Styles styles = null;
if (elementDetails != null) {
styles = elementDetails.getStyles();
}
DOMOutputBuffer outputBuffer = (DOMOutputBuffer) buffer;
Element element = outputBuffer.openElement("plain-text");
if (styles != null) {
element.setStyles(styles);
}
DOMOutputBuffer textOutputBuffer = (DOMOutputBuffer) text.getText();
outputBuffer.addOutputBuffer(textOutputBuffer);
outputBuffer.closeElement(element);
lastElement = element;
return MenuItemRenderedContent.TEXT;