org.loom.tags.menu
Class NestedMenuDecorator
java.lang.Object
org.loom.tags.menu.AbstractMenuDecorator
org.loom.tags.menu.NestedMenuDecorator
- All Implemented Interfaces:
- TagDecorator<MenuTag>
public class NestedMenuDecorator
- extends AbstractMenuDecorator
Decorates menu items as a list (ul) of nested menu items and submenus.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NestedMenuDecorator
public NestedMenuDecorator()
beforeDoTag
public boolean beforeDoTag(MenuTag tag)
throws java.io.IOException,
javax.servlet.jsp.JspException
- Returns:
- true to execute the tag afterwards, false to skip the tag. If false,
the afterDoTag method will not be triggered.
- Throws:
java.io.IOException
javax.servlet.jsp.JspException
afterDoTag
public void afterDoTag(MenuTag tag)
throws java.io.IOException,
javax.servlet.jsp.JspException
- Throws:
java.io.IOException
javax.servlet.jsp.JspException
renderMenuItem
public java.lang.String renderMenuItem(MenuTag tag,
MenuItemData item,
MenuItemData selectedItem)
throws java.io.IOException,
javax.servlet.jsp.JspException
- Return the string that represents this menu item, empty if it should not be rendered
- Parameters:
item - the current item being printedselectedItem - the currently selected item in this menu
- Throws:
java.io.IOException
javax.servlet.jsp.JspException
calculateCss
public java.lang.String calculateCss(MenuItemData item,
MenuItemData selectedItem)
- Calculate the css class of this menuItem.
This method adds the following css classes:
selected if this is the currently selected item
submenu if this menu item has a nested submenu below
All menuItem classes are also expanded because of accessibility: in a world
without javascript, all menu items should be displayed expanded, so we
collapse the unselected items using javascript instead of the other way.
isRenderEmptyItems
public boolean isRenderEmptyItems()
setRenderEmptyItems
public void setRenderEmptyItems(boolean renderEmptyItems)