throws PAPIException {
MarinerPageContext pageContext =
ContextInternals.getMarinerPageContext(context);
MenuAttributes attributes = (MenuAttributes) blockAttributes;
// Get hold of the menu builder - this will be initialised if needed
MenuModelBuilder builder = pageContext.getMenuBuilder();
try {
// Starting a new menu
builder.startMenu();
// Setting attributes on the menu
// Set the pane attribute
MenuInternals.setPane(builder, attributes.getPane(), pageContext);
// Get the styling property values for the current element
Styles styles = pageContext.getStylingEngine().getStyles();
// Emulate deprecated menu styles if necessary
useDeprecatedMenuTypes(styles, attributes.getType());
// Store the propertyvalues for any child use
menuProperties = styles.getPropertyValues();
// Set the stylistic information in the model for this element.
MenuInternals.setElementDetails(builder, attributes, styles);
// Set the event handling
MenuInternals.setEvents(builder, attributes, pageContext);
PolicyReferenceResolver resolver =
pageContext.getPolicyReferenceResolver();
// Set the prompt
builder.setPrompt(resolver.resolveQuotedTextExpression(
attributes.getPrompt()));
// Set the error message
builder.setErrorMessage(resolver.resolveQuotedTextExpression(
attributes.getErrmsg()));
// Set the help
builder.setHelp(resolver.resolveQuotedTextExpression(
attributes.getHelp()));
// Set the title
builder.setTitle(attributes.getTitle());
// Set the Shortcut properties.
setShortcutPropertiesOnBuilder(pageContext, builder, styles);
// Push this element