net.sourceforge.tapestry_jsmenu.api
Interface IJSCookMenuItem

All Known Implementing Classes:
BasicJSCookMenuItem

public interface IJSCookMenuItem

IJSCookMenuItem is the base unit for the menu item model being used by the JSCookMenu component to render the menu.

Note that there is no method in this interface giving some value to be displayed in the content field of the menu item since that information and its corresponding binding to HTML-rendering components is application specific. The BasicJSCookMenuItem implementation of this interface adds some convenience constructors and a getValue() method that might be used in ognl bindings

Author:
Burkhard Eggers
See Also:
BasicJSCookMenuItem

Field Summary
static IJSCookMenuItem MENU_SEPARATOR
          static instance, representing a separator.
 
Method Summary
 java.lang.Iterable<IJSCookMenuItem> getChildren()
          If this item has a submenu, this method retrieves the child items.
 IAsset getIconAsset()
          The default behaviour of icon displaying calls this method to retrieve the items icon.
 IAsset getIconHoverAsset()
          The default behaviour of icon displaying calls this method to retrieve the items mouse-over icon.
 boolean isSeparator()
          When the item is a menu separator, all other methods of this interface are ignored and a separator is displayed.
 

Field Detail

MENU_SEPARATOR

static final IJSCookMenuItem MENU_SEPARATOR
static instance, representing a separator. You can use this to add a separator to your menu.

Method Detail

getChildren

java.lang.Iterable<IJSCookMenuItem> getChildren()
If this item has a submenu, this method retrieves the child items.

Returns:
the list of child items. null and an empty List are both interpreted as no submenu.

isSeparator

boolean isSeparator()
When the item is a menu separator, all other methods of this interface are ignored and a separator is displayed. There is a static

Returns:
true if the item is just a menu separator, false if it is a normal menu item

getIconAsset

IAsset getIconAsset()
The default behaviour of icon displaying calls this method to retrieve the items icon. If a different iconRenderer is specified for the menu this method is never called unless called explicitely in the applications ognl or java code.

Returns:
the asset being displayed when the mouse is not over the item

getIconHoverAsset

IAsset getIconHoverAsset()
The default behaviour of icon displaying calls this method to retrieve the items mouse-over icon. If a different iconRenderer is specified for the menu this method is never called unless called explicitely in the applications ognl or java code.

Returns:
the asset being displayed when the mouse is not over the item