wt.clients.beans.classbrowser
Class ClassTreeModel

java.lang.Object
  extended byjavax.swing.tree.DefaultTreeModel
      extended bywt.clients.beans.classbrowser.ClassTreeModel
All Implemented Interfaces:
Serializable, TreeModel

public class ClassTreeModel
extends DefaultTreeModel

See Also:
Serialized Form

Field Summary
private  String classForRootNode
          Name of the class returned for the first node.
private  String labelForRootNode
          Label of root node.
private  String rootClass
          Name of the root class.
static int SHOW_ALL
          Constant to use for integrating all the classes in the model
static int SHOW_CLASSES
          Constant use for integrating only classes in the model
static int SHOW_INTERFACES
          Constant to use for integrating only interfaces in the model
private  boolean showLeafOnly
          This variable is used to know if the model should present intermediate classes and interfaces or only the lower level.
private  int showMode
          This variable is used to know what is the current mode of integration in the model
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
ClassTreeModel()
          Construct the default class browser using "wt.fc.WTObject" as the default root class
ClassTreeModel(String pRootClass)
           
 
Method Summary
 void fillTree()
           
 void fillTree(String pRootClass)
           
private  void fillTreeView(ClassTreeNode pLastNode, ClassTreeNode pTreeNode)
          Fill a node with all its children
 String getClassForRootNode()
          Answer the fully qualified class used for the class of the root node.
Answer "" if the model use the default value.
 String getLabelForRootNode()
          Answer the label which is used for the label of the root node.
Answer "" if the model use the default value.
 String getRootClass()
          Answer the fully qualified name of the class used as the root of the tree
 ClassTreeNode getRootNode()
          Answer the root node of the tree
 int getShowMode()
          Answer the mode used for the
 boolean isShowLeafOnly()
           
 void setClassForRootNode(String pClassForRootNode)
          Set the value of the class for the root node.
Use "" to clear the class name and use the default class.
 void setLabelForRootNode(String pLabelForRootNode)
          Set the value of the label for the root node.
Use "" to clear the label and use the default name.
 void setRootClass(String pRootClass)
           
 void setShowLeafOnly(boolean pShowLeafOnly)
           
 void setShowMode(int pShowMode)
          Set the mode used for building the tree.
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, 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

SHOW_ALL

public static int SHOW_ALL
Constant to use for integrating all the classes in the model

See Also:
SHOW_CLASSES, SHOW_INTERFACES, setShowMode(int), getShowMode()

SHOW_INTERFACES

public static int SHOW_INTERFACES
Constant to use for integrating only interfaces in the model

See Also:
SHOW_ALL, SHOW_CLASSES, setShowMode(int), getShowMode()

SHOW_CLASSES

public static int SHOW_CLASSES
Constant use for integrating only classes in the model

See Also:
SHOW_ALL, SHOW_INTERFACES, setShowMode(int), getShowMode()

labelForRootNode

private String labelForRootNode
Label of root node. If the content is empty then the default name would be used. The default value is : empty.


classForRootNode

private String classForRootNode
Name of the class returned for the first node. If the content is empty then the default class would be used. The default value is : empty.

See Also:
rootClass

rootClass

private String rootClass
Name of the root class. The content must be to a valid value. The default value is set to wt.fc.WTObject.


showMode

private int showMode
This variable is used to know what is the current mode of integration in the model

See Also:
SHOW_ALL, SHOW_CLASSES, SHOW_INTERFACES

showLeafOnly

private boolean showLeafOnly
This variable is used to know if the model should present intermediate classes and interfaces or only the lower level. The default value is set to : False

See Also:
setShowLeafOnly(boolean), isShowLeafOnly()
Constructor Detail

ClassTreeModel

public ClassTreeModel()
Construct the default class browser using "wt.fc.WTObject" as the default root class

See Also:
setRootClass(java.lang.String)

ClassTreeModel

public ClassTreeModel(String pRootClass)
Parameters:
pRootClass - the fully qualified name of the class used for the root node
See Also:
setRootClass(java.lang.String)
Method Detail

setRootClass

public void setRootClass(String pRootClass)
Parameters:
pRootClass - the fully qualified name of the class that must be used as the root class

getRootClass

public String getRootClass()
Answer the fully qualified name of the class used as the root of the tree

Returns:
String the fully qualified class name of the root node

getRootNode

public ClassTreeNode getRootNode()
Answer the root node of the tree

Returns:
ClassTreeNode the root node of the tree.

setShowMode

public void setShowMode(int pShowMode)
                 throws PropertyVetoException
Set the mode used for building the tree.

Parameters:
pShowMode - mode that should be used for selecting the classes that should be presented in the tree view
Throws:
PropertyVetoException - thrown if pShowMode is not valid.
See Also:
SHOW_ALL, SHOW_CLASSES, SHOW_INTERFACES

getShowMode

public int getShowMode()
Answer the mode used for the

Returns:
int the current mode used to display the classes in the tree
See Also:
SHOW_ALL, SHOW_CLASSES, SHOW_INTERFACES

setShowLeafOnly

public void setShowLeafOnly(boolean pShowLeafOnly)
Parameters:
pShowLeafOnly - use true for seeing only the leaf of the tree; false for seeing the complete hierarchy.

isShowLeafOnly

public boolean isShowLeafOnly()
Returns:
boolean

setLabelForRootNode

public void setLabelForRootNode(String pLabelForRootNode)
Set the value of the label for the root node.
Use "" to clear the label and use the default name.

Parameters:
pLabelForRootNode -
See Also:
#repaintOnShowModeChange

getLabelForRootNode

public String getLabelForRootNode()
Answer the label which is used for the label of the root node.
Answer "" if the model use the default value.

Returns:
String the label to replace the label of the root node

setClassForRootNode

public void setClassForRootNode(String pClassForRootNode)
Set the value of the class for the root node.
Use "" to clear the class name and use the default class.

Parameters:
pClassForRootNode - the fully qualified name of the class that should be used for the root node
See Also:
#repaintOnShowModeChange

getClassForRootNode

public String getClassForRootNode()
Answer the fully qualified class used for the class of the root node.
Answer "" if the model use the default value.

Returns:
String the fully qualified name of the class which is use as the default value for the root node

fillTree

public void fillTree(String pRootClass)
Parameters:
pRootClass -

fillTree

public void fillTree()

fillTreeView

private void fillTreeView(ClassTreeNode pLastNode,
                          ClassTreeNode pTreeNode)
Fill a node with all its children

Parameters:
pLastNode -
pTreeNode -