org.loom.tags.menu
Class NestedMenuDecorator

java.lang.Object
  extended by org.loom.tags.menu.AbstractMenuDecorator
      extended by 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.


Constructor Summary
NestedMenuDecorator()
           
 
Method Summary
 void afterDoTag(MenuTag tag)
           
 boolean beforeDoTag(MenuTag tag)
           
 java.lang.String calculateCss(MenuItemData item, MenuItemData selectedItem)
          Calculate the css class of this menuItem.
 boolean isRenderEmptyItems()
           
 java.lang.String renderMenuItem(MenuTag tag, MenuItemData item, MenuItemData selectedItem)
          Return the string that represents this menu item, empty if it should not be rendered
 void setRenderEmptyItems(boolean renderEmptyItems)
           
 
Methods inherited from class org.loom.tags.menu.AbstractMenuDecorator
isRenderUnauthorizedItems, setRenderUnauthorizedItems
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NestedMenuDecorator

public NestedMenuDecorator()
Method Detail

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 printed
selectedItem - 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: 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)