@SuppressWarnings("unchecked")
@Override
public int doStartTag() throws JspException
{
// Tabel cell tag
HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
HtmlWriter w = new HtmlWriter(pageContext.getOut());
HtmlTag menu = w.startTag(dic.MenuTag());
addStandardAttributes(menu, null);
menu.beginBody(true);
// Create Menu Item Info
MenuInfo mi = new MenuInfo();
// Get Stack
Stack<MenuInfo> stack = (Stack<MenuInfo>)pageContext.getAttribute(MENU_STACK_ATTRIBUTE);
if (stack!=null)
{ // Nested Menu's
MenuInfo parent = stack.peek();
mi.currentId = getString( currentItem, parent.currentId );
mi.currentClass = getString (currentClass, parent.currentClass);
mi.enabledClass = getString (enabledClass, parent.enabledClass);
mi.disabledClass = getString (disabledClass, parent.disabledClass);
mi.expandedClass = getString (expandedClass, parent.expandedClass);
mi.actionItem = getString (actionItem, parent.actionItem);
}
else
{ // A new Menu
stack = new Stack<MenuInfo>();
pageContext.setAttribute(MENU_STACK_ATTRIBUTE, stack);
// Init Menu Info
mi.currentId = getString( currentItem, null );
mi.currentClass = getString (currentClass, dic.MenuItemCurrentClass());
mi.enabledClass = getString (enabledClass, dic.MenuItemLinkClass());
mi.disabledClass = getString (disabledClass, dic.MenuItemDisabledClass());
mi.expandedClass = getString (expandedClass, dic.MenuItemExpandedClass());
mi.actionItem = getString (actionItem, null);
}
// Add to Stack
stack.push(mi);
// boolean usesBody = true;