com.sapportals.htmlb

Class Tree

java.lang.Object
  extended bycom.sapportals.htmlb.Component
      extended bycom.sapportals.htmlb.Tree

public class Tree
extends Component

Title: Tree Description: Tree defines a tree Copyright: Copyright (c) 2001 Company: SAP AG


Field Summary
static int TREE_BEGIN
           
static int TREE_END
           
static String TREE_HIERARCHY
           
static String TREE_LAYOUT
           
static String UI_ID
           
 
Constructor Summary
protected Tree()
          Constructor for a Tree object.
  Tree(String name)
          Constructor for a Tree object.
  Tree(String name, String title)
          Constructor for a Tree object.
 
Method Summary
 TreeNode collapseNodeById(String id)
          Collapse the tree node, which is specified by the node id.
 void decodeTreeHierarchy(String encoded, String status)
          Decode the tree hierarchy.
 TreeNode expandNodeById(String id)
          Expand the tree node, which is specified by the node id.
 int getCurrentNodeId()
          FOR INTERNAL USE ONLY.
 String getEncodedTreeHierachy()
          Return the encoded tree hierarchy.
 String getHeight()
          gets the height of this tree
 HoverMenu getHoverMenu()
          Deprecated.  
 int getOffsetForTreeNode()
          Deprecated. Setting the node offset is not supported
 String getOnTreeClick()
          Return the name of the event handler for the "TreeClick" event.
 TreeNode getRootNode()
          Return the root node of the tree.
 ForcedTextDirection getTextDirection()
          Gets the text direction for the component
 String getTitle()
          Return the displayed title of the tree.
 String getTooltip()
           
 String getUI()
          get a identification String for the renderer that is unique across all supported components.
protected  void initFromPageContext(IPageContext pc, String baseId)
          internal use only.
 boolean isEncodeTitle()
          check if text should be encoded (default) or treated as native HTML.
 boolean isRootNodeVisible()
          Return TRUE if the root node of the tree should be visible.
 boolean rootNodeIsVisible()
          Deprecated. Return TRUE if the root node of the tree should be visible.
 void setCurrentNodeId(int nodeId)
          FOR INTERNAL USE ONLY.
 void setEncodeTitle(boolean encodeTitle)
          Sets the title encoding
 void setHeight(String height)
          sets the height of the tree
 void setOffsetForTreeNode(int offsetForTreeNode)
          Deprecated. Setting the node offset is not supported
 void setOnTreeClick(String onTreeClick)
          Set the name of the event handler for the "TreeClick" event.
 void setRootNode(TreeNode rootNode)
          Set the root node of the tree.
 void setRootNodeIsVisible(boolean rootNodeIsVisible)
          Set if the root node of the tree should be visible or not.
 void setTextDirection(ForcedTextDirection textDirection)
          Sets the text direction for the component
 void setTitle(String title)
          Set the displayed title of the tree.
 void setTooltip(String tooltip)
           
 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 com.sapportals.htmlb.Component
getEncodedIdForForm, getId, getParent, initFromShortId, initializeFromId, isJsObjectNeeded, preRender, render, renderAsString, requiresForm, setId, setJsObjectNeeded, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UI_ID

public static final String UI_ID
See Also:
Constant Field Values

TREE_BEGIN

public static final int TREE_BEGIN
See Also:
Constant Field Values

TREE_END

public static final int TREE_END
See Also:
Constant Field Values

TREE_HIERARCHY

public static final String TREE_HIERARCHY
See Also:
Constant Field Values

TREE_LAYOUT

public static final String TREE_LAYOUT
See Also:
Constant Field Values
Constructor Detail

Tree

protected Tree()
Constructor for a Tree object.


Tree

public Tree(String name)
Constructor for a Tree object.

Parameters:
name - the name of the tree. Should be unique within a single HTML document

Tree

public Tree(String name,
            String title)
Constructor for a Tree object.

Parameters:
name - the name of the tree. Should be unique within a single HTML document
title - the title of the tree
Method Detail

getUI

public String getUI()
Description copied from class: Component
get a identification String for the renderer that is unique across all supported components. E.g. you could simply return the class name of the component class. The reason for using a separate method and not some internal reflection method is that you can more easily extend the functionality or your Component class without having to rewrite the view class.

Specified by:
getUI in class Component
Returns:
a unique identification string for this Component

setTitle

public void setTitle(String title)
Set the displayed title of the tree.

Parameters:
title - the displayed title of the tree

getTitle

public String getTitle()
Return the displayed title of the tree.

Returns:
the displayed title of the tree

getTooltip

public String getTooltip()

setTooltip

public void setTooltip(String tooltip)

setRootNode

public void setRootNode(TreeNode rootNode)
Set the root node of the tree.

Parameters:
rootNode - the root node of the tree

getRootNode

public TreeNode getRootNode()
Return the root node of the tree.

Returns:
the root node of the tree

setOnTreeClick

public void setOnTreeClick(String onTreeClick)
Set the name of the event handler for the "TreeClick" event. This event is fired if the user clicks on a tree node which does not define an own "TreeNodeClick" event handler.

Parameters:
onTreeClick - the name of the event handler for the "TreeClick" event

getOnTreeClick

public String getOnTreeClick()
Return the name of the event handler for the "TreeClick" event.

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

expandNodeById

public TreeNode expandNodeById(String id)
Expand the tree node, which is specified by the node id.

Parameters:
id - the id of the tree node, which should be expanded
Returns:
the expandend tree node or NULL if there is no tree node with the specified id

collapseNodeById

public TreeNode collapseNodeById(String id)
Collapse the tree node, which is specified by the node id.

Parameters:
id - the id of the tree node, which should be collapsed
Returns:
the collapsed tree node or NULL if there is no tree node with the specified id

setRootNodeIsVisible

public void setRootNodeIsVisible(boolean rootNodeIsVisible)
Set if the root node of the tree should be visible or not.

Parameters:
rootNodeIsVisible - TRUE if the root node of the tree should be visible

rootNodeIsVisible

public boolean rootNodeIsVisible()
Deprecated. Return TRUE if the root node of the tree should be visible.

Returns:
TRUE if the root node of the tree should be visible

isRootNodeVisible

public boolean isRootNodeVisible()
Return TRUE if the root node of the tree should be visible.

Returns:
TRUE if the root node of the tree should be visible

getEncodedTreeHierachy

public String getEncodedTreeHierachy()
Return the encoded tree hierarchy.

Returns:
the encoded tree hierarchy

decodeTreeHierarchy

public void decodeTreeHierarchy(String encoded,
                                String status)
Decode the tree hierarchy.

Parameters:
encoded - the encoded tree hierarchy string.
status - state of encoded tree nodes

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

initFromPageContext

protected void initFromPageContext(IPageContext pc,
                                   String baseId)
Description copied from class: Component
internal use only. Components should override this method to analyse the parameters from the request object (via IPageContext) and set their internal data structures accordingly.

Overrides:
initFromPageContext in class Component
Parameters:
pc - the context, including the parameters
baseId - the prefix used for the component. (The result of a former RenderUtil.getIdForForm(rc, c);)

getCurrentNodeId

public int getCurrentNodeId()
FOR INTERNAL USE ONLY. This method is used by the renderer to determine the current node ids.


setCurrentNodeId

public void setCurrentNodeId(int nodeId)
FOR INTERNAL USE ONLY. This method is used by the renderer to determine the current node ids.


getOffsetForTreeNode

public int getOffsetForTreeNode()
Deprecated. Setting the node offset is not supported


setOffsetForTreeNode

public void setOffsetForTreeNode(int offsetForTreeNode)
Deprecated. Setting the node offset is not supported


getHoverMenu

public HoverMenu getHoverMenu()
Deprecated.  


getHeight

public String getHeight()
gets the height of this tree

Returns:
the height of the tree

setHeight

public void setHeight(String height)
sets the height of the tree

Parameters:
height - the height of the tree

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

isEncodeTitle

public boolean isEncodeTitle()
check if text should be encoded (default) or treated as native HTML.

Returns:
true if the text should be encoded, else false

setEncodeTitle

public void setEncodeTitle(boolean encodeTitle)
Sets the title encoding

Parameters:
encodeTitle - true to enable title encoding (default)


Copyright 2006 SAP AG Complete Copyright Notice