logger.error("selector-rendering-error", "menu");
throw new PAPIException(exceptionLocalizer.format(
"missing-renderer-selector", "menu"));
}
MenuRenderer renderer =
rendererSelector.selectMenuRenderer(menu);
final ShortcutProperties shortcutProperties =
menu.getShortcutProperties();
if (null != shortcutProperties) {
// If the device cannot support mixed content in the body
// of a link, then update the shortcut properties so that
// span elements will not be used.
String supportsMixedContent = pageContext.
getDevicePolicyValue(DevicePolicyConstants.
X_ELEMENT_A_SUPPORTS_MIXED_CONTENT);
if (DevicePolicyConstants.NO_SUPPORT_POLICY_VALUE.equals
(supportsMixedContent)) {
shortcutProperties.setSupportsSpan(false);
}
// If the device inserts line breaks before links, then
// shortcuts must appear in the active area or the layout
// will be incorrect (regardless of the value specified in
// the styles).
String insertsLineBreaks = pageContext.getDevicePolicyValue(
DevicePolicyConstants.X_ELEMENT_A_BREAKS_LINE);
if ("before".equals(insertsLineBreaks)) {
shortcutProperties.setActive(true);
}
}
// Process the menu
renderer.render(menu);
}
} catch (BuilderException be) {
logger.error("menu-building-error", be);
throw new PAPIException(
exceptionLocalizer.format("menu-building-error"), be);