com.ibm.wps.portlet.menu
Interface MenuTree
Deprecated. since 6.0. Support of the IBM portlet API may be removed in a future
release of WebSphere Portal. Use of the Java Portlet API (javax.portlet)
is recommended instead.
public interface MenuTree
MenuTree provides information about the portlet specific entries to the portal navigation.
The MenuProvider interface may directly be exposed by a portlet and is used to query a portlet
specific MenuTree.
The tree model MenuTree provides methods to get information about the tree topology,
i.e.:
- To get the root node of the tree model
- To check whether a node has children or not
- To get all the child nodes of a parent node
It is important to note that the MenuTree only describes the logical topology of the
menu. It does not necessarily need to be backed by an in-memory implementation but may also be
generated on-the-fly.
However, the implementor of a MenuTree needs to guarantee that the individual MenuNodes that
logically represent the same item in the menu structure be represented by the same JAVA object.
A MenuTree provides read-only operations to the topology only. Some implementations however
may support a dynamic modification of the menu. In such cases the implementor of the MenuTree
may implement special controller interfaces together with the MenuTree interface. Currently
portlet menus define the following generic controller interfaces: MenuTreeInfoCtrl,
MenuTreeInfoCopyCtrl, MenuTreeTopologyCtrl. Controller interfaces are optional interfaces.
- Since:
- 5.0
- Note:
This interface is designed to be implemented by clients. |
Method Summary |
java.util.Iterator
| getChildren(MenuNode menuNode)
Deprecated. Returns an iterator over all children of the specified menu node.
|
MenuNode
| getRoot()
Deprecated. Returns the root node of this tree.
|
boolean
| hasChildren(MenuNode menuNode)
Deprecated. Returns true if the specified menu node has children.
|
getRoot
MenuNode getRoot()
throws MenuTreeException
- Deprecated.
- Returns the root node of this tree. Eeach tree must contain exactly one root node
that is not null.
- Returns:
- the root node
- Throws:
- MenuTreeException - if operation fails
hasChildren
boolean hasChildren(MenuNode menuNode)
- Deprecated.
- Returns true if the specified menu node has children. This method can be used to
quickly evaluate the existence of children.
- Parameters:
- menuNode - menu node which can have children
- Returns:
- true if specified menu node has children
getChildren
java.util.Iterator getChildren(MenuNode menuNode)
throws MenuTreeException
- Deprecated.
- Returns an iterator over all children of the specified menu node. Each object
returned by the iterator is guaranteed to implement at least the MenuNode interface.
If the specific node does not have any children, the implementor of MenuTree is
free to either retun null or an empty iterator. It is recommended to use the hasChildren(com.ibm.wps.portlet.menu.MenuNode)
method to evaluate the existence of children before calling this method.
- Parameters:
- menuNode - menu node which can have children
- Returns:
- iterator over MenuNodes or null
- Throws:
- MenuTreeException - if operation fails or the
menuNode
is not part of the current tree topology