java.lang.Object | +--com.ibm.commerce.tools.common.ui.DynamicTreeNode
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, which contains all of 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
supply 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 | |
---|---|
protected
java.util.Vector |
children The children nodes attached to this node. |
protected
java.lang.String |
childrenUrlParam If this is a parent node, contains the URL parameters used to populate this node's children. |
protected
java.lang.String[][] |
contextMenu This hold the name value pairs for the context menu. |
protected
java.lang.String |
contextMenuParams Contains URL parameters to be appended to context menu items actions. |
static java.lang.String |
COPYRIGHT IBM copyright notice field. |
protected
java.lang.String[] |
iconType Specifies an icon type. |
protected
java.lang.String |
menuType Specifies a menu type. |
protected
java.lang.String |
name The national language translated name of the DynamicTreeNode. |
protected
java.lang.String |
value Contains the value of the node. |
Constructor Summary | |
---|---|
DynamicTreeNode() Default constructor create 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 | |
---|---|
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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
protected java.lang.String name
protected java.lang.String childrenUrlParam
A null value or emtpy string means this node is a leaf (not expandable)
When the user clicks on the + sign on the tree in the client browser to
expand a node, the value of this field is sent to the DynamicTreeUserDataBean
to be used to populate the children nodes. This is done in JavaScript by
appending the value of this field as follows:
"/webapp/wcs/tools/servlet/DynamicTreeData?XMLFile=xxx&" +
childrenUrlParam
for example, if childrenUrlParam = "p1=a&p2=99", the full URL
will be something like:
/webapp/wcs/tools/servlet/DynamicTreeData?XMLFile=common.testTree&p1=a&p2=99
protected java.lang.String[][] contextMenu
The first item should always be "Open" or some way to launch the
nodes action. The second value contains the fully qualified URL that will be
launched when the user selects that menu item. For example:
contextMenu[0][0] = "Open";
contextMenu[0][1] = "http://www.ibm.com";
contextMenu[1][0] = "";
contextMenu[1][1] = "";
NOTE: An row with empty quote yields a divider line in the context menu. The names here must be national language sensitive.
NOTE: If using TYPE and grouped menus, leave this empty.
protected java.util.Vector children
protected java.lang.String value
This value (as is the rest of this data) is accessible through JavaScript functions.
protected java.lang.String contextMenuParams
A full URL will be constructed by javascript, in the following format:
contextMenu[0][1] + "?" + contextMenuParams
for example, if contextMenuParams = "p1=a&p2=99", the full URL
will be something like:
http://www.ibm.com?p1=a&p2=99
protected java.lang.String[] iconType
protected java.lang.String menuType
Constructor Detail |
---|
public DynamicTreeNode()
public DynamicTreeNode(java.lang.String name, java.lang.String childrenUrlParam, java.lang.String[][] menu)
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.public DynamicTreeNode(java.lang.String name, java.lang.String childrenUrlParams, java.lang.String[][] menu, java.lang.String contextMenuParams)
name
- The name of the DynamicTreeNode that will be displayed
to the user.menu
- The context menu array.contextMenuParams
- Parameters to be appended to all context
menu actions calls.public DynamicTreeNode(java.lang.String name, java.lang.String para, java.lang.String[][] menu, java.lang.String contextMenuParams, java.util.Vector children)
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.public DynamicTreeNode(java.lang.String name, java.lang.String para, java.lang.String[][] menu, java.util.Vector children)
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.public DynamicTreeNode(java.lang.String name, java.lang.String value, java.lang.String para, java.lang.String[][] menu)
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.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)
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.public DynamicTreeNode(java.lang.String name, java.lang.String value, java.lang.String para, java.lang.String[][] menu, java.util.Vector children)
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.public DynamicTreeNode(java.lang.String name, java.lang.String value, java.lang.String para, java.lang.String contextMenuParams, java.lang.String menuType)
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.public DynamicTreeNode(java.lang.String name, java.lang.String value, java.lang.String childrenUrlParams, java.lang.String menuType, java.util.Vector children)
name
- The name of the DynamicTreeNode that will be displayed
to the user.value
- The value of this DynamicTreeNode.menuType
- The name of the corresponding
DynamicTreeMenuType.children
- Contains embedded children of this node.public DynamicTreeNode(java.lang.String name, java.lang.String childrenUrlParams, java.lang.String menuType, java.util.Vector children)
name
- The name of the DynamicTreeNode that will be displayed
to the user.menuType
- The name of the corresponding
DynamicTreeMenuType.children
- Contains embedded children of this node.Method Detail |
---|
public java.lang.String[][] copyStringArray(java.lang.String[][] str)
Typically used by the constructor to create new Strings for the array of String arrays refernced as a parameter. argument to create a fresh copy of the Strings.
str
- The array of String arrays.public java.util.Vector getChildren()
public java.lang.String getChildrenUrlParam()
public java.lang.String[][] getContextMenu()
public java.lang.String getContextMenuParams()
public java.lang.String[] getIconType()
public java.lang.String getMenuType()
public java.lang.String getName()
public java.lang.String getValue()
public void nodeToJS(java.lang.String nodeName, java.lang.StringBuffer sb, int i, DynamicTreeNode child)
public void setChildren(java.util.Vector newChildren)
newChildren
- The Vector of embedded
children.public void setChildrenUrlParam(java.lang.String newChildrenUrlParam)
newChildrenUrlParam
- The childrenUrlParam
value.public void setContextMenu(java.lang.String[][] newContextMenu)
newContextMenu
- The context menu array of String
arrays.public void setContextMenuParams(java.lang.String newContextMenuParams)
newContextMenuParams
- The contextMenuParams
value.public void setIconType(java.lang.String[] newIconType)
newIconType
- The iconType name.public void setMenuType(java.lang.String newMenuType)
newMenuType
- The menuType name.public void setName(java.lang.String newName)
newName
- The name value.public void setValue(java.lang.String newValue)
newValue
- The value of thie
DynamicTreeNode.