public MenuItemRenderedContent render(OutputBuffer buffer, MenuItem item)
throws RendererException {
MenuLabel label = item.getLabel();
MenuIcon icon = label.getIcon();
ElementDetails elementDetails = icon.getElementDetails();
Styles styles = null;
if (elementDetails != null ) {
styles = elementDetails.getStyles();
}
DOMOutputBuffer outputBuffer = (DOMOutputBuffer) buffer;
Element element = outputBuffer.addElement("rollover-image");
if (styles != null) {
element.setStyles(styles);
}
String altText = getAltText(item);
if (altText != null) {
element.setAttribute("alt", altText);
}
try {
String url;
url = icon.getNormalURL().getURL();
element.setAttribute("normal", url);
url = icon.getOverURL().getURL();
element.setAttribute("over", url);
} catch (AssetReferenceException e) {
throw new RendererException(e);
}