protected void updateTree(DocumentEvent event){
  updatingSelection=true;
  try {
    TreeModel model=getTreeModel();
    Object root=model.getRoot();
    for (int counter=model.getChildCount(root) - 1; counter >= 0; counter--) {
      updateTree(event,(Element)model.getChild(root,counter));
    }
  }
  finally {
    updatingSelection=false;
  }
}

protected void updateTree ( DocumentEvent event ) { updatingSelection = true ; try { TreeModel model = getTreeModel ( ) ; Object root = model . getRoot ( ) ; for ( int counter = model . getChildCount ( root ) - 1 ; counter >= 0 ; counter -- ) { updateTree ( event , ( Element ) model . getChild ( root , counter ) ) ; } } finally { updatingSelection = false ; } }
updates the tree based on the event type . this will invoke either updatetree with the root element , or handlechange .
