com.ibm.commerce.tools.common.ui

Class DynamicTreeNode

  • java.lang.Object
    • com.ibm.commerce.tools.common.ui.DynamicTreeNode


  • public class DynamicTreeNode
    extends java.lang.Object
    Creates a node to be displayed on the dynamic tree on a client browser.

    The Dynamic Tree is similar to the Windows Explorer tree. Each node on the tree is created using a DynamicTreeNode. This contains all the data required by the client browser to render a node on the tree. This object is converted to a JavaScript object once created in your DynamicTreeUserDataBean and returned to the client browser.

    The tree can be pre-cached to any number of levels by attaching children to a node.

    Each node can either supply its own menu in contextMenu or a menuType, in which case a corresponding DynamicTreeMenuType object must be created.

    Each node may also have icons associated with it, which will be displayed to the left of the node name on the client browser. This is done be setting the iconType and creating a corresponding DynamicTreeIconType object.

    Each node can set a value assigned to it, which is different from the name which is displayed on the client browser. This is typically set to a database ID value or some other unique identifier to be used by your commands or buttons from another frame.

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      DynamicTreeNode()
      Default constructor creates a new DynamicTreeNode.
      DynamicTreeNode(java.lang.String name, java.lang.String childrenUrlParam, java.lang.String[][] menu)
      Creates a new DynamicTreeNode.
      DynamicTreeNode(java.lang.String name, java.lang.String childrenUrlParams, java.lang.String[][] menu, java.lang.String contextMenuParams)
      Creates a new DynamicTreeNode.
      DynamicTreeNode(java.lang.String name, java.lang.String para, java.lang.String[][] menu, java.lang.String contextMenuParams, java.util.Vector children)
      Creates a new DynamicTreeNode.
      DynamicTreeNode(java.lang.String name, java.lang.String para, java.lang.String[][] menu, java.util.Vector children)
      Creates a new DynamicTreeNode.
      DynamicTreeNode(java.lang.String name, java.lang.String value, java.lang.String para, java.lang.String[][] menu)
      Creates a new DynamicTreeNode.
      DynamicTreeNode(java.lang.String name, java.lang.String value, java.lang.String para, java.lang.String[][] menu, java.lang.String contextMenuParams, java.util.Vector children)
      Creates a new DynamicTreeNode.
      DynamicTreeNode(java.lang.String name, java.lang.String value, java.lang.String para, java.lang.String[][] menu, java.util.Vector children)
      Creates a new DynamicTreeNode.
      DynamicTreeNode(java.lang.String name, java.lang.String value, java.lang.String para, java.lang.String contextMenuParams, java.lang.String menuType)
      Creates a new DynamicTreeNode.
      DynamicTreeNode(java.lang.String name, java.lang.String value, java.lang.String childrenUrlParams, java.lang.String menuType, java.util.Vector children)
      Creates a new DynamicTreeNode.
      DynamicTreeNode(java.lang.String name, java.lang.String childrenUrlParams, java.lang.String menuType, java.util.Vector children)
      Creates a new DynamicTreeNode.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String[][] copyStringArray(java.lang.String[][] str)
      Copies an array of String arrays into a new array of String arrays.
      java.util.Vector getChildren()
      Returns the children of this DynamicTreeNode.
      java.lang.String getChildrenUrlParam()
      Returns the childrenUrlParam field value.
      java.lang.String[][] getContextMenu()
      Returns the context menu.
      java.lang.String getContextMenuParams()
      Returns the context menu parameters which are passed with all menu item actions.
      java.lang.String[] getIconType()
      Returns the iconType value.
      java.lang.String getMenuType()
      Returns the menuType value.
      java.lang.String getName()
      Returns the name of this DynamicTreeNode.
      java.lang.String getValue()
      Returns the value of this DynamicTreeNode
      void nodeToJS(java.lang.String nodeName, java.lang.StringBuffer sb, int i, DynamicTreeNode child)
      Converts DynamicTreeNode to JavaScript.
      void setChildren(java.util.Vector newChildren)
      Sets the children of this DynamicTreeNode.
      void setChildrenUrlParam(java.lang.String newChildrenUrlParam)
      Sets the childrenUrlParam field value.
      void setContextMenu(java.lang.String[][] newContextMenu)
      Sets the context menu.
      void setContextMenuParams(java.lang.String newContextMenuParams)
      Sets the context menu parameters which are passed with all menu item actions.
      void setIconType(java.lang.String[] newIconType)
      Sets the iconType value.
      void setMenuType(java.lang.String newMenuType)
      Sets the menuType value.
      void setName(java.lang.String newName)
      Sets the name of this DynamicTreeNode.
      void setValue(java.lang.String newValue)
      Sets the value of this DynamicTreeNode
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DynamicTreeNode

        public DynamicTreeNode()
        Default constructor creates a new DynamicTreeNode.
      • DynamicTreeNode

        public DynamicTreeNode(java.lang.String name,
                               java.lang.String childrenUrlParam,
                               java.lang.String[][] menu)
        Creates a new DynamicTreeNode.
        Parameters:
        name - The name of the DynamicTreeNode that will be displayed to the user.
        childrenUrlParam - The value to be used to fetch the children of this node.
        menu - The context menu array.
      • DynamicTreeNode

        public DynamicTreeNode(java.lang.String name,
                               java.lang.String childrenUrlParams,
                               java.lang.String[][] menu,
                               java.lang.String contextMenuParams)
        Creates a new DynamicTreeNode.
        Parameters:
        name - The name of the DynamicTreeNode that will be displayed to the user.
        childrenUrlParam - The value to be used to fetch the children of this node.
        menu - The context menu array.
        contextMenuParams - Parameters to be appended to all context menu actions calls.
      • DynamicTreeNode

        public DynamicTreeNode(java.lang.String name,
                               java.lang.String para,
                               java.lang.String[][] menu,
                               java.lang.String contextMenuParams,
                               java.util.Vector children)
        Creates a new DynamicTreeNode.
        Parameters:
        name - The name of the DynamicTreeNode that will be displayed to the user.
        para - The value to be used to fetch the children of this node.
        menu - The context menu array.
        contextMenuParams - Parameters to be appended to all context menu actions calls.
        children - Contains embedded children of this node.
      • DynamicTreeNode

        public DynamicTreeNode(java.lang.String name,
                               java.lang.String para,
                               java.lang.String[][] menu,
                               java.util.Vector children)
        Creates a new DynamicTreeNode.
        Parameters:
        name - The name of the DynamicTreeNode that will be displayed to the user.
        para - The value to be used to fetch the children of this node.
        menu - The context menu array.
        children - Contains embedded children of this node.
      • DynamicTreeNode

        public DynamicTreeNode(java.lang.String name,
                               java.lang.String value,
                               java.lang.String para,
                               java.lang.String[][] menu)
        Creates a new DynamicTreeNode.
        Parameters:
        name - The name of the DynamicTreeNode that will be displayed to the user.
        value - The value of this DynamicTreeNode.
        para - The value to be used to fetch the children of this node.
        menu - The context menu array.
      • DynamicTreeNode

        public DynamicTreeNode(java.lang.String name,
                               java.lang.String value,
                               java.lang.String para,
                               java.lang.String[][] menu,
                               java.lang.String contextMenuParams,
                               java.util.Vector children)
        Creates a new DynamicTreeNode.
        Parameters:
        name - The name of the DynamicTreeNode that will be displayed to the user.
        value - The value of this DynamicTreeNode.
        para - The value to be used to fetch the children of this node.
        menu - The context menu array.
        contextMenuParams - Parameters to be appended to all context menu actions calls.
        children - Contains embedded children of this node.
      • DynamicTreeNode

        public DynamicTreeNode(java.lang.String name,
                               java.lang.String value,
                               java.lang.String para,
                               java.lang.String[][] menu,
                               java.util.Vector children)
        Creates a new DynamicTreeNode.
        Parameters:
        name - The name of the DynamicTreeNode that will be displayed to the user.
        value - The value of this DynamicTreeNode.
        para - The value to be used to fetch the children of this node.
        menu - The context menu array.
        children - Contains embedded children of this node.
      • DynamicTreeNode

        public DynamicTreeNode(java.lang.String name,
                               java.lang.String value,
                               java.lang.String para,
                               java.lang.String contextMenuParams,
                               java.lang.String menuType)
        Creates a new DynamicTreeNode.
        Parameters:
        name - The name of the DynamicTreeNode that will be displayed to the user.
        value - The value of this DynamicTreeNode.
        para - The value to be used to fetch the children of this node.
        contextMenuParams - Parameters to be appended to all context menu actions calls.
        menuType - The name of the corresponding DynamicTreeMenuType.
      • DynamicTreeNode

        public DynamicTreeNode(java.lang.String name,
                               java.lang.String value,
                               java.lang.String childrenUrlParams,
                               java.lang.String menuType,
                               java.util.Vector children)
        Creates a new DynamicTreeNode.
        Parameters:
        name - The name of the DynamicTreeNode that will be displayed to the user.
        value - The value of this DynamicTreeNode.
        childrenUrlParam - The value to be used to fetch the children of this node.
        menuType - The name of the corresponding DynamicTreeMenuType.
        children - Contains embedded children of this node.
      • DynamicTreeNode

        public DynamicTreeNode(java.lang.String name,
                               java.lang.String childrenUrlParams,
                               java.lang.String menuType,
                               java.util.Vector children)
        Creates a new DynamicTreeNode.
        Parameters:
        name - The name of the DynamicTreeNode that will be displayed to the user.
        childrenUrlParam - The value to be used to fetch the children of this node.
        menuType - The name of the corresponding DynamicTreeMenuType.
        children - Contains embedded children of this node.
    • Method Detail

      • copyStringArray

        public java.lang.String[][] copyStringArray(java.lang.String[][] str)
        Copies an array of String arrays into a new array of String arrays.

        Typically used by the constructor to create new Strings for the array of String arrays referenced as a parameter. argument to create a fresh copy of the Strings.

        Parameters:
        str - The array of String arrays.
        Returns:
        The newly created array of String arrays.
      • getChildren

        public java.util.Vector getChildren()
        Returns the children of this DynamicTreeNode.
        Returns:
        The Vector of embedded children.
      • getChildrenUrlParam

        public java.lang.String getChildrenUrlParam()
        Returns the childrenUrlParam field value.
        Returns:
        The childrenUrlParam field value.
      • getContextMenu

        public java.lang.String[][] getContextMenu()
        Returns the context menu.
        Returns:
        The context menu array of String arrays.
      • getContextMenuParams

        public java.lang.String getContextMenuParams()
        Returns the context menu parameters which are passed with all menu item actions.
        Returns:
        the contextMenuParams field value.
      • getIconType

        public java.lang.String[] getIconType()
        Returns the iconType value.
        Returns:
        The iconType field.
      • getMenuType

        public java.lang.String getMenuType()
        Returns the menuType value.
        Returns:
        The menuType value.
      • getName

        public java.lang.String getName()
        Returns the name of this DynamicTreeNode.
        Returns:
        The name field value.
      • getValue

        public java.lang.String getValue()
        Returns the value of this DynamicTreeNode
        Returns:
        The value of the DynamicTreeNode.
      • nodeToJS

        public void nodeToJS(java.lang.String nodeName,
                             java.lang.StringBuffer sb,
                             int i,
                             DynamicTreeNode child)
        Converts DynamicTreeNode to JavaScript.
      • setChildren

        public void setChildren(java.util.Vector newChildren)
        Sets the children of this DynamicTreeNode.
        Parameters:
        newChildren - The Vector of embedded children.
      • setChildrenUrlParam

        public void setChildrenUrlParam(java.lang.String newChildrenUrlParam)
        Sets the childrenUrlParam field value.
        Parameters:
        newChildrenUrlParam - The childrenUrlParam value.
      • setContextMenu

        public void setContextMenu(java.lang.String[][] newContextMenu)
        Sets the context menu.
        Parameters:
        newContextMenu - The context menu array of String arrays.
      • setContextMenuParams

        public void setContextMenuParams(java.lang.String newContextMenuParams)
        Sets the context menu parameters which are passed with all menu item actions.
        Parameters:
        newContextMenuParams - The contextMenuParams value.
      • setIconType

        public void setIconType(java.lang.String[] newIconType)
        Sets the iconType value.
        Parameters:
        newIconType - The iconType name.
      • setMenuType

        public void setMenuType(java.lang.String newMenuType)
        Sets the menuType value.
        Parameters:
        newMenuType - The menuType name.
      • setName

        public void setName(java.lang.String newName)
        Sets the name of this DynamicTreeNode.
        Parameters:
        newName - The name value.
      • setValue

        public void setValue(java.lang.String newValue)
        Sets the value of this DynamicTreeNode
        Parameters:
        newValue - The value of this DynamicTreeNode.