Member variables

Table 113 summarizes the member variables of the TreeNode class.

Table 113. Member variables of the TreeNode class.

Member variable Description Page
description Contains a description of the tree node. description
isExpandable Specifies whether the tree node is expandable; that is, whether there are elements below the current level. isExpandable
isGeneratable Specifies whether the tree node is generatable; that is, whether the node can be converted to a business object definition. isGeneratable
name Contains the name of the tree node. name
nodes Contains the expanded hierarchy of tree nodes. nodes
polymorphicNature Defines the node's nature; that is whether it is "normal" (expandable or a leaf) or "file". polymorphicNature

description

Contains a description of the tree node.

Type

public String description

Notes

The description member variable displays in the Description column of the Select Source dialog box.

isExpandable

Specifies whether the tree node is expandable; that is, whether there are nodes below the current level.

Type

public boolean isExpandable

Notes

The isExpandable member variable indicates whether a node is expandable, as Table 114 shows.

Table 114. Types of nodes

Type of node Description Value of isExpandable
Expandable Node has child nodes true
Leaf (terminating) Node does not have child nodes but is the terminating point of a branch of the source-node hierarchy false

Only normal-nature nodes (nodes with their polymorphicNature member variable set to NODE_NATURE_NORMAL) can have isExpandable set to true.

isGeneratable

Specifies whether the tree node is generatable; that is, whether the user can select this node as one for which the ODA generates content.

Type

public boolean isGeneratable

name

Contains the name of the tree node.

Type

public String name

Notes

The name member variable displays in the Name column of the Select Source dialog box.

nodes

Contains the expanded hierarchy of child tree nodes.

Type

public TreeNode[] nodes

Notes

The nodes member variable contains an array of TreeNode objects, one object for each of this parent node's children. A child node can, in turn, contain child nodes (grandchildren of this parent node). This member variable is only used if the node is expandable (not a leaf); that is, if the isExpandable member variable is true.

polymorphicNature

Indicates the valid actions the user can take on the tree node.

Type

public int polymorphicNature

Notes

The polymorphicNature member variable determines what actions the user can take on the node when it displays in the Select Source dialog box of Business Object Wizard. This variable contains an integer node-nature constant to indicate the nature of the tree node. These node-nature constants are defined in the ODKConstant interface, as Table 115 shows.

Table 115. Nature of tree nodes

Nature of
tree node
Description Node-nature constant
Normal

The user can take either of the following actions:

  • The user can select the node, if the node is a leaf (terminating) node. Only leaf nodes can be selected for generation into content.
  • The user can expand the node to see more nodes. Business Object Wizard displays a plus (+) to the left of an expandable node name.

NODE_NATURE_NORMAL
File

The user can associate a file from the local file system with the node. Business Object Wizard activates the Associate files menu item in the pop-up menu that displays when the user right-clicks on the node name. This menu item opens a window for browsing system files. From this window, the user can select which file to associate with the node.

For a tree node that has a file node nature, the ODA can use the getClientFile() method (defined in the ODKUtility class) to obtain the user-selected file's contents.

NODE_NATURE_FILE

Note:
Because the TreeNode class implements the ODKConstant interface, the node-nature constants are available to the polymorphicNature member variable without being qualified with the ODKConstant name.

For more information on node natures, see Constructing the tree nodes.

Copyright IBM Corp. 1997, 2004