public class NavTreeTableNode<N extends NavTreeTableNode<N>> extends org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode implements NavNode<NavTreeTableModel,N>
NavNode used to create in tree table
This node extends DefaultMutableTreeTableNode used by
JXTreeTable| Modifier and Type | Field and Description |
|---|---|
protected NavTreeTableNodeChildLoador<?,?,N> |
childLoador
Optional child loador to lazy create childs of the node.
|
protected String |
context
Optinal context to distinguish different nodes with same
internalClass. |
protected boolean |
dirty
Flag to know when renderer should (re-)compute render of the node.
|
protected String |
id
Id of the data associated with the node.
|
protected Class<?> |
internalClass
Type of data associated with the node
|
protected boolean |
loaded
Flag to know when the none static node was loaded.
|
| Modifier | Constructor and Description |
|---|---|
|
NavTreeTableNode(Class<?> internalClass,
String id,
String context,
NavTreeTableNodeChildLoador<?,?,N> childLoador) |
protected |
NavTreeTableNode(String id) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(N node) |
Enumeration<N> |
children() |
N |
findNodeById(String id,
NavBridge<NavTreeTableModel,N> model,
NavDataProvider provider)
Given an
id, obtain the child with matching id. |
N |
getChild(String id,
NavBridge<NavTreeTableModel,N> bridge,
NavDataProvider provider)
Given an
id, obtain the child with matching id. |
N |
getChildAt(int index) |
N |
getContainerNode()
Gets the first node form this one to the root which has a none
String type. |
String |
getContext() |
String |
getId() |
Class<?> |
getInternalClass() |
N |
getParent() |
N[] |
getPathToRoot(NavTreeTableNode aNode,
int depth) |
Object |
getUserObject() |
void |
insert(N node,
int position) |
boolean |
isDirty() |
boolean |
isLeaf() |
boolean |
isLoaded() |
boolean |
isRoot() |
boolean |
isStaticNode()
To know if the node is static.
|
boolean |
isStringNode()
Convinient method to known if the node is a
String typed. |
void |
populateChilds(NavBridge<NavTreeTableModel,N> bridge,
NavDataProvider provider)
To populate childs of the node (only when a none static node).
|
void |
populateNode(NavBridge<NavTreeTableModel,N> model,
NavDataProvider provider,
boolean populateChilds)
To populate the node.
|
void |
remove(N node) |
void |
removeAllChildren() |
void |
setDirty(boolean dirty)
Changes the
NavNode.isDirty() state. |
String |
toString() |
getColumnCount, getValueAt, isEditable, setValueAtadd, createChildrenList, getAllowsChildren, getChildCount, getIndex, insert, remove, remove, removeFromParent, setAllowsChildren, setParent, setUserObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAllowsChildren, getChildCount, getIndexprotected final Class<?> internalClass
protected final String context
internalClass.protected final String id
protected boolean dirty
protected boolean loaded
protected final NavTreeTableNodeChildLoador<?,?,N extends NavTreeTableNode<N>> childLoador
protected NavTreeTableNode(String id)
public NavTreeTableNode(Class<?> internalClass, String id, String context, NavTreeTableNodeChildLoador<?,?,N> childLoador)
public String getId()
getId in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>public String getContext()
getContext in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>public Class<?> getInternalClass()
getInternalClass in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>public boolean isLoaded()
isLoaded in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>public boolean isDirty()
isDirty in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>public boolean isStringNode()
NavNodeString typed.isStringNode in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>true if the type of node ifpublic boolean isStaticNode()
NavNodestatic node has no childLoador.isStaticNode in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>true when the node is static : says, the node has
no childLoador.public N getContainerNode()
NavNodeString type.getContainerNode in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>public boolean isRoot()
isRoot in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>public N findNodeById(String id, NavBridge<NavTreeTableModel,N> model, NavDataProvider provider)
NavNodeid, obtain the child with matching id.
If node is NOT loaded, then first loads it (method
NavNode.populateChilds(NavBridge, NavDataProvider)) then do search
on direct childs of the node recursivly.findNodeById in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>id - the id of the researched nodemodel - model owner of nodesprovider - data providernull if not foundpublic N getChild(String id, NavBridge<NavTreeTableModel,N> bridge, NavDataProvider provider)
NavNodeid, obtain the child with matching id.
If node is NOT loaded, then first loads it (method
NavNode.populateChilds(NavBridge, NavDataProvider)) then return
on direct childs of the node.getChild in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>id - the id of the researched nodebridge - model owner of nodesprovider - data providernull if not foundpublic void setDirty(boolean dirty)
NavNodeNavNode.isDirty() state.
As a side effect, when a renderer will use this node, it will force to
reload the render from the NavDataProvider.setDirty in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>dirty - the new dirty valuepublic boolean isLeaf()
isLeaf in interface TreeNodeisLeaf in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>isLeaf in class org.jdesktop.swingx.treetable.AbstractMutableTreeTableNodepublic Object getUserObject()
getUserObject in interface org.jdesktop.swingx.treetable.TreeTableNodegetUserObject in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>getUserObject in class org.jdesktop.swingx.treetable.AbstractMutableTreeTableNodepublic String toString()
toString in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>toString in class org.jdesktop.swingx.treetable.AbstractMutableTreeTableNodepublic void populateNode(NavBridge<NavTreeTableModel,N> model, NavDataProvider provider, boolean populateChilds)
NavNodedirty
the node (renderer will recompute the render of the node).
If populateChilds is set to true, then also populate
childs of the node using the given dataProvider.populateNode in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>model - le delegate modèles content le noeudprovider - le provider de donnéespopulateChilds - un drapeau pour charger aussi les fils du noeud courantpublic void populateChilds(NavBridge<NavTreeTableModel,N> bridge, NavDataProvider provider)
NavNodeloaded of the node.
For a static node, do nothing.populateChilds in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>bridge - model owner of the nodeprovider - data providerpublic N getParent()
getParent in interface TreeNodegetParent in interface org.jdesktop.swingx.treetable.TreeTableNodegetParent in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>getParent in class org.jdesktop.swingx.treetable.AbstractMutableTreeTableNodepublic N getChildAt(int index)
getChildAt in interface TreeNodegetChildAt in interface org.jdesktop.swingx.treetable.TreeTableNodegetChildAt in class org.jdesktop.swingx.treetable.AbstractMutableTreeTableNodepublic Enumeration<N> children()
public void removeAllChildren()
public void add(N node)
add in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>public N[] getPathToRoot(NavTreeTableNode aNode, int depth)
public void remove(N node)
remove in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>public void insert(N node, int position)
insert in interface NavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>Copyright © 2008–2018 Ultreia.io. All rights reserved.