|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlazyj.widgets.Tree<K,V>
K - key type (usually Integer).V - value type (usually String).public class Tree<K,V>
Generic tree object. It will take the entries through a TreeProvider object and will keep the
children in the same order they are returned by the provider. The only restriction is to have one of the
roots as first entry. Any orphan node will be put on the same level with the first entry (root).
| Constructor Summary | |
|---|---|
Tree(TreeProvider<K,V> provider)
Build a tree based on the information returned by the provider. |
|
| Method Summary | |
|---|---|
java.util.List<Tree<K,V>> |
getChildren()
List of children. |
static Tree<java.lang.Integer,java.lang.String> |
getDefaultTree(DBFunctions db)
Build a tree upon a simple query that has ID on the first column, parent ID on the second, and value to be displayed on the third. |
K |
getKey()
Key of this node. |
java.util.Collection<Option<K,V>> |
getOptions()
Convert the tree to a collection of Option objects that are good to be used in a Select. |
java.util.Collection<Option<K,java.lang.String>> |
getOptionsFullPath(java.lang.String sSeparator)
Get the options having as value the concatenated values of the parents and their own, separated by the specified separator. |
V |
getValue()
Value for this node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Tree(TreeProvider<K,V> provider)
provider - | Method Detail |
|---|
public K getKey()
public V getValue()
public java.util.List<Tree<K,V>> getChildren()
public java.util.Collection<Option<K,V>> getOptions()
Option objects that are good to be used in a Select.
getOptions in interface OptionProvider<K,V>public java.util.Collection<Option<K,java.lang.String>> getOptionsFullPath(java.lang.String sSeparator)
sSeparator - some separator, for example " » "
public static Tree<java.lang.Integer,java.lang.String> getDefaultTree(DBFunctions db)
BasicDBTreeProvider to do
the actual work.
db -
BasicDBTreeProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||