01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.admin.dso;
05:
06: import java.util.Enumeration;
07: import java.util.Vector;
08:
09: 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 getRoot() {
22: return treeModel.getRoot();
23: }
24:
25: public Enumeration children(Object node) {
26: Vector children = new Vector();
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 node) {
41: return node instanceof ClassTreeLeaf;
42: }
43:
44: public void setUpdater(TMModelUpdater updater) {/**/
45: }
46: }
|