com.buglabs.menu
Interface IMenuNode

All Known Implementing Classes:
AbstractMenuNode, FolderMenuNode, MenuAccessAdapter, MenuAdapter, MenuAdapter, MenuAdapter, MenuAdapter

public interface IMenuNode

The Bug menu is a tree structure. This class represents the model interface for the menu. A menu node can be either a container (non executing) or a leaf (executing).

Author:
ken

Method Summary
 void execute()
          If menu node is a leaf, the user has selected this node for execution.
 java.util.List getChildren()
           
 IMenuNode getFirstParentOfType(java.lang.String type)
          Iterate through ancestors until one of specified type is found.
 java.lang.String getName()
          Name property used in the UI.
 IMenuNode getNextSibling()
           
 IMenuNode getParent()
           
 IMenuNode getPreviousSibling()
           
 boolean hasChildren()
           
 void setName(java.lang.String name)
          Sets the name property used in the UI.
 IMenuNode setParent(IMenuNode parent)
           
 

Method Detail

getParent

IMenuNode getParent()

setParent

IMenuNode setParent(IMenuNode parent)

getChildren

java.util.List getChildren()
Returns:
All children for this node as an ordered list.

hasChildren

boolean hasChildren()
Returns:
true if number of children greater than 0.

getFirstParentOfType

IMenuNode getFirstParentOfType(java.lang.String type)
Iterate through ancestors until one of specified type is found. NULL if none found.

Parameters:
type -
Returns:

execute

void execute()
             throws java.lang.Exception
If menu node is a leaf, the user has selected this node for execution. Specific logic should be implemented here.

Parameters:
display -
Throws:
java.lang.Exception

getNextSibling

IMenuNode getNextSibling()
Returns:
next IMenuNode in tree that is current (list index + 1) in same level.

getPreviousSibling

IMenuNode getPreviousSibling()
Returns:
previous IMenuNode in tree that is current (list index - 1) in same level.

getName

java.lang.String getName()
Name property used in the UI.

Returns:

setName

void setName(java.lang.String name)
Sets the name property used in the UI. Not unique.

Parameters:
name -