org.ejtools.adwt
Class BeanContextTreeModel

java.lang.Object
  |
  +--org.ejtools.adwt.BeanContextTreeModel
All Implemented Interfaces:
java.beans.beancontext.BeanContextMembershipListener, java.util.EventListener, ObjectSearcher, SearchableTreeModel, javax.swing.tree.TreeModel

public class BeanContextTreeModel
extends java.lang.Object
implements SearchableTreeModel, java.beans.beancontext.BeanContextMembershipListener

Description of the Class

Version:
$Revision: 1.2 $
Author:
Laurent Etiemble

Field Summary
protected  java.util.Collection contexts
          Description of the Field
protected  ObjectIndexer indexer
          Description of the Field
protected  java.util.Collection listeners
          Description of the Field
protected  java.beans.beancontext.BeanContext root
          Root of the tree.
 
Constructor Summary
BeanContextTreeModel(java.beans.beancontext.BeanContext root)
          Constructor for the BeanContextTreeModel object
 
Method Summary
 void addTreeModelListener(javax.swing.event.TreeModelListener tml)
          Adds a feature to the TreeModelListener attribute of the BeanContextTreeModel object
 void childrenAdded(java.beans.beancontext.BeanContextMembershipEvent bcme)
          Description of the Method
 void childrenRemoved(java.beans.beancontext.BeanContextMembershipEvent bcme)
          Description of the Method
protected  java.lang.Object[] computePath(java.beans.beancontext.BeanContext parent, java.lang.Object o)
          Description of the Method
 java.lang.Object find(java.lang.Object o)
          Description of the Method
protected  void fireTreeNodesChanged()
          Description of the Method
protected  void fireTreeNodesInserted()
          Description of the Method
protected  void fireTreeNodesRemoved()
          Description of the Method
protected  void fireTreeStructureChanged()
          Description of the Method
 java.lang.Object getChild(java.lang.Object parent, int index)
          Gets the child attribute of the BeanContextTreeModel object
 int getChildCount(java.lang.Object parent)
          Gets the childCount attribute of the BeanContextTreeModel object
 int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
          Gets the indexOfChild attribute of the BeanContextTreeModel object
 java.lang.Object getRoot()
          Gets the root attribute of the BeanContextTreeModel object
 boolean isLeaf(java.lang.Object node)
          Gets the leaf attribute of the BeanContextTreeModel object
 void removeTreeModelListener(javax.swing.event.TreeModelListener tml)
          Description of the Method
 void setIndexer(ObjectIndexer indexer)
          Sets the indexer attribute of the BeanContextTreeModel object
 void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contexts

protected java.util.Collection contexts
Description of the Field


indexer

protected ObjectIndexer indexer
Description of the Field


listeners

protected java.util.Collection listeners
Description of the Field


root

protected java.beans.beancontext.BeanContext root
Root of the tree.

Constructor Detail

BeanContextTreeModel

public BeanContextTreeModel(java.beans.beancontext.BeanContext root)
Constructor for the BeanContextTreeModel object

Parameters:
root - Description of the Parameter
Method Detail

addTreeModelListener

public void addTreeModelListener(javax.swing.event.TreeModelListener tml)
Adds a feature to the TreeModelListener attribute of the BeanContextTreeModel object

Specified by:
addTreeModelListener in interface javax.swing.tree.TreeModel
Parameters:
tml - The feature to be added to the TreeModelListener attribute

childrenAdded

public void childrenAdded(java.beans.beancontext.BeanContextMembershipEvent bcme)
Description of the Method

Specified by:
childrenAdded in interface java.beans.beancontext.BeanContextMembershipListener
Parameters:
bcme - Description of the Parameter

childrenRemoved

public void childrenRemoved(java.beans.beancontext.BeanContextMembershipEvent bcme)
Description of the Method

Specified by:
childrenRemoved in interface java.beans.beancontext.BeanContextMembershipListener
Parameters:
bcme - Description of the Parameter

find

public java.lang.Object find(java.lang.Object o)
Description of the Method

Specified by:
find in interface ObjectSearcher
Parameters:
o - Description of the Parameter
Returns:
Description of the Return Value

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)
Gets the child attribute of the BeanContextTreeModel object

Specified by:
getChild in interface javax.swing.tree.TreeModel
Parameters:
parent - Description of the Parameter
index - Description of the Parameter
Returns:
The child value

getChildCount

public int getChildCount(java.lang.Object parent)
Gets the childCount attribute of the BeanContextTreeModel object

Specified by:
getChildCount in interface javax.swing.tree.TreeModel
Parameters:
parent - Description of the Parameter
Returns:
The childCount value

getIndexOfChild

public int getIndexOfChild(java.lang.Object parent,
                           java.lang.Object child)
Gets the indexOfChild attribute of the BeanContextTreeModel object

Specified by:
getIndexOfChild in interface javax.swing.tree.TreeModel
Parameters:
parent - Description of the Parameter
child - Description of the Parameter
Returns:
The indexOfChild value

getRoot

public java.lang.Object getRoot()
Gets the root attribute of the BeanContextTreeModel object

Specified by:
getRoot in interface javax.swing.tree.TreeModel
Returns:
The root value

isLeaf

public boolean isLeaf(java.lang.Object node)
Gets the leaf attribute of the BeanContextTreeModel object

Specified by:
isLeaf in interface javax.swing.tree.TreeModel
Parameters:
node - Description of the Parameter
Returns:
The leaf value

removeTreeModelListener

public void removeTreeModelListener(javax.swing.event.TreeModelListener tml)
Description of the Method

Specified by:
removeTreeModelListener in interface javax.swing.tree.TreeModel
Parameters:
tml - Description of the Parameter

setIndexer

public void setIndexer(ObjectIndexer indexer)
Sets the indexer attribute of the BeanContextTreeModel object

Specified by:
setIndexer in interface ObjectSearcher
Parameters:
indexer - The new indexer value

valueForPathChanged

public void valueForPathChanged(javax.swing.tree.TreePath path,
                                java.lang.Object newValue)
Description of the Method

Specified by:
valueForPathChanged in interface javax.swing.tree.TreeModel
Parameters:
path - Description of the Parameter
newValue - Description of the Parameter

computePath

protected java.lang.Object[] computePath(java.beans.beancontext.BeanContext parent,
                                         java.lang.Object o)
Description of the Method

Parameters:
parent - Description of the Parameter
o - Description of the Parameter
Returns:
Description of the Return Value

fireTreeNodesChanged

protected void fireTreeNodesChanged()
Description of the Method


fireTreeNodesInserted

protected void fireTreeNodesInserted()
Description of the Method


fireTreeNodesRemoved

protected void fireTreeNodesRemoved()
Description of the Method


fireTreeStructureChanged

protected void fireTreeStructureChanged()
Description of the Method



Copyright © 2002-2003 EJTools Org.. All Rights Reserved.