KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > dso > ClassesModelNode


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.admin.dso;
5
6 import java.util.Enumeration JavaDoc;
7 import java.util.Vector JavaDoc;
8
9 import treemap.TMModelNode;
10 import treemap.TMModelUpdater;
11
12 import com.tc.admin.common.XTreeNode;
13
14 public class ClassesModelNode implements TMModelNode {
15   private ClassTreeModel treeModel;
16
17   public ClassesModelNode(ClassTreeModel treeModel) {
18     this.treeModel = treeModel;
19   }
20
21   public Object JavaDoc getRoot() {
22     return treeModel.getRoot();
23   }
24
25   public Enumeration JavaDoc children(Object JavaDoc node) {
26     Vector JavaDoc children = new Vector JavaDoc();
27
28     if(node instanceof XTreeNode) {
29       XTreeNode treeNode = (XTreeNode)node;
30       int childCount = treeNode.getChildCount();
31
32       for(int i = 0; i < childCount; i++) {
33         children.add(treeNode.getChildAt(i));
34       }
35     }
36
37     return children.elements();
38   }
39
40   public boolean isLeaf(Object JavaDoc node) {
41     return node instanceof ClassTreeLeaf;
42   }
43
44   public void setUpdater(TMModelUpdater updater) {/**/}
45 }
46
Popular Tags