You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ba...@apache.org on 2005/11/21 09:31:11 UTC
svn commit: r345866 -
/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/NavigationMenuItem.java
Author: baranda
Date: Mon Nov 21 00:31:05 2005
New Revision: 345866
URL: http://svn.apache.org/viewcvs?rev=345866&view=rev
Log:
Applied documentation patch for MYFACES-835. Thanks to Simon Kitching
Modified:
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/NavigationMenuItem.java
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/NavigationMenuItem.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/NavigationMenuItem.java?rev=345866&r1=345865&r2=345866&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/NavigationMenuItem.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/NavigationMenuItem.java Mon Nov 21 00:31:05 2005
@@ -21,6 +21,7 @@
import java.util.ArrayList;
/**
+ * A node in a tree of menu items.<br>
* @author Thomas Spiegl (latest modification by $Author$)
* @version $Revision$ $Date$
*/
@@ -116,6 +117,11 @@
_icon = icon;
}
+ /**
+ * Relevant only for types of menus which can leave a menu in an "expanded"
+ * state across requests. Returns true if the menu is currently open
+ * (displaying its child items).
+ */
public boolean isOpen()
{
return _open;
@@ -146,25 +152,44 @@
_actionListener = actionListener;
}
+ /**
+ * Get the array of child nodes of this menu item. If this node has
+ * no children then an empty array is returned. The array is a copy
+ * of the internal data of this object, so changes to the array will
+ * not affect the state of this object. The members of the array
+ * are the actual children of this object, however (the copy is not
+ * a "deep clone").
+ */
public NavigationMenuItem[] getNavigationMenuItems()
{
if (_navigationMenuItems == null)
{
return new NavigationMenuItem[0];
}
- return (NavigationMenuItem[]) _navigationMenuItems.toArray(new NavigationMenuItem[_navigationMenuItems.size()]);
+ return (NavigationMenuItem[]) _navigationMenuItems.toArray(
+ new NavigationMenuItem[_navigationMenuItems.size()]);
}
+ /** Set the child nodes of this menu item. */
public void setNavigationMenuItems(NavigationMenuItem[] navigationMenuItems)
{
_navigationMenuItems = Arrays.asList(navigationMenuItems);
}
+ /** Set the child nodes of this menu item. */
public void setNavigationMenuItems(List list)
{
_navigationMenuItems = list;
}
+ /**
+ * Add another node to the end of the list of child nodes of
+ * this menu item.
+ * <p>
+ * Note that if setNavigationMenuItems(array) was called previously,
+ * then this method will throw an exception as the child list will
+ * be of fixed length.
+ */
public void add(NavigationMenuItem navigationMenuItem)
{
if (_navigationMenuItems == null)