medi.swing.util
Class TreeUtils

java.lang.Object
  |
  +--medi.swing.util.TreeUtils

public class TreeUtils
extends java.lang.Object

Contains some functions for trees.


Constructor Summary
TreeUtils()
          Creates new TreeUtils
 
Method Summary
static MediTreeNode createWaitNode()
          Creates a fake wait node, i.e. contains the text "Please wait..."
static void fillTree(MediTreeNode node, DbIterator rowIt, int[] colIndexes, int[] IDIndexes, java.lang.String type, java.lang.String divider, boolean addFakeChild)
          Fills a tree and clears the node.
static void fillTree(MediTreeNode node, DbIterator rowIt, int[] colIndexes, int[] IDIndexes, java.lang.String type, java.lang.String divider, boolean addFakeChild, boolean clearTree)
          Fills a tree.
static void fillTree(MediTreeNode node, DbIterator rowIt, int[] colIndexes, int[] IDIndexes, java.lang.String type, java.lang.String divider, boolean addFakeChild, boolean clearTree, boolean reloadTree)
          Fills a tree.
static java.lang.Integer firstValue(java.lang.String value, java.lang.String divider)
          Gets the first value in a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeUtils

public TreeUtils()
Creates new TreeUtils

Method Detail

fillTree

public static void fillTree(MediTreeNode node,
                            DbIterator rowIt,
                            int[] colIndexes,
                            int[] IDIndexes,
                            java.lang.String type,
                            java.lang.String divider,
                            boolean addFakeChild)
                     throws DbException
Fills a tree and clears the node.

Parameters:
node - The root node.
rowIt - The iterator containing the data.
colIndexes - The indexes to use in getting columns in the iterator's rows.
IDIndexes - The indexes to use in getting index columns in the iterator's rows.
type - The type of node.
divider - The divider string.
addFakeChild - Should I add a fake child to display node's handle?
Throws:
DbException - If something goes wrong.

fillTree

public static void fillTree(MediTreeNode node,
                            DbIterator rowIt,
                            int[] colIndexes,
                            int[] IDIndexes,
                            java.lang.String type,
                            java.lang.String divider,
                            boolean addFakeChild,
                            boolean clearTree)
                     throws DbException
Fills a tree.

Parameters:
node - The root node.
rowIt - The iterator containing the data.
colIndexes - The indexes to use in getting columns in the iterator's rows.
IDIndexes - The indexes to use in getting index columns in the iterator's rows.
type - The type of node.
divider - The divider string.
addFakeChild - Should I add a fake child to display node's handle?
clearTree - Should I clear the tree?
Throws:
DbException - If something goes wrong.

fillTree

public static void fillTree(MediTreeNode node,
                            DbIterator rowIt,
                            int[] colIndexes,
                            int[] IDIndexes,
                            java.lang.String type,
                            java.lang.String divider,
                            boolean addFakeChild,
                            boolean clearTree,
                            boolean reloadTree)
                     throws DbException
Fills a tree.

Parameters:
node - The root node.
rowIt - The iterator containing the data.
colIndexes - The indexes to use in getting columns in the iterator's rows.
IDIndexes - The indexes to use in getting index columns in the iterator's rows.
type - The type of node.
divider - The divider string.
addFakeChild - Should I add a fake child to display node's handle?
clearTree - Should I clear the tree?
reloadTree - Should I reload the tree at the end of node filling?
Throws:
DbException - If something goes wrong.

firstValue

public static java.lang.Integer firstValue(java.lang.String value,
                                           java.lang.String divider)
Gets the first value in a string.

Parameters:
value - The string to use.
divider - The divider to use.
Returns:
The first value.

createWaitNode

public static MediTreeNode createWaitNode()
Creates a fake wait node, i.e. contains the text "Please wait..." (localized).

Returns:
The requested node.