jaxx.runtime.swing.navigation
Class NavigationTreeTableModel

java.lang.Object
  extended by org.jdesktop.swingx.treetable.AbstractTreeTableModel
      extended by org.jdesktop.swingx.treetable.DefaultTreeTableModel
          extended by jaxx.runtime.swing.navigation.NavigationTreeTableModel
All Implemented Interfaces:
TreeModel, NavigationModel, org.jdesktop.swingx.treetable.TreeTableModel

public class NavigationTreeTableModel
extends org.jdesktop.swingx.treetable.DefaultTreeTableModel
implements NavigationModel

Model of the tree table used for a navigation tree table.

Il est composé de NavigationTreeNode FIXME : Essayer d'enlever les copier coller NavigationTreeModel

Since:
2.0.0
Author:
sletellier

Field Summary
protected  List<String> columnsName
           
protected  String pathSeparator
          The path separator used to build the NavigationTreeNode.fullPath.
 
Fields inherited from class org.jdesktop.swingx.treetable.DefaultTreeTableModel
columnIdentifiers
 
Fields inherited from class org.jdesktop.swingx.treetable.AbstractTreeTableModel
modelSupport, root
 
Constructor Summary
NavigationTreeTableModel(String pathSeparator, JAXXContext context, List<String> columnsName)
           
 
Method Summary
 NavigationTreeNode findNode(NavigationTreeNode root, String path)
          Search from a given root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by NavigationModel.getPathSeparator().
 NavigationTreeNode findNode(NavigationTreeNode root, String path, Pattern regex)
          Apply first the regex pattern to obtain the searched node.
 NavigationTreeNode findNode(NavigationTreeNode root, String path, String regex)
          Apply first the regex pattern to obtain the searched node.
 NavigationTreeNode findNode(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(String path, Pattern regex)
          Apply first the regex pattern to obtain the searched node.
 NavigationTreeNode findNode(String path, String regex)
          Apply first the regex pattern to obtain the searched node fi the given regex is not null.
 Object getBean(NavigationTreeNode node)
          Obtain the associated bean value from context corresponding to node
 Object getBean(String navigationPath)
          Obtain the associated bean value from context corresponding to node from given navigation path.
 int getColumnCount()
           
 String getColumnName(int column)
           
 JAXXContext getContext()
           
protected  org.jdesktop.swingx.tree.TreeModelSupport getModelSupport()
          Accessor to tree model support.
 String getPathSeparator()
           
 TreeNode[] getPathToRoot(TreeNode aNode)
           
 NavigationTreeTableNode getRoot()
           
 void nodeChanged(TreeNode node)
           
 void nodeChanged(TreeNode node, boolean deep)
           
 void nodeStructureChanged(TreeNode node)
           
protected  void reload(NavigationTreeTableNode node)
           
protected  void reload(NavigationTreeTableNode node, boolean deep)
           
 void removeNodeFromParent(NavigationTreeNode node)
          Message this to remove node from its parent.
 void setRoot(NavigationTreeTableNode root)
           
 
Methods inherited from class org.jdesktop.swingx.treetable.DefaultTreeTableModel
getChild, getChildCount, getIndexOfChild, getPathToRoot, getValueAt, insertNodeInto, isCellEditable, isLeaf, removeNodeFromParent, setColumnIdentifiers, setRoot, setUserObject, setValueAt, valueForPathChanged
 
Methods inherited from class org.jdesktop.swingx.treetable.AbstractTreeTableModel
addTreeModelListener, getColumnClass, getHierarchicalColumn, getTreeModelListeners, removeTreeModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pathSeparator

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

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

columnsName

protected List<String> columnsName
Constructor Detail

NavigationTreeTableModel

public NavigationTreeTableModel(String pathSeparator,
                                JAXXContext context,
                                List<String> columnsName)
Method Detail

getRoot

public NavigationTreeTableNode getRoot()
Specified by:
getRoot in interface TreeModel
Specified by:
getRoot in interface NavigationModel
Overrides:
getRoot in class org.jdesktop.swingx.treetable.DefaultTreeTableModel
See Also:
NavigationModel.getRoot()

getPathToRoot

public TreeNode[] getPathToRoot(TreeNode aNode)
Specified by:
getPathToRoot in interface NavigationModel

setRoot

public void setRoot(NavigationTreeTableNode root)

removeNodeFromParent

public void removeNodeFromParent(NavigationTreeNode node)
Message this to remove node from its parent. This will message nodesWereRemoved to create the appropriate event. This is the preferred way to remove a node as it handles the event creation for you.


findNode

public NavigationTreeNode findNode(String path)
Description copied from interface: NavigationModel
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

Specified by:
findNode in interface NavigationModel
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.
See Also:
NavigationModel.findNode(String)

findNode

public NavigationTreeNode findNode(String path,
                                   String regex)
Description copied from interface: NavigationModel
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 NavigationModel.getPathSeparator().

Example :

$root.child1.leaf1

Specified by:
findNode in interface NavigationModel
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.
See Also:
NavigationModel.findNode(String, String)

findNode

public NavigationTreeNode findNode(String path,
                                   Pattern regex)
Description copied from interface: NavigationModel
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 NavigationModel.getPathSeparator().

Example :

$root.child1.leaf1

Specified by:
findNode in interface NavigationModel
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.
See Also:
NavigationModel.findNode(String, Pattern)

findNode

public NavigationTreeNode findNode(NavigationTreeNode root,
                                   String path)
Description copied from interface: NavigationModel
Search from a given root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by NavigationModel.getPathSeparator().

Specified by:
findNode in interface NavigationModel
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.
See Also:
NavigationModel.findNode(NavigationTreeNode, String)

findNode

public NavigationTreeNode findNode(NavigationTreeNode root,
                                   String path,
                                   String regex)
Description copied from interface: NavigationModel
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 NavigationModel.getPathSeparator().

Specified by:
findNode in interface NavigationModel
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.
See Also:
NavigationModel.findNode(NavigationTreeNode, String, String)

findNode

public NavigationTreeNode findNode(NavigationTreeNode root,
                                   String path,
                                   Pattern regex)
Description copied from interface: NavigationModel
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 NavigationModel.getPathSeparator().

Specified by:
findNode in interface NavigationModel
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.
See Also:
NavigationModel.findNode(NavigationTreeNode, String, Pattern)

getContext

public JAXXContext getContext()
Specified by:
getContext in interface NavigationModel
See Also:
NavigationModel.getContext()

getBean

public Object getBean(String navigationPath)
Description copied from interface: NavigationModel
Obtain the associated bean value from context corresponding to node from given navigation path.

Specified by:
getBean in interface NavigationModel
Parameters:
navigationPath - the current context path of the node
Returns:
the value associated in context with the given navigation path
See Also:
NavigationModel.getBean(String)

getBean

public Object getBean(NavigationTreeNode node)
Description copied from interface: NavigationModel
Obtain the associated bean value from context corresponding to node

Specified by:
getBean in interface NavigationModel
Parameters:
node - the current node
Returns:
the value associated in context with the given node.
See Also:
NavigationModel.getBean(NavigationTreeNode)

getModelSupport

protected org.jdesktop.swingx.tree.TreeModelSupport getModelSupport()
Accessor to tree model support.

Returns:
tree model support

nodeChanged

public void nodeChanged(TreeNode node)
Specified by:
nodeChanged in interface NavigationModel
See Also:
NavigationModel.nodeChanged(TreeNode)

nodeStructureChanged

public void nodeStructureChanged(TreeNode node)
Specified by:
nodeStructureChanged in interface NavigationModel
See Also:
NavigationModel.nodeStructureChanged(TreeNode)

nodeChanged

public void nodeChanged(TreeNode node,
                        boolean deep)
Specified by:
nodeChanged in interface NavigationModel
See Also:
NavigationModel.nodeChanged(TreeNode, boolean)

reload

protected void reload(NavigationTreeTableNode node)

reload

protected void reload(NavigationTreeTableNode node,
                      boolean deep)

getPathSeparator

public String getPathSeparator()
Specified by:
getPathSeparator in interface NavigationModel
See Also:
NavigationModel.getPathSeparator()

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface org.jdesktop.swingx.treetable.TreeTableModel
Overrides:
getColumnCount in class org.jdesktop.swingx.treetable.DefaultTreeTableModel

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface org.jdesktop.swingx.treetable.TreeTableModel
Overrides:
getColumnName in class org.jdesktop.swingx.treetable.DefaultTreeTableModel


Copyright © 2008-2010 CodeLutin. All Rights Reserved.