Class NavTreeTableNode<N extends NavTreeTableNode<N>>
- java.lang.Object
-
- org.jdesktop.swingx.treetable.AbstractMutableTreeTableNode
-
- org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode
-
- org.nuiton.jaxx.runtime.swing.nav.treetable.NavTreeTableNode<N>
-
- All Implemented Interfaces:
Serializable,Cloneable,TreeNode,org.jdesktop.swingx.treetable.MutableTreeTableNode,org.jdesktop.swingx.treetable.TreeTableNode,NavNode<NavTreeTableModel,N>
public class NavTreeTableNode<N extends NavTreeTableNode<N>> extends org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode implements NavNode<NavTreeTableModel,N>
Implementation ofNavNodeused to create in tree table This node extendsDefaultMutableTreeTableNodeused byJXTreeTable- Since:
- 2.2
- Author:
- Sylvain Lletellier
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected NavTreeTableNodeChildLoador<?,?,N>childLoadorOptional child loador to lazy create childs of the node.protected StringcontextOptinal context to distinguish different nodes with sameinternalClass.protected booleandirtyFlag to know when renderer should (re-)compute render of the node.protected StringidId of the data associated with the node.protected Class<?>internalClassType of data associated with the nodeprotected booleanloadedFlag to know when the none static node was loaded.
-
Constructor Summary
Constructors Modifier Constructor Description NavTreeTableNode(Class<?> internalClass, String id, String context, NavTreeTableNodeChildLoador<?,?,N> childLoador)protectedNavTreeTableNode(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(N node)Enumeration<N>children()NfindNodeById(String id, NavBridge<NavTreeTableModel,N> model, NavDataProvider provider)Given anid, obtain the child with matching id.NgetChild(String id, NavBridge<NavTreeTableModel,N> bridge, NavDataProvider provider)Given anid, obtain the child with matching id.NgetChildAt(int index)NgetContainerNode()Gets the first node form this one to the root which has a noneStringtype.StringgetContext()StringgetId()Class<?>getInternalClass()NgetParent()N[]getPathToRoot(NavTreeTableNode aNode, int depth)ObjectgetUserObject()voidinsert(N node, int position)booleanisDirty()booleanisLeaf()booleanisLoaded()booleanisRoot()booleanisStaticNode()To know if the node is static.booleanisStringNode()Convinient method to known if the node is aStringtyped.voidpopulateChilds(NavBridge<NavTreeTableModel,N> bridge, NavDataProvider provider)To populate childs of the node (only when a none static node).voidpopulateNode(NavBridge<NavTreeTableModel,N> model, NavDataProvider provider, boolean populateChilds)To populate the node.voidremove(N node)voidremoveAllChildren()voidsetDirty(boolean dirty)Changes theNavNode.isDirty()state.StringtoString()-
Methods inherited from class org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode
getColumnCount, getValueAt, isEditable, setValueAt
-
Methods inherited from class org.jdesktop.swingx.treetable.AbstractMutableTreeTableNode
add, createChildrenList, getAllowsChildren, getChildCount, getIndex, insert, remove, remove, removeFromParent, setAllowsChildren, setParent, setUserObject
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.swing.tree.TreeNode
getAllowsChildren, getChildCount, getIndex
-
-
-
-
Field Detail
-
internalClass
protected final Class<?> internalClass
Type of data associated with the node
-
context
protected final String context
Optinal context to distinguish different nodes with sameinternalClass.
-
id
protected final String id
Id of the data associated with the node.
-
dirty
protected boolean dirty
Flag to know when renderer should (re-)compute render of the node.
-
loaded
protected boolean loaded
Flag to know when the none static node was loaded.
-
childLoador
protected final NavTreeTableNodeChildLoador<?,?,N extends NavTreeTableNode<N>> childLoador
Optional child loador to lazy create childs of the node.
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>
-
getContext
public String getContext()
- Specified by:
getContextin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>
-
getInternalClass
public Class<?> getInternalClass()
- Specified by:
getInternalClassin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>
-
isLoaded
public boolean isLoaded()
- Specified by:
isLoadedin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>
-
isDirty
public boolean isDirty()
- Specified by:
isDirtyin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>
-
isStringNode
public boolean isStringNode()
Description copied from interface:NavNodeConvinient method to known if the node is aStringtyped.- Specified by:
isStringNodein interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Returns:
trueif the type of node if
-
isStaticNode
public boolean isStaticNode()
Description copied from interface:NavNodeTo know if the node is static. Astaticnode has nochildLoador.- Specified by:
isStaticNodein interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Returns:
truewhen the node is static : says, the node has nochildLoador.
-
getContainerNode
public N getContainerNode()
Description copied from interface:NavNodeGets the first node form this one to the root which has a noneStringtype.- Specified by:
getContainerNodein interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Returns:
- the first concrete node type
-
isRoot
public boolean isRoot()
- Specified by:
isRootin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>
-
findNodeById
public N findNodeById(String id, NavBridge<NavTreeTableModel,N> model, NavDataProvider provider)
Description copied from interface:NavNodeGiven anid, obtain the child with matching id. If node is NOTloaded, then first loads it (methodNavNode.populateChilds(NavBridge, NavDataProvider)) then do search on direct childs of the node recursivly.- Specified by:
findNodeByIdin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Parameters:
id- the id of the researched nodemodel- model owner of nodesprovider- data provider- Returns:
- the found node or
nullif not found
-
getChild
public N getChild(String id, NavBridge<NavTreeTableModel,N> bridge, NavDataProvider provider)
Description copied from interface:NavNodeGiven anid, obtain the child with matching id. If node is NOTloaded, then first loads it (methodNavNode.populateChilds(NavBridge, NavDataProvider)) then return on direct childs of the node.- Specified by:
getChildin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Parameters:
id- the id of the researched nodebridge- model owner of nodesprovider- data provider- Returns:
- the found node or
nullif not found
-
setDirty
public void setDirty(boolean dirty)
Description copied from interface:NavNodeChanges theNavNode.isDirty()state. As a side effect, when a renderer will use this node, it will force to reload the render from theNavDataProvider.- Specified by:
setDirtyin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Parameters:
dirty- the new dirty value
-
isLeaf
public boolean isLeaf()
- Specified by:
isLeafin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Specified by:
isLeafin interfaceTreeNode- Overrides:
isLeafin classorg.jdesktop.swingx.treetable.AbstractMutableTreeTableNode
-
getUserObject
public Object getUserObject()
- Specified by:
getUserObjectin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Specified by:
getUserObjectin interfaceorg.jdesktop.swingx.treetable.TreeTableNode- Overrides:
getUserObjectin classorg.jdesktop.swingx.treetable.AbstractMutableTreeTableNode
-
toString
public String toString()
- Specified by:
toStringin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Overrides:
toStringin classorg.jdesktop.swingx.treetable.AbstractMutableTreeTableNode
-
populateNode
public void populateNode(NavBridge<NavTreeTableModel,N> model, NavDataProvider provider, boolean populateChilds)
Description copied from interface:NavNodeTo populate the node. A side-effect of this method is to setdirtythe node (renderer will recompute the render of the node). IfpopulateChildsis set totrue, then also populate childs of the node using the givendataProvider.- Specified by:
populateNodein interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Parameters:
model- le delegate modèles content le noeudprovider- le provider de donnéespopulateChilds- un drapeau pour charger aussi les fils du noeud courant
-
populateChilds
public void populateChilds(NavBridge<NavTreeTableModel,N> bridge, NavDataProvider provider)
Description copied from interface:NavNodeTo populate childs of the node (only when a none static node). A side-effect of this method is to setloadedof the node. For a static node, do nothing.- Specified by:
populateChildsin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Parameters:
bridge- model owner of the nodeprovider- data provider
-
getParent
public N getParent()
- Specified by:
getParentin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>- Specified by:
getParentin interfaceTreeNode- Specified by:
getParentin interfaceorg.jdesktop.swingx.treetable.TreeTableNode- Overrides:
getParentin classorg.jdesktop.swingx.treetable.AbstractMutableTreeTableNode
-
getChildAt
public N getChildAt(int index)
- Specified by:
getChildAtin interfaceTreeNode- Specified by:
getChildAtin interfaceorg.jdesktop.swingx.treetable.TreeTableNode- Overrides:
getChildAtin classorg.jdesktop.swingx.treetable.AbstractMutableTreeTableNode
-
children
public Enumeration<N> children()
-
removeAllChildren
public void removeAllChildren()
-
add
public void add(N node)
- Specified by:
addin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>
-
getPathToRoot
public N[] getPathToRoot(NavTreeTableNode aNode, int depth)
-
remove
public void remove(N node)
- Specified by:
removein interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>
-
insert
public void insert(N node, int position)
- Specified by:
insertin interfaceNavNode<NavTreeTableModel,N extends NavTreeTableNode<N>>
-
-