wt.clients.beans.classbrowser
Class ClassBrowser

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended bysymantec.itools.awt.TreeView
                  extended bywt.clients.beans.classbrowser.ClassBrowser
All Implemented Interfaces:
Accessible, ImageObserver, ItemSelectable, MenuContainer, Serializable

public class ClassBrowser
extends symantec.itools.awt.TreeView

This class has been designed for presenting a tree view of the hierarchy of class in Windchill.
It is implementing a ClassTreeModel for manipulating the data.

 There is several way to use it :

Since:
WT R2.0
See Also:
Serialized Form

Nested Class Summary
protected  class ClassBrowser.TreeModelHandler
          Listens to the model and updates the tree as needed
 
Nested classes inherited from class symantec.itools.awt.TreeView
 
Nested classes inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  boolean repaintOnShowModeChange
          Set if the tree should be updated each time that a value is changed.
private  ClassTreeModel treeModel
          The model of the class browser
private  TreeModelListener treeModelListener
           
 
Fields inherited from class symantec.itools.awt.TreeView
actionListener, adjustment, CHILD, count, e, errors, fm, focus, g1, horizontalScrollBar, im1, isSun1_1, itemListener, key, LAST, mouse, needResetVector, newWidth, NEXT, NODE_COLLAPSED, NODE_EXPANDED, NODE_TOGGLED, redrawTriggered, rootNode, sbHLineIncrement, sbHShow, sbHSize, sbVShow, SEL_CHANGED, selectedNode, topVisibleNode, v, verticalScrollBar, viewCount, viewHeight, viewWidest, viewWidth
 
Fields inherited from class java.awt.Panel
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ClassBrowser()
          Construct a new ClassBrowser creating a default class browser model
ClassBrowser(ClassTreeModel pModel)
          Construct a new class browser using pModel as the model.
ClassBrowser(String pRootClass)
          Construct a new class browser using pRootClass as the root class of the tree
ClassBrowser(String pRootClass, String pLabelForRootNode)
          Construct a new class browser using pRootClass as the root class of the tree and pLabelForRootNode as the label for the root node.
ClassBrowser(String pRootClass, String pLabelForRootNode, String pClassForRootNode)
          Construct a new class browser using pRootClass as the root class of the tree, pLabelForRootNode as the label for the root node, and pClassForRootNode as the class name for the root node.
 
Method Summary
protected  TreeModelListener createTreeModelListener()
          Creates and returns an instance of TreeModelHandler.
 void fillTree()
          This operation is (re)creating the tree based on the model attached.
private  void fillTree(symantec.itools.awt.TreeNode pLastNode, ClassTreeNode pModelRootNode)
          Add a node (pModelRootNode) to the tree (to pLastNode) and ask for attaching its children
protected static ClassTreeModel getDefaultClassTreeModel()
          Create a default model for the class tree
 ClassTreeModel getModel()
          Answer the class tree model currently active
 String getRootClassname()
          Invoke that method to retrieve the name of the root class.
The return value could be different than the one set with setRootClass if a classForRootNode has been specified !
 String getSelectedClassname()
          Invoke that method to retrieve the name of the class that has been selected in the tree
 void setModel(ClassTreeModel pModel)
          Set the class tree model to pModel.
 
Methods inherited from class symantec.itools.awt.TreeView
addActionListener, addChild, addItemListener, addNotify, addSibling, addSibling, append, changeSelection, clear, compWidth, debugVector, drawDotLine, drawNodeText, drawNodeToggle, drawTree, exists, exists, findLastPreSpace, getBgHilite, getCount, getFgHilite, getMinimumSize, getPreferredSize, getRootNode, getSelectedNode, getSelectedObjects, getSelectedText, getTreeStructure, getViewCount, handleAdjustmentEvent, handleFocusGained, handleFocusLost, handleKeyPressed, handleMousePressed, handleMouseReleased, insert, isFocusTraversable, minimumSize, newTreeNode, paint, parseTreeStructure, preferredSize, printTree, printTree, recount, redraw, redraw, remove, remove, removeActionListener, removeItemListener, removeNotify, removeSelected, repaint, resetVector, sendActionEvent, setLayout, setSelectedNode, setTreeStructure, traverse, triggerRedraw, update, vectorize
 
Methods inherited from class java.awt.Panel
getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, paintComponents, paramString, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

treeModel

private ClassTreeModel treeModel
The model of the class browser


repaintOnShowModeChange

private boolean repaintOnShowModeChange
Set if the tree should be updated each time that a value is changed. The default is set to true.


treeModelListener

private TreeModelListener treeModelListener
Constructor Detail

ClassBrowser

public ClassBrowser()
Construct a new ClassBrowser creating a default class browser model


ClassBrowser

public ClassBrowser(ClassTreeModel pModel)
Construct a new class browser using pModel as the model.

Parameters:
pModel - the model used for the display

ClassBrowser

public ClassBrowser(String pRootClass)
Construct a new class browser using pRootClass as the root class of the tree

Parameters:
pRootClass - the fully qualified class name for the root of the tree

ClassBrowser

public ClassBrowser(String pRootClass,
                    String pLabelForRootNode)
Construct a new class browser using pRootClass as the root class of the tree and pLabelForRootNode as the label for the root node.

Parameters:
pRootClass - the fully qualified class name for the root of the tree
pLabelForRootNode - the label for the root node

ClassBrowser

public ClassBrowser(String pRootClass,
                    String pLabelForRootNode,
                    String pClassForRootNode)
Construct a new class browser using pRootClass as the root class of the tree, pLabelForRootNode as the label for the root node, and pClassForRootNode as the class name for the root node.

Parameters:
pRootClass - the fully qualified class name for the root of the tree
pLabelForRootNode - the label for the root node
pClassForRootNode - the fully qualified class name for the root node
Method Detail

getDefaultClassTreeModel

protected static ClassTreeModel getDefaultClassTreeModel()
Create a default model for the class tree

Returns:
ClassBrowserModel the model that would be used by the class browser

setModel

public void setModel(ClassTreeModel pModel)
Set the class tree model to pModel. Changing the model would change immediatly the tree.

Parameters:
pModel - the class tree model to use

getModel

public ClassTreeModel getModel()
Answer the class tree model currently active

Returns:
ClassTreeModel the class tree model currently used

getRootClassname

public String getRootClassname()
Invoke that method to retrieve the name of the root class.
The return value could be different than the one set with setRootClass if a classForRootNode has been specified !

Returns:
String the fully qualified name of the root class

getSelectedClassname

public String getSelectedClassname()
Invoke that method to retrieve the name of the class that has been selected in the tree

Returns:
String the fully qualified name of the class that has been selected in the tree

fillTree

public void fillTree()
This operation is (re)creating the tree based on the model attached.

See Also:
getModel()

fillTree

private void fillTree(symantec.itools.awt.TreeNode pLastNode,
                      ClassTreeNode pModelRootNode)
Add a node (pModelRootNode) to the tree (to pLastNode) and ask for attaching its children

Parameters:
pLastNode - the last node that has been attached to the tree
pModelRootNode - the node that should be added

createTreeModelListener

protected TreeModelListener createTreeModelListener()
Creates and returns an instance of TreeModelHandler. The returned object is responsible for updating the expanded state when the TreeModel changes.