Tree Applet documentation v. 2.6
Copyright SCAND LLC 2005

Initialization

Tree applet can load content in two modes:

In both cases it is possible to manage items of the tree applet using public methods of it. This can be done as from another Java applet that uses Tree applet, so from browser using JavaScript. The public methods are described below in the section "Tree methods".

Items parameters

To populate tree with data you should specify for every item set of required parameters, listed below.

Name Required Possible values Description
ITEMi Yes according to IDC parameter Item's identifier. Used as reference to item while accessing from script functions.
TEXTi Yes Any string value Visible name of tree item, which will be displayed on screen.
ACTIONi Yes Valid parameters for script function List of parameters, transmitted to script function, described by EVAL parameter.
Can accept:
1. Integer value
2. String value in single or double quotation marks.
3. Collection of (1) and (2), separated by commas.
LEVELi Yes Integer Level of current node. Must be from 0 till previous item's level + 1.
SELECTi No Any value If specified, then current item will be selected.(Cursor will be placed on last selected item.)
IM0i, IM1i No Integer Indexes of images (given by IMAGEi parameters), associated with current item. Ignored if no ICONS_PERMANENT parameter specified.

It is possible to specify a file name directly in this parameter. In this case the parameter should have value in format f<file_name>

CHILDi No Any value Use in dynamical tree only. Not null value means non-terminal node - children for it will be loaded from server. (See also Dynamic loading section)
COLORi No HTML color format The color of item's text
SELCOLORi No HTML color format The color of text for selected items
OPENEDi No Any value Sets item initially to open state
CHECKEDi No Any value If specified, then current item will be checked (See Check items section)
CHECK_DISABLEDi No Any value If specified, then current item will have disabled checkbox (See Check items section)
UNDERLINEi No Any value If specified, then current item will be underlined.
FONTi No Java font format The font of item's text in format <font_name>-<font_style>-<font_size>
USERDATAi No Values in format <key>='<value>' User-defined data for node
 Note: 'i' indicates the sequential number of an item in initialization list. Starts from 0.

 Example 1. Possible item definition.

<PARAM NANE='ITEM0' VALUE='0'>
<PARAM NANE='NAME0' VALUE='Root item'>
<PARAM NANE='ACTION0' VALUE="'r13'">
<PARAM NANE='LEVEL0' VALUE='0'>
<PARAM NANE='SELECT0' VALUE='1'>

Representation parameters

This set of parameters describes the color, fonts and other attributes of tree applet. Attributes of fonts and attributes can be redefined for each tree item using Items parameters and Items Properties Control.

Color parameters

This set of parameters describes the color model of the tree applet.
Name Description
BG_COLOR Background color.
FG_COLOR Color of non-selected item's label.
BGSEL_COLOR Background of selected item.
FGSEL_COLOR Color of selected item's label.
LINES_COLOR Color of lines in tree
CROSSES_COLOR Color of crosses for non-terminal items
CONTOUR_COLOR Color of selected items' contour color
 

Size parameters

This set of parameters describes sizes of tree components:

 o NODE_HEIGHT

The height of node. All nodes in tree has the same height. Default value is 18.

 o IMAGE_WIDTH / IMAGE_HEIGHT

Size of icons in tree. If real size of any image differs from this value, image will be resized. Default value is 16x16.

 o LEVEL_INDENT

Indent between two levels in tree. Default value is 4.

 o MARGIN_LEFT / MARGIN_TOP / MARGIN_RIGHT / MARGIN_BOTTOM

Define margin values from left/top/right/bottom borders correspondingly.

Images control

This set of parameters specifies the image list of tree items and behavior of showing images.

 o IMAGEi

Specifies the list of images for the tree items. Has structure IMAGE0, IMAGE1, ... ,IMAGEn. This numbers can be passed in IM0 and IM1 parameters of an item (see Items parameters).

If ICONS_PERMANENT parameter is not specified, they will have next meaning:
IMAGE0 - Image for root nodes.
IMAGE1 - Image for terminal nodes.
IMAGE2 - Image for non-terminal opened nodes.
IMAGE3 - Image for non-terminal closed nodes.

The path for image starts from TreeApplet class folder.

 o BACKGROUND_IMAGE

Specifies image name for background of the applet

 o BACKGROUND_IMAGE_POSITION

Sets position of background image in format <x>;<y>. If not specified, background image will be repeated in the background.


 o ICONS_PERMANENT

If this parameter has non-empty value, then images associated with the item should be given in IM0,IM1 parameters, otherwise, default images from IMAGE0...IMAGE3 parameters will be used instead.

Important: If this parameter specified, minimum one of images (IM0 or IM1) must be specified for each node. Otherwise the tree will not be initialized.

 o CROSSES

If this parameter has non-empty value, non-terminal items will be marked with "+" on the left side

 o ROOT_CROSS

If this parameter has 0 value, root items displayed without "+" expand symbol

 o FONT

Font of tree applet in Java font format: <font_name>-<font_style>-<font_size>

Default value is "Verdana", size 13, style PLAIN.

 o ROOT_CLOSEABLE

Allows you to collapse root nodes with LEVEL=0. Disabled by default. 

Check items

 This set of parameters permits to use checkboxes as items in tree

 o CHECKBOXES

Creates tree with checkboxes for all nodes. Images for checkboxes has fixed size 11x11 pt and can be specified with followed parameters:

Checkboxes representation:

Name Description Default value
IMAGE_CHECKED Image for checked item icons/item_checked.gif
IMAGE_UNCHECKED Image for unchecked item icons/item_unchecked.gif
IMAGE_SHADEN Image for unchecked item, who has checked children on next levels icons/item_shaden.gif

 o SHOW_IMAGES

Shows checkboxes with images. Default value is "1".

 o CHECK_SIZE

Size of images for checked/unchecked items. Default value is 11x11 ps..

 o AutoCheckBoxes

Processing of checks is automatic - if item checked, all subnodes becomes to checked state too and all parents came into shadow mode. Default value is "1".

Dynamic loading

In case of huge set of data reasonable to load only root nodes from HTML page and load additionally subnodes as required. For this possibility parameter GET_DOC is using.

Important: This possibility available only in full version of jtree.

 o GET_DOC

Used in dynamical trees. It means the name of document, which will load the data from server. Loading happens when:
    1. This parameter is not null,
    2. Node hasn't child subnodes
    3. Parameter CHILD for this node is not null.
The document can get identifier of called node through id parameter and must return the list of strings, ended by empty string. Every string contains information about single child node in the next format:
    "Name","id","action",hasChildren,im0,im1,UNDERLINE
Where id - identifier of the node, name - its name, action - the same meaning as ACTION parameter, hasChildren - CHILD parameter, im0,im1 - IM0,IM1 parameters. If UNDERLINE world specified in last position item will be underlined.

Example 2. ASP document for loading subnodes from database.

<%
id = request("id")
sqlStr ="select KeyField, NameField from DataTable where ParentKeyFied=" & id
set ResultSet = DBConnection.execute(sqlStr)
while not ResultSet.eof
          Key = ResultSet("KeyField")
          Name = ResultSet("NameField")
          response.writeln("""" & Name & """,""" & Key & """,""" & Key & """,0,1,2" )
          ResultSet.moveNext
wend
response.writeln("")
%>

If name of document starts with javascript: prefix, information will be loaded from javascript function, the name of wich should follow specified prefix.

Example 3. Declaration of JavaScript initialization function

<html>
<head>
<script>
function getDoc()
{
return "'Root Node','Root Node',\"'Root Node'\",0,1,2"
}
</script>
</head>
<body>
...
<applet>
<param name="GET_DOC" value="getDoc">
</applet>
...
</body>
</html>

 o INIT_DOC

The name of document for initial loading of tree. (See GET_DOC parameter) 

 Menu parameters

 o MENU

Enabling menu in tree applet. It will be called after right-button clicking on node. The value of this parameter is the name of script function, wich will be called after selection in menu. It must have two parameters - the identifier of node and number of selected item in menu (started from 0). If this parameter specified, next parameters will be processed:

 o MENUi

Specifies the name of menu item. Can has any string values or 'SEPARATOR' for inserting menu separator between menu items.

 o ON_MENU_PRE

Specifies menu initialization script function. This function should be used for customizing popup menu and is called directly before displaying menu and takes two parameters: identifier of node and TreeMenu object. Initially this object contains parameters defined with MENUi parameters. See Menu object for additional information..

 o MENU_MULTISELECT

Enables menu for multi-selected items in tree. If not set (default), selection moved only to last selected item (other will be clean)

Menu object

This object is passes into ON_MENU_PRE function and make possible to change structure of the menu in run-time. It has the next set of public functions:

void addSeparator() Adds seperator into menu.
void addString(String txt) Adds new item with specified label into menu.
void void remove(int index) Removes item from menu.
void removeAll() Removes all items from menu.
String getLabel() Gets label of specified item.
setEnable(int index, boolean isEnable)() Sets specified item to enabled or disabled state.
void void setLabel(int index, String txt) Sets label of specified item.

Events processing

 This set of functions specifies script functions to process events from the tree.

 o EVAL

The name of script function, which will be called when any item in tree is selected. Values specified in ACTION parameter will be passed to this function.

Example 4. Function with single argument.

function foo( s ) { }

<PARAM name="EVAL" VALUE="foo">
<PARAM name="ACTION0" VALUE="0">  // foo(0) will be called
<PARAM name="ACTION1" VALUE="'test'"> // foo('test') will be called
Example 5. Function with two arguments.
function foo( s1, s2 ) { }

<PARAM name="EVAL" VALUE="foo">
<PARAM name="ACTION0" VALUE="0,0">  // foo(0,0) will be called
<PARAM name="ACTION0" VALUE="'test',28"> // foo('test',28) will be called
<PARAM name="ACTION0" VALUE="28"> // Invalid, function does't take one argument.

 o ON_LOAD

The name of script function, which will be called when all items have been loaded into the tree and you can call any tree applet's method.

 o ON_DBLCLICK

The name of script function, which will be called after doubleclicking on node. Function takes single parameter - the identifier of node.

 o ON_CHECK

The name of script function, which will be called after changing of checked state of item. It has two parameters - identifier of item and boolean value of current checked state.

 o ON_EXPAND

The name of script function, which will be called after expanding/collupsing of the node. Function takes two arguments - identifier of node and expanding boolean flag

 o ON_KEY

The name of script function, which will be called after any of key pressing, when jtree applet has input focus. This function has single argument - instance of java.awt.event.KeyEvent object - you can get all information about event (key code, key character, ctrl- and shift mofofiers, etc) from it (see JDK documentation).
If this function return "false" value, standard processing of this event will be skiped by applet.

 o ON_MOUSE_ENTER

The name of script function, which will be called when mouse pointer is entered into item, function receives identifier of item as parameter

 o ON_MOUSE_LEAVE

The name of script function, which will be called when mouse pointer is leaved item' area, function receives identifier of item as parameter

Selection parameters

 o HIER_SEL

Hierarchical selection flag. By default you cannot select node item and its child simultaneously. To enable child selection you should set this parameter to any nonempty value.

 o MULTISELECT

Enabling (1) or disabling (0) multiple selection mode of tree. Default it's enabled.

 o ONELEVEL_SEL

Allows to select several items in tree only in subset of single parent node

Other parameters

 o TREENAME

Specified name of tree. In this case state of tree will be stored in internal java variable and restored after page reloading.

XML initialization

Tree structure can be loaded from separated XML document. In this case applet should have only one parameter - XML - wich describes location of xml document, started from html document base. Important: this possibily can be used only in internet or intranet applications, becouse applet can't load another file from local drive. Below you can see simple example of xml document for tree:

Example 6. XML-code with simple tree structure
<tree
  image0 = "icons/item_root.gif"
  image1 = "icons/item_node.gif"
  image2 = "icons/item_open.gif"
  image3="icons/item_closed.gif"
  eval = "TreeSel"
  crosses = "1">

	<item id='item0' text='Root' action='0'>
		<item id='item1' text='node1000' action='a'/>
		<item id='item8' text='node2000' action='b'/>
		<item id='item10' text='node3000' action='c'/>
	</item>

</tree>
TREE tag attributes

Inside of tree tag all tree attributes (see Initialization) section can be used. In single XML document only one tree structure can be described.

ITEM tag attributes

Each item can be described as single xml tag or start/end tags. All items wich are described inside of start/end couple will be subitems of outside item. Besides, in this couple can be placed label of item (as text) and user-defined data (as <userdata/> tag).

Example 7. XML-code for item with label 'Single item' and user-defined data:
<item id='128'> Single item  <userdata key='some key' value='some value'/> </item>

Another possibility to define label of item - using of text attribute of item tag (see example 5). All other attributes, desribed in Items parameters section can be used inside of item tag.

Definition of the menu

Example 8. Definition of menu:
<menu on_menu='onMenu'  on_menu_pre='on_menu_pre'>
	<menuitem name='Open item'/>
	<menuitem name='Close item'/>
	<separator/>
	<menuitem name='Delete item'/>
</menu>

Dynamic XML loading

If get_doc attribute is specified for tree, algorithm of work will be similar to tree without XML (see GET_DOC parameter description). But response should contain tree structure in XML format (without tree tag), wich will be inserted as subtree of source item.

Member functions

Search functions

 o findRef
public String findRef(java.lang.String ref)
Returns identifier of node with action act.

Parameters:
ref - action for searching

Retutns:
identifier of first item with action=ref or null if not found.
 o findRefByLabel
public String findRefByLabel(java.lang.String lbl)
Returns separated by comas list of items with specified label

Retutns:
list of identifiers or null if no items found

Selection control

 o hasData
public boolean hasData()
Checking for presents of selected items in tree

Retutns:
Returns true if there are some selected items in tree.
 o getSelectedItems
public String getSelectedItems()
Gets names of selected items from tree

Retutns:
Returns the names of selected items, separated by commas. Empty string will be returned if zero items are selected.
 o getSelectedItemsId
public String getSelectedItemsId()
Gets identifiers of selected items from tree

Retutns:
Returns the identifiers of selected items, separated by commas. Empty string will be returned if zero items are selected.
public String getSelectedItemsId(java.lang.String delimiter)
Gets identifiers of selected items from tree, separated by delimiter

Retutns:
Returns the identifiers of selected items, separated by delimiter. Empty string will be returned if zero items are selected.
public String getSelectedItemsId(int sortType)
Returns the identifiers of selected items, separated by commas. Empty string will be returned if zero items selected.

Parameters:
sortType - If sortType = 0 returns id's in natural selection order, sortType = 1 - in 'top down' order

Retutns:
Returns the identifiers of selected items, separated by commas. Empty string will be returned if zero items are selected.
public String getSelectedItemsId(int sortType, java.lang.String delimiter)
Returns the identifiers of selected items, separated by delimiter. Empty string will be returned if zero items selected.

Parameters:
sortType - If sortType = 0 returns id's in natural selection order, sortType = 1 - in 'top down' order

Retutns:
Returns the identifiers of selected items, separated by commas. Empty string will be returned if zero items are selected.
 o getLastSelectedId
public String getLastSelectedId()
Gets last selected item from tree

Retutns:
Returns the identifier of the last selected item. Empty string will be returned if zero items are selected.
 o isLastItemSelected
public boolean isLastItemSelected()
Gets state of last selected item from tree

Retutns:
Returns true, if last selected item is't deselected by repeated pressing on it. (One of item has color border around it)
 o selectItem
public void selectItem(java.lang.String id)
Moves selection to the item with specified ID.

Parameters:
id - identifier of node
public void selectItem(java.lang.String id, boolean isCall)
Moves selection to the item with specified ID.

Parameters:
id - identifier of node
isCall - If true, script function for selected node will be called.
 o addSelection
public void addSelection(java.lang.String id, boolean isCall)
Adds (or removes) item into select list (in multiselect tree)

Parameters:
id - identifier of node
isCall - If true, script function for selected node will be called.
 o unselectAll
public void unselectAll()
Clear selection in tree

Navigation functions

 o getSubItems
public String getSubItems(java.lang.String id)
Returns the list of all children items from the next level of tree, separated by commas.

Parameters:
id - identifier of item

Retutns:
list of childer identifiers, separated by commas. Empty for terminal nodes. Null if item not found.
 o getAllSubItems
public String getAllSubItems(java.lang.String id)
Returns the list of all children items from all next levels of tree, separated by commas.

Parameters:
id - identifier of item

Retutns:
list of identifiers, null if id not found
 o getLastAllSubItems
public String getLastAllSubItems(java.lang.String id)
Similar to the getAllSubItems except we only want the last descendant.
 o getNextItem
public String getNextItem(java.lang.String id)
Return the id of the item that appears next sequentially in the tree.
 o getNextSibling
public String getNextSibling(java.lang.String id)
Return the id of the next sibling after parameter id.

Items properties control

 o setLabel
public void setLabel(java.lang.String id, java.lang.String text)
Available in full version only
Sets label for the item with specified ID.

Parameters:
id - identifier of node
text - new item label
 o getParentId
public String getParentId(java.lang.String id)
Returns the parent ID for item.

Parameters:
id - identifier of item

Retutns:
parent node ID or null if id not found or if it is root node.
 o getAction
public String getAction(java.lang.String id)
Returns the action string for item. Null if id not found.

Parameters:
id - identifier of item

Retutns:
associated action or null if id not found.
 o getLabel
public String getLabel(java.lang.String id)
Returns the label of item. Null if id not found.

Parameters:
id - identifier of item
 o openItem
public void openItem(java.lang.String id)
Opens specified item.

Parameters:
id - identifier of item
 o setItemColor
public void setItemColor(java.lang.String id, java.lang.String strNormColor, java.lang.String strSelColor)
Available in full version only
Sets the color of specified item.

Parameters:
id - identifier of item
strNormColor - normal color
strSelColor - selection color
 o setFont
public void setFont(java.lang.String id, java.lang.String font)
Available in full version only
Sets the font of specified item.

Parameters:
id - identifier of item
font - desired font in format <name>-<style>-<size>
 o getFont
public String getFont(java.lang.String id)
Returns font of specified item as string
 o setUnderline
public void setUnderline(java.lang.String id, boolean isUnderline)
Available in full version only
Sets Underline flag for specified item

Parameters:
id - identifier of item
isUnderline - underline flag
 o getItemImage
public int getItemImage(java.lang.String id)
Gets image index of specified item.

Parameters:
id - identifier of item

Retutns:
index of image
public int getItemImage(java.lang.String id, int index)
Gets image index of specified item.

Parameters:
id - identifier of item
index - index of image (0-close, 1-open)

Retutns:
index of image
 o getImageName
public String getImageName(int index)
Gets name of image at specified index

Parameters:
index - index of image

Retutns:
path to the image
 o setItemImage
public void setItemImage(java.lang.String id, java.lang.String im)
Sets image for specified item.

Parameters:
id - identifier of item
im - the name (or number) for image
public void setItemImage(java.lang.String id, java.lang.String im1, java.lang.String im2)
Sets images for specified item.

Parameters:
id - identifier of item
im1 - the name (or number) for opened image
im2 - the name (or number) for closed image
 o getLevel
public int getLevel(java.lang.String id)
Returns zero-based level of item.

Retutns:
level of item or -1 if not found
 o isOpen
public boolean isOpen(java.lang.String id)
Returns true if item is opened
 o hasChildren
public boolean hasChildren(java.lang.String id)
Available in full version only
Checks item for children nodes

Parameters:
id - identifier of node
 o setColor
public void setColor(java.lang.String pattern, java.lang.String strColor)
Sets color of tree

Parameters:
pattern - Name color to set. Can have the next values: BG_COLOR, FG_COLOR, BGSEL_COLOR, FGSEL_COLOR, LINES_COLOR, CROSSES_COLOR

Tree manipulation functions

 o deleteSelectedItem
public void deleteSelectedItem()
Deletes selected item.
 o deleteAllItems
public void deleteAllItems()
Deletes all items.
 o deleteItem
public void deleteItem(java.lang.String id)
Deletes item with 'id' identifier.

Parameters:
id - identifier of node
public void deleteItem(java.lang.String id, boolean isSel)
Deletes item with 'id' identifier.

Parameters:
id - identifier of node
isSel - If true (default), parent of deleted item get selection, else no selected items leaving in tree.
 o deleteWithoutChildren
public void deleteWithoutChildren(java.lang.String id)
Deletes item with 'id' identifier and moves child nodes to current level.

Parameters:
id - identifier of node
 o insertNewChild
public void insertNewChild(java.lang.String pId, java.lang.String id, java.lang.String label, java.lang.String action)
Inserts new item into tree without images and options = "SELECT,CALL,CHILD"
public void insertNewChild(java.lang.String pId, java.lang.String id, java.lang.String label, java.lang.String action, java.lang.String options)
Inserts new item into tree without images
public void insertNewChild(java.lang.String pId, java.lang.String id, java.lang.String label, java.lang.String action, java.lang.String im0, java.lang.String im1)
Inserts new item into tree with options = "SELECT,CALL,CHILD"
public void insertNewChild(java.lang.String pId, java.lang.String id, java.lang.String label, java.lang.String action, java.lang.String im0, java.lang.String im1, java.lang.String options)
Inserts new child item for node with 'pId' identifier

Parameters:
pId - parent identifier
id - the identifier for newly created item.
label - the label for newly node
action - the action for newly node
im0 - number (or name) of first image
im1 - number (or name) of second image
options - is copmosition of the next values separated by commas:
SELECT - new item gets selection
CALL - action function for new item will be called after insertion
CHILD - new item has children (for dinamical tree)
CHECKED - node is checket (for checkboxes applet only)
TOP - insert new node at first child position Default value for options is "SELECT,CALL,CHILD"
 o insertNewNext
public void insertNewNext(java.lang.String pId, java.lang.String id, java.lang.String label, java.lang.String action)
Inserts new item into tree without images and options = "SELECT,CALL,CHILD"
public void insertNewNext(java.lang.String pId, java.lang.String id, java.lang.String label, java.lang.String action, java.lang.String options)
Inserts new item into tree without images
public void insertNewNext(java.lang.String pId, java.lang.String id, java.lang.String label, java.lang.String action, java.lang.String im0, java.lang.String im1)
Inserts new item into tree with options = "SELECT,CALL,CHILD"
public void insertNewNext(java.lang.String pId, java.lang.String id, java.lang.String label, java.lang.String action, java.lang.String im0, java.lang.String im1, java.lang.String options)
Inserts new node at position next to the 'pId' item

Parameters:
pId - parent identifier
id - the identifier for newly created item.
label - the label for newly node
action - the action for newly node
im0 - number (or name) of first image
im1 - number (or name) of second image
options - is copmosition of the next values separated by commas:
SELECT - new item gets selection
CALL - action function for new item will be called after insertion
CHILD - new item has children (for dinamical tree)
CHECKED - node is checket (for checkboxes applet only)
Default value for options is "SELECT,CALL,CHILD"
 o insertNewRoot
public void insertNewRoot(java.lang.String id, java.lang.String label, java.lang.String action)
Inserts new root node without images and options = "SELECT,CALL"
public void insertNewRoot(java.lang.String id, java.lang.String label, java.lang.String action, java.lang.String options)
Inserts new root node without images
public void insertNewRoot(java.lang.String id, java.lang.String label, java.lang.String action, java.lang.String im0, java.lang.String im1)
Inserts new root node with options "SELECT,CALL"
public void insertNewRoot(java.lang.String id, java.lang.String label, java.lang.String action, java.lang.String im0, java.lang.String im1, java.lang.String options)
Inserts new root node at LEVEL=0.

Parameters:
id - the identifier for newly created item.
label - the label for newly node
action - the action for newly node
im0 - number (or name) of first image
im1 - number (or name) of second image
options - is copmosition of the next values separated by commas:
SELECT - new item gets selection
CALL - action function for new item will be called after insertion
CHILD - new item has children (for dinamical tree)
CHECKED - node is checket (for checkboxes applet only)
Default value for options is "SELECT,CALL,CHILD"
 o deleteAllNext
public void deleteAllNext(java.lang.String id)
Available in full version only
Deletes item with 'id' identifier and all items on the same level of the tree.

Parameters:
id - identifier of item

Expanding/collapsing functions

 o expandAllChildren
public void expandAllChildren(java.lang.String id)
Expands all children of item with 'id' identifier (also expands subnodes).

Parameters:
id - identifier of node
 o expandAllSelectedChildren
public void expandAllSelectedChildren(java.lang.String id)
Makes all selected subitems of item with 'id' identifier visible.

Parameters:
id - identifier of node
 o collapseAllChildren
public void collapseAllChildren(java.lang.String id)
Collapses all children of item with 'id' identifier (with it's subnodes.).

Parameters:
id - identifier of node

Cut & Paste functions

 o doCut
public int doCut()
Cuts all selected items from tree.

Retutns:
number of items where cut.
 o doPaste
public int doPaste(java.lang.String id)
Pastes cut items as child of specified node.

Parameters:
id - identifier for node, where past operation will be process

Retutns:
function returning the next codes:
0 - successful
1 - no items was cut
2 - One of cut item is root of the tree
3 - specified item not found
4 - Parent - to - child inserting
public int doPaste(java.lang.String id, java.lang.String new_ids)
Pastes items as child of specified node.

Parameters:
id - identifier for node, where past operation will be process
new_ids - - identifiers for items, separated by commas. Number of items must be equal to number of cut items.

Retutns:
function returning the next codes:
0 - successful
1 - no items was cut
2 - One of cut item is root of the tree
3 - specified item not found
4 - numbers of items in new_ids is incorrect
 o clearCut
public void clearCut()
Clears 'cut' flag on all items

User specified data manipulation functions

 o setUserData
public boolean setUserData(java.lang.String id, java.lang.String key, java.lang.String value)
Sets user-specified data to node.

Parameters:
id - identifier of node
key - key for data
value - data value

Retutns:
true if node was found.
 o getUserData
public String getUserData(java.lang.String id, java.lang.String key)
Returns user-specified data from node.

Parameters:
id - identifier of node
key - key for data

Retutns:
Returns null value if node or data key not found.

Checkboxes operations functions

 o isItemChecked
public boolean isItemChecked(java.lang.String id)
Available in full version only
Returns true if specified item was checked.

Parameters:
id - identifier of item

Retutns:
true if item was checked, false else or if not found
 o setCheck
public void setCheck(java.lang.String id, boolean isCheck)
Available in full version only
Sets check state for specified item

Parameters:
id - identifier of item
isCheck - check state for item
 o setCheckEnabled
public void setCheckEnabled(java.lang.String id, int isEnable)
Available in full version only
Enable/disable checkbox for specified item

Parameters:
id - identifier of item
isEnable - 0(disable)/1(enable) checkbox
 o getAllChecked
public String getAllChecked(boolean isSubitems)
Available in full version only
Returns list of checked items, separated by commas

Parameters:
isSubitems - if set to true, all items will be returned, else only first checked item without it's children.
 o setSubChecked
public void setSubChecked(java.lang.String id, boolean isCheck)
Available in full version only
Sets all subitems into specified check state

Parameters:
id - identifier of item. If id=null applying for all items in tree
isCheck - new check state
 o getAboveChecked
public String getAboveChecked(java.lang.String id)
Available in full version only
Gets identifiers of all checked items above specified in top-down order.
 o getBelowChecked
public String getBelowChecked(java.lang.String id)
Available in full version only
Gets identifiers of all checked items below specified in top-down order.
 o getCheckedParents
public String getCheckedParents(java.lang.String id)
Available in full version only
Gets identifiers of all checked parents of specified item.
 o getCheckedChildren
public String getCheckedChildren(java.lang.String id)
Available in full version only
Gets identifiers of all checked children of specified item

Tree updating operations

 o updateItem
public void updateItem(java.lang.String id)
Available in full version only
Updates specified item from server
 o storeTree
public void storeTree(java.lang.String treeName)
Available in full version only
Stores current state of tree into internal treeName variable

Parameters:
treeName - the name of internal variable
 o dropStaticTree
public void dropStaticTree(java.lang.String treeName)
Available in full version only
Removes specified tree from static trees list
 o restoreTree
public boolean restoreTree(java.lang.String treeName)
Available in full version only
Restores tree from the treeName internal variable.

Parameters:
treeName - the name of internal variable

Retutns:
Returns false if this variable is't found (was't created by storeTree() call)
 o reloadTree
public void reloadTree(java.lang.String docName)
Available in full version only
Forces a full reload of tree by reading of specified document from the server.
 o loadXML
public void loadXML(java.lang.String xml)
Loads tree structure from XML

Parameters:
xml - XML-representing string

Child applets functions

 o showApplet
public void showApplet(java.lang.String name, int x, int y, int width, int height)
Shows another applet in current applet panel

Parameters:
name - path to code of applet (from current DOC_BASE)
x - x coordinate of child applet
y - y coordinate of child applet
width - width of child applet
height - height of child applet
 o hideApplet
public void hideApplet()
Hides child applet
 o getChildApplet
public Applet getChildApplet()
Returns the instance of child applet

Move functions

 o moveSelectionRight
public void moveSelectionRight()
Available in full version only
Moves selected items right by one level in tree hierarchy
 o moveSelectionLeft
public void moveSelectionLeft()
Available in full version only
Moves selected items left by one level in tree hierarchy
 o moveSelectionUp
public void moveSelectionUp()
Available in full version only
Moves selected items up in curent hierarchy level
 o moveSelectionDown
public void moveSelectionDown()
Available in full version only
Moves selected items down in curent hierarchy level

Other functions

 o getAppletInfo
public String getAppletInfo()
Returns information about applet
 o updateTree
public void updateTree()
Repaints tree structure.
 o getTreeDeclaration
public String getTreeDeclaration()
Prints contents of current tree into Java log panel.
 o enablePopup
public void enablePopup(boolean b)
Available in full version only
Enables popup menu functionality
 o createMenu
public TreeMenu createMenu(java.lang.String menu_fun, java.lang.String menu_pre_fun)
Creates new popup menu for tree

Parameters:
menu_fun - Name of script function for menu-actions processing
menu_pre_fun - Name of script function for menu preconfiguration
 o sortChildrenByName
public void sortChildrenByName(java.lang.String id)
Sorts children of specified node by name