com.sapportals.htmlb

Class TreeNode

java.lang.Object
  extended bycom.sapportals.htmlb.TreeNode

public class TreeNode
extends Object

Title: TreeNode Description: TreeNode defines a tree node

Copyright 2004 SAP AG


Constructor Summary
TreeNode(String id)
          A constructor of a TreeNode object.
TreeNode(String id, String text)
          A constructor of a TreeNode object.
TreeNode(String id, String text, TreeNode parent)
          A constructor of a TreeNode object.
TreeNode(String id, String text, TreeNode parent, boolean isOpen)
          A constructor of a TreeNode object.
 
Method Summary
 void addChildNode(TreeNode node)
          Add a tree node to the list of child nodes.
 int collectNodeStatusString(int nodeIndex, StringBuffer status)
           
 void encodeTreeNode(IHtmlbEncoder encoder)
          Return the encoded tree node (including the tree node itself and all childs.
 Enumeration getChildNodes()
          Return a enumeration of all childs of the tree node.
 Component getComponent()
          Return the component which should be displayed as tree node content.
 Object getContent()
          Return the displayed tree node content.
 HoverMenu getHoverMenu()
          returns the hover menu for this tree node
 String getID()
          Return the id of the tree node.
 TreeNode getNodeByID(String id)
          Return the tree node with the specified id.
 String getNodeStatus()
          Return the node status
 String getOnNodeClick()
          Return the name of the event handler for the "NodeClick" event.
 String getOnNodeClose()
          Set the name of the event handler of the "NodeExpand" event.
 String getOnNodeExpand()
          Set the name of the event handler of the "NodeExpand" event.
 TreeNode getParentNode()
          Return the parent tree node or NULL if the tree node is a root node.
 String getText()
          Return the displayed text of the tree node.
 ForcedTextDirection getTextDirection()
          Gets the text direction for the component
 String getTooltip()
          gets the Tooltip for this TreeNode.
 Tree getTree()
           
 boolean hasChildren()
          Return TRUE if the tree node has any childs.
 boolean hasChilds()
          Deprecated. Return TRUE if the tree node has any childs.
 boolean isEncode()
           
 boolean isOpen()
          Return TRUE if the tree node should be displayed as open node.
 boolean isShowExpander()
           
 void removeAllChildren()
          remove all children from the node
 void removeAllChilren()
          Deprecated. Use
 void removeChildNode(TreeNode node)
          remode a node from the list of child nodes
 void setComponent(Component component)
          Set the component which should be displayed as tree node content.
 void setEncode(boolean encode)
           
 void setHoverMenu(HoverMenu hoverMenu)
          sets the hover menu for this tree node
 void setID(String id)
          Set the id of the tree node.
 void setOnNodeClick(String onNodeClick)
          Set the name of the event handler of the "NodeClick" event.
 void setOnNodeClose(String onNodeClose)
          Return the name of the event handler for the "NodeExpand" event.
 void setOnNodeExpand(String onNodeExpand)
          Return the name of the event handler for the "NodeExpand" event.
 void setOpen(boolean isOpen)
          Set the tree node to open or to closed.
 void setParentNode(TreeNode parent)
          Set the parent node.
 void setShowExpander(boolean showExpander)
           
 void setText(String text)
          Set the displayes text of the tree node.
 void setTextDirection(ForcedTextDirection textDirection)
          Sets the text direction for the component
 void setTooltip(String tooltip)
          sets the Tooltip for this TreeNode.
 void setTree(Tree tree)
           
 void updateNodeStatus(Tree tree)
          Update the status of the node (and the whole sub tree) as defined in the specified tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeNode

public TreeNode(String id)
A constructor of a TreeNode object.

Parameters:
id - the node id. This should be unique for a tree.

TreeNode

public TreeNode(String id,
                String text)
A constructor of a TreeNode object.

Parameters:
id - the node id. This should be unique for a tree.
text - the displayed node text.

TreeNode

public TreeNode(String id,
                String text,
                TreeNode parent)
A constructor of a TreeNode object.

Parameters:
id - the node id. This should be unique for a tree.
text - the displayed node text.
parent - the parent tree node

TreeNode

public TreeNode(String id,
                String text,
                TreeNode parent,
                boolean isOpen)
A constructor of a TreeNode object.

Parameters:
id - the node id. This should be unique for a tree.
text - the displayed node text.
parent - the parent tree node
isOpen - TRUE if the tree node should be displayed open
Method Detail

setID

public void setID(String id)
Set the id of the tree node. This id should be unique in the tree.

Parameters:
id - the id of the tree node.

getID

public String getID()
Return the id of the tree node.

Returns:
the id of the tree node

setText

public void setText(String text)
Set the displayes text of the tree node.

Parameters:
text - the displayed text of the tree node

getText

public String getText()
Return the displayed text of the tree node.

Returns:
the displayed text of the tree node

setComponent

public void setComponent(Component component)
Set the component which should be displayed as tree node content.

Parameters:
component - the component

getComponent

public Component getComponent()
Return the component which should be displayed as tree node content.

Returns:
the defined component

getContent

public Object getContent()
Return the displayed tree node content.

Returns:
the tree node content

addChildNode

public void addChildNode(TreeNode node)
Add a tree node to the list of child nodes.

Parameters:
node - the new child node

removeChildNode

public void removeChildNode(TreeNode node)
remode a node from the list of child nodes


removeAllChilren

public void removeAllChilren()
Deprecated. Use

remove all children from the node


removeAllChildren

public void removeAllChildren()
remove all children from the node


getChildNodes

public Enumeration getChildNodes()
Return a enumeration of all childs of the tree node.

Returns:
the enumeration of all childs of the tree node

getParentNode

public TreeNode getParentNode()
Return the parent tree node or NULL if the tree node is a root node.

Returns:
the parent tree node.

setParentNode

public void setParentNode(TreeNode parent)
Set the parent node.

Parameters:
parent - the parent node

getTooltip

public String getTooltip()
gets the Tooltip for this TreeNode. Tooltips can not contain HTML coding.

Returns:
the tooltip text

setTooltip

public void setTooltip(String tooltip)
sets the Tooltip for this TreeNode. Tooltips can not contain HTML coding.

Parameters:
tooltip - the tooltip text

setOpen

public void setOpen(boolean isOpen)
Set the tree node to open or to closed.

Parameters:
isOpen - TRUE if the tree node sould be displayed as open node

isOpen

public boolean isOpen()
Return TRUE if the tree node should be displayed as open node.

Returns:
TRUE if the tree node should be displayes as open node

hasChilds

public boolean hasChilds()
Deprecated. Return TRUE if the tree node has any childs.

Returns:
TRUE if the tree node has any childs

hasChildren

public boolean hasChildren()
Return TRUE if the tree node has any childs.

Returns:
TRUE if the tree node has any childs

setOnNodeClick

public void setOnNodeClick(String onNodeClick)
Set the name of the event handler of the "NodeClick" event. This event is fired if the user clicks on this tree node.

Parameters:
onNodeClick - the name of the event handler of the "NodeClick" event

getOnNodeClick

public String getOnNodeClick()
Return the name of the event handler for the "NodeClick" event.

Returns:
the name of the event handler for the "NodeClick" event

getOnNodeExpand

public String getOnNodeExpand()
Set the name of the event handler of the "NodeExpand" event. This event is fired if the user clicks on this tree node.

Returns:
the name of the event handler of the "NodeExpand" event

setOnNodeExpand

public void setOnNodeExpand(String onNodeExpand)
Return the name of the event handler for the "NodeExpand" event.

Parameters:
onNodeExpand - the name of the event handler for the "NodeExpand" event

getOnNodeClose

public String getOnNodeClose()
Set the name of the event handler of the "NodeExpand" event. This event is fired if the user clicks on this tree node.

Returns:
the name of the event handler of the "NodeExpand" event

setOnNodeClose

public void setOnNodeClose(String onNodeClose)
Return the name of the event handler for the "NodeExpand" event.

Parameters:
onNodeClose - the name of the event handler for the "NodeExpand" event

getNodeByID

public TreeNode getNodeByID(String id)
Return the tree node with the specified id. It is searched in the whole (sub) tree, which is defined by the tree node.

Returns:
the requested tree node or NULL if there is no such tree node with the specified id

encodeTreeNode

public void encodeTreeNode(IHtmlbEncoder encoder)
                    throws IOException
Return the encoded tree node (including the tree node itself and all childs.

Parameters:
encoder - the encoder to use
Throws:
IOException

updateNodeStatus

public void updateNodeStatus(Tree tree)
Update the status of the node (and the whole sub tree) as defined in the specified tree.

Parameters:
tree - the tree

getNodeStatus

public String getNodeStatus()
Return the node status

Returns:
the node status

collectNodeStatusString

public int collectNodeStatusString(int nodeIndex,
                                   StringBuffer status)

getHoverMenu

public HoverMenu getHoverMenu()
returns the hover menu for this tree node


setHoverMenu

public void setHoverMenu(HoverMenu hoverMenu)
sets the hover menu for this tree node


getTree

public Tree getTree()

setTree

public void setTree(Tree tree)

isEncode

public boolean isEncode()

setEncode

public void setEncode(boolean encode)

isShowExpander

public boolean isShowExpander()

setShowExpander

public void setShowExpander(boolean showExpander)

getTextDirection

public ForcedTextDirection getTextDirection()
Gets the text direction for the component

Returns:
com.sapportals.htmlb.enum.ForcedTextDirection

setTextDirection

public void setTextDirection(ForcedTextDirection textDirection)
Sets the text direction for the component

Parameters:
textDirection - com.sapportals.htmlb.enum.ForcedTextDirection


Copyright 2006 SAP AG Complete Copyright Notice