BBjTree
Description
The BBjTree object provides methods for manipulating a GUI tree control.
Implemented Interfaces
DragSource, DropTarget, Editable, Focusable, MouseWheelEnabled, Scrollable,TabTraversable, Validateable
Creation
BBjAPI > BBjSysGui > BBjWindow > BBjTree
A BBjTree object is created through the following BBjWindow method:
Return Value | Method |
---|---|
BBjTree | addTree() |
BBjTree | addTree(byte[] flags) |
BBjTree | addTree(int ID) |
BBjTree | addTree(int ID, byte[] flags) |
BBjTree | addTree(int ID, number x, number y, number w, number h) |
BBjTree | addTree(int ID, number x, number y, number w, number h, byte[] flags) |
Methods of BBjTree - Tree Node Setup
Return Value | Method |
---|---|
void | addExpandableNode(int childID, int parentID, String text) |
void | addNode(int childID, int parentID, String text) |
void | clearImageSize() |
int | getChildAt(int parentID, int index) |
int | getImageHeight() |
int | getImageWidth() |
int | getIndexOfChild(int ID) |
int | getNumChildren(int parentID) |
int | getParentNode(int childID) |
int | getRoot() |
void | insertExpandableNode(int childID, int parentID, String text, int index) |
void | insertNode(int childID, int parentID, String text, int index) |
boolean | isNodeLeaf(int ID) |
void | removeDescendants(int ID) |
void | removeNode(int ID) |
void | setImageSize(number width, number height) |
void | setRoot(int ID, String text) |
Methods of BBjTree - Tree Node Expanding and Collapsing
Return Value | Method |
---|---|
void | collapseNode(int ID) |
void | collapseTreeFromNode(int ID) |
void | expandNode(int ID) |
void | expandTreeFromNode(int ID) |
int | getCollapsedNode() |
int | getExpandedNode() |
BBjVector | getExpandedNodes() |
boolean | isNodeExpandable(int ID) |
boolean | isNodeExpanded(int ID) |
Methods of BBjTree - Tree Node Contents
Return Value | Method |
---|---|
String | getNodeText(int ID) |
void | setNodeText(int ID, String text) |
Methods of BBjTree - Tree Node Editing
Return Value | Method |
---|---|
void | editNode(int ID) |
void | endEdit() |
boolean | isNodeEditable(int ID) |
boolean | isTreeEditable() |
void | setNodeEditable(int ID, boolean editable) |
void | setTreeEditable(boolean editable) |
Methods of BBjTree - Tree Node Icons
Return Value | Method |
---|---|
void | clearNodeIcon(int ID) |
void | clearNodeSelectedIcon(int ID) |
void | setCollapsedIcon(BBjImage image) |
void | setCollapsedIcon(String file) |
void | setCollapsedImage(BBjImage image) |
void | setExpandedIcon(BBjImage image) |
void | setExpandedIcon(String file) |
void | setExpandedImage(BBjImage image) |
void | setLeafIcon(BBjImage image) |
void | setLeafIcon(String file) |
void | setLeafImage(BBjImage image) |
void | setNodeIcon(int ID, BBjImage image) |
void | setNodeIcon(int ID, String file) |
void | setNodeImage(int ID, BBjImage image) |
void | setNodeSelectedIcon(int ID, BBjImage image) |
void | setNodeSelectedIcon(int ID, String file) |
void | setNodeSelectedImage(int ID, BBjImage image) |
void | setSelectedIcon(BBjImage image) |
void | setSelectedIcon(String file) |
void | setSelectedImage(BBjImage image) |
Methods of BBjTree - Tree Node Selection
Note:
Multiple nodes can be selected.
Return Value | Method |
---|---|
void | deselectAll() |
void | deselectChildren(int parentID) |
void | deselectNode(int ID) |
BBjColor | getSelectedBackColor() |
BBjColor | getSelectedForeColor() |
int | getSelectedNode() |
BBjVector | getSelectedNodes() |
int | getSelectionMode() |
boolean | isNodeSelected(int ID) |
boolean | isRootVisible() |
void | selectChildren(int parentID) |
void | selectNode(int ID) |
void | setNodeVisible(int ID) |
void | setRootVisible(boolean visible) |
void | setSelectedBackColor(BBjColor color!) |
void | setSelectedForeColor(BBjColor color!) |
void | setSelectionMode(int mode) |
Methods of BBjTree - Node-specific Font (BBj 24.01+)
Return Value | Method |
---|---|
BBjFont | getNodeFont(int ID) |
void | setNodeFont(int ID, BBjFont font!) |
Methods of BBjTree - Node-specific Text Color
Return Value | Method |
---|---|
BBjColor | getNodeForeColor(int ID) |
void | setNodeForeColor(int ID, BBjColor color) |
Methods of BBjTree - Node-specific Tooltips
Return Value | Method |
---|---|
String | getToolTipText(int ID) |
void | setToolTipText(int ID, String text) |
Methods of BBjTree - Drag and Drop
Return Value | Method |
---|---|
boolean | getDragEnabled() |
String | getDragType(int ID) |
BBjVector | getDropTypes(int ID) |
void | setDragEnabled(boolean enable) |
void | setDragType(int ID, String type) |
void | setDropTypes(int ID, BBjVector types) |
Methods of BBjTree implemented for DragSource
Return Value | Method |
---|---|
int | getDragActions() |
string | getDragType() |
void | setDragActions(int actions) |
void | setDragType(string type) |
Methods of BBjTree implemented for DropTarget
Return Value | Method |
---|---|
int | getDropActions() |
void | setDropActions(int actions) |
BBjVector | getDropTypes() |
void | setDropTypes(BBjVector types) |
Methods of BBjTree implemented for Editable
Return Value | Method |
---|---|
boolean | isEditable() |
void | setEditable(boolean edit) |
Methods of BBjTree implemented for Focusable
Return Value | Method |
---|---|
boolean | isFocusable() |
void | setFocusable(boolean focus) |
Methods of BBjTree implemented for MouseWheelEnabled
Return Value | Method |
---|---|
int | getScrollWheelBehavior() |
void | setScrollWheelBehavior(int trav) |
Methods of BBjTree implemented for Scrollable
Return Value | Method |
---|---|
int | getHorizontalScrollBarHeight() |
int | getHorizontalScrollBarPosition() |
int | getHorizontalScrollBarWidth() |
int | getVerticalScrollBarHeight() |
int | getVerticalScrollBarPosition() |
int | getVerticalScrollBarWidth() |
boolean | isHorizontalScrollBarVisible() |
boolean | isVerticalScrollBarVisible() |
void | setHorizontalScrollBarPosition(int position) |
void | setVerticalScrollBarPosition(int position) |
Methods of BBjTree implemented for TabTraversable
Return Value | Method |
---|---|
boolean | isTabTraversable() |
void | setTabTraversable(boolean trav) |
Methods of BBjTree implemented for Validateable
Return Value | Method |
---|---|
void | accept(boolean valid) |
string | getValidationText() |
Methods of BBjTree inherited from BBjControl
Events
CSS
The visual appearance of BUI controls is defined using CSS (cascading style sheets) rules. Easily change the default colors, border, and other settings by customizing these rules, all without changing any application code. See CSS API for a high-level overview of BUI CSS.
To see the effect of some simple CSS rules, use the following BBjTree sample:
|
With the default CSS, that BBjTabCtrl looks like this:
The BBjTree defines the following CSS style names:
Style Name | Description |
---|---|
.BBjTree | The top level tree control |
.BBjTree-node | An individual node |
.BBjTree-node-image | An image icon within a node row |
.BBjTree-content | Display text within a node row |
.BBjTree-node-edit | The edit control that a user types into to edit node text |
.BBjTree.bbj-disabled | The tree is disabled |
.BBjTree.bbj-focused | The tree is focused |
.BBjTree.bbj-readonly | The tree is read-only |
.BBjTree .bbj-selected | The selected node; note the space between the two parts |
The following CSS styles the edit control that the user types into to edit node text:
|
With that CSS, the node editor looks like this:
Mode Selection Constants
The getSelectionMode and setSelectionMode methods use the following constants:
Constant | Description |
---|---|
SINGLE_TREE_SELECTION |
Only one node can be selected at a time. |
CONTIGUOUS_TREE_SELECTION |
Multiple contiguous tree nodes can be selected. |
DISCONTIGUOUS_TREE_SELECTION |
Multiple tree nodes can be selected; they do not have to be contiguous. This is the default. |
Constants inherited from BBjControl
Example
|
See Also
CALLBACK Verb - Register BBj Subroutine
DWC Component: dwc-tree
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.