1.  
  2. _p.buildComponentTree = function(start, tree, row) {
  3. var children1 = start.getChildren();
  4. var len = children1.length;
  5. var row;
  6. var t = new Date();
  7. var key;
  8.  
  9. if (!tree) {
  10. tree = new BiTree2();
  11. tree.setShowGridLines(true);
  12. tree.setShowHeaders(false);
  13. tree.setShowRowHeaders(false);
  14. tree.setColumnNames([""]);
  15. tree.setColumnCount(1);
  16. tree.setColumnWidths([200]);
  17. tree.setColumnOrders([0]);
  18. row = new BiTree2Row([this.getClassname(start)]);
  19. tree.addRow(row);
  20. row.setUserData(start);
  21. tree.setStyleProperty("border", "1px solid #dedbde");
  22. var dm = tree.getDataModel();
  23. dm.getIcon = function(x, y) {
  24. return "./tb_membertree_active.gif";
  25. }
  26. var markers = this.markers;
  27. var handleTreeClick = function(e) {
  28. var cellInfo = this.getCellInfoFromMouseEvent(e);
  29. var comp = this.getDataModel().getNodeAt(cellInfo.getRow()).getUserData();
  30. comp.border = comp.getStyleProperty("border");
  31. comp.setStyleProperty("border", "1px dotted #000000");
  32. if (comp.getStyleProperty("display") == "none") {
  33. comp.display = "none";
  34. comp.setStyleProperty("display", "");
  35. }
  36. markers.push(comp);
  37. }
  38. tree.addEventListener("click", handleTreeClick);
  39. }
  40.  
  41. if (len > 0) {
  42. if (!row) {
  43. row = new BiTree2Row([start]);
  44. row.setUserData(start);
  45. }
  46. for (var i=0;i<len;i++) {
  47. var row1 = new BiTree2Row([this.getClassname(children1[i])]);
  48. row.addRow(row1);
  49. row1.setUserData(children1[i]);
  50. tree = this.buildComponentTree(children1[i], tree, row1);
  51. }
  52. }
  53. return tree;
  54. }
  55.  
  56.