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

Le modele utilisé pour un arbre de navigation.

Il est composé de NavigationTreeModel.NavigationTreeNode

Author:
chemit
See Also:
Serialized Form

Nested Class Summary
 class NavigationTreeModel.NavigationTreeNode
          la représentation d'un noeud dans le modele NavigationTreeModel
 
Field Summary
protected  java.lang.String navigationPathSeparator
          the separator char used to produce the navigation path of a node.
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
NavigationTreeModel(javax.swing.tree.TreeNode root, java.lang.String navigationPathSeparator)
           
 
Method Summary
 NavigationTreeModel.NavigationTreeNode findNode(NavigationTreeModel.NavigationTreeNode root, java.lang.String path)
          Search from a given root node a node named by his fully path (concatenation of nodes NavigationTreeModel.NavigationTreeNode.navigationPath valued separated by navigationPathSeparator.
 NavigationTreeModel.NavigationTreeNode findNode(NavigationTreeModel.NavigationTreeNode root, java.lang.String path, java.util.regex.Pattern regex)
          Apply first the regex pattern to obtain the searched node.
 NavigationTreeModel.NavigationTreeNode findNode(NavigationTreeModel.NavigationTreeNode root, java.lang.String path, java.lang.String regex)
          Apply first the regex pattern to obtain the searched node.
 NavigationTreeModel.NavigationTreeNode findNode(java.lang.String path)
          Search from the root node a node named by his fully path (concatenation of nodes NavigationTreeModel.NavigationTreeNode.navigationPath valued separated by dot.
 NavigationTreeModel.NavigationTreeNode findNode(java.lang.String path, java.util.regex.Pattern regex)
          Apply first the regex pattern to obtain the searched node.
 NavigationTreeModel.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 getJAXXContextValue(JAXXContext context, NavigationTreeModel.NavigationTreeNode node)
          Obtain the associated bean value from context corresponding to node
 java.lang.Object getJAXXContextValue(JAXXContext context, java.lang.String navigationPath)
          Obtain the associated bean value from context corresponding to node from given navigation path.
 NavigationTreeModel.NavigationTreeNode getRoot()
           
 void nodeChanged(javax.swing.tree.TreeNode node)
           
 void nodeChanged(javax.swing.tree.TreeNode 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, nodeStructureChanged, 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

navigationPathSeparator

protected final java.lang.String navigationPathSeparator
the separator char used to produce the navigation path of a node.

Constructor Detail

NavigationTreeModel

public NavigationTreeModel(javax.swing.tree.TreeNode root,
                           java.lang.String navigationPathSeparator)
Method Detail

getRoot

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

findNode

public NavigationTreeModel.NavigationTreeNode findNode(java.lang.String path)
Search from the root node a node named by his fully path (concatenation of nodes NavigationTreeModel.NavigationTreeNode.navigationPath 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 NavigationTreeModel.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 NavigationTreeModel.NavigationTreeNode.navigationPath valued separated by navigationPathSeparator.

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 NavigationTreeModel.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 NavigationTreeModel.NavigationTreeNode.navigationPath valued separated by navigationPathSeparator.

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 NavigationTreeModel.NavigationTreeNode findNode(NavigationTreeModel.NavigationTreeNode root,
                                                       java.lang.String path)
Search from a given root node a node named by his fully path (concatenation of nodes NavigationTreeModel.NavigationTreeNode.navigationPath valued separated by navigationPathSeparator.

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 NavigationTreeModel.NavigationTreeNode findNode(NavigationTreeModel.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) NavigationTreeModel.NavigationTreeNode.navigationPath valued separated by navigationPathSeparator.

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 NavigationTreeModel.NavigationTreeNode findNode(NavigationTreeModel.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 NavigationTreeModel.NavigationTreeNode.navigationPath valued separated by navigationPathSeparator.

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.

getJAXXContextValue

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

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

getJAXXContextValue

public java.lang.Object getJAXXContextValue(JAXXContext context,
                                            NavigationTreeModel.NavigationTreeNode node)
Obtain the associated bean value from context corresponding to node

Parameters:
context - the context where to seek value
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

nodeChanged

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


Copyright © 2008-2009 CodeLutin. All Rights Reserved.