jaxx.runtime.swing.navigation
Class NavigationTreeModel

java.lang.Object
  extended by javax.swing.tree.DefaultTreeModel
      extended by jaxx.runtime.swing.navigation.NavigationTreeModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.tree.TreeModel

public class NavigationTreeModel
extends javax.swing.tree.DefaultTreeModel

Model of the tree used for a navigation tree.

Il est composé de NavigationTreeNode

Since:
1.7.2
Author:
chemit
See Also:
Serialized Form

Field Summary
protected  java.lang.String pathSeparator
          The path separator used to build the NavigationTreeNode.fullPath.
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
NavigationTreeModel(java.lang.String pathSeparator, JAXXContext context)
           
 
Method Summary
 NavigationTreeNode findNode(NavigationTreeNode root, java.lang.String path)
          Search from a given root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by pathSeparator.
 NavigationTreeNode findNode(NavigationTreeNode root, java.lang.String path, java.util.regex.Pattern regex)
          Apply first the regex pattern to obtain the searched node.
 NavigationTreeNode findNode(NavigationTreeNode root, java.lang.String path, java.lang.String regex)
          Apply first the regex pattern to obtain the searched node.
 NavigationTreeNode findNode(java.lang.String path)
          Search from the root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by dot.
 NavigationTreeNode findNode(java.lang.String path, java.util.regex.Pattern regex)
          Apply first the regex pattern to obtain the searched node.
 NavigationTreeNode findNode(java.lang.String path, java.lang.String regex)
          Apply first the regex pattern to obtain the searched node fi the given regex is not null.
 java.lang.Object getBean(NavigationTreeNode node)
          Obtain the associated bean value from context corresponding to node
 java.lang.Object getBean(java.lang.String navigationPath)
          Obtain the associated bean value from context corresponding to node from given navigation path.
 JAXXContext getContext()
           
 java.lang.String getPathSeparator()
           
 NavigationTreeNode getRoot()
           
 void nodeChanged(javax.swing.tree.TreeNode node)
           
 void nodeChanged(javax.swing.tree.TreeNode node, boolean deep)
           
 void nodeStructureChanged(javax.swing.tree.TreeNode node)
           
protected  void reload(NavigationTreeNode node)
           
protected  void reload(NavigationTreeNode node, boolean deep)
           
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodesChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pathSeparator

protected final java.lang.String pathSeparator
The path separator used to build the NavigationTreeNode.fullPath.

See Also:
NavigationTreeNode.getNodePath(), NavigationTreeNode.getFullPath()
Constructor Detail

NavigationTreeModel

public NavigationTreeModel(java.lang.String pathSeparator,
                           JAXXContext context)
Method Detail

getRoot

public NavigationTreeNode getRoot()
Specified by:
getRoot in interface javax.swing.tree.TreeModel
Overrides:
getRoot in class javax.swing.tree.DefaultTreeModel

findNode

public NavigationTreeNode findNode(java.lang.String path)
Search from the root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by dot.

Example :

$root.child1.leaf1

Parameters:
path - the fully path of the searched node.
Returns:
the node matching the fully context from the root node, or null if not find.

findNode

public NavigationTreeNode findNode(java.lang.String path,
                                   java.lang.String regex)
Apply first the regex pattern to obtain the searched node fi the given regex is not null.

Search then from the root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by pathSeparator.

Example :

$root.child1.leaf1

Parameters:
path - the fully path of the searched node.
regex - a optional regex to apply to path before searching
Returns:
the node matching the fully context from the root node, or null if not found.

findNode

public NavigationTreeNode findNode(java.lang.String path,
                                   java.util.regex.Pattern regex)
Apply first the regex pattern to obtain the searched node.

Search then from the root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by pathSeparator.

Example :

$root.child1.leaf1

Parameters:
path - the fully path of the searched node.
regex - a optional regex to apply to path before searching
Returns:
the node matching the fully context from the root node, or null if not found.

findNode

public NavigationTreeNode findNode(NavigationTreeNode root,
                                   java.lang.String path)
Search from a given root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by pathSeparator.

Parameters:
root - root node to be used
path - the fully path of the searched node.
Returns:
the node matching the fully context from the given root node, or null if not found.

findNode

public NavigationTreeNode findNode(NavigationTreeNode root,
                                   java.lang.String path,
                                   java.lang.String regex)
Apply first the regex pattern to obtain the searched node.

Search then from a given root node a node named by his fully path (concatenation of nodes) NavigationTreeNode.path valued separated by pathSeparator.

Parameters:
root - root node to be used
path - the fully path of the searched node.
regex - a previous regex to apply to path : must have a matches
Returns:
the node matching the fully context from the given root node, or null if not found.

findNode

public NavigationTreeNode findNode(NavigationTreeNode root,
                                   java.lang.String path,
                                   java.util.regex.Pattern regex)
Apply first the regex pattern to obtain the searched node.

Search then from a given root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by pathSeparator.

Parameters:
root - root node to be used
path - the fully path of the searched node.
regex - a previous regex to apply to path : must have a matches
Returns:
the node matching the fully context from the given root node, or null if not found.

getContext

public JAXXContext getContext()

getBean

public java.lang.Object getBean(java.lang.String navigationPath)
Obtain the associated bean value from context corresponding to node from given navigation path.

Parameters:
navigationPath - the current context path of the node
Returns:
the value associated in context with the given navigation path

getBean

public java.lang.Object getBean(NavigationTreeNode node)
Obtain the associated bean value from context corresponding to node

Parameters:
node - the current node
Returns:
the value associated in context with the given node.

nodeChanged

public void nodeChanged(javax.swing.tree.TreeNode node)
Overrides:
nodeChanged in class javax.swing.tree.DefaultTreeModel

nodeStructureChanged

public void nodeStructureChanged(javax.swing.tree.TreeNode node)
Overrides:
nodeStructureChanged in class javax.swing.tree.DefaultTreeModel

nodeChanged

public void nodeChanged(javax.swing.tree.TreeNode node,
                        boolean deep)

reload

protected void reload(NavigationTreeNode node)

reload

protected void reload(NavigationTreeNode node,
                      boolean deep)

getPathSeparator

public java.lang.String getPathSeparator()


Copyright © 2008-2010 CodeLutin. All Rights Reserved.