public class NavTreeNode<N extends NavTreeNode<N>> extends DefaultMutableTreeNode implements NavNode<DefaultTreeModel,N>
NavNode used to create in tree table
This node extends DefaultMutableTreeNode| Modifier and Type | Field and Description |
|---|---|
protected NavTreeNodeChildLoador<?,?,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.
|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject| Modifier | Constructor and Description |
|---|---|
|
NavTreeNode(Class<?> internalClass,
String id,
String context,
NavTreeNodeChildLoador<?,?,N> childLoador) |
protected |
NavTreeNode(String id) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(N node) |
Enumeration<N> |
children() |
N |
findNodeById(String id,
NavBridge<DefaultTreeModel,N> model,
NavDataProvider provider)
Given an
id, obtain the child with matching id. |
N |
getChild(String id,
NavBridge<DefaultTreeModel,N> bridge,
NavDataProvider provider)
Given an
id, obtain the child with matching id. |
N |
getChildAfter(TreeNode aChild) |
N |
getChildAt(int index) |
N |
getChildBefore(TreeNode aChild) |
N |
getContainerNode()
Gets the first node form this one to the root which has a none
String type. |
String |
getContext() |
N |
getFirstChild() |
N |
getFirstLeaf() |
String |
getId() |
Class<?> |
getInternalClass() |
N |
getLastChild() |
N |
getLastLeaf() |
N |
getNextLeaf() |
N |
getNextNode() |
N |
getNextSibling() |
N |
getParent() |
N |
getPreviousLeaf() |
N |
getPreviousNode() |
N |
getPreviousSibling() |
N |
getRoot() |
N |
getSharedAncestor(N aNode) |
Object |
getUserObject() |
void |
insert(N node,
int position) |
boolean |
isDirty() |
boolean |
isLeaf() |
boolean |
isLoaded() |
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<DefaultTreeModel,N> bridge,
NavDataProvider provider)
To populate childs of the node (only when a none static node).
|
void |
populateNode(NavBridge<DefaultTreeModel,N> model,
NavDataProvider provider,
boolean populateChilds)
To populate the node.
|
void |
remove(N node) |
void |
setDirty(boolean dirty)
Changes the
NavNode.isDirty() state. |
String |
toString() |
add, breadthFirstEnumeration, clone, depthFirstEnumeration, getAllowsChildren, getChildCount, getDepth, getIndex, getLeafCount, getLevel, getPath, getPathToRoot, getSharedAncestor, getSiblingCount, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObjectequals, 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 NavTreeNodeChildLoador<?,?,N extends NavTreeNode<N>> childLoador
protected NavTreeNode(String id)
public NavTreeNode(Class<?> internalClass, String id, String context, NavTreeNodeChildLoador<?,?,N> childLoador)
public String getId()
getId in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>public String getContext()
getContext in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>public Class<?> getInternalClass()
getInternalClass in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>public boolean isLoaded()
isLoaded in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>public boolean isDirty()
isDirty in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>public boolean isStringNode()
NavNodeString typed.isStringNode in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>true if the type of node ifpublic boolean isStaticNode()
NavNodestatic node has no childLoador.isStaticNode in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>true when the node is static : says, the node has
no childLoador.public N getContainerNode()
NavNodeString type.getContainerNode in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>public N findNodeById(String id, NavBridge<DefaultTreeModel,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<DefaultTreeModel,N extends NavTreeNode<N>>id - the id of the researched nodemodel - model owner of nodesprovider - data providernull if not foundpublic N getChild(String id, NavBridge<DefaultTreeModel,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<DefaultTreeModel,N extends NavTreeNode<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<DefaultTreeModel,N extends NavTreeNode<N>>dirty - the new dirty valuepublic boolean isLeaf()
isLeaf in interface TreeNodeisLeaf in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>isLeaf in class DefaultMutableTreeNodepublic Object getUserObject()
getUserObject in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>getUserObject in class DefaultMutableTreeNodepublic String toString()
toString in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>toString in class DefaultMutableTreeNodepublic void populateNode(NavBridge<DefaultTreeModel,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<DefaultTreeModel,N extends NavTreeNode<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<DefaultTreeModel,N> bridge, NavDataProvider provider)
NavNodeloaded of the node.
For a static node, do nothing.populateChilds in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>bridge - model owner of the nodeprovider - data providerpublic N getParent()
getParent in interface TreeNodegetParent in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>getParent in class DefaultMutableTreeNodepublic N getRoot()
getRoot in class DefaultMutableTreeNodepublic N getFirstChild()
getFirstChild in class DefaultMutableTreeNodepublic N getLastChild()
getLastChild in class DefaultMutableTreeNodepublic N getChildAfter(TreeNode aChild)
getChildAfter in class DefaultMutableTreeNodepublic N getChildBefore(TreeNode aChild)
getChildBefore in class DefaultMutableTreeNodepublic N getNextSibling()
getNextSibling in class DefaultMutableTreeNodepublic N getPreviousSibling()
getPreviousSibling in class DefaultMutableTreeNodepublic N getFirstLeaf()
getFirstLeaf in class DefaultMutableTreeNodepublic N getLastLeaf()
getLastLeaf in class DefaultMutableTreeNodepublic N getNextLeaf()
getNextLeaf in class DefaultMutableTreeNodepublic N getPreviousLeaf()
getPreviousLeaf in class DefaultMutableTreeNodepublic N getNextNode()
getNextNode in class DefaultMutableTreeNodepublic N getPreviousNode()
getPreviousNode in class DefaultMutableTreeNodepublic N getChildAt(int index)
getChildAt in interface TreeNodegetChildAt in class DefaultMutableTreeNodepublic Enumeration<N> children()
children in interface TreeNodechildren in class DefaultMutableTreeNodepublic void add(N node)
add in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>public void remove(N node)
remove in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>public void insert(N node, int position)
insert in interface NavNode<DefaultTreeModel,N extends NavTreeNode<N>>Copyright © 2008–2017 Ultreia.io. All rights reserved.