ti.chimera.registry
Class RegistryTreeModel

java.lang.Object
  extended byti.swing.treetable.AbstractTreeModel
      extended byti.chimera.registry.RegistryTreeModel
All Implemented Interfaces:
javax.swing.tree.TreeModel

public class RegistryTreeModel
extends AbstractTreeModel

A tree model for a subtree of the registry. The model tracks changes to the form of the registry (ie. link/unlink nodes), and fires the appropriate tree structure change events.

XXX add a RegistryTreeFilter, so different registry trees can filter out nodes...

XXX add a TreeCellRender plus interface to set icons, etc., for different node contract types... this should be done here, rather than in the user of the RegistryTreeModel in order to force a more consistent user interface, because the icon will be conveying type information, it would be confusing to the user if the same type results in different icons in different places

XXX need some way to unsubscribe all DirectorySubscriber-s when the tree model is no longer in use...

Version:
0.1
Author:
Rob Clark

Nested Class Summary
static class RegistryTreeModel.NodeWrapper
           
static class RegistryTreeModel.RegistryTreeCellRenderer
          A TreeCellRenderer that uses the icons set with #setFileIcon.
 
Field Summary
 
Fields inherited from class ti.swing.treetable.AbstractTreeModel
listenerList, root
 
Constructor Summary
RegistryTreeModel(Main main, java.lang.String path)
          Class Constructor.
 
Method Summary
 void dispose()
          Dispose of the tree model
 java.lang.Object getChild(java.lang.Object parent, int idx)
           
 int getChildCount(java.lang.Object parent)
           
 boolean isLeaf(java.lang.Object node)
          Is the particular node a leaf node?
 
Methods inherited from class ti.swing.treetable.AbstractTreeModel
addTreeModelListener, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getIndexOfChild, getRoot, removeTreeModelListener, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryTreeModel

public RegistryTreeModel(Main main,
                         java.lang.String path)
                  throws RegistryException
Class Constructor.

Parameters:
path - the path to the root node of the tree
Method Detail

dispose

public void dispose()
Dispose of the tree model


isLeaf

public boolean isLeaf(java.lang.Object node)
Description copied from class: AbstractTreeModel
Is the particular node a leaf node?

Specified by:
isLeaf in interface javax.swing.tree.TreeModel
Overrides:
isLeaf in class AbstractTreeModel

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int idx)

getChildCount

public int getChildCount(java.lang.Object parent)