|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaxx.runtime.swing.nav.NavNodeChildLoador<T,O,M,B,N>
T - type of data used to create nodes (can be just a String type to use only ids)O - type of data associated with nodesN - type of node to used (to make possible full co-variance and no cast in fal implementations).public abstract class NavNodeChildLoador<T,O,M,B extends NavBridge<M,N>,N extends NavNode<M,N>>
Object to load childs of a node.
It usesNavDataProvider in method
loadChilds(NavBridge , NavNode , NavDataProvider) to obtain datas
then build childs nodes.
A factory of such objects can be found in NavHelper to make
them reusable in other places than inside a NavNode to auto-load
childs.
For example when you want to creat by hand a new node, always prefer to reuse
a such object rathen than duplicate same code in helper...
NavHelper,
NavNode,
Serialized Form| Field Summary | |
|---|---|
protected Class<O> |
beanType
Type of data of the node |
| Constructor Summary | |
|---|---|
protected |
NavNodeChildLoador(Class<O> beanType)
|
| Method Summary | |
|---|---|
protected void |
addChildNodes(N parentNode,
List<T> datas,
NavDataProvider dataProvider)
Add childs to given parentNode using retrive datas from
the data provider. |
abstract N |
createNode(T data,
NavDataProvider dataProvider)
Hook to create a child node given his data. |
Class<O> |
getBeanType()
Returns the type of data associated with nodes to create. |
abstract List<T> |
getData(Class<?> parentClass,
String parentId,
NavDataProvider dataProvider)
Obtain the list of data used to create nodes. |
void |
loadChilds(B bridge,
N parentNode,
NavDataProvider dataProvider)
Load childs of the given parentnode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Class<O> beanType
| Constructor Detail |
|---|
protected NavNodeChildLoador(Class<O> beanType)
| Method Detail |
|---|
public abstract List<T> getData(Class<?> parentClass,
String parentId,
NavDataProvider dataProvider)
throws Exception
T is O, we directly use the data associated with nodes.
parentClass - type of parentparentId - id of parentdataProvider - the data provider
Exception - if any problem
public abstract N createNode(T data,
NavDataProvider dataProvider)
data.
data - the data of the node to createdataProvider - the data provider
public Class<O> getBeanType()
public void loadChilds(B bridge,
N parentNode,
NavDataProvider dataProvider)
throws Exception
parentnode.
bridge - the model owner of nodesparentNode - the parent node where to insert nodesdataProvider - data provider
Exception - pour tout probleme de recuperation de donnees
protected void addChildNodes(N parentNode,
List<T> datas,
NavDataProvider dataProvider)
parentNode using retrive datas from
the data provider.
This method is invoked by the loadChilds(NavBridge , NavNode , NavDataProvider).
parentNode - the node where to insertdatas - the data used to create nodedataProvider - the data provider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||