net.sf.navigator.menu
Class MenuComponent

java.lang.Object
  extended by net.sf.navigator.menu.MenuBase
      extended by net.sf.navigator.menu.MenuComponent
All Implemented Interfaces:
Serializable, Component

public class MenuComponent
extends MenuBase
implements Serializable, Component

This class extends MenuBase and basically contains helper methods for adding and fetching children and parents.

Version:
$Revision: 1.19 $ $Date: 2006/10/17 11:27:09 $
Author:
Scott Sayles, Matt Raible
See Also:
Serialized Form

Field Summary
protected static MenuComponent[] _menuComponent
           
protected  List menuComponents
           
protected  MenuComponent parentMenu
           
 
Fields inherited from class net.sf.navigator.menu.MenuBase
action, align, altImage, description, forward, height, image, location, module, name, onclick, onContextMenu, ondblclick, onmouseout, onmouseover, page, roles, target, title, toolTip, width
 
Constructor Summary
MenuComponent()
           
 
Method Summary
 void addMenuComponent(MenuComponent menuComponent)
           
 boolean equals(Object o)
          This method compares all attributes, except for parent and children
 String getBreadCrumb()
           
 List getComponents()
          Convenience method for Velocity templates
 MenuComponent[] getMenuComponents()
           
 int getMenuDepth()
          Get the depth of the menu
 MenuComponent getParent()
           
 boolean isLast()
          Returns the last.
 void removeChildren()
          Remove all children from a parent menu item
protected  void setBreadCrumb(String delimiter)
          Build the breadcrumb trail leading to this menuComponent
 void setLast(boolean last)
          Sets the last.
 void setMenuComponents(MenuComponent[] menuComponents)
           
 void setParent(MenuComponent parentMenu)
           
 String toString()
           
 
Methods inherited from class net.sf.navigator.menu.MenuBase
getAction, getAlign, getAltImage, getDescription, getForward, getHeight, getImage, getLocation, getModule, getName, getOnclick, getOnContextMenu, getOndblclick, getOnmouseout, getOnmouseover, getPage, getRoles, getTarget, getTitle, getToolTip, getUrl, getWidth, setAction, setAlign, setAltImage, setDescription, setForward, setHeight, setImage, setLocation, setModule, setName, setOnclick, setOnContextMenu, setOndblclick, setOnmouseout, setOnmouseover, setPage, setRoles, setTarget, setTitle, setToolTip, setUrl, setWidth
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.navigator.menu.Component
getName, setName
 

Field Detail

_menuComponent

protected static MenuComponent[] _menuComponent

menuComponents

protected List menuComponents

parentMenu

protected MenuComponent parentMenu
Constructor Detail

MenuComponent

public MenuComponent()
Method Detail

addMenuComponent

public void addMenuComponent(MenuComponent menuComponent)

getMenuComponents

public MenuComponent[] getMenuComponents()

setMenuComponents

public void setMenuComponents(MenuComponent[] menuComponents)

setParent

public void setParent(MenuComponent parentMenu)

getParent

public MenuComponent getParent()

getComponents

public List getComponents()
Convenience method for Velocity templates

Returns:
menuComponents as a java.util.List

equals

public boolean equals(Object o)
This method compares all attributes, except for parent and children

Overrides:
equals in class Object
Parameters:
o - the object to compare to

getMenuDepth

public int getMenuDepth()
Get the depth of the menu

Returns:
Depth of menu

isLast

public boolean isLast()
Returns the last.

Returns:
boolean

setLast

public void setLast(boolean last)
Sets the last.

Parameters:
last - The last to set

removeChildren

public void removeChildren()
Remove all children from a parent menu item


getBreadCrumb

public String getBreadCrumb()

setBreadCrumb

protected void setBreadCrumb(String delimiter)
Build the breadcrumb trail leading to this menuComponent

Parameters:
delimiter - type of separator

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2007 SourceForge. All Rights Reserved.